Choppy sound with SDL applications when not root

Hello all,

When I start an application as non-root that uses the SDL (audio)
library the sound is choppy and delayed. I have no such problems when I
use the applications as root or when I use other sound applications as
non-root. I’m running Fedora Core 3 with the standard alsa sound
drivers. The behavior indicates that there are some problems with file
permissions. Has anyone else experienced this?

Regards,
August

You might be getting more ‘real-time’ permissions as root, but not as big
a timeslice as a normal user.

How big of a buffer are you setting when you initialize SDL’s sound system?On Fri, Feb 11, 2005 at 01:10:16AM +0100, August wrote:

When I start an application as non-root that uses the SDL (audio)
library the sound is choppy and delayed. I have no such problems when I
use the applications as root or when I use other sound applications as
non-root. I’m running Fedora Core 3 with the standard alsa sound
drivers. The behavior indicates that there are some problems with file
permissions. Has anyone else experienced this?


-bill!
bill at newbreedsoftware.com “I’m anticipating an all-out tactical
http://newbreedsoftware.com/ dog-fight, followed by a light dinner.”

Do you mean the initialization of SDL in the source code? I am an end
user of the applications I’m talking about (ZSNES and Tux Racer). Since
all (both) applications are affected, the settings I need to change will
probably be system wide.On tor, 2005-02-10 at 16:46 -0800, Bill Kendrick wrote:

On Fri, Feb 11, 2005 at 01:10:16AM +0100, August wrote:

When I start an application as non-root that uses the SDL (audio)
library the sound is choppy and delayed. I have no such problems when I
use the applications as root or when I use other sound applications as
non-root. I’m running Fedora Core 3 with the standard alsa sound
drivers. The behavior indicates that there are some problems with file
permissions. Has anyone else experienced this?

You might be getting more ‘real-time’ permissions as root, but not as big
a timeslice as a normal user.

How big of a buffer are you setting when you initialize SDL’s sound system?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

August wrote:
| Do you mean the initialization of SDL in the source code? I am an end
| user of the applications I’m talking about (ZSNES and Tux Racer). Since
| all (both) applications are affected, the settings I need to change will
| probably be system wide.
If it’s multiple applications and only SDL, it would appear to be the
audio back-end. If “export SDL_AUDIODRIVER=dsp” doesn’t work, try
playing around with the available audio drivers:
http://www.libsdl.org/faq.php?action=listentries&category=9#10
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFCDCFJv24lB609Ih8RAoppAKCEef6t7Q0ZkcotBDXuwWz1Q1HEugCeNBur
5IYYkUlC3mg6NzD51zinkYg=
=bAS6
-----END PGP SIGNATURE-----

August wrote:

Hello all,

When I start an application as non-root that uses the SDL (audio)
library the sound is choppy and delayed. I have no such problems when I
use the applications as root or when I use other sound applications as
non-root. I’m running Fedora Core 3 with the standard alsa sound
drivers. The behavior indicates that there are some problems with file
permissions. Has anyone else experienced this?

What SDL version is there on FC3 ?
What sound card do you have ?
Does the following help :
export SDL_AUDIODRIVER=dsp
export SDL_DSP_NOSELECT=1

Stephane

I have has a similar problem before. The issue was that ARTS was running.
This delayed the sounds that were playing, sometimes for a second. I turned
off ARTS and is seemed to work fine. I am not sure that this explains the
sounds working well as root.

Walt> ----- Original Message -----

From: sdl-bounces+waltc=fleetwoodgaming.com@libsdl.org
[mailto:sdl-bounces+waltc=fleetwoodgaming.com at libsdl.org] On Behalf Of
August
Sent: Thursday, February 10, 2005 5:10 PM
To: sdl at libsdl.org
Subject: [SDL] Choppy sound with SDL applications when not root

Hello all,

When I start an application as non-root that uses the SDL (audio)
library the sound is choppy and delayed. I have no such problems when I
use the applications as root or when I use other sound applications as
non-root. I’m running Fedora Core 3 with the standard alsa sound
drivers. The behavior indicates that there are some problems with file
permissions. Has anyone else experienced this?

Regards,
August


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Yes, `export SDL_AUDIODRIVER=dsp’ solved the problem. Thank you all. Is
this documented somewhere?On fre, 2005-02-11 at 04:13 +0100, Stephane Marchesin wrote:

August wrote:

Hello all,

When I start an application as non-root that uses the SDL (audio)
library the sound is choppy and delayed. I have no such problems when I
use the applications as root or when I use other sound applications as
non-root. I’m running Fedora Core 3 with the standard alsa sound
drivers. The behavior indicates that there are some problems with file
permissions. Has anyone else experienced this?

What SDL version is there on FC3 ?
What sound card do you have ?
Does the following help :
export SDL_AUDIODRIVER=dsp
export SDL_DSP_NOSELECT=1


August

Hello all,

In my program I want to use SDL to just play a wav file (stored on the
disk). What code is needed to perform that? There is no example of how
to do that in the SDL manual.–
August

Hi,

you should take a look at SDL_Mixer and see if it’s suitable for you. It
makes sound things a bit easier.

-Sebastian

August schrieb:> Hello all,

In my program I want to use SDL to just play a wav file (stored on the
disk). What code is needed to perform that? There is no example of how
to do that in the SDL manual.

Like someone else said, you want to use SDL_Mixer. Here are some examples:

http://www.kekkai.org/roger/sdl/mixer/

and

http://gpwiki.org/index.php/C:Playing_a_WAV_Sound_File_With_SDL_mixer

Good luck,
ChrisOn Sat, 12 Feb 2005 17:28:34 +0100, August wrote:

Hello all,

In my program I want to use SDL to just play a wav file (stored on the
disk). What code is needed to perform that? There is no example of how
to do that in the SDL manual.


Chris Nystrom
http://www.newio.org/~ccn
AIM: nystromchris