[SDL] SDL useful for sound synthesis?

Waltzer George george.waltzer at gmail.com
Thu Sep 21 11:20:59 PDT 2006

yep, my mistake. I just confused MIDI with digital (wav format), I thought
he is doing some calculation and in the end snends the wav to the port.

For threads, yes, I forgot that the audio part has already one (using the
Well, to have such latencies controled, perhaps he should try then an OS
like RTOS or the like among with a good card driver :)

long live SDL...

On 9/21/06, David Olofson <david at olofson.net> wrote:
> On Thursday 21 September 2006 19:12, Waltzer George wrote:
> [...]
> > I think that's the clasic problem trying to stream anything,
> > regardless if audio or video.
> Real time sound synthesis is quite different from streaming, in that
> you essentially want zero latency. That is, you can't use any
> buffering beyond what the audio subsystem needs to avoid glitches, or
> you lose the whole point of trying to keep the audio output latency
> low in the first place.
> [...]
> > How to do this without clicks and ugly stuff? Use the treading
> > posibility of SDL,
> > create a thread(there are tutorials about this). You should play
> > from within that tread.
> I would strongly recommend *not* using any extra threads for low
> latency audio on most platforms. It increases the risk of operating
> system "coffee breaks" interfering with your audio, and you need
> additional buffering between each pair of threads in the chain,
> adding to the total latency.
> SDL already provides an audio thread on platforms that need it, and
> your best bet is to do all audio processing in that thread, that is,
> in the context of the callback from SDL audio.
> That said, there *are* low latency audio subsystems that use multiple
> threads or even processes to great effect (http://jackaudio.org/),
> but getting that to work reliably can be hard, if at all possible, on
> some platforms. "Don't try this at home!" ;-)
> //David Olofson - Programmer, Composer, Open Source Advocate
> .-------  http://olofson.net - Games, SDL examples  -------.
> |        http://zeespace.net - 2.5D rendering engine       |
> |       http://audiality.org - Music/audio engine          |
> |     http://eel.olofson.net - Real time scripting         |
> '--  http://www.reologica.se - Rheology instrumentation  --'
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060921/7fda6fa6/attachment-0008.htm>

More information about the SDL mailing list