[MPlayer-dev-eng] N fps and N Hz screen refresh rate (the vblank problem)

Pallai Roland pallair at magex.hu
Sun Jan 4 22:42:48 CET 2009


2008/12/30 Uoti Urpala <uoti.urpala at pp1.inet.fi>:
> On Tue, 2008-12-30 at 19:38 +0100, Reimar Döffinger wrote:
>> On Tue, Dec 30, 2008 at 07:23:41PM +0100, Pallai Roland wrote:
>> What video card doe you have? Can it do OpenGL?
>> Have you tried -vo gl (or if supported better -vo gl:yuv=2)?
>
> The gl swapinterval alone can not solve this well. If the monitor
> framerate is a multiple of the video framerate then the default does not
> help at all. You'll need to set a higher swapinterval that matches the
> ratio of video and screen updates. But then with such a setting A/V sync
> adjustments break because it becomes impossible to speed up the video at
> all. You'd need either a mode that adjusts audio length instead or a
> mode that drops frames instead of showing them faster (or with
> swapinterval > 1 preferably allows showing them with a smaller
> interval).

I've done a lot of work on this issue, now perfectly clear what
happened and why. Let me share my experiences.

My original problem was that the update_video() timing slipped -what
is the right word for that? :)- to the brink of the vblanks in every
1-2 minutes when 25fps at 25hz and began to jitter for 10-15 seconds.
Well, this is a problem that mainly affects the "radeon" driver.
Refresh timing isn't so precise with radeon, the refresh rate wasn't
*exactly* 25Hz. I tried the same machine with an Nvidia GeForce 7600
GS and the update_video() never slipped against the vblank. I used the
same custom ModeLine's in xorg.conf.
The problem was worsen by the latency caused by "radeon" driver. Time
between played frames variables from 38 to 42ms in mplayer with radeon
driver and variables only between 39.5-40.5ms with nvidia driver.
Bigger latency means longer jitter.

I tested what I see on the nvidia when the update_video() slipping to
the brink of the vblank, played 23.976fps at 24Hz. The "rollover" was
much less noticeable, thanks to the less latency (I guess).


The final solution is the gl swapinterval with -framedrop, that works
well if framerate and refresh rate are equal and I don't use an ATI
card: the fglrx painfully slow, the Xorg's radeon driver suffers from
tearing.


Thanks for your help and sorry for disturbing.



More information about the MPlayer-dev-eng mailing list