Tests for the hacked cx2388x video4linux driver to find out if it can do continuous capturing using the cap_raw_all flag, and to find out how to use it. first build the driver: tar zxvf cx88-0.0.4-mdvh-hackX.tar.gz cd cx88-0.0.4-mdvh-hackX make KDIR=/path/to/kernel/source/tree Now use the insmod options below to load cx8800.ko. You also need to insmod v4l1-compat.ko and cx88xx.ko but that one does not need any special options. To see the list of new insmod options run: modinfo ./cx8800.ko loading for the first time: cd rmmod cx88xx (be sure no old modules are loaded) rmmod cx8800 insmod v4l1-compat insmod ./cx88xx.ko insmod ./cx8800.ko for example the last line could be: insmod ./cx8800.ko cap_raw_all=1 frm_size=2048 I tried to dig up the right parameters to get the continuous raw capturing working. I think it will only work if you also enable vbi_frame mode. Since this mode was not yet supported in the driver I tried to find out the parameters used in the bttv driver (which does support vbi_frame mode, called BT848_COLOR_FMT_RAW in the driver) Still there are lots of uncertainties because bttv and cx2388x are not the same and the datasheets leave a lot of room for interpretation. But maybe the vbi_frame mode is not needed at all and we only need to set the cap_raw_all flag and the frm_size. frm_size is needed for cap_raw_all mode but it is still quite a mistery to me. It might need to correspond to capture_width or capture_width*2. I don't know exactly what a frame is here. I suspect it is the number of samples per output_line. In the bt878 chip there is no frm_size register. If using vbi_frame mode the bt878 always outputs 1024 samples per line. The datasheet says: VBI Frame Size Used in both RAW all mode and VBI frame mode specifies # of bytes packed in each packet has to be QWORD boundary. But there is no description of what a packet is. The datasheet also says: In the VBI frame output mode, VBI data capture occurs in the active video region and includes all the horizontal blank/sync information in the data stream. This feature can be used to provide a high-quality still-capture of video. The data is vertically bound beginning at the first line during VACTIVE and ending after a fixed number of packets. The data stream is packetized into a series of 256-dword blocks. A fixed number of dword blocks (434 for NTSC and 650 for PAL) are captured during each field. This is equivalent to 111,104 dwords for NTSC (434 × 256 dwords) and 166,400 dwords for PAL (650 × 256 dwords) per field. The VBI frame capture region can be extended to include the 10 lines prior to the default VACTIVE region by setting the EXT_FRAME register bit. VDELAY must also be set to its minimum value of 2. So, since 256 dwords is 2048 bytes, possibly the default should be: frm_size=2048 The only real option to find out is to try different settings. Here are the test videocaptures I thought of. I don't know if standard capture programs will allow you to use non-standard capture_sizes like 2048x692. If not please let me know and I will write a small test_capture appplication. Any comments welcome. Simple test to see what cap_raw_all in normal (not vbi_frame) mode does: capture settings: Try different standard settings. Also try grey 8bpp 1024x640 insmod options: cap_raw_all=1 frm_size = try 2048 or 1024 or capture_width or capture_width/2 or 0 so for example: insmod ./cx8800.ko cap_raw_all=1 frm_size=2048 Try more things to see what cap_raw_all in normal (not vbi_frame) mode does: capture settings: capture_color :try different color modes, probably GREY, 8bpp works best capture_width: try normal resolutions (640x480) or try 1024 and 2048. This might need to correspond to frm_size or frm_size/2 capture_height=try normal resolutions (640x480) or for PAL 625 or 674 or 692 for NTSC 450 or 466 or 525 insmod options: cap_raw_all=1 vbi_frame_capture_raw_mode=0 force_hactive=0 (or for PAL use 922, for NTSC use 754, must correspond to norm_swidth(tvnorm)) force_maxw=2048 (set to capture_width or greater) force_maxh=800 (set to capture_height or greater) frm_size = try 2048 or 1024 or capture_width or capture_width/2 or 0 force_vdelay=2 force_vactive=for PAL try 576, 610,625,692 (values from 576 to 694) for NTSC try 450,480,508,525 (values from 448 to 526) vbi_v_del=2 disable_samplerateconverter=1 or 0 disable_vscale=1 or 0 disable_hscale=1 or 0 Test to determine if vbi_frame mode works: normal vbi_frame mode without extend_vbi: capture settings: capture_color : use GREY, 8bpp capture_width: try 1024 and 2048. This might need to correspond to frm_size or frm_size/2 capture_height=for PAL 640 for NTSC 434 or 640 insmod options: vbi_frame_capture_raw_mode=1 force_hactive=for PAL use 922, for NTSC use 754, must correspond to norm_swidth(tvnorm) force_maxw=2048 (set to capture_width or greater) force_maxh=692 (set to capture_height or greater) frm_size = try 2048 or 1024 or 0 vbi_v_del=2 disable_samplerateconverter=1 or 0 disable_vscale=1 disable_hscale=1 If vbi_frame mode works, try to get extra lines with this test. normal vbi_frame mode with extend_vbi (you get more output lines): capture settings: capture_color : use GREY, 8bpp capture_width: try 1024 and 2048. This might need to correspond to frm_size or frm_size/2 capture_height=for PAL 674 for NTSC 450 or 674 insmod options: vbi_frame_capture_raw_mode=1 force_hactive=for PAL use 922, for NTSC use 754, must correspond to norm_swidth(tvnorm) force_maxw=2048 (set to capture_width or greater) force_maxh=692 (set to capture_height or greater) frm_size = try 2048 or 1024 or 0 force_vdelay=2 force_vactive=for try 610 (values from 600 to 694) for NTSC try 508 (values from 448 to 526) vbi_v_del=2 disable_samplerateconverter=1 or 0 disable_vscale=1 disable_hscale=1 Try to see what cap_raw_all does when in vbi_frame mode. cap_raw_all in vbi_frame mode without extend_vbi: capture settings: capture_color : use GREY, 8bpp capture_width: try 1024 and 2048. This might need to correspond to frm_size or frm_size/2 capture_height=for PAL 640 for NTSC 434 or 640 insmod options: cap_raw_all=1 vbi_frame_capture_raw_mode=1 force_hactive=for PAL use 922, for NTSC use 754, must correspond to norm_swidth(tvnorm) force_maxw=2048 (set to capture_width or greater) force_maxh=800 (set to capture_height or greater) frm_size = try 2048 or 1024 or 0 vbi_v_del=2 disable_samplerateconverter=1 or 0 disable_vscale=1 disable_hscale=1 See if we can get more extra lines in cap_raw_all and vbi_frame mode: cap_raw_all in vbi_frame mode with extend_vbi (you get more output lines): capture settings: capture_color : use GREY, 8bpp capture_width: try 1024 and 2048. This might need to correspond to frm_size or frm_size/2 capture_height=for PAL 674 for NTSC 450 or 674 insmod options: cap_raw_all=1 vbi_frame_capture_raw_mode=1 force_hactive=for PAL use 922, for NTSC use 754, must correspond to norm_swidth(tvnorm) force_maxw=2048 (set to capture_width or greater) force_maxh=800 (set to capture_height or greater) frm_size = try 2048 or 1024 or 0 force_vdelay=2 force_vactive=for PAL try 576, 610,625,692 (values from 576 to 694) for NTSC try 450,480,508,525 (values from 448 to 526) vbi_v_del=2 disable_samplerateconverter=1 or 0 disable_vscale=1 disable_hscale=1 cap_raw_all=1 frm_size versus capture_width versus htotal versus hactive: force_htotal:default PAL 1135, NTSC 910. maximum is 2047.Programmable total number of pixel per line. This determines the actual number of raw samples per line/2 taken during a normal capture. We probably don't need to verride this. force_hactive=for PAL use 922, for NTSC use 754, must correspond to norm_swidth(tvnorm) capture_width: try 1024 and 2048. This might need to correspond to frm_size or frm_size/2 frm_size = try 2048 or 1024 ? This might need to correspond to capture_width or capture_width*2. I don't know exactly what a frame is here. I suspect it is the number of samples per output_line. In the bt878 chip there is no frm_size register. If using vbi_frame mode the bt878 always outputs 1024 samples per line. The datasheet says: VBI Frame Size Used in both RAW all mode and VBI frame mode specifies # of bytes packed in each packet has to be QWORD boundary. But there is no description of what a packet is. The datasheet also says: In the VBI frame output mode, VBI data capture occurs in the active video region and includes all the horizontal blank/sync information in the data stream. This feature can be used to provide a high-quality still-capture of video. The data is vertically bound beginning at the first line during VACTIVE and ending after a fixed number of packets. The data stream is packetized into a series of 256-dword blocks. A fixed number of dword blocks (434 for NTSC and 650 for PAL) are captured during each field. This is equivalent to 111,104 dwords for NTSC (434 × 256 dwords) and 166,400 dwords for PAL (650 × 256 dwords) per field. The VBI frame capture region can be extended to include the 10 lines prior to the default VACTIVE region by setting the EXT_FRAME register bit. VDELAY must also be set to its minimum value of 2. So possibly the default frm_size=256 dwords =256*8=2048 disable_samplerateconverter=1 Use the same clock for the ADC as for the video_decoder. Strangely enough the current driver nomally enables the samplerate_converter. I don't know why. Experiment with this setting disable_vscale=1 Do not do any vertical scaling (needed for vbi_frame_mode, probably also for cap_caw_all) disable_hscale=1 Do not do any horizontal scaling (needed for vbi_frame_mode, probably also for cap_raw_all) cap_raw_all=0 of 1 A value of 1 enables continuous raw data mode capture. You also need to set frm_size to the correct value and probably use a capture height of 640 or 674 and a capture width corresponding to frm_size vbi_frame_capture_raw_mode=1 Enable vbi_frame mode. This sets up the driver to use RAW vbi_frame_capture_mode when V4L2_PIX_FMT_GREY 8 bpp, gray is chosen as the color format in the capture application. Use normal capture device, NOT the vbi device for this. You also need to set frm_size. All new insmod options: (get the current list with modinfo ./cx8800.ko) filename: ./cx8800.ko description: v4l2 driver module for cx2388x based TV cards parm: force_htotal:default PAL 1135, NTSC 910. Force htotal to this value, maximum is 2047.Programmable total number of pixel per line. This determines tha actual number of raw samples per line taken during a normal capture parm: force_swidth:force scaled width to this value. default for PAL is 922, for NTSC 754 parm: force_hdelay:default PAL 186, NTSC 135, maximum 1023. HDELAY is programmed with the number of pixels between horizontal sync and the first pixel of each line to be displayed or captured. HDELAY should be an even number to get Cb as the first pixel, an odd number to get Cr. The register value is programmed with respect to the scaled frequency clock. parm: force_vdelay:default PAL 36,default NTSC 24 For video decoding, VDELAY is programmed with the number of half lines between the end of the serration pulses and the first line to be displayed or captured. The register value is programmed with respect to the unscaled input signal. VDELAY must be programmed to an even number to avoid apparent field reversal.*/ parm: force_fsc8:pll frequency in Hz. (for videodecoder (will be scaled) and ADC) default PAL 35468950, NTSC 28636360. min 16000000 max 80000000 parm: force_vbi_pkt_size:default PAL 511, NTSC 288, max 1023 .VBI Packet Size. The number of raw data dwords (four 8-bit samples) to capture per line while in VBI capture mode (only used in VBI line mode). parm: force_vactive:default PAL 576, NTSC 480, This is the vertical active. It defines the number of half lines used in the vertical scaling process. Values between 1 and 1023 are allowed. parm: force_hactive:default set to capture_width.This is the horizontal active. It defines the number of horizontal active pixels per line. Values between 1 and 1023 are allowed. parm: force_maxh:default PAL 576, NTSC 480, maximum value the driver will accept for height parm: force_maxw:default PAL 768, NTSC 640, maximum value the driver will accept for width parm: frm_size:VBI Frame Size: default 1024. Used in both RAW all mode and VBI frame mode specifies # of bytes packed in each packet. Has to be QWORD boundary. This number might need to correspond in some way to the exact height and /or width requested in the capture command. parm: vbi_v_del:The number of CLKx1 s to delay from the trailing edge of HRESET before starting VBI line capture. Used in both VBI line mode and VBI frame mode, where in VBI frame mode it has to set to a value of 2. parm: extend_vbi:A value of 1 extends the frame output capture region to include the 20 half lines prior to the default VACTIVE region. Can be used in vbi_frame_mode. parm: disable_samplerateconverter:set to 1 to disable the samplerate_conversion for the video_decoder and make the videodecoderrate the same as the ADC sampling freq. If set to 0 the videodecoder works at a different frequency as the sampling frequency of the ADCs, for normal operation we should not need the samplerateconversion and just use pll_freq=fsc8 for everything. The datasheets are confusing about these settings parm: disable_vscale:set to 1 to disable the vertical scaling. parm: disable_hscale:set to 1 to disable the horizontal scaling. parm: cap_raw_all:A value of 1 enables continuous raw data mode capture. You also need to set frm_size parm: raw16: 0 = 8xFsc 8-bit data mode (Raw Data) 1 = 4xFsc 16-bit data mode (Filtered VBI data) parm: vbi_frame_capture_raw_mode: This sets up the driver to use RAW vbi_frame_capture_mode when V4L2_PIX_FMT_GREY 8 bpp, gray is chosen as the color format in the capture application. Use normal capture device, NOT the vbi device for this. You also need to set frm_size. greetings, Martin Dvh