[mythtv] MythTV Recording System Future

Martin Moeller martin at martinm-76.dk
Thu Jul 24 00:05:22 EDT 2003


I think the change it saa7134 specific, but maybe it'll work with other
stuff, too. It seemed to be a slight alteration of frequency, if I
remember correctly.

The patch that was posted should be attached.
Getting AleVT 1.6.1 itself is probably not too hard.

I still need to try out a newer saa7134 driver and test without the
patch.

What I did was:

Unpack AleTV 1.6.1
Apply patch
Compile
Install
Start MythTV Live TV
Launch AleTV and notice it picked up the station.
Change station.
Observe that AleVT had noticed this as well..
I didn't seem to get any 'hits' on the subtitle pages but that may be by
design..?

If vbi.c in the MythTV code borrows heavily from AleVT then the
information in the patch may be quite usefull :)

Hmm.. It seems that while there are many simmilarities, there are at
least as many differences. I'm guessing the functions in libvbitext are
not quite as new as those in AleVT 1.6.1...

/Martin.

ons, 2003-07-23 kl. 14:34 skrev Tako Schotanus:
> Hi Martin,
> 
> could you maybe tell me what it is you have done and how?
> Because on the ivtv list they're interested as well in getting Teletext
> working and I promised to help :-)
> 
> -Tako (quintesse at palacio-cristal.com)
> 
> > -----Original Message-----
> > From: mythtv-dev-bounces at snowman.net 
> > [mailto:mythtv-dev-bounces at snowman.net] On Behalf Of Martin Moeller
> > Sent: woensdag 23 juli 2003 6:58
> > To: Development of mythtv
> > Subject: Re: [mythtv] MythTV Recording System Future
> > 
> > 
> > Well, with a patch someone mentioned for AleVT, I now have working
> > Teletext on my system, so while I'm no C/C++ programmer I 
> > just might see
> > if I can understand enough to at least get subtitles on BBC Prime.
> > 
> > When teletext is working we do need a field for storing subtitle pages
> > per channel. The Channel table seems like a good place :)
> > 
> > /Martin.
> > 
> > tir, 2003-07-22 kl. 23:22 skrev Martin Moeller:
> > > I'm interested in the teletext code, but I have yet to make 
> > my saa7134
> > > chip show the teletext. I hope to update the driver in the 
> > near future
> > > and see if I can get a generic vbi program to actually do anything.
> > > 
> > > If I feel superhuman, I might even look at mythtv's code :)
> > > 
> > > /Martin.
> > > 
> > > tir, 2003-07-22 kl. 22:32 skrev Isaac Richards:
> > > > On Tuesday 22 July 2003 03:59 am, Tako Schotanus wrote:
> > > > > Didn't have a lot of time yesterday to look at the code 
> > (somebody
> > > > > dropped off a baby to care of), but one thing that I 
> > did see was a
> > > > > reference to BTTV and suddenly I got this sinking 
> > feeling: I've got a
> > > > > PVR-250, do those cards even support teletext??
> > > > >
> > > > > If so, great! If not, well, sorry I got your hopes up, Isaac :-/
> > > > 
> > > > Nope, they don't yet.  Ah well..
> > > > 
> > > > Isaac
> > > > _______________________________________________
> > > > mythtv-dev mailing list
> > > > mythtv-dev at snowman.net
> > > > http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-dev
> > > 
> > > 
> > > 
> > ______________________________________________________________________
> > > 
> > > _______________________________________________
> > > mythtv-dev mailing list
> > > mythtv-dev at snowman.net
> > > http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-dev
> > 
> > 
> 
> 
> ______________________________________________________________________
> 
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at snowman.net
> http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-dev
-------------- next part --------------
--- vbi.c.orig	Sat Mar  3 19:14:03 2001
+++ vbi.c	Tue Apr  8 21:43:05 2003
@@ -26,6 +26,17 @@
 
 /***** v4l2 vbi-api *****/
 
+/* #include "/usr/src/linux/include/linux/videodev2.h" */
+
+enum v4l2_buf_type {
+	V4L2_BUF_TYPE_VIDEO_CAPTURE  = 1,
+	V4L2_BUF_TYPE_VIDEO_OUTPUT   = 2,
+	V4L2_BUF_TYPE_VIDEO_OVERLAY  = 3,
+	V4L2_BUF_TYPE_VBI_CAPTURE    = 4,
+	V4L2_BUF_TYPE_VBI_OUTPUT     = 5,
+	V4L2_BUF_TYPE_PRIVATE        = 0x80,
+};
+
 struct v4l2_vbi_format
 {
     u32 sampling_rate;		/* in 1 Hz */
@@ -40,7 +51,7 @@
 
 struct v4l2_format
 {
-    u32	type;			/* V4L2_BUF_TYPE_* */
+    enum v4l2_buf_type type;            /* V4L2_BUF_TYPE_* */
     union
     {
 	struct v4l2_vbi_format vbi;	/*  VBI data  */
@@ -48,9 +59,8 @@
     } fmt;
 };
 
-#define V4L2_VBI_SF_UBYTE	1
-#define V4L2_BUF_TYPE_VBI       0x00000009
-#define VIDIOC_G_FMT		_IOWR('V',  4, struct v4l2_format)
+#define V4L2_PIX_FMT_GREY     0x59455247 /* v4l2_fourcc('G','R','E','Y') *//*  8  Greyscale     */
+#define VIDIOC_G_FMT		_IOWR ('V',  4, struct v4l2_format)
 
 /***** end of api definitions *****/
 
@@ -423,8 +433,19 @@
     vbi->seq = seq;
 
     if (seq > 1)	// the first may contain data from prev channel
+    {
+#if 1
 	for (i = 0; i+vbi->bpl <= n; i += vbi->bpl)
 	    vbi_line(vbi, rawbuf + i);
+#else
+        /* work-around for old saa7134 driver versions (prior 0.2.6) */
+	for (i = 16 * vbi->bpl; i + vbi->bpl <= n; i += vbi->bpl)
+	    vbi_line(vbi, rawbuf + i);
+
+	for (i = 0; i + vbi->bpl <= 16 * vbi->bpl; i += vbi->bpl)
+	    vbi_line(vbi, rawbuf + i);
+#endif
+    }
 }
 
 
@@ -468,8 +489,9 @@
     int soc, eoc;	// start/end of clock run-in
     int bpl;		// bytes per line
 
-    if (p->sample_format != V4L2_VBI_SF_UBYTE)
+    if (p->sample_format != V4L2_PIX_FMT_GREY)
     {
+        fprintf(stderr, "got pix fmt %x\n", p->sample_format);
 	error("v4l2: unsupported vbi data format");
 	return -1;
     }
@@ -526,13 +548,15 @@
     struct v4l2_format v4l2_format[1];
     struct v4l2_vbi_format *vbifmt = &v4l2_format->fmt.vbi;
 
-    if (ioctl(vbi->fd, VIDIOC_G_FMT, v4l2_format) == -1
-	|| v4l2_format->type != V4L2_BUF_TYPE_VBI)
+    memset(&v4l2_format, 0, sizeof(v4l2_format));
+    v4l2_format->type = V4L2_BUF_TYPE_VBI_CAPTURE;
+    if (ioctl(vbi->fd, VIDIOC_G_FMT, v4l2_format) == -1)
     {
 	// not a v4l2 device.  assume bttv and create a standard fmt-struct.
 	int size;
+        perror("ioctl VIDIOC_G_FMT");
 
-	vbifmt->sample_format = V4L2_VBI_SF_UBYTE;
+	vbifmt->sample_format = V4L2_PIX_FMT_GREY;
 	vbifmt->sampling_rate = 35468950;
 	vbifmt->samples_per_line = 2048;
 	vbifmt->offset = 244;


More information about the mythtv-dev mailing list