# On SDL audio and aRTsd (and linux)

**URL:** <https://discourse.libsdl.org/t/on-sdl-audio-and-artsd-and-linux/6278>\
**Category:** SDL Development\
**Created:** [March 25, 2002, 2:15am UTC](https://discourse.libsdl.org/t/on-sdl-audio-and-artsd-and-linux/6278 "2002-03-25T02:15:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Teunis\_Peters](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/t/d07c76/32.png) [@Teunis\_Peters](https://discourse.libsdl.org/u/Teunis_Peters)\
**Post date:** [March 25, 2002, 2:15am UTC](https://discourse.libsdl.org/t/on-sdl-audio-and-artsd-and-linux/6278/1 "2002-03-25T02:15:01Z")

</div>

I know this -may- be treading on sacred ground, but is there any way for  
SDL to probe the -software- drivers first before trying hardware? I’ve  
got multiple (3 actually) soundcards but only the first is hooked up to  
speakers… and under KDE/X, artsd is almost -always- active. Now I  
know I could disable artsd before running an SDL app, but that strikes me  
as a waste of time due to theoretically SDL supporting it…

I know driver conf/driver load order is a “2.0” issue but still, checking  
software drivers under -unix- first does seem useful…  
(and falling back to the perfectly valid OSS/Alsa drivers afterward of  
course… 🙂

G’day, eh? 🙂  
- Teunis (yes, I’ve quit using winterlion at [fsj.net](http://fsj.net). Long story…)

PS: environment variable fixes for this seem rather… shallow… as I  
suspect this problem will show up on any system running KDE with 2 or more  
soundcards 🙂

---

<div class="post-metadata">

**Author:** ![slouken](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/ec9cab/32.png) [@slouken](https://discourse.libsdl.org/u/slouken)\
**Post date:** [March 25, 2002, 9:47am UTC](https://discourse.libsdl.org/t/on-sdl-audio-and-artsd-and-linux/6278/2 "2002-03-25T09:47:01Z")

</div>

> I know this -may- be treading on sacred ground, but is there any way for  
> SDL to probe the -software- drivers first before trying hardware? I’ve  
> got multiple (3 actually) soundcards but only the first is hooked up to  
> speakers… and under KDE/X, artsd is almost -always- active. Now I  
> know I could disable artsd before running an SDL app, but that strikes me  
> as a waste of time due to theoretically SDL supporting it…

Yeah, but the sound daemons always have worse latency than writing to the  
soundcard directly. For multimedia apps it’s always preferrable to write  
to the soundcard if you can.

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

---

<div class="post-metadata">

**Author:** ![Sam\_Hart](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/d26b3c/32.png) [@Sam\_Hart](https://discourse.libsdl.org/u/Sam_Hart)\
**Post date:** [March 25, 2002, 1:20pm UTC](https://discourse.libsdl.org/t/on-sdl-audio-and-artsd-and-linux/6278/3 "2002-03-25T13:20:00Z")

</div>

While I agree that sound daemons (like artsd or esound) really are a Bad  
Thing (a kludge to hold us over till ALSA in 2.6 😉 , because sooo many  
distros have them turned on by default, and sooo many users don’t  
understand that they lock up the sound device (where I work, I’m the  
only sysadmin who understands this, and I’m technically the _Windows_  
guy, not the \*nix guy 😉 it always causes problems for end-users.

Perhaps probing like this shouldn’t go inside of SDL, but there really  
should be support for it somewhere (even if it’s in the form of a  
question in the FAQ that points developers to code they can impliment  
themselves to work-with, or disable artsd ;-)On Mon, 2002-03-25 at 10:46, Sam Lantinga wrote:

> > I know this -may- be treading on sacred ground, but is there any way for  
> > SDL to probe the -software- drivers first before trying hardware? I’ve  
> > got multiple (3 actually) soundcards but only the first is hooked up to  
> > speakers… and under KDE/X, artsd is almost -always- active. Now I  
> > know I could disable artsd before running an SDL app, but that strikes me  
> > as a waste of time due to theoretically SDL supporting it…
> 
> Yeah, but the sound daemons always have worse latency than writing to the  
> soundcard directly. For multimedia apps it’s always preferrable to write  
> to the soundcard if you can.

–  
Sam “Criswell” Hart \<@Sam\_Hart\> AIM, Yahoo!:   
Homepage: \< [http://www.geekcomix.com/snh/](http://www.geekcomix.com/snh/) \>  
PGP Info: \< [http://www.geekcomix.com/snh/contact/](http://www.geekcomix.com/snh/contact/) \>  
Tux4Kids: \< [http://www.tux4kids.org/](http://www.tux4kids.org/) \>

---

<div class="post-metadata">

**Author:** ![Teunis\_Peters](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/t/d07c76/32.png) [@Teunis\_Peters](https://discourse.libsdl.org/u/Teunis_Peters)\
**Post date:** [March 26, 2002, 5:19pm UTC](https://discourse.libsdl.org/t/on-sdl-audio-and-artsd-and-linux/6278/4 "2002-03-26T17:19:01Z")

</div>

> > > I know this -may- be treading on sacred ground, but is there any way for  
> > > SDL to probe the -software- drivers first before trying hardware? I’ve  
> > > got multiple (3 actually) soundcards but only the first is hooked up to  
> > > speakers… and under KDE/X, artsd is almost -always- active. Now I  
> > > know I could disable artsd before running an SDL app, but that strikes me  
> > > as a waste of time due to theoretically SDL supporting it…
> > 
> > Yeah, but the sound daemons always have worse latency than writing to the  
> > soundcard directly. For multimedia apps it’s always preferrable to write  
> > to the soundcard if you can.
> 
> While I agree that sound daemons (like artsd or esound) really are a Bad  
> Thing (a kludge to hold us over till ALSA in 2.6 😉 , because sooo many  
> distros have them turned on by default, and sooo many users don’t  
> understand that they lock up the sound device (where I work, I’m the  
> only sysadmin who understands this, and I’m technically the _Windows_  
> guy, not the \*nix guy 😉 it always causes problems for end-users.

Don’t forget that in the case of artsd and esd, the applicable -GUI-  
systems enable by default… and many GUI apps are dependant on them and  
lock the daemons open. Now the artsd at least can be forced to be shut  
down (that’d be useful in an SDL helper lib I guess… 🙂 but I’m not sure  
about esd. (for those unfamiliar, KDE and artsd are tied together fairly  
tightly, and Gnome and esd are tied together as well but somewhat more  
loosely). By my own experience artsd is more powerful and much nicer in a  
lot of ways but has undergone fairly bad breakage in some circumstances  
(such as g+±3.0).

The thing is - regardless of how nice it is to talk to hardware directly,  
when a sound daemon is in place like this it’s NOT necessarily the “Right  
Thing” to just grab the next card in the list…

IMHO right things are:  
1. a configuration file (TODO for 2.0 I know 🙂  
2. disable the daemon on request… hrm… helper lib time?  
_sigh_. I’d like something that fixed -all- SDL apps.  
(this would require the app being aware of it… also  
added detail)  
3. use the daemon, assuming that’s want the user wants…  
(probably a safe bet a lot of the time)

Outside of UI territory there’s lots of options… I suppose one would be  
to code an “SDL sound daemon” but that’s just overkill… _heh_ a  
DirectX-like kernel module just to provide guaranteed sound access to SDL  
apps. Yep that’s a M$-style approach. I sense “Wrong Thing” 🙂

I don’t think setting environment vars is the Right Thing but it’d make a  
good FAQ backup… Something like

Q: I’m running KDE and I’m not hearing anything? Note : I’ve got a second  
soundcard but haven’t gotten around to disabling it… (or I need it for  
other purposes and would prefer SDL not to -ever- touch it… 🙂

SDL\_AUDIO=artsd" for KDE or something like that…

So how much does coexisting with the running system matter to SDL?

G’day, eh? 🙂  
- TeunisOn 25 Mar 2002, Samuel Hart wrote:

> On Mon, 2002-03-25 at 10:46, Sam Lantinga wrote:  
> A: in .Xclients (which doesn’t exist by default btw) include "export

---

<div class="post-metadata">

**Author:** ![Ricardo\_Markiewicz](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/r/74df32/32.png) [@Ricardo\_Markiewicz](https://discourse.libsdl.org/u/Ricardo_Markiewicz)\
**Post date:** [March 26, 2002, 8:04pm UTC](https://discourse.libsdl.org/t/on-sdl-audio-and-artsd-and-linux/6278/5 "2002-03-26T20:04:01Z")

</div>

Hi all!!, why i receive all mails by duplicated ?? …

thx !!–  
Ricardo Markiewicz - Dexter Quad Main Programmer  
[http://gazer.bsdcore.org](http://gazer.bsdcore.org)
