SDL_Init(SDL_INIT_AUDIO) crash

Hi!

One of my games crashed when /dev/dsp is in use, when I call
SDL_Init(SDL_INIT_AUDIO), even if it’s the first line in the main function. The
only output is “/dev/dsp: Device or resource busy”. That’s probably my fault,
since other programs work well. Does anyone have an idea what could cause this?

Here’s gdb’s output:
#0 0x80547ec in pause ()
#1 0x40233a73 in esd_open_sound () from /usr/lib/libesd.so.0
#2 0x40025490 in SDL_OpenAudioPath () from /usr/local/lib/libSDL-1.1.so.0
#3 0x4002318a in SDL_AudioInit () from /usr/local/lib/libSDL-1.1.so.0
#4 0x400222c6 in SDL_InitSubSystem () from /usr/local/lib/libSDL-1.1.so.0
#5 0x40022385 in SDL_Init () from /usr/local/lib/libSDL-1.1.so.0
#6 0x804b241 in main (argc=2, argv=0xbffffbe4) at main.c:435

Thanks for any help,

Karl.

Hi!

One of my games crashed when /dev/dsp is in use, when I call
SDL_Init(SDL_INIT_AUDIO), even if it’s the first line in the main function. The
only output is “/dev/dsp: Device or resource busy”. That’s probably my fault,
since other programs work well. Does anyone have an idea what could cause this?

Here’s gdb’s output:
#0 0x80547ec in pause ()
#1 0x40233a73 in esd_open_sound () from /usr/lib/libesd.so.0
#2 0x40025490 in SDL_OpenAudioPath () from /usr/local/lib/libSDL-1.1.so.0
#3 0x4002318a in SDL_AudioInit () from /usr/local/lib/libSDL-1.1.so.0
#4 0x400222c6 in SDL_InitSubSystem () from /usr/local/lib/libSDL-1.1.so.0
#5 0x40022385 in SDL_Init () from /usr/local/lib/libSDL-1.1.so.0
#6 0x804b241 in main (argc=2, argv=0xbffffbe4) at main.c:435

I’ve seen this as well. It appears to be a bug in esd.
Anybody tracked down what’s going on?

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Karl,
It does look like a Esound problem, you could probably try several things
though.

Explicitly tell SDL to use esd (export SDL_AUDIODRIVER=esd).
Try with esd both running and not running
Upgrade you esd version.
Make sure you don’t have ESPEAKER set.
Disable esd in SDL by passing configure --enable-esd=noOn Wed, Dec 06, 2000 at 07:43:13PM +0100, Karl Bartel wrote:

One of my games crashed when /dev/dsp is in use, when I call
SDL_Init(SDL_INIT_AUDIO), even if it’s the first line in the main function. The
only output is “/dev/dsp: Device or resource busy”. That’s probably my fault,
since other programs work well. Does anyone have an idea what could cause this?

Here’s gdb’s output:
#0 0x80547ec in pause ()
#1 0x40233a73 in esd_open_sound () from /usr/lib/libesd.so.0
#2 0x40025490 in SDL_OpenAudioPath () from /usr/local/lib/libSDL-1.1.so.0
#3 0x4002318a in SDL_AudioInit () from /usr/local/lib/libSDL-1.1.so.0
#4 0x400222c6 in SDL_InitSubSystem () from /usr/local/lib/libSDL-1.1.so.0
#5 0x40022385 in SDL_Init () from /usr/local/lib/libSDL-1.1.so.0
#6 0x804b241 in main (argc=2, argv=0xbffffbe4) at main.c:435


Martin

Bother! said Pooh punching holes in another shipment of condoms.

I forgot to tell that I do not use esd.

Bye, Karl.> Karl,

It does look like a Esound problem, you could probably try several things
though.

Explicitly tell SDL to use esd (export SDL_AUDIODRIVER=esd).
Try with esd both running and not running
Upgrade you esd version.
Make sure you don’t have ESPEAKER set.
Disable esd in SDL by passing configure --enable-esd=no

On Wed, Dec 06, 2000 at 07:43:13PM +0100, Karl Bartel wrote:

One of my games crashed when /dev/dsp is in use, when I call
SDL_Init(SDL_INIT_AUDIO), even if it’s the first line in the main function. The
only output is “/dev/dsp: Device or resource busy”. That’s probably my fault,
since other programs work well. Does anyone have an idea what could cause this?

Here’s gdb’s output:
#0 0x80547ec in pause ()
#1 0x40233a73 in esd_open_sound () from /usr/lib/libesd.so.0
#2 0x40025490 in SDL_OpenAudioPath () from /usr/local/lib/libSDL-1.1.so.0
#3 0x4002318a in SDL_AudioInit () from /usr/local/lib/libSDL-1.1.so.0
#4 0x400222c6 in SDL_InitSubSystem () from /usr/local/lib/libSDL-1.1.so.0
#5 0x40022385 in SDL_Init () from /usr/local/lib/libSDL-1.1.so.0
#6 0x804b241 in main (argc=2, argv=0xbffffbe4) at main.c:435


Martin

Bother! said Pooh punching holes in another shipment of condoms.

No, but you told me on #sdl. However, if sdl is being compiled with esd
support then libesd must be on your system.On Fri, Dec 08, 2000 at 03:00:13PM +0100, Karl Bartel wrote:

I forgot to tell that I do not use esd.


Martin

Bother! said Pooh, as he hung onto Cloud City’s antenna.

No, but you told me on #sdl. However, if sdl is being compiled with esd
support then libesd must be on your system.

That’s not the problem. libesd is getting hung up trying to contact a
non-existent ESD daemon. I have the same problem on my box at home,
but I haven’t had time to track it down. Strangely it’s not consistent,
if I hit Ctrl-C and restart the application, it works fine.

What may be happening is that the audio device is busy (or nonexistent),
so SDL is asking for help from ESD, and ESD is blocking on the audio open.
I hadn’t seen this before I updated my helix gnome setup, so it may be a
new problem.

Anyway, you can build SDL without ESD support to avoid this problem, just
by passing “–disable-esd” to configure before building the library.

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Sam Lantinga wrote:

No, but you told me on #sdl. However, if sdl is being compiled with esd
support then libesd must be on your system.

That’s not the problem. libesd is getting hung up trying to contact a
non-existent ESD daemon. I have the same problem on my box at home,
but I haven’t had time to track it down. Strangely it’s not consistent,
if I hit Ctrl-C and restart the application, it works fine.
I can reproduce this constantly, but only for one program and only the
newest version. But I can’t find the difference to the older versions
(concerning audio)…

Bye, Karl.