Author Topic: SDL_Mixer1.2 bug?  (Read 1630 times)

David Knight (OP)

  • Posts: 577
SDL_Mixer1.2 bug?
« on: August 31, 2014, 08:49:59 am »
I've been debugging the cdogs music issue and it seems to be related to an (SDL_Mixer1.2)  mix_LoadMUS call. It crashes when given a .txt file or when given the rage.mod music file (presumably it doesn't recognise this file, it parses other .mod and .ogg files successfully). According to it should return NULL but instead it seems to crash on the most recent dingux (2014/08/20).

If given "The promise.ogg.txt" it returns:
Segmentation fault

If given "rage.mod" it returns:
 __is*{_1} (-128,0x4  {locale})

The same code parses without error on Ubuntu linux.

This is my first bug report so I've probably neglected to mention something important and of course may be totally wrong ;). Can someone more experienced at this check and confirm this is true?

To further test I tried GMU:
I tried playing .mod files in GMU. It plays and switches between .ogg files fine. It plays the first .mod file correctly and then freezes when you attempt to play the second .mod file in a session, it doesn't matter if it's the same file or a different one.
I created an empty file called crashtest.ogg. GMU fails to play as expected but does not crash.
I created an empty file called crashtest.mod. GMU fails to play first time as expected, the second time it crashes.

This is no longer the case with the most recent opendingux, I had reverted to the previous version, when I updated opendingux this no longer happens, apologies for the confusion.
« Last Edit: September 01, 2014, 08:41:27 am by David Knight »

Senor Quack

  • Posts: 223
Re: SDL_Mixer1.2 bug?
« Reply #1 on: September 01, 2014, 01:39:47 am »
It's not uncommon for certain tracked music files (i.e. MOD files) to be incompatible with SDL's music functionality.  I've had this problem before and the best solution is to use a dedicated MOD music player to output to WAV format, and then encode that to OGG and use that instead, at least for that one file.  I've even sometimes had to try several MOD players, finding one that would finally be able to play the troublesome file.  The bright side is that with this method, you can enable fancy interpolation in the mod player and, as a result, you will have a higher quality result than before.  Would you believe I've even had one issue (rRootage) where one of the three included OGG music files would crash when played on ARM platforms.  My solution in that case ended up being to simply decode the OGG file to a WAV and include that one music file as a WAV file.  Reencoding back to OGG would have really hurt the quality so I left it as WAV.  This does not apply to you here, though.

As for your other issue of passing a .txt file as an argument, I can't see how that is supposed to work.  You should always be passing an argument that is simply a string containing the filename of a valid music file.  Also, since this is Linux, you need to be mindful of spaces in your filenames.  The easiest way to deal with this is to simply rename the music file to use underscores in place of spaces.
« Last Edit: September 01, 2014, 01:46:29 am by Senor Quack »


  • Posts: 38
Re: SDL_Mixer1.2 bug?
« Reply #2 on: May 06, 2015, 01:57:47 am »

I just came across this issue with SDL2. It played fine on my computer,  but not on my gcw0.
Solution: Converted the *.mod file to a *.xm file with Milkytracker.
« Last Edit: May 06, 2015, 02:38:49 am by jxv »


Post a new topic