LWN.net Logo

X: 25 years and still lacking vsync'ed double buffering

X: 25 years and still lacking vsync'ed double buffering

Posted Oct 2, 2009 6:45 UTC (Fri) by Tuxie (guest, #47191)
In reply to: X: 25 years and still lacking vsync'ed double buffering by alankila
Parent article: LPC: 25 years of X

This is effectively fixed by enable triple buffering in xorg.conf.

Without triple buffering, playing videos with a similar but not exact multiple of the screen Hz (like 29.97 FPS video on a 60 Hz display) can cause problems. MPlayer can come to a situation where each frame is finished just after the vblank so it will stall waiting for vblank most of the time, leaving little time left to do actual decoding, resulting in very choppy playback. This is especially visible on low Hz modes like "24p" (23.976 Hz) and HD video. Enabling triple buffering solves this.

It doesn't however fix the problem with drifting audio/video sync when video/screen Hz only almost match. For that you need either hard frameskips or syncing audio to video with resampling or AC3/DTS packet dropping/duplication, which AFAIK only recent SVN snapshots of XBMC can do on Linux systems. MPlayer and stable XBMC sync video to audio.

For some reason (Nvidia driver bug?) though, triple buffering cause problems with Nvidia hardware decoding/rendering (VDPAU) so if you rely on VDPAU to do your video playback you will want to disable it.

It will also cause a display lag of one frame so you may want to disable it for fast paced FPS games.


(Log in to post comments)

X: 25 years and still lacking vsync'ed double buffering

Posted Oct 8, 2009 7:52 UTC (Thu) by kragil (subscriber, #34373) [Link]

Triple buffering, yeah!
It is fun to see that a concept that I used in the Amiga arcade games I wrote as a kid is now a solution to X problems.

It probably is true what they say, that most of hard CS problems were solved in the 60s (I just takes a few generations to implement them everywhere)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds