FS#75355 - [hedgewars] audio failure (game fails with error)

Attached to Project: Community Packages
Opened by Eduard de Jong (jongeduard) - Sunday, 17 July 2022, 17:03 GMT
Last edited by Felix Yan (felixonmars) - Friday, 16 September 2022, 17:51 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Felix Yan (felixonmars)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
Since a few days, Hedgewars stopped working on Arch Linux (I have multiple Arch systems on multiple machines, all have the same issue).

Additional info:
* package version(s):
- hedgewars version 1.0.0-303
- certain sdl2 packages got updated last days. My suspicion is that it has something to do with it.

Steps to reproduce:
1. Start the application: no music in the main screen.
2. Click to start a new quick game: no audio/music, and after a couple of seconds, the game terminates with an error popup that tells:
"Mix_LoadWAV_RW: Unrecognized audio format".
See the attached screenshot of this.

Note:
I have also a Fedora system installed. Hedgewars still works there.
So it looks like it might be an Arch specific issue. Not shure of course.
This task depends upon

Closed by  Felix Yan (felixonmars)
Friday, 16 September 2022, 17:51 GMT
Reason for closing:  Fixed
Additional comments about closing:  hedgewars 1.0.0-329
Comment by Eduard de Jong (jongeduard) - Tuesday, 19 July 2022, 17:00 GMT
Update: The actual crash turns out to occur when you start walking (so by using the arrow keys).

Anyone else playing this game on Arch Linux??? ;)
Comment by mpan (mpan) - Saturday, 30 July 2022, 22:26 GMT
To clarify: the nature of the bug has been determined instantly after it hit the repos and it comes from SDL_mixer (extra/sdl2_mixer in Arch) changing⁽¹⁾ the default backend from libvorbis to std_vorbis⁽²⁾. The problem can currently be trivially circumvented by rebuilding sdl2_mixer with libvorbis as the backend, by using `--disable-music-ogg-stb --enable-music-ogg-vorbis` options in configure invocation.

Due to presence of a clean temporary solution, no reports available yet from other distros, no clear indication⁽³⁾ of which project is at fault (SDL, Hedgewars or Arch), and meatspace turbulence I did not seek to progress beyond determining what’s written above. While no official bug report has been opened yet, #hedgewars@Libera is aware of the situation.

The bug manifests itself much earlier than starting the game engine. Just without a crash. Hedgewars will silently fail to load Vorbis sounds in the menu, rendering it — no pun intended — silent.

____
⁽¹⁾ https://github.com/libsdl-org/SDL_mixer/releases/tag/release-2.6.1
⁽²⁾ https://github.com/nothings/stb/blob/master/stb_vorbis.c
⁽³⁾ A rough and quick test indicated that the std_vorbis backend itself seems to be functional, so it’s not as simple as pointing a finger at the module.
Comment by mpan (mpan) - Sunday, 31 July 2022, 13:47 GMT
I tested both backends with almost⁽¹⁾ all games in official Arch repos that depend on sdl2_mixer and have Vorbis files. blobwars, singularity, renpy-demos, wesnoth and widelands seem to work. I also managed to play a certainly failing Hedgewars sound in Wesnoth with no error, while Hedgewars failed to play a file from Wesnoth.

This seems to be narrowing the case to Hedgewars code. And code only, as it’s not dependent on its data files. Can someone confirm or deny existence of the bug on another distro with SDL_mixer 2.6.0?
____
⁽¹⁾ community/naev being the sole exception due to a conflict between openblas it requires and blas on my system.
Comment by Toolybird (Toolybird) - Sunday, 07 August 2022, 21:42 GMT
Good troubleshooting so far. Definitely seems like it should be reported to hedgewars upstream.
Comment by mpan (mpan) - Saturday, 13 August 2022, 19:37 GMT
If anyone is wishing to look into that: consider poking around PhysFS bridge on the Pascal side. After talking with upstream, currently it seems the most likely culprit.
Comment by Daniel (Daniel.alomar) - Wednesday, 17 August 2022, 08:51 GMT
Same issue on Manjaro Linux. Disabling audio and music I can play. Waiting for a fix.. :-)
Comment by Daniel (Daniel.alomar) - Wednesday, 17 August 2022, 09:37 GMT
Same issue on Manjaro Linux. Disabling audio and music I can play. Waiting for a fix.. :-)
Comment by Louis Sautier (sbraz) - Tuesday, 23 August 2022, 20:50 GMT
Hi, I couldn't find an upstream report so I made one: https://issues.hedgewars.org/show_bug.cgi?id=839
Comment by mpan (mpan) - Wednesday, 24 August 2022, 19:38 GMT
nemo has requested⁽¹⁾ a rebuild with `-DBUILD_ENGINE_C=1`. That is supposed to “[fire] off unc0rr's haskell parser that transforms the pascal sources into C files, then compiles with clang” and eliminate Pascal compiler from the view.
____
⁽¹⁾ https://issues.hedgewars.org/show_bug.cgi?id=839#c1
Comment by mpan (mpan) - Wednesday, 14 September 2022, 04:11 GMT
A fix is available upstream.⁽¹⁾ That will be included in the 1.0.1 release.
____
⁽¹⁾ https://hg.hedgewars.org/hedgewars-draft/rev/fcea0f51d94f
Comment by Felix Yan (felixonmars) - Wednesday, 14 September 2022, 19:29 GMT
Applied the patch in hedgewars 1.0.0-329 and verified that it fixes the audio issue for me. Please give it a try.
Comment by Eduard de Jong (jongeduard) - Friday, 16 September 2022, 13:06 GMT
Coming back here because I just noticed that Hedgewars works again on Arch! Thank you!! :)
Comment by mpan (mpan) - Friday, 16 September 2022, 17:38 GMT
Thanks, Felix. Seems to be working here (1.0.0-330).

Loading...