SDL_mixer crashing on loop - why?

Moderator
Posts: 697
Joined: 2002.04
Post: #1
The title says it all; why might a track being played through SDL_mixer crash on the loop of the track? If the track is set to play only the once, no crash occurs...

Code:
/* This is all the sound handling code in the app; prior to this SDL was initialised with the proper SDL_INIT_AUDIO flag. */
Mix_OpenAudio( 22050, MIX_DEFAULT_FORMAT, 2, 2048 );
Mix_AllocateChannels( 8 );
m_music = Mix_LoadMUS( "placeholder.mid" );
/* Load a few samples with Mix_LoadWAV() here. */
Mix_PlayMusic( m_music, -1 );

Results in...

Quote:Your buggy app has exited due to signal 4 (SIGILL).

Mark Bishop
--
Student and freelance OS X & iOS developer
Quote this message in a reply
Member
Posts: 86
Joined: 2005.01
Post: #2
I've heard of this happening on Linux before. I'll try looking through the archives for the source of the bug.
Quote this message in a reply
Member
Posts: 233
Joined: 2003.05
Post: #3
Have you tried swapping in a different sound file to play and see if that works?

"Pay no attention to that man behind the curtain." - Wizard of Oz
Quote this message in a reply
Moderator
Posts: 697
Joined: 2002.04
Post: #4
Quote:Have you tried swapping in a different sound file to play and see if that works?
Yes, with no joy; I've also tried different types of sound files, et al... I've looked back through the archives of the mailing list, but as seems to be the trend today, none of my searches are turning up anything relevant...

Mark Bishop
--
Student and freelance OS X & iOS developer
Quote this message in a reply
Moderator
Posts: 434
Joined: 2002.09
Post: #5
My advice would be, find some sample code that does work, then slowly make it look more like what you were trying to do until it stops working. Or if it does exactly what you do need, drop it into your project with as little editing as possible. :-)

Measure twice, cut once, curse three or four times.
Quote this message in a reply
Moderator
Posts: 697
Joined: 2002.04
Post: #6
Just had another go at trying to fix this bug; after recompiling SDL_mixer, still no joy if using the original music files (.mid) – but if I now try to play .ogg's, there's no crash on the loop – so, unexpected, and possibly unwarranted, joy...

Mark Bishop
--
Student and freelance OS X & iOS developer
Quote this message in a reply
Apprentice
Posts: 8
Joined: 2004.07
Post: #7
I am having problems with .mid too... It seems like my app crashes when the .mid is finished playing, while other formats works fine.
Quote this message in a reply
Moderator
Posts: 697
Joined: 2002.04
Post: #8
Well, as I wrote somewhere above, in my situation there's no crash when the track merely finishes playing, only when the track finishes playing and the specified no. of loops is >1 or -1...

I suppose the course of action to take is to just avoid .mid's when using SDL_mixer (as none of the emails I sent to the mailing list regarding this problem received any feedback...)

Mark Bishop
--
Student and freelance OS X & iOS developer
Quote this message in a reply
Member
Posts: 233
Joined: 2003.05
Post: #9
I wish I knew more about it, but did you try searching the archives at the newsgroup page?
http://news.gmane.org/gmane.comp.lib.sdl
I have a vague recollection of some discussion about midi files, but it wasn't relevant to me at the time, so I don't really remember details. In any case, it sounds serious, and there are some members on that list that may still pick up on it. (Also, I noticed your post on that list is lacking some of the details you have since discovered and posted here, you might want to follow up on your post there)

Switching to another format is an option but you'll lose the advantage of small files. A good way to make up for that is to get really good kickin' music that midi could never pull off. Wink

"Pay no attention to that man behind the curtain." - Wizard of Oz
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  glCreateShader crashing Jar445 0 4,480 Jan 19, 2009 02:39 PM
Last Post: Jar445
  SDl_mixer and image bronxbomber92 3 3,451 Dec 15, 2006 12:27 PM
Last Post: bronxbomber92
  Installing SDL_image & SDL_mixer bronxbomber92 8 5,551 Oct 14, 2006 09:39 PM
Last Post: szymczyk
  Using SDL_mixer to play ogg sound (not music) effects kordova 3 6,273 Sep 1, 2006 12:29 PM
Last Post: kordova
  SDL_mixer exception at Mix_PlayMusic kordova 2 3,348 Sep 1, 2006 04:09 AM
Last Post: kordova