SDL mixer problem on jessie (raspberry pi)

I have made a bomberman like game and it was develop on mac os X for my arcade cabinet build with a raspberry pi. the version of retropie used was 3.8 for the development. I used SDL2 for this and i have a strange bug with the last version of retropie based on jessie (Linux version 4.9.24-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #993 SMP Wed Apr 26 18:01:23 BST 2017)

When i call the function MIX_OpenAudio, on the last version of jessie, the execution is stuck. on mac os X, ubuntu, fedora or retropie 3.8, i don’t have any problem. I don’t know why the loading game stuck on this function. I get no Error, no stack trace, just stuck.

if someone has already have the same problem or take a look inside the code or any idea ?


ps : i’m french sorry if my english is not perfect.

I get no Error, no stack trace, just stuck.

The way to troubleshoot this is

  • first, make sure you have debug symbols. If you’re installing libsdl2 from the Debian pacage, I think you want to do sudo apt-get install libsdl2-dbg
  • launch the program and wait for it to freeze
  • Find the PID of the frozen process. ps -A | grep your_executable_name
  • Run gdb, then at the prompt type attach PID where PID is the pid of your running program
  • type bt + enter at the gdb prompt, hopefully you will get a useful backtrace

Hi all, i’m come back to fix this problem, since jessie raspbian version, every build and execution is stuck on the Mix_OpenAudio function, this is my code :

Sound::Sound() {

**if (Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, MIX_DEFAULT_CHANNELS, 1024) == -1) {**

** printf("%s", Mix_GetError());**
** }**
for(int i = 0; i < nbChannelSound; i++){
activeChannel[i] = false;
menu = Mix_LoadMUSType_RW(SDL_RWFromMem(music_menu_mp3, music_menu_mp3_len), MUS_MP3, 0);
battle = Mix_LoadMUSType_RW(SDL_RWFromMem(music_battle_mp3, music_battle_mp3_len), MUS_MP3, 0);

bipSound = Mix_LoadWAV_RW(SDL_RWFromMem(sound_bip_wav, sound_bip_wav_len), 0);
bombeBounceSound = Mix_LoadWAV_RW(SDL_RWFromMem(sound_bounce_wav, sound_bounce_wav_len), 0);
playerBurnSound = Mix_LoadWAV_RW(SDL_RWFromMem(sound_burn_wav, sound_burn_wav_len), 0);
cancelSound = Mix_LoadWAV_RW(SDL_RWFromMem(sound_cancel_wav, sound_cancel_wav_len), 0);
endSound = Mix_LoadWAV_RW(SDL_RWFromMem(sound_end_wav, sound_end_wav_len), 0);
fireSound = Mix_LoadWAV_RW(SDL_RWFromMem(sound_fire_wav, sound_fire_wav_len), 0);
hole1Sound = Mix_LoadWAV_RW(SDL_RWFromMem(sound_hole1_wav, sound_hole1_wav_len), 0);
hole2Sound = Mix_LoadWAV_RW(SDL_RWFromMem(sound_hole2_wav, sound_hole2_wav_len), 0);
hole3Sound = Mix_LoadWAV_RW(SDL_RWFromMem(sound_hole3_wav, sound_hole3_wav_len), 0);
playerKickSound = Mix_LoadWAV_RW(SDL_RWFromMem(sound_kick_wav, sound_kick_wav_len), 0);
louisSound = Mix_LoadWAV_RW(SDL_RWFromMem(sound_louis_wav, sound_louis_wav_len), 0);
mineSound = Mix_LoadWAV_RW(SDL_RWFromMem(sound_mine_wav, sound_mine_wav_len), 0);
teleporterCloseSound = Mix_LoadWAV_RW(SDL_RWFromMem(sound_teleporter_close_wav, sound_teleporter_close_wav_len), 0);
teleporterOpenSound = Mix_LoadWAV_RW(SDL_RWFromMem(sound_teleporter_open_wav, sound_teleporter_open_wav_len), 0);
validSound = Mix_LoadWAV_RW(SDL_RWFromMem(sound_valide_wav, sound_valide_wav_len), 0);

Mix_PlayMusic(menu, -1);
Mix_VolumeMusic (MIX_MAX_VOLUME);
Mix_Volume(0, MIX_MAX_VOLUME / 2);
Mix_Volume(3, MIX_MAX_VOLUME / 2);

mineOffsetChannel = 14;


I upgrade on stretch and this is the same problem, someone have succeed to use SDL_mixer on raspberry pi ?

version of devel library :

libsdl2-dev is already the newest version (2.0.5+dfsg1-2).
libsdl2-image-dev is already the newest version (2.0.1+dfsg-2+b1).
libsdl2-mixer-dev is already the newest version (2.0.1+dfsg1-1).
libsdl2-net-dev is already the newest version (2.0.1+dfsg1-2).
libsdl2-ttf-dev is already the newest version (2.0.14+dfsg1-1).

no update found for the moment. On retropie 3.8 its SDL2 2.0.0 and mixer 2.0.0 and i have no problem with this version.

Need help please.