Hello,
With a lot of help from the very patient hverkuil, I have produced a patch
that allows me to capture the CC data from NTSC broadcasts and see them
appear on the screen in MythTV-0.19. Hans has briefly glanced at this
patch, but hasn't thoroughly vetted it, so if there's something here that
looks wrong, please let me know. It's running fine for me.
I'm subscribed to the daily digest for ivtv-devel, so there might be a bit
of a delay for me to reply to comments on the list, but mail sent directly
to my address will reach me pretty quickly.
diff --recursive -u ivtv-0.4.3.orig/driver/cx25840-vbi.c
ivtv-0.4.3/driver/cx25840-vbi.c
--- ivtv-0.4.3.orig/driver/cx25840-vbi.c Wed Nov 16 13:16:58 2005
+++ ivtv-0.4.3/driver/cx25840-vbi.c Thu Mar 23 21:06:58 2006
@@ -210,7 +210,7 @@
cx25840_vbi_setup(client);
/* Sliced VBI */
- cx25840_write(client, 0x404, 0x36); /* Ancillery data */
+ cx25840_write(client, 0x404, 0x32); /* Ancillary data */
cx25840_write(client, 0x406, 0x13);
cx25840_write(client, 0x47f, vbi_offset);
@@ -256,7 +256,7 @@
if (is_pal) {
cx25840_write(client, 0x474, 0x2a);
} else {
- cx25840_write(client, 0x474, 0x1a + 6);
+ cx25840_write(client, 0x474, 0x22);
}
break;
}
@@ -290,6 +290,7 @@
case 6:
id2 = V4L2_SLICED_CAPTION_525;
err = !odd_parity(p[0]) || !odd_parity(p[1]);
+ l += 3;
break;
case 9:
id2 = V4L2_SLICED_VPS;
diff --recursive -u ivtv-0.4.3.orig/driver/ivtv-driver.c
ivtv-0.4.3/driver/ivtv-driver.c
--- ivtv-0.4.3.orig/driver/ivtv-driver.c Mon Feb 6 16:44:44 2006
+++ ivtv-0.4.3/driver/ivtv-driver.c Thu Mar 23 18:26:16 2006
@@ -1109,7 +1109,12 @@
itv->vbi_raw_decoder_line_size = 1444;
itv->vbi_raw_decoder_sav_odd_field = 0x20;
itv->vbi_raw_decoder_sav_even_field = 0x60;
- itv->vbi_sliced_decoder_line_size = 284;
+
+ if (itv->std & V4L2_STD_NTSC)
+ itv->vbi_sliced_decoder_line_size = 272;
+ else
+ itv->vbi_sliced_decoder_line_size = 284;
+
itv->vbi_sliced_decoder_sav_odd_field = 0xB0;
itv->vbi_sliced_decoder_sav_even_field = 0xF0;
if (itv->card->type == IVTV_CARD_PVR_150) {
@@ -1191,7 +1196,7 @@
if (itv->has_cx25840) {
// NTSC does not yet have a working sliced VBI
// implementation for the cx25840.
- itv->v4l2_cap &= ~V4L2_CAP_SLICED_VBI_CAPTURE;
+ itv->v4l2_cap |= V4L2_CAP_SLICED_VBI_CAPTURE;
}
} else {
itv->is_50hz = 1;
diff --recursive -u ivtv-0.4.3.orig/driver/ivtv-vbi.c
ivtv-0.4.3/driver/ivtv-vbi.c
--- ivtv-0.4.3.orig/driver/ivtv-vbi.c Tue Nov 15 15:57:25 2005
+++ ivtv-0.4.3/driver/ivtv-vbi.c Thu Mar 23 18:26:16 2006
@@ -449,7 +449,8 @@
if (*buf == 0xff)
break;
}
- for (i = 0; i < size / line_size; i++) {
+
+ for (i = 0; i < 1 + (size - 1) / line_size; i++) {
p = buf + i * line_size;
// Look for SAV code
--
Christopher Neufeld
Home page: http://www.cneufeld.ca/neufeld
"Don't edit reality for the sake of simplicity"
_______________________________________________
ivtv-devel mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-devel