I got the impression that retrace sync on flip with double buffering used to
work with X/DGA (at least on XFree86 4.0.1), but this doesn’t seem to be the
case with SDL 1.1.7+… Did something break, or isn’t this supposed to work in
the first place? I’ll try some older versions and other stuff to sort out more
accurately what works and what doesn’t on my machines. I could be mixing things
up…
Further, I’ve failed to get any SDL/OpenGL code to animate without tearing. It
seems that double buffering is indeed done (using hardware blits), but as
there’s no retrace sync, there are very visible artifacts when doing fast
scrolling and the like. Also, the frame rate is way beyond the refresh rate
(like 189 fps on a 80.7 Hz display), which again indicates that no raster sync
is done. This happens on the G400 as well as on the Mach64 Rage Pro, in
windowed mode as well as in full screen mode. Is this possible to fix, and if
so; how, and does it work on the majority of cards?
I’m thinking about some sort of more or less portable solution for targets
that don’t support retrace sync at all. I’ve collected some retrace sync code
for various hardware (from SDL, svgalib, X,…), and it seems that it’s
possible to do it through simple polling/busy-waiting on most hardware, without
interfering with the driver.
The question is; what do I do with this code? It seems that most people seem
to believe retrace sync is too ugly to be in production drivers, with the net
result that Linux can’t do high quality animation. So the only options would
be to put it in some library, or make a “stand alone” library or driver of some
kind.
The idealistic alternative would be to wait until all video cards have commands
and interrupts for all kinds of synchronization. However, some sources indicate
that one might have too wait forever.
Either may, this is really needed for quality animation, especially on
targets that “flip” using blits. (Tearing unavoidable without at least retrace
syncing the blit.) It’s not worth the effort writing a 2D engine with subpixel
accurate rendering for ultra smooth animation or even try to achieve full
frame rate, if there’s no way to avoid tearing and other artifacts introduced
by the display target…
Basically, where do I best spend my limited time in order to fix this?
As things look now, I’d prefer to have it in SDL, but somehow I got the
impression that it has very, very low priority for various reasons. It might
not be an issue for the majority of SDL users/developers, but I consider it a
showstopper. (Well, I have more code to hack, but I’d rather see the real
results than jerking and tearing.)
//David
…- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------> http://www.linuxaudiodev.com/maia -' ..- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |
--------------------------------------> david at linuxdj.com -’