Closed paulocoutinhox closed 4 years ago
Using SDL_MIXER=2
should automatically get vorbis, https://github.com/emscripten-core/emscripten/blob/incoming/tools/ports/sdl_mixer.py#L38 - so I think those warnings about vorbis are mistaken. Might be true about mp3 though.
We should probably have a mechanism that makes -lvorbis
work if USE_VORBIS
was set. Or vice versa.
I'm having the same problem with 1.38.31. I'm compiling with -s USE_SDL_MIXER=2 -s USE_OGG=1 -s USE_VORBIS=1
. Mix_Init(MIX_INIT_OGG)
returns 0
and Mix_GetError()
returns "Mixer not built with Ogg Vorbis support"
. I tried emcc --clear-cache
with no luck.
What do I do?
@kripken BTW, I was previously using the SDL2 audio callback in combination with stb_vorbis to play music. It can be a little stuttery and SDL_PauseAudioDevice
doesn't actually pause (it just loops the previous chunk).
Is Mix_PlayMusic
better?
If I can't get this to work then perhaps I'd have better luck with inline JavaScript?
I can confirm the issue - it seems like the issue is that libvorbisfile is not installed as part of the vorbis port.
Any fix idea for that?
Looks like as a temporary workaround, I can cancel the build of SDL2_mixer when it detects that vorbis is missing, then edit ~/.emscripten_ports/sdl2_mixer/SDL2_mixer-release-2.0.1/configure and remove all references to -logg, -lvorbis and -lvorbisfile. After that it'll build a working version of SDL2_mixer.
As the configure script hardcodes these flags, I see only two real solutions:
Same here. Before issue i worked with version 1.38.29, updated to latest 1.39.0 and got no ogg support in SDL_mixer. Tried next sdk versions: sdk-1.38.31-64bit, 1.38.33, 1.38.40, 1.39.0 - same issue with log:
checking vorbis/vorbisfile.h usability... yes
checking vorbis/vorbisfile.h presence... no
configure: WARNING: vorbis/vorbisfile.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: vorbis/vorbisfile.h: proceeding with the compiler's result
checking for vorbis/vorbisfile.h... yes
checking for ov_open_callbacks in -lvorbisfile -lvorbis -logg -lm... no
configure: WARNING: *** Unable to find Ogg Vorbis library (http://www.xiph.org/)
configure: WARNING: Ogg Vorbis support disabled
Found only one of available at the moment version sdk-1.38.30-64bit compiles SDL_mixer with ogg support:
checking vorbis/vorbisfile.h usability... yes
checking vorbis/vorbisfile.h presence... no
configure: WARNING: vorbis/vorbisfile.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: vorbis/vorbisfile.h: proceeding with the compiler's result
checking for vorbis/vorbisfile.h... yes
checking for ov_open_callbacks in -lvorbisfile -lvorbis -logg -lm... yes
So if I understand correctly was broken in 1.38.33 and 1.38.40? And I assume you were using fastcomp in those versions? So it seems this is not related to the upstream switch but happened some time before?
broken in latest 1.39.0 upstream too
i did not test all available versions, but looks like it was broken since 1.38.31 till latest 1.39.0. Also i tested latest 1.39.0 upstream and fastcomp - both broken
So it seems this is not related to the upstream switch but happened some time before?
I think yes. Looks like it was near 1.38.30 -> 1.38.31, and there was no upstream yet.
I think the key issue here is in https://github.com/emscripten-core/emscripten/issues/7879#issuecomment-455395415 - if USE_VORBIS
is set, we need to make that work with SDL2_mixer, which for some reason doesn't currently. This is not a new issue, but it would definitely be good to fix if someone has time to look into it.
I've taken a look at it and it seems that ports/vorbis.py only copies libvorbis.la, missing libvorbisfile.la and libvorbisenc.la. However, I am not familiar enough with the scripts to fix the file. Is there documentation on those somewhere?
@Oipo Each port has a python file that manages it, for SDL2_mixer that is tools/ports/sdl2_mixer.py
, for vorbis it's tools/ports/vorbis.py
. Not much docs on those files, but they are pretty short. Let me know if you have any questions about the APIs used there!
@kripken Ah yes, I managed to find those. However, looking at vorbis.py, do I edit https://github.com/emscripten-core/emscripten/blob/incoming/tools/ports/vorbis.py#L35 to return more than one library name? Or do I edit line 28 to copy more?
In general a port should return one output in the current model. Perhaps before line 33 we could link all the necessary libraries files, if there is more than one?
I think we should move away from using configure here and switch to using build_port
like the other ports. SDL2_mixer and harfbuzz look like the only two ports that rely on using configure to build the port. This makes them not portable since configure can't run on windows.
Hi,
When i use "-s USE_SDL_MIXER=2", i got compilation errors using emscripten version 1.38.24:
Can anyone help me?