Sound Latency Problems in Linux with SDL_mixer

Thanks in advance for any help…

I have written a game in SDL that plays .WAV and .OGG files. It uses
the SDL_Mixer library. I have no sound latency problems running in
Windows, only in Linux. I am using Red Hat 8.0 and sdl 1.2.4. The
application run finds right after boot. But if I execute it again
immediately after exiting, there is a 1 second delay before playing
sound. If I wait 5 minutes and then run it - it works fine no latency.
Is there some kind of clean up I ned to do other than
Mix_CloseAudio();?

Any ideas? I have tried lowering and increasing the buffer size from
1024 all the way to 5120.

Thanks again for any help…

Here is a snippet of the init sound code:

int audio_rate = 22050;
Uint16 audio_format = AUDIO_S16;
int audio_channels = 2;
int audio_buffers = 4096;

if(Mix_OpenAudio(audio_rate, audio_format, audio_channels,
audio_buffers))
{
getlog()->log(“Unable to open audio!\n”);
}
/* Pre-load sound effects */
phaser = Mix_LoadWAV(“phaser.wav”);
explosion = Mix_LoadWAV(“explosion.wav”);

And here is the playing code:
Mix_PlayChannel(-1, explosion, 0);

And the clean up:
Mix_CloseAudio();

Hi all,

i’ve still the same problem on Windows ME.

My System:
AMD Athlon 1,4 SoundBlaster Audigy and Windows ME. SDL 1.2.5 and
SDL_Mixer 1.2.4.

I also compiled the latest version of SDL_Mixer from CVS, but the delay
in playing any sound files still exists.

Does anyone have the same problem or any solution for it ?

Cheers,

Luke

-----Urspr?ngliche Nachricht-----Von: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org] Im Auftrag von
Bob Cober
Gesendet: Sonntag, 3. November 2002 11:43
An: sdl at libsdl.org
Betreff: [SDL] Sound Latency Problems in Linux with SDL_mixer

Thanks in advance for any help…

I have written a game in SDL that plays .WAV and .OGG files. It uses
the SDL_Mixer library. I have no sound latency problems running in
Windows, only in Linux. I am using Red Hat 8.0 and sdl 1.2.4. The
application run finds right after boot. But if I execute it again
immediately after exiting, there is a 1 second delay before playing
sound. If I wait 5 minutes and then run it - it works fine no latency.
Is there some kind of clean up I ned to do other than
Mix_CloseAudio();?

Any ideas? I have tried lowering and increasing the buffer size from
1024 all the way to 5120.

Thanks again for any help…

Here is a snippet of the init sound code:

int audio_rate = 22050;
Uint16 audio_format = AUDIO_S16;
int audio_channels = 2;
int audio_buffers = 4096;

if(Mix_OpenAudio(audio_rate, audio_format, audio_channels,
audio_buffers))
{
getlog()->log(“Unable to open audio!\n”);
}
/* Pre-load sound effects */
phaser = Mix_LoadWAV(“phaser.wav”);
explosion = Mix_LoadWAV(“explosion.wav”);

And here is the playing code:
Mix_PlayChannel(-1, explosion, 0);

And the clean up:
Mix_CloseAudio();


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

Hi all,

i’ve still the same problem on Windows ME.

My System:
AMD Athlon 1,4 SoundBlaster Audigy and Windows ME. SDL 1.2.5 and
SDL_Mixer 1.2.4.

I also compiled the latest version of SDL_Mixer from CVS, but the delay
in playing any sound files still exists.

What are you using to compile SDL? Are you using the pre-built DLL?
What value are you setting for the chunksize in SDL_mixer?

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

Thanks in advance for any help…

I have written a game in SDL that plays .WAV and .OGG files. It uses
the SDL_Mixer library. I have no sound latency problems running in
Windows, only in Linux. I am using Red Hat 8.0 and sdl 1.2.4. The
application run finds right after boot. But if I execute it again
immediately after exiting, there is a 1 second delay before playing
sound. If I wait 5 minutes and then run it - it works fine no latency.

It sounds like you might be running into aRts.
Are you using KDE? If so, try disabling the audio daemon for a while.

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