David Hedbor wrote:
Has anyone compared ESD with regular OSS on something like a AMD
K6-2/350 using XMMS for example? It sucks. Skips at the slightest
provocation. Quake with ESD would probably be a severe pain in the ass.
I can’t but agree more. ESD is not suitable for games, at least not
action games. If you don’t want it to skip, you need to buffer. If you
buffer you get latency. Even if you don’t buffer, esd has noticeable
latency.
Yeah, I didn’t even get into the latency of ESD. The time between the
click on the play button and the moment it starts playing is incredibly
long. I am not sure, but I think ddt started the “sound server in
another process through a pipe” thing, and he told me that he regrets
doing so. He likes his Quake1 design (which I think lives on in Quake2
and Quake3 with improvements) much better.
Is there any intention of having the SDL sound be non-threaded one of
these days? I might even use it… 
As in using non-blocking io? Although, what’s wrong with threaded
audio? 
The audio device is always non-blocking, there is absolutely no
difference between using the O_NONBLOCK flag or not. I would think of
this as a bug, but thinking of it, having the write() call unblock only
when the buffer is finished playing would yield horrible output.
What wrong with threaded audio? Go into gdb and tell me! 
No, it’s not really that bad, but I just feel it is so easy to make the
sound system based on the fd/handle or something, and putting a helper
function that starts a thread for the sound (for compatibility with
current apps).
I am thinking of something along the lines of the ConnectionNumber()
macro in Xlib. You can just use the Xlib event functions, or you can ask
for the ConnectionNumber() and use it in a select/poll. You have the
choice. Most people take the easy way with the Xlib functions, but
more advanced applications have the ConnectionNumber() available to play
with.
(I agree that a level of indirection, like OpenAL or SDL, abstracting
stuff like ESD, OSS and ALSA, is good)
Definitely.
I didn’t look much at the OpenAL API, does its design imply threaded
audio or could it be used in a non-threaded way? Thank God Quake is
non-threaded, so that if it switches to OpenAL, drivers will HAVE to
support the non-threaded code path correctly… :-)–
“There are two major products that come out of Berkeley: LSD and Unix.
We don’t believe this to be a coincidence.” – Jeremy S. Anderson