Well, things are kinda of ugly, but I can at least get a few VBI buffers
out of the CX23418 (and then it stops).


To get reasonable looking raw VBI captures, for NTSC, I had to set the
VBI buffer size to 26 lines * 1444 samples and tell the encoder to send
13 lines per field.  (I guess the CX18-AV-Core is setup to send 13 lines
per field).  I commented out the "compression" done in the cx18 driver
to get the unmolested, but still byte swapped, buffers.

The CX23418 throws in a 12 byte sequence before the first VBI line, and
again in the last 12 bytes of the last line of the frame.  Here's a dump
from a little utility I wrote to show where things get aligned when
capturing with 'cat /dev/vbi >foo.vbi'.

code 0x3fffffff found at 0 (0)
code 0xff000020 found at 0xc (12), 12 bytes from previous
code 0xff000020 found at 0x5b0 (1456), 1444 bytes from previous
code 0xff000020 found at 0xb54 (2900), 1444 bytes from previous
code 0xff000020 found at 0x10f8 (4344), 1444 bytes from previous
code 0xff000020 found at 0x169c (5788), 1444 bytes from previous
code 0xff000020 found at 0x1c40 (7232), 1444 bytes from previous
code 0xff000020 found at 0x21e4 (8676), 1444 bytes from previous
code 0xff000020 found at 0x2788 (10120), 1444 bytes from previous
code 0xff000020 found at 0x2d2c (11564), 1444 bytes from previous
code 0xff000020 found at 0x32d0 (13008), 1444 bytes from previous
code 0xff000020 found at 0x3874 (14452), 1444 bytes from previous
code 0xff000020 found at 0x3e18 (15896), 1444 bytes from previous
code 0xff000020 found at 0x43bc (17340), 1444 bytes from previous
code 0xff000060 found at 0x4960 (18784), 1444 bytes from previous
code 0xff000060 found at 0x4f04 (20228), 1444 bytes from previous
code 0xff000060 found at 0x54a8 (21672), 1444 bytes from previous
code 0xff000060 found at 0x5a4c (23116), 1444 bytes from previous
code 0xff000060 found at 0x5ff0 (24560), 1444 bytes from previous
code 0xff000060 found at 0x6594 (26004), 1444 bytes from previous
code 0xff000060 found at 0x6b38 (27448), 1444 bytes from previous
code 0xff000060 found at 0x70dc (28892), 1444 bytes from previous
code 0xff000060 found at 0x7680 (30336), 1444 bytes from previous
code 0xff000060 found at 0x7c24 (31780), 1444 bytes from previous
code 0xff000060 found at 0x81c8 (33224), 1444 bytes from previous
code 0xff000060 found at 0x876c (34668), 1444 bytes from previous
code 0xff000060 found at 0x8d10 (36112), 1444 bytes from previous
code 0x3fffffff found at 0x92a8 (37544)
code 0xff000020 found at 0x92b4 (37556), 1444 bytes from previous
code 0xff000020 found at 0x9858 (39000), 1444 bytes from previous
code 0xff000020 found at 0x9dfc (40444), 1444 bytes from previous
code 0xff000020 found at 0xa3a0 (41888), 1444 bytes from previous
code 0xff000020 found at 0xa944 (43332), 1444 bytes from previous
code 0xff000020 found at 0xaee8 (44776), 1444 bytes from previous
code 0xff000020 found at 0xb48c (46220), 1444 bytes from previous
code 0xff000020 found at 0xba30 (47664), 1444 bytes from previous
code 0xff000020 found at 0xbfd4 (49108), 1444 bytes from previous
code 0xff000020 found at 0xc578 (50552), 1444 bytes from previous
code 0xff000020 found at 0xcb1c (51996), 1444 bytes from previous
code 0xff000020 found at 0xd0c0 (53440), 1444 bytes from previous
code 0xff000020 found at 0xd664 (54884), 1444 bytes from previous
code 0xff000060 found at 0xdc08 (56328), 1444 bytes from previous
code 0xff000060 found at 0xe1ac (57772), 1444 bytes from previous
code 0xff000060 found at 0xe750 (59216), 1444 bytes from previous
code 0xff000060 found at 0xecf4 (60660), 1444 bytes from previous
code 0xff000060 found at 0xf298 (62104), 1444 bytes from previous
code 0xff000060 found at 0xf83c (63548), 1444 bytes from previous
code 0xff000060 found at 0xfde0 (64992), 1444 bytes from previous
code 0xff000060 found at 0x10384 (66436), 1444 bytes from previous
code 0xff000060 found at 0x10928 (67880), 1444 bytes from previous
code 0xff000060 found at 0x10ecc (69324), 1444 bytes from previous
code 0xff000060 found at 0x11470 (70768), 1444 bytes from previous
code 0xff000060 found at 0x11a14 (72212), 1444 bytes from previous
code 0xff000060 found at 0x11fb8 (73656), 1444 bytes from previous
code 0x3fffffff found at 0x12550 (75088)
code 0xff000020 found at 0x1255c (75100), 1444 bytes from previous
code 0xff000020 found at 0x12b00 (76544), 1444 bytes from previous
code 0xff000020 found at 0x130a4 (77988), 1444 bytes from previous
code 0xff000020 found at 0x13648 (79432), 1444 bytes from previous
code 0xff000020 found at 0x13bec (80876), 1444 bytes from previous
code 0xff000020 found at 0x14190 (82320), 1444 bytes from previous
code 0xff000020 found at 0x14734 (83764), 1444 bytes from previous
code 0xff000020 found at 0x14cd8 (85208), 1444 bytes from previous
code 0xff000020 found at 0x1527c (86652), 1444 bytes from previous
code 0xff000020 found at 0x15820 (88096), 1444 bytes from previous
code 0xff000020 found at 0x15dc4 (89540), 1444 bytes from previous
code 0xff000020 found at 0x16368 (90984), 1444 bytes from previous
code 0xff000020 found at 0x1690c (92428), 1444 bytes from previous
code 0xff000060 found at 0x16eb0 (93872), 1444 bytes from previous
code 0xff000060 found at 0x17454 (95316), 1444 bytes from previous
code 0xff000060 found at 0x179f8 (96760), 1444 bytes from previous
code 0xff000060 found at 0x17f9c (98204), 1444 bytes from previous
code 0xff000060 found at 0x18540 (99648), 1444 bytes from previous
code 0xff000060 found at 0x18ae4 (101092), 1444 bytes from previous
code 0xff000060 found at 0x19088 (102536), 1444 bytes from previous
code 0xff000060 found at 0x1962c (103980), 1444 bytes from previous
code 0xff000060 found at 0x19bd0 (105424), 1444 bytes from previous
code 0xff000060 found at 0x1a174 (106868), 1444 bytes from previous
code 0xff000060 found at 0x1a718 (108312), 1444 bytes from previous
code 0xff000060 found at 0x1acbc (109756), 1444 bytes from previous
code 0xff000060 found at 0x1b260 (111200), 1444 bytes from previous
code 0x3fffffff found at 0x1b7f8 (112632)
code 0xff000020 found at 0x1b804 (112644), 1444 bytes from previous
code 0xff000020 found at 0x1bda8 (114088), 1444 bytes from previous
code 0xff000020 found at 0x1c34c (115532), 1444 bytes from previous
code 0xff000020 found at 0x1c8f0 (116976), 1444 bytes from previous
code 0xff000020 found at 0x1ce94 (118420), 1444 bytes from previous
code 0xff000020 found at 0x1d438 (119864), 1444 bytes from previous
code 0xff000020 found at 0x1d9dc (121308), 1444 bytes from previous
code 0xff000020 found at 0x1df80 (122752), 1444 bytes from previous
code 0xff000020 found at 0x1e524 (124196), 1444 bytes from previous
code 0xff000020 found at 0x1eac8 (125640), 1444 bytes from previous
code 0xff000020 found at 0x1f06c (127084), 1444 bytes from previous
code 0xff000020 found at 0x1f610 (128528), 1444 bytes from previous
code 0xff000020 found at 0x1fbb4 (129972), 1444 bytes from previous
code 0xff000060 found at 0x20158 (131416), 1444 bytes from previous
code 0xff000060 found at 0x206fc (132860), 1444 bytes from previous
code 0xff000060 found at 0x20ca0 (134304), 1444 bytes from previous
code 0xff000060 found at 0x21244 (135748), 1444 bytes from previous
code 0xff000060 found at 0x217e8 (137192), 1444 bytes from previous
code 0xff000060 found at 0x21d8c (138636), 1444 bytes from previous
code 0xff000060 found at 0x22330 (140080), 1444 bytes from previous
code 0xff000060 found at 0x228d4 (141524), 1444 bytes from previous
code 0xff000060 found at 0x22e78 (142968), 1444 bytes from previous
code 0xff000060 found at 0x2341c (144412), 1444 bytes from previous
code 0xff000060 found at 0x239c0 (145856), 1444 bytes from previous
code 0xff000060 found at 0x23f64 (147300), 1444 bytes from previous

So the '3fffffff' VBI frame header can be found at n*26*1444  but the
last 12 samples of the last line of every frame are discarded by the
encoder (no big deal).

The 12 byte frame headers and the following SAV code from the data file
are:

0000000: 3fffffff 00000000 00001515 ff000020 
00092a8: 3fffffff 00000000 000020d1 ff000020 
0012550: 3fffffff 00000000 00002c89 ff000020 
001b7f8: 3fffffff 00000000 00003845 ff000020 

The differences between the changing numbers is 3004, 3000, & 3004
decimal.  If you consider those ticks of a 90 kHz clock like many MPEG
timestamps, than those numbers are 33.38 ms, 33.33 ms, and 33.38 ms or
frame rates of 29.96 Hz, 30.0 Hz and 29.96 Hz.  So it looks like the raw
VBI stream from the encoder comes with time stamps.


Now, if I could only get it not to stall....

Regards,
Andy



_______________________________________________
ivtv-devel mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-devel

Reply via email to