From owner-freebsd-multimedia@FreeBSD.ORG Sat Sep 6 18:49:57 2008 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD006106566B for ; Sat, 6 Sep 2008 18:49:57 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.247]) by mx1.freebsd.org (Postfix) with ESMTP id 893DB8FC1C for ; Sat, 6 Sep 2008 18:49:57 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: by an-out-0708.google.com with SMTP id b33so153520ana.13 for ; Sat, 06 Sep 2008 11:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:mime-version:content-type:content-transfer-encoding :content-disposition:message-id; bh=mIk7RKGAXZbyXR/dowFVo2mtjORAtBAQU14M5Cx71Lc=; b=umdLSXkMvWSDlNmlopMKkRbN+0jhLw5/mIrj8c/bwDvRy9SHuX46LDl2C2JrCxfH4I b1+ptAH7ftVlWgNMz8u6BZpdQrmfdE0LX8Ib7iaHqGrvFHhQBiUXpThTkJbtj90VnP/A d1VKTPlu41LCeiJ7EY7n9xUbqW/dda3QegsX0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; b=gqU+dZd3dE0rIGF//WOkA6P6LegIsnbjBtjhRGJMMMmeeB0ZusvAxJv0ThXScldCU5 gSxhG1VN8VNbnYIqBuFWyFpMoWiQMYGz8khLP6MbXX/Pct0C/dSKwJ4/9SPvMByx3x1y FN3u2o4UFCNtJHzKHBYOUpq74yhxrpM6+Ikqs= Received: by 10.100.143.12 with SMTP id q12mr13970101and.24.1220725422412; Sat, 06 Sep 2008 11:23:42 -0700 (PDT) Received: from ?192.168.0.137? ( [24.174.5.175]) by mx.google.com with ESMTPS id c39sm3625607anc.29.2008.09.06.11.23.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 06 Sep 2008 11:23:40 -0700 (PDT) From: Jason Harmening To: freebsd-multimedia@freebsd.org Date: Sat, 6 Sep 2008 13:22:37 -0500 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200809061322.37736.jason.harmening@gmail.com> Subject: New cards and analog support for cx88 X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2008 18:49:57 -0000 I have a new snapshot of the cx88 driver here: ftp://corona.homeunix.net/cx88_20080824.tar.gz 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 untested. 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 untested. 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 cx88_audio_client.cpp ./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 EEPROM. 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. Thanks, Jason