The DC10+ is a low-end video capture card by Pinnacle. This card only works with the software "Studio" for windows but fortuately there is a driver to make it run on linux. The chipset used on the DC10+ is a zoran-36067, so we can use the zoran driver (http://mjpeg.sourceforge.net/driver-zoran/). Here is how to be able to display a video signal from your DC10+ direcly on your screen on Debian Lenny.

Loading modules

There is no need to compile a kernel or any module: the zoran modules are included in a default Debian install. Let's add zr36060 et zr36067 to the modules to be loaded at startup time:

~$ cat >> /etc/modules
zr36060
zr36067 v4l_bufsize=1296 card=2 v4l_nbufs=2

The DC10+ identifier is "2"; you can check here for the list of supported cards.

Display vs Capture

To display a video signal on my screen in realtime, I don't mind losing frames so I don't need many buffers but I need some memory to capture raw images.

Since we don't mind about dropped frames, 2 buffers will be enough. Now let's talk about the buffer size. The buffer default size is 128KB: it is the maximum size for a contiguous block of memory that the kernel can give us with a kmalloc call. This means a maximum resolution of 320x200 using 16bits colors (320x200x 2 = 128000, 128KB = 131072). The DC10+ can capture 768x576 24bits images. So we need a buffer size of 1296KB. For further details about video4linux and memory, check out the linux kernel documentation: Documentation/video4linux/Zoran.

If you plan to use your capture card to record video on your hard drive, you need different values. Your module parameter would look like:

zr36067 v4l_bufsize=512 card=2 v4l_nbufs=32

When capturing frames, the DC10+ compress the images using MJPEG so you'll be fine with 512KB. 32 buffers should be enough to avoid skipped frames.

Memory

The buffers used to capture video must be a contiguous memory region. Because the kernel can't provide such a big zone, the zoran driver uses a few hacks to use memory out of the range handled by the kernel. Usually the whole RAM is used by the kernel, so we'll have to tell the kernel how many memory it can use buring the boot. Open the /boot/grub/menu.lst file and edit the kopt line to add the "mem" option. I have 2024MB on my machine so I'll free 4MB (1296KB x 2 buffers + some more just in case).

~$ kopt=root=/dev/mapper/raid0-root ro mem=2020M

Reboot once you updated your boot menu:

~$ update-grub

Capture software

I now need some software to capture and display the video stream from the capture card. We'll be using the debian-multimedia.org package repository to install mplayer (to display video) and mencoder (to record video).

~$ cat >> /etc/apt/sources.list
deb http://www.debian-multimedia.org testing main
~$ apt-get update
~$ apt-get install mplayer mencoder

To display the analogic input, you can execute mplayer with this command line:

~$ mplayer tv:// -tv driver=v4l2:device=/dev/video0:input=0:outfmt=yuy2:width=768:height=572 -vf pp=lb/fd -fps 25 -zoom

You can change the "input" parameter from the "-tv" option. The "-vf" add some video filter to deinterlace the picture. Here i'm using a blend filter ("ld") with a ffmpeg deinterlace filter ("fd"). The "-zoom" option is used for fullscreen display.

It even works with compiz Laughing!

 

Capture DC10+ sous compiz

To record the video into a file, the parameters for the option "-tv" are the same.

~$ mencoder -oac mp3lame -ovc lavc tv:// -lavcopts vbitrate=1600:vcodec=mpeg4:vqmin=2 -tv driver=v4l2:device=/dev/video0:input=0:forceaudio:forcechan=2:outfmt=yuy2:width=382:height=286 -o test.avi

Problems?

Sometimes the video capture fails. You can add a debug option to the module loading to get further details about the failure. On some systems the module can't allocate the needed memory (error in the "get_high_mem" function). An ugly way to fix it is to compile the module and assume the kernel *will* give you the memory you requested Surprised. Edit the file drivers/media/video/zoran_driver.c and change the line

if (fh->v4l_buffers.buffer_size <= MAX_KMALLOC_MEM) {

with

if (true) {

This won't make a 100% success during video capture initialization. In some cases you'll have to close a few apps to free memory Yell.

More information: http://linuxtv.org/wiki/index.php/Zoran_devices_(zr36057,_zr36067)