Login
Back to forumSee the full topicGo to last reply

Posted By

Gaia
on 2016-04-04
14:58:10
 Re: A Monumental Step Forward In Emulation

Mike's was using SDL1, mine is using SDL2 which is still not officially in production I believe. But the real culprit is I think is how the control is returned to the main loop in Emscipten: in SDL's audio implementation you typically have a callback function which runs in a different thread than the main one and the buffer fill is called independently from the main loop's thread. Somehow this method still works under Emscripten / JS despite it being strictly single threaded if there is misalignment between the main thread driven by the VBL of the video and the sound buffer underrun we might be out of luck. I do not know how the SDL2 port of Emscripten gets around this problem - if at all - but a more fool proof method could be implementing SDL2's new 'SDL_QueueAudio' method which runs in the same thread as the main one instead of a separate callback thread. So that's probably next on the todo list happy



Back to top


Copyright © Plus/4 World Team, 2001-2024