RFC: SDL_PushAudio

Dear SDL community,

First of all, kudos for SDL 2.0. I’ve been raging for years about some
parts of the legacy SDL, most notably the impossibility to fully
accelerate the apps with a GPU. I like the way it goes now.

I’m the co-author of a Linux distribution targetted at open-source
handheld consoles, that embeds SDL, and supports a couple of SDL
emulators like gnuboy or snes9x. Emulators are really the special case
where SDL becomes unadapted when it comes to submitting sound, as they
generally want to “push” sound and doesn’t map well to the "pull"
interface used by SDL.

So instead of patching every emulator I work on to cope with the
callback, I added a push interface to SDL. See the attached patch.

As ALSA and OSS (and probably others) do already provide a push
interface, the current implementation could be enhanced; SDL_PushAudio
could write directly to the buffer of the audio device (provided no
conversion is necessary).

Best regards,

Paul Cercueil
-------------- next part --------------
A non-text attachment was scrubbed…
Name: sdl-pushaudio.patch
Type: text/x-patch
Size: 3039 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20120529/53ba01f9/attachment.bin

Hi.

Make sure to.post this on bugzilla, too. It might get lost on the list.

Regards
MartinAm 30.05.2012 01:36 schrieb “Paul Cercueil” :

Dear SDL community,

First of all, kudos for SDL 2.0. I’ve been raging for years about some
parts of the legacy SDL, most notably the impossibility to fully accelerate
the apps with a GPU. I like the way it goes now.

I’m the co-author of a Linux distribution targetted at open-source
handheld consoles, that embeds SDL, and supports a couple of SDL emulators
like gnuboy or snes9x. Emulators are really the special case where SDL
becomes unadapted when it comes to submitting sound, as they generally want
to “push” sound and doesn’t map well to the “pull” interface used by SDL.

So instead of patching every emulator I work on to cope with the callback,
I added a push interface to SDL. See the attached patch.

As ALSA and OSS (and probably others) do already provide a push interface,
the current implementation could be enhanced; SDL_PushAudio could write
directly to the buffer of the audio device (provided no conversion is
necessary).

Best regards,

Paul Cercueil


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org