SDL sound in linux

SDL apps in linux work without sound if they aren’t run as root. To
change that, the user has to set the environment variable
SDL_AUDIODRIVER to something that works, by trial and error.

Is this going to be fixed?

Giorgos wrote:

SDL apps in linux work without sound if they aren’t run as root. To
change that, the user has to set the environment variable
SDL_AUDIODRIVER to something that works, by trial and error.

Works for me. I’ve never heard of anybody needing to set SDL_AUDIODRIVER to
get sound in an SDL application.

Is this going to be fixed?

It must be a problem in your code or in your setup, not in SDL.

Hello !

SDL apps in linux work without sound if they aren’t run as root. To
change that, the user has to set the environment variable SDL_AUDIODRIVER
to something that works, by trial and error.

Is this going to be fixed?

Maybe i understand it wrong, but SDL apps normally work with sound
as root or as a normal user. They also run without sound as root and
as a normal user. If you do not want to have sound you can use the Dummy
Audio driver.

CU

I do want sound, the problem is that sound works only as root.On Thu, 2005-12-15 at 15:59 +0100, Torsten Giebl wrote:

Hello !

SDL apps in linux work without sound if they aren’t run as root. To
change that, the user has to set the environment variable SDL_AUDIODRIVER
to something that works, by trial and error.

Is this going to be fixed?

Maybe i understand it wrong, but SDL apps normally work with sound
as root or as a normal user. They also run without sound as root and
as a normal user. If you do not want to have sound you can use the Dummy
Audio driver.

CU

http://www.google.com.gr/search?q="SDL_AUDIODRIVER"+sound+linux
+sdl&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8&client=firefox&rls=org.mozilla:en-US:unofficialOn Thu, 2005-12-15 at 15:44 +0100, Christophe Cavalaria wrote:

Giorgos wrote:

SDL apps in linux work without sound if they aren’t run as root. To
change that, the user has to set the environment variable
SDL_AUDIODRIVER to something that works, by trial and error.

Works for me. I’ve never heard of anybody needing to set SDL_AUDIODRIVER to
get sound in an SDL application.

Most distributions set the sound devices to be only accessible by
users in the “audio” group. Check your user permissions.On 12/15/05, Giorgos wrote:

I do want sound, the problem is that sound works only as root.

  • SR

I do want sound, the problem is that sound works only as root.

Odds are that your problem is that your user account isn’t in the right
group to have permissions to access the audio device. If you check the
permissions of the sounds device itself, eg:

ls -l /dev/audio
crw-rw---- 1 root audio 14, 4 Dec 6 11:07 /dev/audio

You will see it in a group, usually (as above) “audio” (depending on
distro). Add your user account to that group, log out and back in, then
it should work as that user.

This is a security thing to prevent any random remote user from playing
sound on a machine they are not really on, etc…On Thu, Dec 15, 2005 at 05:58:51PM +0200, Giorgos wrote:


Steaphan Greene
GPG public key: http://www.cs.binghamton.edu/~sgreene/gpg.key.txt
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20051215/3fe0f9c1/attachment.pgp

All other applications are working with sound so I’m obviously in the
audio group.On Thu, 2005-12-15 at 11:55 -0500, Simon Roby wrote:

On 12/15/05, Giorgos <@Giorgos> wrote:

I do want sound, the problem is that sound works only as root.

Most distributions set the sound devices to be only accessible by
users in the “audio” group. Check your user permissions.

Heh, that’s news to me. I’ll have to go back 7 years and let myself know.

:wink:

-bill!On Thu, Dec 15, 2005 at 02:04:08PM +0200, Giorgos wrote:

SDL apps in linux work without sound if they aren’t run as root.

But the thing is that I’m perfectly capable of getting sound from every
app that doesn’t use sdl. And I’ve said this at least 3 times in this
thread.On Thu, 2005-12-15 at 13:37 -0500, Steaphan Greene wrote:

On Thu, Dec 15, 2005 at 05:58:51PM +0200, Giorgos wrote:

I do want sound, the problem is that sound works only as root.

Odds are that your problem is that your user account isn’t in the right
group to have permissions to access the audio device. If you check the
permissions of the sounds device itself, eg:

