SDL_mixer error: Audio write: Invalid argument

Hi again, I have a weird situation here. The SDL_mixer in my application
sometimes works and sometimes doesn’t. When it failed to give any sound at
all, it returned this error: “Audio write: Invalid argument”. Why is that?
And how can I fix this? Thanks in advance.

Hi again, I have a weird situation here. The SDL_mixer in my application
sometimes works and sometimes doesn’t. When it failed to give any sound at
all, it returned this error: “Audio write: Invalid argument”. Why is that?
And how can I fix this? Thanks in advance.

This is probably a driver issue; is this a Linux box? What sort of hardware?

–ryan.

Hi again, I have a weird situation here. The SDL_mixer in my application
sometimes works and sometimes doesn’t. When it failed to give any sound
at
all, it returned this error: “Audio write: Invalid argument”. Why is
that?
And how can I fix this? Thanks in advance.

This is probably a driver issue; is this a Linux box? What sort of
hardware?

–ryan.

Yeah, it’s in Linux SuSE 10.0. I don’t know the sound card as it is
onboard but I guess it is a Realtek AC97.

Yeah, it’s in Linux SuSE 10.0. I don’t know the sound card as it is
onboard but I guess it is a Realtek AC97.

It’s possible that using the ALSA instead of OSS target (or the other
way around) may work better. These are two separate kernel subsystems
for audio playback on Linux, and SDL can target either one.

The ALSA SDL backend.

SDL_AUDIODRIVER=alsa ./my-program

The OSS SDL backend.

SDL_AUDIODRIVER=dsp ./my-program

–ryan.

In the #else of #ifdef SDL_HAS_64BIT_TYPE the typedef Uint32 Uint64 is
typedef Uint32 Uint32;

In the #else of #ifdef SDL_HAS_64BIT_TYPE the typedef Uint32 Uint64 is
typedef Uint32 Uint32;

Fixed, thanks!

-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

No use. I added either: SDL_putenv (“SDL_AUDIODRIVER=alsa ./my-program”);
or SDL_putenv (“SDL_AUDIODRIVER=dsp ./my-program”); the problem still
exist. Or maybe I should use either eSound or Arts? Because apparently all
the other game from the distro eg. SuperTux, TuxRacer, etc worked fine.>

Yeah, it’s in Linux SuSE 10.0. I don’t know the sound card as it is
onboard but I guess it is a Realtek AC97.

It’s possible that using the ALSA instead of OSS target (or the other
way around) may work better. These are two separate kernel subsystems
for audio playback on Linux, and SDL can target either one.

The ALSA SDL backend.

SDL_AUDIODRIVER=alsa ./my-program

The OSS SDL backend.

SDL_AUDIODRIVER=dsp ./my-program

–ryan.


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

What you want to do is SDL_putenv(“SDL_AUDIODRIVER=alsa”) inside the
source of my-program. The business where you put the environment
variable assignment on the front of a command line is a bash-ism that
allows you to modify the environment for one statement.

Stoned koala bears drooled eucalyptus spit in awe as
benang at cs.its.ac.id said:> No use. I added either: SDL_putenv (“SDL_AUDIODRIVER=alsa ./my-program”);

or SDL_putenv (“SDL_AUDIODRIVER=dsp ./my-program”); the problem still
exist. Or maybe I should use either eSound or Arts? Because apparently all
the other game from the distro eg. SuperTux, TuxRacer, etc worked fine.


William Brodie-Tyrrell

Carpe Diem - fish of the day.

<@William_Brodie-Tyrre>
http://www.brodie-tyrrell.org/

Done that also, but still the error remains.>

What you want to do is SDL_putenv(“SDL_AUDIODRIVER=alsa”) inside the
source of my-program. The business where you put the environment
variable assignment on the front of a command line is a bash-ism that
allows you to modify the environment for one statement.

Stoned koala bears drooled eucalyptus spit in awe as
@benang_at_cs.its.ac said:

No use. I added either: SDL_putenv (“SDL_AUDIODRIVER=alsa
./my-program”);
or SDL_putenv (“SDL_AUDIODRIVER=dsp ./my-program”); the problem still
exist. Or maybe I should use either eSound or Arts? Because apparently
all
the other game from the distro eg. SuperTux, TuxRacer, etc worked fine.