[SDL] Re: Converting push sound model to SDL
leob at mailcom.com
Thu Jun 23 18:54:30 PDT 2005
Stephen Anthony <stephena <at> users.sourceforge.net> writes:
> If I'm understanding you correctly, you want to move from a "push the
> sound bytes down the pipe" model to a callback model? If so, I
> encountered and eventually solved (with a great amount of misery) the
> exact same problems with Stella, the Atari 2600 emulator.
> Originally, the sound processing was done in a separate sound server,
> where updates were simply done with 'write' and using OSS. Later, the
> code was converted to use SDL.
> Have a look at the web repository on stella.sf.net. Specifically, look
> for the old OSS sound code in 'src/ui/sound/Attic/OSS.c' and the new
> code in 'src/common/SoundSDL.cxx'. To be sure, there are some things
> there that you can ignore, but it might give you some ideas on how to
Thanks a lot. As far as I can see from the CVS comments there are still
problems with matching the speed of the emulator to the speed of the original
Atari. In my emulator I never need to compute how much ahead I am and to call
SDL_Delay if the audio is enabled - the sound system does the speed matching for
me - this is what I'm trying to achieve in SDL. In your code you apparently
rely on some other means of slowing the emulator down.
More information about the SDL