Screen Flicker With Libsdl-mixer


GernotFrisch

Member
Joined
Jan 2, 2007
Messages
445
Hi,

I sometimes experience full screen flickering (one frame in a minute or even less), when I play an MP3 in the background. I also put the clock to 240MHz. Maybe that's an issue, too.
It's very hard to tell when and why it happens. I'm going totally nuts.
Is there a known issue with that?
 
I have it in games I've ported that use SDL HW double-buffering. I don't think I've seen it in two of my ports and those did not use double-buffering.

I recall reading somewhere that the method of waiting for the screen redraw is a bit of a kludge, as GPH or magiceyes didn't do something right, maybe with the VSYNC interrupt or something.
 
Yup, it's a bit of a kludge - basically SDL busy-waits for the vsync signal (it runs in a tight loop constantly reading a hardware register,) if the call happens just after the vsync then SDL can take up to a full 1/60th of a second doing nothing.

The hardware provides an interrupt for when vsync happens, but the kernel doesn't expose it to userland. I hope on the Pandora that we will be able to set a call-back or something similar.
 
I think my problem is a different one. Since it is swapping the screens, but it's showing a different piece of memory for one frame.
Maybe I should see what time the last sync was, and only flip if it's more than 1/50th of a second, making a pause otherwise?
 
Back
Top