Greetings,
I develop a third party viewer for Second Life and have been using FMOD for years in it.
With FMOD Studio, I am seeing some weird things happening under some Linux systems (so far, could only reproduce in Linux VirtualBox VMs configured to use ALSA as the audio back-end).
On these systems, while FMOD reports a successful initialization and opening of an ALSA output, no sound is produced at all, and when shutting down the application, FMOD stays stuck forever in FMOD::System::close(), waiting for a semaphore in libpthread’s sem_wait().
Here is the log and backtrace I get under gdb:
2020-11-06T21:50:56Z INFO: LLAudioEngine::init: Audio engine successfully initialized with 30 channels.
2020-11-06T21:50:57Z INFO: LLAudioEngine_FMOD::init: ALSA output initialized
2020-11-06T21:50:57Z INFO: LLAudioEngine_FMOD::init: FMOD device: default:CARD=Intel with parameters: 48000 Hz, 2 channels - Buffers: 4 * 1024 bytes - Latency: 85ms.
2020-11-06T21:50:57Z INFO: LLStartUp::startAudioEngine: Audio engine initialized.
…/… <-at this point I close the viewer application
2020-11-06T21:51:13Z INFO: LLStartUp::shutdownAudioEngine: Deleting existing audio engine instance
2020-11-06T21:51:13Z INFO: LLAudioEngine_FMOD::shutdown: Shutting down the audio engine…
2020-11-06T21:51:13Z INFO: LLAudioEngine_FMOD::shutdown: Closing FMOD Studio
…/…
2020-11-06T21:51:15Z INFO: ll_cleanup_apr: Cleaning up APR <-at this point the viewer finished cleaned up its structures and should exit
^C
Program received signal SIGINT, Interrupt.
0x0000003dbb40d8b0 in sem_wait () from /lib64/libpthread.so.0
(gdb) bt
#0 0x0000003dbb40d8b0 in sem_wait () at /lib64/libpthread.so.0
#1 0x00007ffff7598739 in () at /usr/local/CoolVLViewer-1.28.0/lib/libfmod.so.12
#2 0x00007ffff7597c47 in () at /usr/local/CoolVLViewer-1.28.0/lib/libfmod.so.12
#3 0x00007ffff7569097 in () at /usr/local/CoolVLViewer-1.28.0/lib/libfmod.so.12
#4 0x00007ffff758e2d6 in () at /usr/local/CoolVLViewer-1.28.0/lib/libfmod.so.12
#5 0x00007ffff7583e94 in FMOD::System::close() () at /usr/local/CoolVLViewer-1.28.0/lib/libfmod.so.12
#6 0x00000000011195de in LLAudioEngine_FMOD::shutdown() (this=) at indra/llaudio/llaudioengine_fmod.cpp:394
#7 0x00007fff00000000 in ()
#8 0x00007fffffffd890 in ()
#9 0x00000000026db910 in ()
#10 0x00007ffff6249a90 in ()
#11 0x0000000000d072d0 in LLStartUp::shutdownAudioEngine() () at indra/newview/llstartup.cpp:378
#12 0x00007fff00000000 in ()
#13 0x00007ffff62ab280 in ()
#14 0x00007ffff6249a90 in ()
#15 0x00007ffff6249a90 in ()
#16 0x00000000006984c3 in LLAppViewer::cleanup() (this=) at indra/newview/llappviewer.cpp:1961
#17 0x0000000000000000 in ()
(gdb) quit
To me, it feels a bit like if FMOD somehow queued the sounds for playback and was waiting for the queue to empty before closing down. Since no sound is output, it would wait forever…