$Id: pvrusb2.html 1153 2006-05-17 04:39:09Z isely $
Mike Isely <isely at pobox dot com>
The home location for this page is here.
If you have any suggestions for improving either this web page or the driver itself, please drop me a message.
Contents
Contacting People / Discussion List
Overview
Download
Setup
Usage
FAQ
Utilities
Bugs
Change History
If you wish to contact me, my e-mail address is spelled out at the top of this page.
There is also a pvrusb2 e-mail discussion list, hosted here at this site. This is a mailman-operated list, so you can subscribe, unsubscribe, access your subscription, scan archives, etc via the web. (You can also initiate a subscription by sending a message to <pvrusb2-subscribe at isely dot net>.) Any pvrusb2 relevant topic there is fair game. Posting to the pvrusb2 list is limited to just subscribers, but I encourage you to subscribe to the list. The main web page for the discussion list can be found here.
Note also for those who use IRC, the channel #pvrusb2 has been set up on freenode. I tend to idle there (with a fairly obvious handle) when I can.
This driver is intended for the Hauppauge WinTV PVR USB2, which is a USB 2.0 hosted TV Tuner. Examples for sale can be found at pricegrabber. This device is an analog tuner, but it has a hardware mpeg encoder, which makes it ideal for use in PVR applications. Functionally, the "PVR USB2" device is very similar to Hauppauge's line of "PVR-nnn" PCI based tuner cards - except this device uses USB instead of PCI which makes it suitable for laptop, xbox, or embedded device applications where there would otherwise not be a PCI slot available.
Please note that this driver is only for the WinTV PVR USB2, and in particular this driver is not for the seemingly similar sounding Hauppauge WinTV USB2 which is in fact a completely different and less capable device from Hauppauge. (See here for a driver that should work with the WinTV USB2 hardware.)
This driver is very much a work in progress. Its history started with the reverse-engineering effort by Björn Danielsson whose web page can be found here. From there Aurelien Alleaume began an effort to create a video4linux compatible driver. His web page about this driver can be found here. However after October 2004, work there seemed to have stopped and repeated attempts to contact him over several months since then were not successful. The driver hosted here picks up from that point. I have been maintaining / improving this since February 2005.
There are now actually two variations of this driver available. One is here on this site. The other is hosted within the official video4linux Mercurial source tree, and is hopefully the vector through which this driver will find its way into the kernel source tree. I maintain them both and they are closely related. You can use either. As for deciding which you might want to try: If you are already into building & running all of V4L then the V4L version is probably what you want. If on the other hand you just want to get this one driver working (damnit!) and don't want to learn about Mercurial (V4L's source code manager), and you don't like the idea of pulling in 50+ modules just to run one piece of hardware, then you may prefer to run the standalone version hosted here. On the other-other hand, what's in V4L is probably closer to what will eventually find its way into the kernel. It's up to you. Right now the way I do development is that the standalone version is the "primary" version. To update the V4L version I process the sources through a Perl script that reconfigures the driver for use inside of V4L (strips out source files and code that don't make sense there, and enables some bits for in-V4L-tree operation that might otherwise be shut off). I'm using Subversion to maintain the driver sources and do diff / patching as needed for any changes from the V4L side that come back my way.
Note: Even if you choose to run the V4L hosted version of this driver, you will still need to extract and install the firmware - and the extraction script is not (yet) part of the V4L repository. If you need just the extraction script (something normally contained in the standalone driver snapshot), you can download a reasonably recent version from here: http://www.isely.net/downloads/fwextract.pl.
As of this writing, there are two major variants of the PVR USB2 hardware in circulation. They can be physically distinguished by the white sticker on the underside of the device - the retail boxes are identical, unfortunately. You can also distiguish the two variants through the USB ID reported to the host when the device is plugged in.
This driver is intended to work with both old and new hardware. Right now it is stable with the old hardware, and for the new hardware things seem reasonably OK as well but of course only time will tell. See the Bugs section for more details. Also, the firmware situation and chip-level modules are different in the two cases, which may impact how you set things up. The documentation on this site covers both model variants.
I've been trying to collect a census of the various model variants in circulation. You can find the current results in models.txt; please e-mail me if you would like to add your device to the tally.
If you have trouble getting the driver to work, please read through this site again - there are a lot of details here and it is easy to miss something. Also, I've written a short FAQ covering common situations that people have found themselves in. Try scanning the mailing list archives here. If none of that helps, send me a message or subscribe and post to the mailing list (information here) - it's entirely possible that you might have encountered something new and thus I want to hear about it so I can address the problem for everyone...
Downloads can be found here.
To operate your PVR USB2 device in Linux, there are several prerequisites and a number of things you must do first.
You must satisfy at least these prerequisites before the driver will work:
The Prerequisites / Compatibility section of setup.html has the details for the above.
There are 3 basic steps you must complete in order to operate your PVR USB2 device in Linux:
If you are trying the in-V4L driver version, then the compilation steps above are a part of the V4L repository build and so you don't have to do anything special there. However even in that case you still have to deal with the firmware part of the puzzle.
The following sections of setup.html have the details for getting your PVR USB2 device working:
Driver compilation and installation
Firmware extraction and installation
Support Modules
The page usage.html has everything you ever wanted to know about using this driver, but contained below is a basic summary to get you going.
Plug in your WinTV-PVR-USB-2.0 device and after a few seconds the driver should be ready to go. Progress can be monitored through the kernel log.
If you have udev installed on your system, then within a few seconds after the driver initializes, you should see something like this appear in your system: /dev/video0 (if this is the only video device in your system). If you're not running udev, then you need to make sure that appropriate /dev entries have been configured into your system; details for that (e.g. correct major / minor numbers) are a V4L specific issue and outside the scope of documentation. Really, save yourself a headache and just use udev...
One you have a valid /dev entry, then you can start playing! Any V4L application which can handle mpeg stream data should be able to work. You can also just "cat" /dev/video and you'll get a video stream for whatever the device is currently configured to capture.
In addition to the V4L API, this driver also implements a sysfs-hosted interface, which can be found in /sys/class/pvrusb2/sn-xxxxxx (substitute xxxxxx for your device's serial number). Through that interface you can operate the device right from your shell prompt without need for any kind of utility program(s). The driver snapshot even includes some contributed shell scripts that do exactly this.
For more signficantly more information how to use this device, please don't forget to examine usage.html.
I've written up a short list of common mis-steps and solutions encountered by people trying the driver. If you have any suggestions for things to add here, please let me know. Hopefully you can find your situation described here.
The driver package now includes a few utilities related to operation of this device. This topic can be found in utils.html.
With the "old" model 29xxx series devices, the driver appears to be quite stable. For that hardware there are currently no known problems. (Missing features are a different matter however.)
With the newer model 24xxx series devices, the driver still has one potential stability problem: Only during initialization, the cx25843 chip might wedge itself. When this happens, all attempts to read from it yield a particular garbage byte, the same garbage byte regardless of the subaddress accessed. That then causes the cx25840 to fail to detect the chip and so it fails to attach to the driver. There is logic in the pvrusb2 driver now to detect this situation and report it to the system log - look for this message: "WARNING: Detected a wedged cx25840 chip; the device will not work." If this happens, power cycle the device.
This situation used to be worse - until recently, msp3400 could jump into the fracas (mistaking the cx25843 chip for an msp3400), get extremely confused, and then corrupt the Linux kernel. The detection logic added to the pvrusb2 driver for this also includes the ability to try to keep msp3400 away from the chip, and it tries to control initial access in order to keep the chip from wedging in the first place. Since adding that logic, nobody has seen the chip wedge again, so this problem might actually be fixed (or at least worked around).
New hardware issues not withstanding, stability is pretty decent. However there are other issues, mainly missing features. These include:
Change history can be found here: history.html
Note: If you are viewing a local sandbox copy of this page, the file history.html will not exist. This file is generated from change_history.txt which you can find in the same directory.
Feel free to e-mail me (address at the top of this page) if you have any questions or just want to say hello...
Mike Isely