As I finally managed to get sound working in DF v0.31.18 under Linux/KDE, I thought I'd post the instructions here for others to find.
As it happens, there were two problems. The first was the DF wasn't loading the OpenAL libraries, giving an annoying dialog box and the following messages to the console:
Dynamically loading the OpenAL library failed, disabling sound
Initializing OpenAL failed, no sound will be played
Using the instructions from
this thread, I solved the problem like this:
$ ln -s /usr/lib/libsndfile.so.1 df_linux/libs/libsndfile.so
$ ln -s /usr/lib/libopenal.so.1 df_linux/libs/libopenal.so
The second problem was that OpenAL was picking PulseAudio instead of ALSA as the output device, and failing for some reason like this:
Sound devices available:
PulseAudio Software
ALSA Software
OSS Software
Picking PulseAudio Software. If your desired device was missing, make sure you have the appropriate 32-bit libraries installed. If you wanted a different device, configure ~/.openalrc appropriately.
Initializing OpenAL failed, no sound will be played
Annoyingly, while the message suggests editing .openalrc,
that doesn't actually do anything.
Apparently, that config file is no longer used in modern versions of OpenAL. Or something. What did work, however, was:
$ echo "drivers = alsa," > .alsoftrc
Now OpenAL is using ALSA, and I can listen to the relaxing plink-plonk of the DF theme to my heart's content.