pvrusb2 driver FAQ

$Id: pvrusb2-faq.html,v 1.11 2005/06/06 00:15:29 isely Exp $

Mike Isely <isely at pobox dot com>

The home location for this page is here.


This page describes list of common pitfalls (in no particular order) and their corresponding solutions when using the pvrusb2 linux driver. I have gathered up this list from e-mail correspondence over time. If there are things you think should be added here, please let me know.

Feel free to e-mail me if you have any other questions.

Mike Isely <isely at pobox dot com>

1. When I try to install the driver with "make install" the installation fails.

That's because I screwed up when reworking the build process with the 20050527 snapshot. We're using Kbuild and the correct internal target is "modules_install" not "install". Previous snapshots should be OK because they predate the bug. Anything after 20050527 should be OK because it's been fixed. Note that in any case if you follow the procedure on the pvrusb2.html, then you're copying the modules by hand anyway, in which case this isn't an issue.

2. Why am I not getting any sound?

There are multiple possible causes for this problem. Check the following:

3. Why can't I get this driver to work on an xbox?

The problem is that the xbox has an I2C adapter controller in the xbox Linux software that is very hostile to the presence of other I2C busses showing up in the system. The pvrusb2 hardware has an internal I2C bus. The fix for this is to patch the xbox Linux software. Contact me for a patch.

4. The image is jumpy and the audio tends to lag.

Possibly your system isn't keeping up with the driver's bit rate. There are some things you can do to determine what is going on:

It is possible to have a very fast system but still have lousy video rendering performance. Good video rendering depends a lot on the video card you are using. For example I have found that Nvidia 5200-class video cards do hardware video scaling significantly better than ATI 9200-class video cards.

5. I can't tune anything. I get either video snow or a blank screen.

There are multiple possible causes for this problem. Check the following:

6. I can't get xawtv to work.

There are multiple possible causes for this problem. Check the following:

7. I can't get mplayer to work.

Even though this driver is a video4linux driver, and mplayer is able to handle video4linux devices, you can't run mplayer against this driver in such a way that mplayer tries to treat it as a video4linux device. What happens when you try is that mplayer (1) can't grok v4l frames as mpeg2 data, and (2) even if it could, mplayer tries to use mmap() style I/O to fetch the video "frames" and that is not currently supported by the pvrusb2 driver.

The way to make mplayer work is just to not do anything special. Specify your video device name (e.g. /dev/video0) as the "file" to read - mplayer will then happily stream plain old mpeg2 data from the device. Yes, I know that means you can't use mplayer to adjust the device's controls, like for example changing the channel. However you can still use the driver's sysfs interface to do this while mplayer is running.

Another alternative solution you can try is the patched mplayer available with the ivtv driver. I haven't tried this, but I suspect the ivtv driver author patched mplayer to deal with exactly the problems I describe above. Thus if it works for ivtv it may very well also work for the pvrusb2 driver. (Please tell me if you try this and let me know if it worked.)

8. I can't compile because tveeprom.h is missing or the compilation dies with a complaint about tvdata being an incomplete type.

The tvdata structure is defined in tveeprom.h so the common solution is to find tveeprom.h. That header file is part of your kernel source tree. If it isn't there, then your kernel sources are too old to work with this driver. Update your kernel. Alternatively you can probably also work with a slightly older kernel that has been patched up with the latest video4linux snapshot. However I really recommend you go to a later kernel. A good choice known to work is 2.6.11.10.

9. I'm getting errors in the log about being unable to find pvrusb2.f1 or pvrusb2.f2.

Those two files are the firmware images that must be loaded into the pvrusb2 hardware before it will work properly. The firmware is not part of this snapshot, but you can extract it from your Windows drivers - which you should have gotten with the device. The extraction process is a little involved and unfortunately sensitive to the version of your Windows driver, but fortunately you only have to do this once. The best instructions for doing this can be found on Björn's web page. Note that you may need to rename the firmware file names. The two files should be:

FileSizeDescription
pvrusb2.f18192 bytes8051 program image
pvrusb2.f2262144 bytesmpeg2 encoder image?

10. I copied the driver module(s) into my system but the kernel isn't loading them.

You might have compiled for the wrong kernel version. The kernel loader will usually report this in a very unsubtle way in the system log.

If the kernel is complaining that it can't find the module, you might want to try this first:

depmod -a

I leave it as an exercise to the reader to look up the man page for depmod to see why this is important :-)

11. Sometimes streaming quits in xawtv.

This is a known problem, and a likely bug in the driver.

If streaming is quickly turned off and back on again then the device can get confused. Once this happens the only recovery is to unplug the device and plug it back in. Any place where streaming can be rapidly stopped / started risks this problem. One good test case is to attempt to enable a filter in xawtv - every time it seems this kills the device. The driver and the device have nothing to do with any filter in xawtv, but xawtv tells the driver to stop streaming while it sets up the filter, and that stop / start sequence hits our problem.

This can sometimes also manifest itself as rampant ongoing audio and video corruption, though most of the time I've seen the video stream just cease to start back up.

From the driver's viewpoint, all the data requests have been queued up to the hardware but the hardware just doesn't produce any data. This is my primary problem to solve at the moment. Unfortunately this one may take a while, as I suspect the root cause may be in how the driver is programming the undocumented mpeg encoder chip in the hardware. Bear with me on this (and I'd love some help if anyone has any help to offer).