ls -l /dev/audio
crw-rw---- 1 root audio 14, 4 Dec 6 11:07 /dev/audio

You will see it in a group, usually (as above) “audio” (depending on
distro). Add your user account to that group, log out and back in, then
it should work as that user.

Could you check if there are any sound daemons running (ie. artsd or
esd) and kill them, then try SDL apps again? Personally whenever I
troubleshoot a sound problem under Linux, sound daemons are the first
thing I point my finger at. (well, my middle finger to be more
precise, haha…)

If the problem still persists, AFAIK you didn’t tell us what distro
you are running. That could help. Also, did you compile SDL yourself,
or used what you distro has provided?

  • SROn 12/15/05, Giorgos wrote:

On Thu, 2005-12-15 at 11:55 -0500, Simon Roby wrote:

On 12/15/05, Giorgos wrote:

I do want sound, the problem is that sound works only as root.

Most distributions set the sound devices to be only accessible by
users in the “audio” group. Check your user permissions.

All other applications are working with sound so I’m obviously in the
audio group.

I do want sound, the problem is that sound works only as root.

Odds are that your problem is that your user account isn’t in the right
group to have permissions to access the audio device. If you check the
permissions of the sounds device itself, eg:

ls -l /dev/audio
crw-rw---- 1 root audio 14, 4 Dec 6 11:07 /dev/audio

You will see it in a group, usually (as above) “audio” (depending on
distro). Add your user account to that group, log out and back in, then
it should work as that user.

But the thing is that I’m perfectly capable of getting sound from every
app that doesn’t use sdl. And I’ve said this at least 3 times in this
thread.

There are environmental variables to control what driver SDL uses for
audio output. My best guess is that root’s environmental variables are
different than your normal user’s environmental variables.

The environmental variable may be SDL_AUDIODRIVER.

Btw, I’m far from being an expert on SDL, so the above could be
horribly, horribly wrong. If it is, just hollar, and I’ll refund double
the amound I charged for this advice. :wink:

~ Jesse MeyerOn Fri, 16 Dec 2005, Giorgos wrote:

On Thu, 2005-12-15 at 13:37 -0500, Steaphan Greene wrote:

On Thu, Dec 15, 2005 at 05:58:51PM +0200, Giorgos wrote:


Any sufficiently advanced incompetence is indistinguishable from malice.
- Vernon Schryver

esd is running and if I kill it it works. Is this expected behaviour?On Thu, 2005-12-15 at 18:25 -0500, Simon Roby wrote:

Could you check if there are any sound daemons running (ie. artsd or
esd) and kill them, then try SDL apps again? Personally whenever I
troubleshoot a sound problem under Linux, sound daemons are the first
thing I point my finger at. (well, my middle finger to be more
precise, haha…)

But the thing is that I’m perfectly capable of getting sound from
every app that doesn’t use sdl. And I’ve said this at least 3 times in
this thread.

Not until after I sent out this e-mail. I am not psychic, so I couldn’t
know what you were going to say after I sent this but before you read it.

Don’t worry, I won’t try to help you again.On Fri, Dec 16, 2005 at 12:19:55AM +0200, Giorgos wrote:


Steaphan Greene
GPG public key: http://www.cs.binghamton.edu/~sgreene/gpg.key.txt
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20051215/b3aefacc/attachment.pgp

Yes. Welcome to the “sound daemons are a stupid concept and should die
already” club.On 12/15/05, Giorgos wrote:

On Thu, 2005-12-15 at 18:25 -0500, Simon Roby wrote:

Could you check if there are any sound daemons running (ie. artsd or
esd) and kill them, then try SDL apps again? Personally whenever I
troubleshoot a sound problem under Linux, sound daemons are the first
thing I point my finger at. (well, my middle finger to be more
precise, haha…)

esd is running and if I kill it it works. Is this expected behaviour?

  • SR

Me. I am running jackd all the time, and if I want the SDL apps to appear directly into the jack graph as a jack application, and not trough the alsa->jack ALSA plugin, I have to run:
SDL_AUDIODRIVER="jack" my_sdl_app