View Issue Details

IDProjectCategoryView StatusLast Update
0012781Dwarf FortressTechnical -- Soundpublic2024-10-13 09:46
Reportergf222 Assigned To 
PrioritylowSeveritymajorReproducibilityalways
Status newResolutionopen 
Product Version50.12 
Summary0012781: No music while playing the game on Linux
DescriptionOn DF 50.12 on Linux (Ubuntu version 22.04.4 LTS), there is no audio after starting a game and loading into a fortress. There is music in the main menu and while the game loaded, but as soon as the game loads into a fortress, there is no audio at all, even while doing nothing for a few minutes. Pressing ESC and going into the menu while in a fortress shows the track playing as "Classic DF Title Theme - Tarn Adams." But, there is no audio. This happens every single time the game opens.

I tried to tab out of the the game to test if the audio was still working on my pc while the game is running, and it was.

This was a completely unmodded game with no modifications.

Just something to add: I have never played DF before and this was done at the request at someone else.
Steps To Reproduce1. Install the packages SDL2, SDL2_image, SDL2_mixer as well as DF 50.12 on an Ubuntu or Debian Linux installation
2. Open the game, and start a fortress, and there will be no sound in game
Additional InformationThis was tested on a completely fresh Ubuntu installation (version 22.04.4 LTS) on a PC with an i9 and a RTX 2080 Ti. The audio worked perfectly fine on the computer, and this was tested using YouTube on Firefox with cheap USB headphones. The only changes I made to the base Ubuntu installation were installing SDL2 packages (SDL2, SDL2_image, SDL2_mixer). The audio servers seemed to be ALSA and PulseAudio, the Ubuntu defaults. I tried removing the files libfmod_plugin.so and libfmod.so.13 from the DF directory at the suggestion of someone else, but there still was no audio.


When launching the game, the terminal spat this out:
Loading audio...libfmod.so.13: cannot open shared object file: No such file or
directoryFailed to load fmod, trying SDL_mixer...Audio loaded successfully!Loading
bindings from prefs/interface.txt
Loading bindings from data/init/interface.txt
Unknown binding: UNITLIST_SORT_PROFA
Unknown binding: UNITLIST_SORT_PROFB
Broken unicode: [KEY:{]
Broken unicode: [KEY:|]

(The broken unicode thing continued for a long time)
Tagssound

Activities

GrantMoyer

2024-10-13 09:46

reporter   ~0042398

For any end users stumbling upon this issue, you can work around it for now by putting `LD_PRELOAD=libfmod.so.13 %command%` into Dwarf Fortress'es launch options under the game properties.

---

I see this same issue in 50.14 on Arch Linux. However, if I LD_PRELOAD the libfmod.so.13 packaged with Dwarf Fortress to force it to load before the game, the *audio* does work. Based on this, I took an strace of launching the game, and it reveals an issue:

    openat(AT_FDCWD, "/home/wsltoad/.vs/dwarves/fmod/lib/x86_64/glibc-hwcaps/x86-64-v4/libfmod.so.13",
  365│O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

Dwarf Fortress is trying to load the library from various development and system directories, but not from the installation directory. It looks like the Dwarf Fortress binary has an absolute path to a development directory as an rpath instead of a relative directory. From readelf -d dwarfort:

    0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN:/home/wsltoad/.vs/dwarves/steam]

Add Note

Note

Issue History

Date Modified Username Field Change
2024-04-18 08:45 gf222 New Issue
2024-04-18 08:45 gf222 Tag Attached: 50.12
2024-04-18 08:45 gf222 Tag Attached: 64-bit
2024-04-18 08:45 gf222 Tag Attached: sound
2024-08-22 22:25 lethosor Tag Detached: 64-bit
2024-08-22 22:25 lethosor Product Version 50.11 => 50.12
2024-08-22 22:25 lethosor Tag Detached: 50.12
2024-10-13 09:46 GrantMoyer Note Added: 0042398