-
Notifications
You must be signed in to change notification settings - Fork 61
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
Libretro: playing music doesn't work [Emscripten + Nintendo switch] #36
Comments
Finally added $50 to this, it's now a bounty! https://www.bountysource.com/issues/59020062-libretro-playing-music-doesn-t-work |
The reason audio doesnt currently play with the mixer is because the functions for getting the audio and chunk size are not implemented. You will need to use the mixer functions in audio_mixer.c iirc to set up a mixing loop for all music. |
Hi @mudlord |
You are using the functions from audio_mix.c it seems. Those functions are incomplete. |
@mudlord Sorry I have no idea how to do that. Could you please submit a PR for this ? There's a bounty. |
@twinaphex this has been done here: |
OK, sure thing. |
Seems it's breaking on ios: |
Please test the branch ios. |
still fails: cc -arch armv7 -isysroot /Volumes/T2/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk -miphoneos-version-min=5.0 -miphoneos-version-min=5.0 -DIOS -O3 -DMRBOOM -DHAVE_IBXM -D_FORTIFY_SOURCE=0 -DPLATFORM="Darwin" -DGIT_VERSION="" fdffce4"" -D__LIBRETRO__ -I./libretro-common/include -I./libretro-common -I./ai -I. -Wall -pedantic -fPIC -std=gnu99 -fPIC -c -o libretro-common/audio/conversion/float_to_s16_neon.o libretro-common/audio/conversion/float_to_s16_neon.c |
Update. Please test. |
1 file changed, 3 insertions(+), 3 deletions(-) asm( .type convert_float_s16_asm, %function .type convert_s16_float_asm, %function ^ ^ :11:3: error: unknown directive: |
There should be no s16_to_float_neon.c and float_to_s16_neon.c make clean? |
yes I did a make clean ^ franck-mac-book-air:mrboom-libretro franck$ git pull |
Already up to date. |
$ cat Makefile.common | grep -i neon SOURCES_ASM := $(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler_neon.S $ git status nothing to commit, working tree clean $ git log
|
It seems strange that the old version is used when compiling. |
just tried with 6fd524a its the same. I also double checked the clean was deleting all .o |
you expect SOURCES_ASM not to be compiled? |
I think I understand what the problem is. |
The compiler compiles .c files instead of .S files. |
Please test the branch ios-dont. |
@DevilFrost yes ios-dont worked |
btw would be cool to have a "no music" option... |
Ok I added DONT_WANT_ARM_OPTIMIZATIONS and it compiled on iOS. |
It is really strange. |
On OS X it's weird also, sometime I run it an there's no music only FX. Sometimes there is both. Something else: you're not using musics_volume? https://github.com/Javanaise/mrboom-libretro/blob/master/common.cpp#L103 |
musics_volume used with the SDL2. The libretro is not used. |
make mrboom LIBSDL2=1 Works with a gcc for x86_64. |
@DevilFrost yes I fixed it |
@DevilFrost do you have the random bug where the music is not on? which platform are you using? |
@frranck there is no such bug. Debian. |
OK I fixed the android issue. There still no music on Nintendo switch though. |
Made an interesting discovery. Gamecube music sounds really fast, like 2x Windows builds. And it turns out Windows builds are 2x faster than several standalone MOD players. Which explains why some riffs sound so rushed. Changed libretro rate to 22050 and music tempo now feels more relaxed everywhere. So there's a problem in the ibxm player. :shocked: edit: Or it's the libretro mixer. |
Worth pointing out that the XM player got a small update (2017 -> 2019) And it correctly puts out wave files that sound okay. So now we analyze what libretro is doing that speeds it up. |
|
Finally found the music issue. It was skipping samples. It should refill when Will test later if gamecube music is fixed. |
Submitted a PR to libretro-common. Windows is fixed. Gamecube sounds better but still has stereo separation + very fast tempo, so might be some ibxm endian problem. I don't know if Emscripten or Switch is changed, but I'll PR over here too after common is merged. |
Emscripten is not playing music because frontend Makefile.emscripten needs |
@SimpleTease what do you mean ctr platform? |
seems Switch is erasing the CFLAGS https://github.com/Javanaise/mrboom-libretro/blob/master/Makefile#L221 |
Emscripten and Switch should have music now, although I can't test either. |
Emscripten can be tested online https://web.libretro.com/ when it's merged and we can ask someone for Switch. |
I tried the web player with several browsers but it always hangs on me when trying to start the core. For the gamecube music problem,
Trying to figure out both problems. |
Because static linking, frontend is sharing audio mixer with core. Frontend is setting rate to 32000 which is creating our tempo problems.
I think we can move the mixer init around in common.cpp but I'll need to do some checking first, to make sure Retroarch can re-init the mixer when switching cores or internal music player. |
Libretro web player ""should"" have working music, but I still can't get player to run any cores. |
Just adding a note here that Wii U also has no music. |
I tried to load .MOD and .XM in that branch https://github.com/Javanaise/mrboom-libretro/tree/adding_music using ibxm but I'm getting some "audio_mixer_play_mod cannot retrieve duration !" errors.
If I change https://github.com/Javanaise/mrboom-libretro/blob/adding_music/libretro-common/audio/audio_mixer.c#L599
to replay = new_replay( module, 48000, 1 ); // ( module, s_rate, 1);
I don't get the error message but still don't get the module played...
PS: If you compile the game by default you'll use the data from retro_data.h
If you compile the game with:
make LOAD_FROM_FILES=1
You will get the data decrunched and read from files inside a temporary directory
The text was updated successfully, but these errors were encountered: