New cards and analog support for cx88

Jason Harmening jason.harmening at
Sat Sep 6 18:49:57 UTC 2008

I have a new snapshot of the cx88 driver here:

The big news is preliminary analog video and audio support, along with added 
HDTV support for several cards.

For digital video, Konstantin Dimitrov has contributed bugfixes and support 
for the following cards:

DViCO FusionHDTV 5 Gold (ATSC)
Hauppauge WinTV-HVR-1100 (DVB-T)
Hauppauge WinTV-HVR-1100 LP (DVB-T)
Leadtek WinFast DTV2000H (DVB-T)
Hauppauge WinTV-HVR-1300 (DVB-T)
Hauppauge WinTV-HVR-3000 (DVB-T)
Hauppauge WinTV-HVR-4000 (DVB-T)

This is a massive improvement for the driver, as it previously only supported 
the following:

pcHDTV HD-3000 (ATSC)
pcHDTV HD-5500 (ATSC)
Hauppauge WinTV Nova-T (DVB-T)

Konstantin is also working on adding DVB-S, DVB-S2, analog audio input, and FM 
radio support for the Hauppauge WinTV-HVR-4000.

That brings me to the next part of the announcement, which is that analog 
video and audio support has been added.  Kernel driver sources are in the 
video/ and audio/ subfolders, respectively, and running the top-level 'make' 
command will generate cx88video.ko and cx88audio.ko kernel modules.

The analog video driver has only been tested with NTSC video on the two pcHDTV 
cards.  It supports scaling, cropping, and both packed and planar pixel 
formats.  VBI capture *seems* to work, but I don't have a VBI parsing tool to 
tell me for sure.  As with the cx88mpeg driver, it can capture to both user- 
and kernel-allocated buffers.  PAL and SECAM support are present but 

The biggest limitation for analog video is that I don't have a good capture 
app right now.  There are test apps in the tests/ directory for the pcHDTV 
cards that will grab a sequence of frames and dump them to .ppm files.  I 
will work to integrate analog capture support into the cx88 capture app, but 
I also would like to work on a more universal solution, such as V4BSD, for 
both digital and analog capture.

Capture isn't nearly as much of an issue with the audio driver--it interfaces 
with the FreeBSD pcm subsystem, so all that is needed is a very simple app 
that sets the broadcast audio format and the tuner frequency (see 
tests/cx88_audio_client.cpp for an example).  The capture itself can be done 
by any app that can talk to /dev/dsp* devices.  You can even do something as 
simple as 'cat /dev/dspX > /dev/dspY', where X corresponds to your cx88 audio 
device and Y is your soundcard.  A "plain" capture like this won't give very 
good sound quality, however, as the default bitrate settings for dsp devices 
are low.  Most actual capture apps are capable of setting the bitrates to 
something better.

The analog audio driver has been tested with BTSC audio and FM radio on the 
pcHDTV cards.  Unless your card has a dedicated FM radio tuner (which the 
pcHDTV cards don't), FM reception will be spotty and of poor quality.  
Support for other broadcast standards (NICAM/A2/EIA-J) is present but 

The biggest limitation for audio is that it requires PCI function 1 to be 
enabled on the CX2388x.  Many cards, especially older ones, will not have 
this function enabled and will instead require the user to run a patch cable 
from the card to their soundcard's line-in jack.  My drivers don't currently 
support this "passthrough" audio capture, as there are some cx88 hardware 
bugs with it that would require hacks to work around.

If your card doesn't have PCI function 1 enabled, you may be able to enable it 
by flipping a bit in your card's EEPROM.  I've written a very simple app 
(utils/cx88_audio_enable.cpp) that does this.   Compile and run as follows:

g++ -Wall -O2 -I../ -I../libtuner -L../libtuner -ltuner -o audioenable 

./audioenable /dev/cx88videoX,  where X is the node number for the video 
device on the card where you want to enable audio.

You'll need cx88video.ko loaded, as the app will go through the video device 
to access the EEPROM.  If it detects the audio function isn't already 
enabled, it will flip the necessary bit and then wait for the internal EEPROM 
programming cycle to complete.  You will need to power-cycle your computer 
before you can use the audio function.  This works for the pcHDTV HD-3000, 
but it may not work for other cards since some card vendors write-protect the 

With analog mostly working, here's what I'd like to do in the coming months:

1)  Make libtuner and the cx88 driver stack into ports, with manpages and 
README docs.
2)  Work on cx88 analog capture solution
3)  Work on broader capture solution, possibly V4BSD
4)  Research adding support for cx23885/6/7-based PCI-Express capture cards

If you have a problem using the drivers or if you'd like to make a 
contribution, please let me know.  I'll be glad to help wherever I can.


More information about the freebsd-multimedia mailing list