[pvrusb2] Intermittent video stream damage

Mike Isely isely at isely.net
Sun Dec 14 13:40:40 CST 2008


On Sat, 13 Dec 2008, Bjorn Danielsson wrote:

> Once in a while I get an unusable video stream, and I want to ask
> here if anyone else has seen the same symptoms. I start streaming
> and get both video and sound, but the video is extremely "jerky"
> with mplayer, as if everyone in the picture has severe chronic
> spasms, including the furniture sometimes...
> 
> I have seen this happen a couple of times per month, and usually I
> just stop the streaming and restart (re-open /dev/video0) and then
> the problem goes away. But I am worried that this might happen while
> recording something. This has fortunately not happened yet, or perhaps
> unfortunately because a saved broken MPEG would really make it easier
> to debug this. But I did manage to catch the output from an affected
> mplayer process recently:
> 
> AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
> Starting playback...
> VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12)
> VDec: using Planar YV12 as output csp (no 0)
> Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
> VO: [xv] 720x576 => 768x576 Planar YV12 
> [mpeg2video @ 0xb90c60]ac-tex damaged at 7 0
> [mpeg2video @ 0xb90c60]00 motion_type at 8 1
> [mpeg2video @ 0xb90c60]00 motion_type at 4 2
> [mpeg2video @ 0xb90c60]mb incr damaged
> [mpeg2video @ 0xb90c60]00 motion_type at 5 4
> [mpeg2video @ 0xb90c60]slice mismatch
> [mpeg2video @ 0xb90c60]00 motion_type at 25 6
> [mpeg2video @ 0xb90c60]ac-tex damaged at 0 7
> [mpeg2video @ 0xb90c60]invalid cbp at 2 8
> [mpeg2video @ 0xb90c60]00 motion_type at 2 9
> 
> and it kept going on like that. The pvrusb2 driver in this case is
> the one bundled with linux-2.6.26.2.
> 
> I can't be sure of course that these broken video streams have
> anything to do with the pvrusb2 driver, but I think I have already
> excluded some of the more "obvious" failure modes, because I know that:
> 
>  + The problem has occurred on two different pvrusb2 hardware devices
>  + This never happened when I used the old libusb userspace driver
>  + This never happens when I stream DVB-T to mplayer via the same software
> 
> Don't we all love intermittent failures? :-)

Bjorn:

The closest I can get to recognizing this is that mplayer is known to 
get squirrely if there are any real-time breaks in the video stream, 
i.e. if it stops receives bytes for a few seconds.  Then mplayer goes 
crazy (e.g. stuttering / slide show) trying to bring the video and audio 
back into sync.  When I first saw that I was sure it was a pvrusb2 
driver problem - and spent weeks chasing it.  Then I realized that it 
only happened with mplayer, AND that if I capture the stream to a file 
first and played the file later that I could never cause the problem to 
happen.  This interesting little behavior is written up on the driver 
usage page where mplayer is discussed.

However the symptoms you are describing don't quite match that.  I never 
saw messages about "damaged" data :-( For what it's worth, the pvrusb2 
driver passes the byte stream through unmolested from the hardware, and 
that area of code is completely within the pvrub2 driver and has been 
stable for several years now.  The only time the driver does anything 
with the data is right at stream startup - it throws away bytes from the 
driver until it sees a valid marker for a packet header.  Some PVR-USB2 
devices have had a tendency to spew garbage before valid data right at 
startup, probably the result of an uninitialized video buffer, and this 
could confuse some apps like xawtv.

I suppose if something were causing capture issues upstream of the mpeg 
encoder, like loss of video sync, then the encoder could get confused 
and start spewing bad frames.  I saw the other reply from Carsten 
suggesting the problem cleared for him after moving to a different 
V4l-DVB core version.  You're running a 29xxx device, right?  That means 
the video capture chip in the saa7115 which is less common these days.  
The cx25840 seems to be what recent devices (including the 24xxx model) 
use for video capture.  So breakage in the saa7115 chip-level driver in 
V4L-DVB might have gone unnoticed for a while :-(

  -Mike

-- 

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


More information about the pvrusb2 mailing list