- Status Closed
- Percent Complete
- Task Type Patches
- Category User Interface → Simulator
-
Assigned To
safetydan - Operating System All players
- Severity Critical
- Priority Very Low
- Reported Version
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
FS#5748 - Fix Skipping Audio in Simulator on OS X (caused by excessive surface blitting in SDL)
The SDL simulator on OS X when compiled skips while playing audio. The message reported is:
sdl_audio_callback: No Data.
Upon investigation, this behaviour only occurs when the simulator window was visible. Upon closer investigation, the Simulator draws to the screen twice, once with SDL_UpdateRect() and again with SDL_Flip(). According to the SDL Documentation (www.libsdl.org/cgi/docwiki.cgi/SDL_5fFlip), SDL_Flip is equivalent to updating the whole screen with SDL_UpdateRect().
When hardware aceleration is available, SDL_UpdateRect() AFAIK is bad when double buffering is used because the backbuffer is a frame behind the current LCD display. If only a region of it is updated, as the original code did, the output will contain a mixture of the new LCD and the one a frame before it.
Because of the incorrect behavior when the program is double buffered, and the redundancy that keeps the OS X version of the simulator, I removed the call to SDL_UpdateRect(). The program output seems to still be correct, and the OS X version no longer skips on any of the computers I’ve tested on.
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task
I’ve tried this patch under Linux and it doesn’t seem to make any difference. I’ll investigate some more though.