Very large .mp3 files (~9MB) are prone to crashing the game

Found a bug in R'n'D? Report it here!

Moderators: Flumminator, Zomis

Post Reply
ncrecc
Posts: 153
Joined: Thu Jul 12, 2018 12:59 am

Very large .mp3 files (~9MB) are prone to crashing the game

Post by ncrecc »

Here are just some examples:

https://i.frogbox.es/ljx
^ 9055 KB. Game crashes when it tries to load this at all.

https://i.frogbox.es/ljy
^ 10515 KB. Game plays no music when this song comes up. Clicking the toggle music button in any level where this song would be playing crashes the game.

https://i.frogbox.es/ljz
^ 11165 KB. Game loads up fine, but produces a clicking noise and instantly crashes whenever it would have to play this.

I actually ran into this by accident, not just intentionally poking around for bugs. Some musicians on Bandcamp normally release their songs in .mp3 format at high quality levels, thus causing huge filesizes.
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: Very large .mp3 files (~9MB) are prone to crashing the game

Post by filbo »

Hi ncrecc --

This may be a case where knowing what operating system you're using, and perhaps version of SDL libraries installed on that system, would be useful. Also whether the RnD program you're using was downloaded from Holger's compilations, or built yourself.

I downloaded your 'ljx' link and got it to play OK in an RnD level. My system is LinuxMint 17.3; `sdl2-config --version` says '2.0.2'; SDL library packages and the packages apparently in use for audio purposes are:

Code: Select all

libsdl2-2.0-0       2.0.2+dfsg1-3ubuntu1.2
libsdl2-image-2.0-0 2.0.0+dfsg-3+deb8u1build0.14.04.1
libsdl2-mixer-2.0-0 2.0.0+dfsg1-3
libsdl2-net-2.0-0   2.0.0+dfsg1-2
libmad0             0.15.1b-9ubuntu14.04.1
libpulse0           1:4.0-0ubuntu11.1
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Very large .mp3 files (~9MB) are prone to crashing the game

Post by Holger »

Yes, knowing some details about the operating system and program (from package or self-compiled) would be very useful in such cases.

Nevertheless, I can confirm the problems you have with these three MP3 files (on Linux, using SDL 2.0.6 and version 2.0.1 of all other SDL libraries).

Files "burana.mp3" and "kid.mp3" indeed crash the game -- the crash happens in the smpeg code (in function "Decode_MPEGaudio()" at audio/mpegtoraw.cpp, line 372). File "nocturne.mp3" apparently refuses to load entirely -- "playmus" from the SDL_mixer package (which uses the same code/library) says "Couldn't load nocturne.mp3: MPEG file does not have any audio stream.".

However, loading and playing all three MP3 files using "vlc" works just fine.

Opening all three files in "audacity" and just immediately exporting them as MP3 again (with all default settings) apparently "fixes" all three MP3 files, which then load and play fine also in R'n'D.

Apparently these MP3 files had some properties which the (rather old) smpeg MP3 library refuses to process correctly... :-/
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: Very large .mp3 files (~9MB) are prone to crashing the game

Post by filbo »

Interesting. The Ubuntu build of SDL2 uses libmad0, until 19.04 'disco dingo' which will be released next month, which switches to libmpg123, quote: 'to avoid potential GPL licensing issues of libsdl2-mixer users'. None of the builds I can find ever used libsmpeg.
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Very large .mp3 files (~9MB) are prone to crashing the game

Post by Holger »

SDL2_mixer version 2.0.1 comes bundled with the following additional libraries to support additional audio formats:

- flac-1.2.1
- libmikmod-3.1.12
- libmodplug-0.8.8.4
- libogg-1.3.1
- libvorbis-1.3.3
- libvorbisidec-1.2.1
- smpeg2-2.0.0

I usually choose to build "libmodplug" for MOD support and "smpeg2" for MP3 support (and skip the rest) for R'n'D. Never bothered with adding other external libraries like libmad or libmpg123 that are not bundled with SDL_mixer... Although it may be a solution for this problem (as those libraries may be newer than libsmpeg).

And never heard of GPL licensing issues of libsmpeg... May have something to do with weird MP3 codec licensing though.
ncrecc
Posts: 153
Joined: Thu Jul 12, 2018 12:59 am

Re: Very large .mp3 files (~9MB) are prone to crashing the game

Post by ncrecc »

Holger wrote: Sat Mar 02, 2019 11:59 am Yes, knowing some details about the operating system and program (from package or self-compiled) would be very useful in such cases.
I'm using Windows 10 and the pre-compiled 4.1.2.0 package.
Regarding re-exporting through Audacity... it seems I hadn't actually tried that! :oops: The songs work fine in that case.

I have noticed two other bugs where certain .ogg -> .mp3 or .flac -> .mp3 exports are played back at half speed in RnD, and where some .ogg files seem to be ignored by RnD entirely, but for the sake of organization I'll start another topic about that.
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: Very large .mp3 files (~9MB) are prone to crashing the game

Post by filbo »

So, I actually found an Ubuntu changelog where they did in fact previously use libsmpeg, but moved to libmad: https://launchpad.net/ubuntu/+source/sd ... 2/1.2.11-5 -- some time in late 2011, with the comment 'Use libmad (GPL) instead of unmaintained smpeg (LGPL) for mp3 support'.

So Ubuntu's SDL used libsmpeg, changed to libmad in 2011 because libsmpeg was considered unmaintained; changed to libmpg123 in 2019 because of some licensing issue.

I kind of which there was some commentary about relative performance, stability, standards support / compatibility, etc. Lurching around between libraries for entirely external reasons seems wrong...
Post Reply