GP2X Sdl_mixer Is Driving Me Crazy.


DaveN

Digger
Joined
Jun 7, 2006
Messages
335
Website
Visit site
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 ):
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:
Which libs did you use in the end (with a link if possible). I am still trying to find a SDL_mixer lib that uses mad and tremor instead of smpeg and vorbis.
 
In the end I stuck with theoddbot's or guyfawkes one, I'm not sure which one, my toolchain is pretty chaotic now, but it compiles fine. It doesn't uses the librarys you mentioned, but it works for me. I've found this patch on the archive that will support libmod and tremor, but I haven't been able to compile it. Had some problems with my mac. But I haven't spent too much time on that, so you may be able to get it pretty fast. I haven't found anymore.

Here's the wiki page to it.
 
Nuts. I am currently using DevkitGP2X so I cant perform the Wiki tutorial. I may try the official SDK SDL_mixer libs and see if I get any gain from that.

Cheers anyway.
 
Back
Top