DaveN
Digger
So, I'm really down with my nerves and energy. I've been trying to get this working as I want since three and a half hours, but it just won't.
Some background infos, I'm using this libs by the oddbot with the newest sdl_mixer included, so it won't play the sound at double speed. Those include also the hw sdl.
I'm initialising it like this ( music_volume is set to 50 ):
This works every 2nd time, the other times it crashes. If it works correctly, 'music' is '0x384b30', if it crashes it's '0x3736a8'. And I'm trying to load the same file. Oh, and the error happens after the initializing, SDL_Init with audio works all the time. The complete output until this point is:
test.ogg and music is 0x3736a8
Volume changed to 50
Fatal signal: Floating Point Exception (SDL Parachute Deployed)
So it crashed at trying to play the file, but how is it possible that it sometimes uses floates, sometimes not? After it crashes, I load the menu in telnet per 'cd /usr/gp2x/' './gp2xmenu' and then I navigate to the game using the gp2x and it's menu. Then it works. After that, it crashes, so I'll have to start up the menu again.
If it doesn't crashes and I'm trying to load a way, it sometimes works, the other times it tells me that I can't load wav's. Ogg's work all the time ( if it reaches this point ).
Cheers, David.
EDIT: PROBLEM SOLVED. After 4 1/2 hours of looking at this god damn code and drinking coffee and eating cold pasta. And after completly re-installing and compiling sdl_mixer three times of three different sources.
Some background infos, I'm using this libs by the oddbot with the newest sdl_mixer included, so it won't play the sound at double speed. Those include also the hw sdl.
I'm initialising it like this ( music_volume is set to 50 ):
Code:
if(SDL_Init(SDL_INIT_AUDIO)==-1) {
::cout<<"Error loading sdl_mixer: "<<SDL_GetError()<<endl;
}
Mix_OpenAudio( 22050, AUDIO_S16, 2, 256 );
Mix_Music *music = NULL;
music = Mix_LoadMUS(music_tracks[0].c_str());
::cout<<music_tracks[current_song].c_str()<<" and music is "<<music<<" "<<Mix_GetError()<<endl;
Mix_VolumeMusic(music_volume);
::cout<<"Volume changed to "<<music_volume<<endl;
if (Mix_PlayMusic(music,1) == -1 ) {
::cout<<"Error playing music: "<<Mix_GetError()<<endl;
};
::cout<<"Music started playing"<<endl;
Mix_HookMusicFinished(musicFinished);
This works every 2nd time, the other times it crashes. If it works correctly, 'music' is '0x384b30', if it crashes it's '0x3736a8'. And I'm trying to load the same file. Oh, and the error happens after the initializing, SDL_Init with audio works all the time. The complete output until this point is:
test.ogg and music is 0x3736a8
Volume changed to 50
Fatal signal: Floating Point Exception (SDL Parachute Deployed)
So it crashed at trying to play the file, but how is it possible that it sometimes uses floates, sometimes not? After it crashes, I load the menu in telnet per 'cd /usr/gp2x/' './gp2xmenu' and then I navigate to the game using the gp2x and it's menu. Then it works. After that, it crashes, so I'll have to start up the menu again.
If it doesn't crashes and I'm trying to load a way, it sometimes works, the other times it tells me that I can't load wav's. Ogg's work all the time ( if it reaches this point ).
Cheers, David.
EDIT: PROBLEM SOLVED. After 4 1/2 hours of looking at this god damn code and drinking coffee and eating cold pasta. And after completly re-installing and compiling sdl_mixer three times of three different sources.
Last edited by a moderator: