Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL2_Mixer mp3 support doesn't work #430

Closed
TheJosh opened this issue Jul 2, 2014 · 12 comments
Closed

SDL2_Mixer mp3 support doesn't work #430

TheJosh opened this issue Jul 2, 2014 · 12 comments
Labels
Milestone

Comments

@TheJosh
Copy link
Contributor

TheJosh commented Jul 2, 2014

I was getting constant link errors related to SMPEG. When I changed sdl2_mixer.mk to not include mp3 support and re-ran make sdl2_mixer, it started working. I didn't try the libmad support (which is how Debian does it) as I don't use mp3s in my game.

@TheJosh
Copy link
Contributor Author

TheJosh commented Jul 2, 2014

Patch:

diff --git a/src/sdl2_mixer.mk b/src/sdl2_mixer.mk
index 329fbc6..452ac5f 100644
--- a/src/sdl2_mixer.mk
+++ b/src/sdl2_mixer.mk
@@ -8,7 +8,7 @@ $(PKG)_CHECKSUM := 9ed975587f09a1776ba9776dcc74a58e695aba6e
 $(PKG)_SUBDIR   := SDL2_mixer-$($(PKG)_VERSION)
 $(PKG)_FILE     := SDL2_mixer-$($(PKG)_VERSION).tar.gz
 $(PKG)_URL      := http://www.libsdl.org/projects/SDL_mixer/release/$($(PKG)_FILE)
-$(PKG)_DEPS     := gcc sdl2 libmodplug ogg vorbis smpeg2
+$(PKG)_DEPS     := gcc sdl2 libmodplug ogg vorbis

 define $(PKG)_UPDATE
     $(WGET) -q -O- 'http://hg.libsdl.org/SDL_mixer/tags' | \
@@ -33,11 +33,11 @@ define $(PKG)_BUILD
         --enable-music-mod-modplug \
         --enable-music-ogg \
         --disable-music-flac \
-        --enable-music-mp3 \
+        --disable-music-mp3 \
         --disable-music-ogg-shared \
         --disable-music-flac-shared \
+       --disable-music-mp3-shared \
         --disable-smpegtest \
-        SMPEG_CONFIG='$(PREFIX)/$(TARGET)/bin/smpeg2-config' \
         WINDRES='$(TARGET)-windres' \
         LIBS='-lvorbis -logg'
     $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS

@TimothyGu
Copy link
Member

About smpeg, I personally have no idea why it still exists. FFmpeg is a googol times better than that. As for MP3 I have some misgivings about it. After all, MXE is created for all users, not just the users who don't need MP3. Can you show the errors using MP3?

@TheJosh
Copy link
Contributor Author

TheJosh commented Jul 9, 2014

It was a bunch of linker errors against functions beginning with SMPEG_ but I don't have the log anymore. The errors wasn't when I guess l built sdl2_mixer, it was when I used it.

I also modified and rebuilt the package to link against smpeg v1 but that didn't work

The Debian package links against libmad instead, maybe we should try that

@TimothyGu TimothyGu removed the bug label Aug 8, 2014
@TimothyGu
Copy link
Member

@TheJosh yes. If possible, please send a patch converting SDL2_Mixer to libmad.

@elektito
Copy link

I should point out that libmad is under the GPL which might not be what some of SDL2_mixer's users be expecting. In fact, changing to libmad might cause some people to violate the GPL unknowingly. I guess that's the reason SDL2_mixer is not linked against libmad by default.

@TheJosh
Copy link
Contributor Author

TheJosh commented Sep 29, 2014

Does that only apply for statlic linking?
On 29/09/2014 11:08 PM, "Mostafa Razavi" notifications@github.com wrote:

I should point out that libmad is under the GPL which might not be what
some of SDL2_mixer's users be expecting. In fact, changing to libmad might
cause some people to violate the GPL unknowingly. I guess that's the reason
SDL2_mixer is not linked against libmad by default.

Reply to this email directly or view it on GitHub
#430 (comment).

@TimothyGu
Copy link
Member

@elektito said:

In fact, changing to libmad might cause some people to violate the GPL unknowingly

Thanks for the information. This is indeed a problem. Even Debian is pretty ambiguous on this matter: http://anonscm.debian.org/cgit/pkg-sdl/packages/libsdl2-mixer.git/tree/debian/copyright

FYI the option for enabling libmad is --enable-music-mp3-mad-**gpl**.

@TheJosh said:

Does that only apply for static linking?

No, GPL applies to all work using the library, unlike the LGPL.

@tonytheodore
Copy link
Member

@TheJosh Can you check if 2cf4af8 fixes it?

@TheJosh
Copy link
Contributor Author

TheJosh commented Oct 10, 2014

Hi. Will test when I have time.

On 10 October 2014 01:06, Tony Theodore notifications@github.com wrote:

@TheJosh https://github.com/TheJosh Can you check if 2cf4af8
2cf4af8
fixes it?

Reply to this email directly or view it on GitHub
#430 (comment).

@EdwardCorlew
Copy link

Hi, just tested this on the latest branch and I'm also seeing the following errors:

/opt/mxe/usr/lib/gcc/i686-w64-mingw32.static/4.9.2/../../../../i686-w64-mingw32.static/lib/../lib/libSDL2_mixer.a(dynamic_mp3.o): In function `Mix_InitMP3':
/opt/mxe/tmp-sdl2_mixer-i686-w64-mingw32.static/SDL2_mixer-2.0.0/dynamic_mp3.c:153: undefined reference to `SMPEG_actualSpec'
/opt/mxe/tmp-sdl2_mixer-i686-w64-mingw32.static/SDL2_mixer-2.0.0/dynamic_mp3.c:154: undefined reference to `SMPEG_delete'
/opt/mxe/tmp-sdl2_mixer-i686-w64-mingw32.static/SDL2_mixer-2.0.0/dynamic_mp3.c:155: undefined reference to `SMPEG_enableaudio'
/opt/mxe/tmp-sdl2_mixer-i686-w64-mingw32.static/SDL2_mixer-2.0.0/dynamic_mp3.c:156: undefined reference to `SMPEG_enablevideo'
/opt/mxe/tmp-sdl2_mixer-i686-w64-mingw32.static/SDL2_mixer-2.0.0/dynamic_mp3.c:157: undefined reference to `SMPEG_new_rwops'
/opt/mxe/tmp-sdl2_mixer-i686-w64-mingw32.static/SDL2_mixer-2.0.0/dynamic_mp3.c:158: undefined reference to `SMPEG_play'
/opt/mxe/tmp-sdl2_mixer-i686-w64-mingw32.static/SDL2_mixer-2.0.0/dynamic_mp3.c:159: undefined reference to `SMPEG_playAudio'
/opt/mxe/tmp-sdl2_mixer-i686-w64-mingw32.static/SDL2_mixer-2.0.0/dynamic_mp3.c:160: undefined reference to `SMPEG_rewind'

etc.

edit:

This may have been because I was linking the dynamic libraries for sdl2_mixer. I can check within the next 24 hrs.

@TimothyGu
Copy link
Member

@EdwardCorlew probably not, as your log shows

/opt/mxe/tmp-sdl2_mixer-i686-w64-mingw32.**static**/SDL2_mixer-2.0.0/dynamic_mp3.c:157: undefined reference to `SMPEG_new_rwops'

@TimothyGu
Copy link
Member

I'll take a look at it tomorrow if I find time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants