ihhub / fheroes2

fheroes2 is a recreation of Heroes of Might and Magic II game engine.
https://ihhub.github.io/fheroes2/
GNU General Public License v2.0
2.58k stars 359 forks source link

[Vita] No music from OGG files #7423

Closed Kiiro-Yakumo closed 11 months ago

Kiiro-Yakumo commented 11 months ago

Preliminary checks

Platform

PlayStation Vita

Describe the bug

I'm compiling stable releases for PS Vita / PS TV, up until now it worked without problems. After updating from 1.0.5 to 1.0.6 the music went silent for all three options (altough MIDI may be my fault as I'm not sure if I've put the soundfont in the right place). However music from OGG files worked up to 1.0.5 so I'm sure about the files placement. It seemed that new libraries are needed for the compiling so I've installed with Vita SDK libxmp, libxmp-lite and sdl2_mixer_ext. It compiled but as mentioned, no music can be heard. The intro videos - the official ones - play with sound however.

Thank you in advance and have a good day.

Kiiro Yakumo

Save file

Not applicable in this situation.

Additional info

With the help of Vita emulator I've noticed this entry when changing to External music type: [03:07:50.655] |I| [export_sceClibPrintf]: 01.01.1970 01:30:34: [ERROR] createMusic: Failed to create a music track from file ux0:data/fheroes2/music/homm2_41.ogg. The error: Failed loading libvorbisfile.a: SDL_LoadObject() not implemented I'm pretty sure libvorbis is installed in Vita SDK but there doesn't seem to exist separate entry for libvorbisfile.

oleg-derevenetz commented 11 months ago

Hi @Kiiro-Yakumo

I'm pretty sure libvorbis is installed in Vita SDK but there doesn't seem to exist separate entry for libvorbisfile.

Our Vita build uses libvorbisfile for quite some time:

                                           -lmodplug -lmpg123 -lvorbisfile -lvorbis -logg -lxmp

Are you using our Makefile.vita to do the build? Have you tried installing our own build (fheroes2_psv.zip from release downloads) on your device? Does it have issues with music?

Kiiro-Yakumo commented 11 months ago

Yes, I have it written in a separate file to not forget: make -j16 -f Makefile.vita

Checked quickly release build from the downloads on the emulator and it's still silent with the same error. Checked the output again and I guess few more lines are somewhat related to this so I will post them as well:

[10:56:25.448] |I| [export_sceIoOpen]: Opening file: ux0:/data/fheroes2/music/homm2_41.ogg

[10:56:25.448] |T| [open_file]: sceIoOpen: Opening file ux0:/data/fheroes2/music/homm2_41.ogg (ux0:/data/fheroes2/music/homm2_41.ogg), fd: 0x1a

[10:56:25.454] |T| [close_file]: sceIoClose: Closing file fd: 0x1a

[10:56:25.461] |I| [export_sceClibPrintf]: 01.01.1970 02:09:40: [ERROR] createMusic:  Failed to create a music track from file ux0:data/fheroes2/music/homm2_41.ogg. The error: Failed loading libvorbisfile.a: SDL_LoadObject() not implemented

I have to admit this is puzzling, if fheroes2 was using libvorbisfile for quite a while and it worked - which I have confirmed with file search to exist, maybe libvorbis package installs both "libvorbis" and "libvorbisfile" - then maybe one of the libraries responsible for playing the music by that - SDL2_Mixer / SDL2_Mixer_ext ? - has some kind of a bug? PC Version works without problems, including MIDI - probably software - so it's probably somewhere in the Vita (libs) area.

EDIT - Fixed the error section formatting.

oleg-derevenetz commented 11 months ago

then maybe one of the libraries responsible for playing the music by that - SDL2_Mixer / SDL2_Mixer_ext ? - has some kind of a bug?

I'd say that SDL_mixer(?) is built incorrectly - it tries to load libvorbisfile.a dynamically (DLL-style), which obviously won't work. It should be linked statically instead.

oleg-derevenetz commented 11 months ago

@Kiiro-Yakumo I believe this PR, once merged, should fix this issue:

https://github.com/vitasdk/packages/pull/284

Kiiro-Yakumo commented 11 months ago

@oleg-derevenetz Thank you for the info, I will keep an eye on it. Once it will merge I will update Vita SDK, recompile fheroes2 1.0.6 and check on emulator, PS Vita and PS TV.

oleg-derevenetz commented 11 months ago

Hi @Kiiro-Yakumo https://github.com/vitasdk/packages/pull/284 has been merged recently, could you please check if it resolves this issue?

Kiiro-Yakumo commented 11 months ago

Hi @oleg-derevenetz I did two updates of Vita SDK across the day but it seems it's actually kinda worse now and it doesn't compile at all.

/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld: /usr/local/vitasdk/arm-vita-eabi/lib/libSDL2_mixer.a(music_opus.c.obj): in function `OPUS_Load':
(.text+0x10): undefined reference to `op_open_callbacks'
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld: (.text+0x14): undefined reference to `op_tags'
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld: (.text+0x1a): undefined reference to `op_tags'
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld: (.text+0x1e): undefined reference to `op_open_callbacks'
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld: (.text+0x26): undefined reference to `op_free'
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld: (.text+0x2a): undefined reference to `op_head'
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld: (.text+0x2e): undefined reference to `op_free'
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld: (.text+0x32): undefined reference to `op_head'
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld: (.text+0x36): undefined reference to `op_seekable'
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld: (.text+0x3e): undefined reference to `op_read'
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld: (.text+0x42): undefined reference to `op_seekable'
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld: (.text+0x46): undefined reference to `op_read'
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld: (.text+0x4e): undefined reference to `op_pcm_seek'
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld: (.text+0x52): undefined reference to `op_pcm_tell'
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld: (.text+0x56): undefined reference to `op_pcm_seek'
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld: (.text+0x5a): undefined reference to `op_pcm_tell'
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld: (.text+0x62): undefined reference to `op_pcm_total'
/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/10.3.0/../../../../arm-vita-eabi/bin/ld: (.text+0x6e): undefined reference to `op_pcm_total'
collect2: error: ld returned 1 exit status
oleg-derevenetz commented 11 months ago

@Kiiro-Yakumo

I did two updates of Vita SDK across the day but it seems it's actually kinda worse now and it doesn't compile at all.

You need to add a few libs: #7486

Kiiro-Yakumo commented 11 months ago

@oleg-derevenetz this makes the compilation possible indeed. Good news, PS Vita emulator has sound now, I will quickly check just in case on PS Vita and PS TV to make sure it work on real hardware as well and I guess it can be closed as solved. Give me a minute or two, I will edit this post with the results. EDIT - I guess I should put it as a list: PS Vita emulator :ballot_box_with_check: PS TV :ballot_box_with_check: PS Vita :ballot_box_with_check:

I guess this solves the problem once and for all that is, up to next big revolution in the Vita SDK libraries :stuck_out_tongue: Slight offtopic - I wonder how come the same emoticon code (checkbox) displays sometimes differently...

oleg-derevenetz commented 11 months ago

I guess this solves the problem once and for all that is, up to next big revolution in the Vita SDK libraries 😛

Then we can close this issue, I believe.

I wonder how come the same emoticon code (checkbox) displays sometimes differently...

What do you mean?

Kiiro-Yakumo commented 11 months ago

@oleg-derevenetz That was the reason of so many edits in previous post by the way. I was typing the ":" in hope I can put a checkbox that way, copied it three times total to be sure they are all the same type, but after saving the post last one was for example more "blueish" than the others (or maybe first one). I have edited the post in hope I can fix this somehow and added some text, they are all the same again. A total of two such situations happened. I don't know maybe it was some interpretation error in the browser or whatnot. They are all the same type now so it's fine.