[pvrusb2] Hello; and empty files problem....

Mike Isely isely at isely.net
Sat Mar 3 22:39:22 CST 2007

On Thu, 1 Mar 2007, Rod Smith wrote:

> Hi,
> I recently purchased a Hauppauge WinTV PVR-USB2 for use with MythTV. For the 
> most part, the device is working fine (and thanks to Mike Isely for the 
> driver!); however, ocasionally it runs into a problem. The dmesg output 
> and /var/log/messages file contain the following error messages:
> pvrusb2: ***WARNING*** device's encoder appears to be stuck (status=000000003)
> pvrusb2: Encoder command: 0x81
> pvrusb2: Giving up waiting.  It is likely that this is a bad idea...
> pvrusb2: Error recovery initiated
> pvrusb2: Retrying device reconfiguration
> Thereafter, MythTV records 0-length files, for both the current and subsequent 
> recordings; apparently the error recovery attempted by the driver was 
> unsuccessful or MythTV has problems resyncing after the fact. Unloading the 
> driver and reloading it (via rmmod and modprobe, respectively) fixes the 
> problem.

What's going on with that message is that the pvrusb2 driver has given 
up waiting for the encoder to respond to a command.  When this happens, 
the driver prints the message you see, forces the encoder into reset, 
reloads its firmware, reconfigures the device and then starts it running 
again.  The whole sequence takes a very short time (scale of a second or 
less), and any app streaming at that time basically should not even 
notice this except for a probable glitch in the mpeg2 data stream from 
the encoder being restarted.  So I'm unclear on why MythTV is reacting 
badly here.  Your description is the _first_ time I've heard of this 
particular interaction.

> I've run across references to similar problems in the mailing list archives 
> and elsewhere, but in those cases either additional error messages are 
> present (those five lines are the only indications of problems in my logs) or 
> it seems to be a relatively harmless blip.

Right.  If this error is only because the encoder hiccuped, then the 
driver recovers it and everyone is happy.  If it is part of a larger 
problem (like maybe the whole PVR USB2 device got smacked by a power 
glitch), then other bad things will usually happen as well.  But the 
common case is just the encoder being reset and that is generally not a 
problem.  (Yes, I'd still like to know why the encoder does this at all, 
but at this point it's basically a benign issue.)

> So -- is there a workaround for this? I'm sure I could write a script to 
> monitor /var/log/messages and restart the driver when necessary, but if 
> there's an existing solution I'd rather use it.
> Obligatory hardware/software information:
> - 3.06GHz Celeron-D
> - Biostar PT880 Pro-A7C motherboard with VIA PT880 PRO/VT8237R chipset
> - 24xxx PVR-USB2 hardware
> - I've also got a pcHDTV 3000 card in this system
> - 32-bit 2.6.20 Linux kernel, locally compiled from stock sources
> - pvrusb2 driver from above 2.6.20 kernel
> - firmware as delivered in my hardware's retail package; md5sums:
>   - d85cb08382395390dc95ac6ebc2205f9  v4l-cx2341x-enc.fw
>   - c5749da3eb141e87634ff1e2c1e6f390  v4l-cx25840.fw
>   - 34d213394328adf78e2fc9f1411691b0  v4l-pvrusb2-24xxx-01.fw
> - Ubuntu 6.10
> - MythTV 0.20, as delivered with Ubuntu
> I'm willing to upgrade firmware or drivers if these would improve matters; or 
> if there are some other tools to help, I can try them. I can also recompile 
> my kernel, if specific options might help.
> If anybody's got any pointers, I'd appreciate them. Thanks.

The in-kernel 2.6.20 pvrusb2 driver is fairly old.  There have been some 
stability fixes since then.  Those fixes are already on their way into a 
2.6.20.y kernel release but you might want to try building the 
most current standalone driver and see if that helps the situation.  I'm 
not sure if it's going to help, because none of the changes I've done 
were to specifically address the symptoms you are describing.  However 
it can't hurt to try.


                        |         Mike Isely          |     PGP fingerprint
     Spammers Die!!     |                             | 03 54 43 4D 75 E5 CC 92
                        |   isely @ pobox (dot) com   | 71 16 01 E2 B5 F5 C1 E8
                        |                             |

More information about the pvrusb2 mailing list