[SDL] audio documentation...

Glenn Maynard g_sdl at zewt.org
Wed Apr 21 15:53:03 PDT 2004


On Wed, Apr 21, 2004 at 11:11:08PM +0200, David Olofson wrote:
> No, without a recent (2.4+) kernel and/or lowlatency patches, it can 
> actually be *worse* than Windows, at least in terms of worst case 
> scheduling latency. (Average latency is pretty much irrelevant to RT 
> applications. It's usually in the µs range regardless of OS anyway.)

Huh?  Average scheduling latency in Linux 2.4 is at least 10ms.  If
you set SCHED_RR, usleep() will give you smaller sleeps than that, but
it's just busy looping--it isn't actually giving up any CPU (so you
can't actually do this constantly, or you'll hang the system).

Are you talking about something else when you say "scheduling latency"?

> BTW, Audiality (the sound engine used in Kobo Deluxe) happily runs 
> with less than 10 ms latency even on standard 2.4 Linux kernels, 
> whereas I can't seem to get it to work at all with less than ~70 ms 
> latency on Win32. I'm still not totally sure why that is, though; 
> could be an Audiality/Win32 specific problem.

The "prefetch size" (that is, the amount DirectSound tells you to write
ahead in the buffer: the distance between the play and write cursors)
is typically very large.  I think the only way to get around this right
now is to use ASIO, or to use kernel streaming, which is 2k and XP-
specific, documented as "probably won't work in future releases", and
prevents other apps from playing sounds.

I think this is a limitation of DirectSound, and not something that
drivers can fix.

-- 
Glenn Maynard




More information about the SDL mailing list