[pvrusb2] Jumpy Video in Mythtv

Mike Isely isely at isely.net
Sat Jun 30 11:58:28 CDT 2007


On Thu, 28 Jun 2007, Mark Goldberg wrote:

> On 6/28/07, Mike Isely <isely at isely.net> wrote:
> > It is a known fact that if the audio is set to full scale on a PVR USB2
> > device then you *will* get distortion.  This is actually what the V4L
> 
> > One good way to try to debug the audio issue here is to divide and
> > conquer.  Try operating the device just with mplayer, using sysfs for
> > the volume control.  Figure out what the right maximum gain is in that
> > case.  Note the value.  Now go back to MythTV and get into the state
> 
> I've noticed this and my MythTV encoder settings are not at 100% volume.
> Looking at the sysfs interface the level is some odd number in the 50000s.
> I've reduced this to 48000 and there is still distortion. It is a
> little difficult as
> some of the MythTV encoder settings are ignored and some used.
> 
> I'm thinking though that the level may just be too high for the
> hardware input, so
> reducing the software volume may not help.

That's a good point.  Can you feed the audio signal into a cassette 
deck, stereo amp, or something similar and check for distortion that 
way?


> 
> >Though if you are not getting distortion for ATSC playback
> >then this would seem to rule out everything downstream of the PVR USB2
> >device.
> 
> I think they use different audio codecs, so this may not be sure.

ATSC is just mpeg2 bits sent over the air.  Last time I messed with ATSC 
using mplayer I thought it just saw an MPEG-TS and the embedded audio 
subchannels weren't anything unusual.


> 
> It also seems that there still may be a slight audio delay or video
> delay, not enough to obviously tell, but enough so you can tell
> something is not quite right. Is there any adjustment for this in the
> encoding side. I know you can adjust it during playback, but it would
> be nice to have it recorded ideally.

There isn't any adjustment in the driver.  The video and audio are 
combined into mpeg within the device itself not in the driver (that 
after all is the entire point of this device), and I don't recall seeing 
any adjustments provided by the cx23416's API.

I have generally not seen any problems like that here that can be pinned 
to the encoder.  For example, if you play the stream with mplayer and 
then suspend the encoder (through a debug interface) then audio / video 
sync turns to crap.  But this is because mplayer is trying to do 
something in real time and is getting confused by the lack of incoming 
data.  Similarly, if something disrupts the stream from the PVR USB2 
device long enough (e.g. a channel change that doesn't lock right away 
or a really bad signal) then mplayer can get confused.  The "smoking 
gun" that points to mplayer is if you instead just capture the device's 
output to a file (e.g. "cat /dev/video0 >/tmp/foo.mpg"), disrupt / 
suspend the stream a few times during the capture, and then play back 
that capture with mplayer - then synchronization stays perfect the 
entire time.  I suppose it's possible for a similar thing to happen 
involving MythTV but I haven't seen it yet.  If the cable receiver is 
sending the video and audio signals slightly out of sync then 
unfortunately there's not a lot that the pvrusb2 driver could do there 
to compensate :-(

  -Mike


-- 
                        |         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