Redhat 9.0 SDL Sound Delay

I recently installed RH9.0, and I noticed that in ANY application that
uses the SDL libraries, that the sound lag is huge. Half a second or
greater at least. The programs involved are Tux Racer (had to
re-compile from the src rpm to get sound at all), The Ur-quan Masters
v0.3a (http://sc2.sourceforge.net/), and the SDL examples from the book
"Programming Linux Games". The source code, ready to compile from the
examples is at http://www.nostarch.com/plg.htm. Most of it won’t
compile by default, just go into the “sdl” subdirectory and compile
that. In most installations it should compile no problem.

The sound delay is easily apparent in all of the SDL applications. Do
the “sound test” in the PLG archive and it’s completely obvious. There
also SEEMS to be sound delays in xmms (MUCH smaller, but still there),
whereas there doesn’t seem to be ANY in Return to Castle Wolfenstein
that I could tell.

For whom it might help, I have a SB Audigy, and am using the sound
drivers installed for it by the RH9.0 installation. I thought it might
have been just the kernel module, but then I noticed it was WAY worse in
SDL applications. But the weird thing was, I went to the labs at my
university which also recently went to RH9.0, and the SAME THINGS
HAPPENED, with completely different hardware. I doubt ANYTHING in those
computers have the same components as mine, so I think it’s an SDL
problem, but this didn’t happen in RH8.0 with the same apps, using SDL
on that system.

Any ideas?

Kevin Frandsen
@Kevin_Frandsen

P.S. This is a copy of the same message that I just posted to the
linux.redhat newsgroup as well.

I recently installed RH9.0, and I noticed that in ANY application
that uses the SDL libraries, that the sound lag is huge.

Some sound daemon again, maybe…? (EsoundD or aRts.)

For whom it might help, I have a SB Audigy,

So, you don’t need a sound daemon at all; that card gives you (at
least) 32 stereo channels with low latency h/w mixing. :slight_smile:

and am using the sound
drivers installed for it by the RH9.0 installation. I thought it
might have been just the kernel module, but then I noticed it was
WAY worse in SDL applications.

ALSA or OSS/Free? Either way, I doubt it has anything to do with the
kernel module. Some cards have weird restrictions WRT buffer sizes,
but the EMU10k1 and whatever-they-call-the-Audigy-version based cards
are note among those - and none of them cause that huge latencies
anyway.

But the weird thing was, I went to
the labs at my university which also recently went to RH9.0, and
the SAME THINGS HAPPENED, with completely different hardware.

Yep, as expected… Sound daemon.

I
doubt ANYTHING in those computers have the same components as mine,
so I think it’s an SDL problem, but this didn’t happen in RH8.0
with the same apps, using SDL on that system.

AFAIK, SDL’s “problem” is that it uses a sound daemon as a first
choice if there is one. That’s probably a good idea in theory, since
you would expect that most people that use such beasts do it for a
reason - such as network transparent audio. (As opposed to having the
remote computer play the sound while you’re playing X games on
another machine. hehe)

//David Olofson - Programmer, Composer, Open Source Advocate

.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. |
| RT and off-line synth. Scripting. Sample accurate timing. |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Tuesday 09 September 2003 03.35, Kevin Frandsen wrote:

You were right. It was aRts. I just kill that process, and all is nice
again. I similarly posted this to the linux.redhat forum as well. They
didn’t have any ideas at all, whereas you guys got it immediately.
Cool. =)

Now for a newbie question. How do I shut down arts forever? It’s
loaded up every time I log in, so I dunno what to do now to keep it
away? Is there a config file somewhere to tell which “services” to do
on startup, or an easier graphical utility in redhat?

Thanks

Kevin Frandsen
@Kevin_Frandsen

A better solution might be just to have SDL not use ARTS. You can tell it what
sound driver to use by setting the SDL_AUDIODRIVER environment variable to
something else. According to the SDL FAQ, valid options for Linux are:
dsp - Use the OSS API by opening /dev/dsp
dma - Use the OSS API to perform DMA access on /dev/dsp
esd - Connect to the ESound audio daemon
artsc - Connect to the ARTS audio daemon
So try setting SDL_AUDIODRIVER to dma (or dsp if that doesn’t work), by
putting
export SDL_AUDIODRIVER=dma
at the end of ~/.bash_profile (you’ll need to log out and then log back in for
changes to take effect).On Wednesday 10 September 2003 3:34 pm, Kevin Frandsen wrote:

You were right. It was aRts. I just kill that process, and all is nice
again. I similarly posted this to the linux.redhat forum as well. They
didn’t have any ideas at all, whereas you guys got it immediately.
Cool. =)

Now for a newbie question. How do I shut down arts forever? It’s
loaded up every time I log in, so I dunno what to do now to keep it
away? Is there a config file somewhere to tell which “services” to do
on startup, or an easier graphical utility in redhat?

[…]

Now for a newbie question. How do I shut down arts forever?

Well, there are reasons why you might want to run a sound server, and
you can get SDL to bypass it and still have other apps use it.

Anyway, if you want to try tweaking the settings for lower latency, or
just disable it permanently, try Sound → Sound Server in the KDE
Control Center.

//David Olofson - Programmer, Composer, Open Source Advocate

.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. |
| RT and off-line synth. Scripting. Sample accurate timing. |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Thursday 11 September 2003 00.34, Kevin Frandsen wrote:

Kevin Frandsen wrote:

Now for a newbie question. How do I shut down arts forever? It’s
loaded up every time I log in, so I dunno what to do now to keep it
away? Is there a config file somewhere to tell which “services” to do
on startup, or an easier graphical utility in redhat?

You’re probably using KDE.
Go to KDE Control Center (or whatever the name is) and browse through
options (I think it’s in sound section). There is an option like: “start
Atrsd on startup” or something like that. Just uncheck the checkbox and
you’re done. (If you can’t find option, I can tell you exactly where it
is later when I get to my Linux box). Please note that by doing so you
probably won’t have KDE sounds for events (sistem startup/shutdown/etc.)

For services, look at /etc/rc.d scripts, but AFAIK, Artsd isn’t started
with sistem, but KDE starts it.–
Milan Babuskov
http://njam.sourceforge.net

Thanks Milan, and David. Both of your posts helped. To disable aRts,
go to KDE control panel, and under Sound and Multimedia → Sound System,
the first tab has a checkbox “Start aRts soundserver on KDE startup”.
Uncheck it, and it’s all good then.

Thanks again

Kevin Frandsen
@Kevin_Frandsen

Milan Babuskov wrote:> Kevin Frandsen wrote:

Now for a newbie question. How do I shut down arts forever? It’s
loaded up every time I log in, so I dunno what to do now to keep it
away? Is there a config file somewhere to tell which “services” to do
on startup, or an easier graphical utility in redhat?

You’re probably using KDE.
Go to KDE Control Center (or whatever the name is) and browse through
options (I think it’s in sound section). There is an option like: “start
Atrsd on startup” or something like that. Just uncheck the checkbox and
you’re done. (If you can’t find option, I can tell you exactly where it
is later when I get to my Linux box). Please note that by doing so you
probably won’t have KDE sounds for events (sistem startup/shutdown/etc.)

For services, look at /etc/rc.d scripts, but AFAIK, Artsd isn’t started
with sistem, but KDE starts it.