[mythtv] Playback too fast

Greg Stark gsstark at mit.edu
Fri Mar 31 22:46:24 UTC 2006


Isaac Richards <ijr at case.edu> writes:

> On Friday 31 March 2006 15:29, Greg Stark wrote:
> > Isaac Richards <ijr at case.edu> writes:
> > > > Or perhaps the usleep should be happening before the videosync method
> > > > is even called from NuppelVideo itself.
> > >
> > > A usleep isn't accurate enough for that.
> >
> > It seems to work fine with the usleep+busywait sync method.
> >
> > usleep (actually the syscall on linux is nanosleep) on most platforms has a
> > resolution of 10ms. Even if it goes over by 1 or two iterations that's only
> > 10-20ms which is still less than the frame interval for a 30fps NTSC video.
> 
> Who's limited to 30fps NTSC?  Use the bob, and you're at 60 fps.  720p at 60 HD 
> video..  10-20ms resolution simply doesn't cut it.

Sure, so it wouldn't normally call the usleep unless it got at least a full
frame ahead. My point is you have to at least check where you are and not just
use dead reckoning.

> Yes, it trusts that the ioctls are doing what they're supposed to be doing.  
> If they're not, they shouldn't be advertised as working in the first place.

Well there's two problems here. A) They might not, as they weren't in this
case. and B) all they promise is that they'll sync with the retrace, not that
they'll wait for a specific amount of time. Mythtv makes assumptions about the
timing based on the refresh rate it calculates from GetModeLIne. If it gets it
wrong then mythtv never corrects based on gettimeofday at all and gets
completely confused.

Incidentally I'm a bit surprised at all the effort expended to sync with
retrace. AFAIK mplayer makes no effort to sync with the retrace and just uses
the RTC to sync to the audio and I've never noticed any page tearing. Are you
sure the X server doesn't use page flipping to avoid tearing automatically?

-- 
greg



More information about the mythtv-dev mailing list