[SDL] sound latency

Sam Lantinga slouken at devolution.com
Mon Jul 1 10:53:01 PDT 2002

> On Sun, 30/06/2002 12:12:12 , Loren Osborn <linux_dr at yahoo.com> wrote:
> [...]
> >Hmm... I Just though of something that might greatly
> >improve latency (if it's doable).  The program
> >generally knows when it needs to add a new sound to
> >the mix.  If at this time, would it be possible for
> >the program to signal SDL of this, so that SDL could
> >EXPIRE the REMAINDER of the current buffer (minus a
> >few micro-seconds to allow time for the remix).  That
> >way the sound mix callback (or possibly a new special
> >purpose callback) would be re-called to mix the new
> >sound into the sound buffer with practically zero
> >latency.  (Sound is not my forte, so this might not be
> >possible, but I it seems like a perfectly reasonable
> >idea.)

> This is pretty much how "shared memory zero latency mixing" works, although there are more efficient ways to do it than to entirely ditch and rerender the "future" part of the buffer. (That can become *very* expensive...)

This is almost mutually exclusive with the current callback semantics
of the SDL audio API.  It will be considered for the next generation SDL
API, but won't go into the current stable code.

See ya,
	-Sam Lantinga, Software Engineer, Blizzard Entertainment

More information about the SDL mailing list