SDL-mixer and SDL-sound: Problem with mp3 support
Manuel A. Fernandez Montecelo
manuel.montezelo at gmail.com
Sun May 12 15:13:14 UTC 2013
2013/5/12 Vincent Prat <vinceprat at free.fr>:
> Hello
>
> Thank you for your answer.
> After some investigations, it appears that libmad and sdl-mixer work fine.
> It is in fact sdl-sound that is unable to handle correctly mp3 files.
> I used sdl-sound to compute the duration of the sound file I wanted to play
> and if the duration was zero, nothing was played by sdl-mixer. Sorry for
> having misled you.
>
> Anyway, there is still a problem with sdl-sound. The duration of mp3 files
> is largely underestimated whereas the result is correct for other formats.
> And using sdl-sound to play a mp3 sound through Mix_QuickLoad_RAW and
> Mix_PlayChannel gives a very short and unpleasant sound.
> Besides, for a valid mp3 file, the flag of the corresponding Sound_Sample
> used to be different from SOUND_SAMPLEFLAG_NONE, which is not the case now.
The relevant options of sdl-sound are:
--enable-smpeg enable MP3 decoding via smpeg default=yes
--enable-mpglib enable MP3 decoding internally default=yes
both of which are enabled in debian/rules.
They seem to have been built in my system (amd64) when I uploaded the
package. mpglib seems to be internal code, but smpeg is not and the
library doesn't link against it (it does for ogg or others). I don't
know very well what's going on.
On the other hand, smpeg is old (almost 10 years old) and I think that
mostly abandoned upstream (although I didn't check). Maybe recent
changes in compiler options, for example the hardening flags, are
causing troubles. Since libmad looks a much better alternative, I did
the switch in sdl-mixer, but this one doesn't support it.
I compiled "playsound" (from sdl-sound sources), which after a small
modification needed to get it compiled (adding <signal.h>), can play
some .mp3 that I have around, but only ~20% of them.
Many of the produce a bad sound for a fraction of a second and abort with:
Error in decoding sound file!
reason: [MPGLIB: Free format not supported.].
My guess is that sdl-sound's internal "mpglib" are not up to date and
cannot play many .mp3 files, for one reason or another (maybe they are
e.g. with VBR, some "advanced" features, or newer variations of the
standard).
Maybe you can submit a bug report to the package with a minimal test
case (instructions plus small mp3 file) so we can forward it upstream
or somebody can produce a patch. You can try also with other .mp3
that you have around, to see if you can get at least some of them
played.
Cheers.
--
Manuel A. Fernandez Montecelo <manuel.montezelo at gmail.com>
More information about the Pkg-sdl-maintainers
mailing list