SDL_OpenAudio() hangs under Linux?

Recently, programs which attempt to use SDL 1.1.8 audio seem to be
freezing on calling SDL_OpenAudio() – no error messages, just stone-cold.
kill -9 is required to stop the errant process. Here is an example piece
of code, from prboom 2.1.2 (see http://prboom.sourceforge.net/ ):--------------------------------------------------------------------------
SDL_AudioSpec audio;

// Secure and configure sound device first.
fprintf( stderr, "I_InitSound: ");

// Open the audio device
audio.freq = SAMPLERATE;
#if ( SDL_BYTEORDER == SDL_BIG_ENDIAN )
audio.format = AUDIO_S16MSB;
#else
audio.format = AUDIO_S16LSB;
#endif
audio.channels = 2;
audio.samples = SAMPLECOUNT;
audio.callback = I_UpdateSound;
if ( SDL_OpenAudio(&audio, NULL) < 0 ) {
fprintf(stderr, “couldn’t open audio with desired format\n”);
return;
}
SAMPLECOUNT = audio.samples;
fprintf(stderr, " configured audio device with %d samples/slice\n",
SAMPLECOUNT);

Frankly, I’m baffled. How can I figure out what SDL isn’t getting along
with so as to alleviate the problem?

Matthew W. Miller – @Matthew_W_Miller

Recently, programs which attempt to use SDL 1.1.8 audio seem to be
freezing on calling SDL_OpenAudio() – no error messages, just stone-cold.
kill -9 is required to stop the errant process.

Sounds like a kernel driver problem to me. Can you give more information
on the system? Do other sound applications work? How about the "loopwave"
program in the test directory of the SDL source distribution?

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