Closed TwinFan closed 1 year ago
I could not recreate any problem. The error does not appear to me "just so".
I can certainly enforce it via debugger or by adding code that consciously passes non-unit length vectors to FMOD_System_Set3DListenerAttributes
, but all that happens then is as per design:
DEBUG
, another message is logged stating that the sound system has now been disabled
and otherwise everything just goes on as normal, no interruption to LiveTraffic's planes or X-Plane. Tested on Mac and Linux.Can only ask affected user to try a debug version that provokes the error to see if once it happens his system is freezing again.
Started a support thread for discussion with affected users. A xPilot user joined in with similar issue with xPilot, which also uses XPMP2, also tracked as xpilot-project/xpilot#137.
Turns out: It is not actually the error 36 itself that causes issues, but calling FMOD_System_Release
while handling the original error: Currently XPMP2 treats any error returned by the call to FMOD_System_Set3DListenerAttributes
as fatal and shuts down the sound system to avoid further errors. Only the shutdown actually causes the freeze.
The very same freeze happens during a normal exit of the plugin at the same place, ie. during the call to FMOD_System_Release
.
Users see a connection to the use of the PipeWire module (in absence of PulseAudio) in certain Linux distros. I still can't reproduce in a standard Ubuntu 22.04 installation and hence not confirm the suspicion.
Fix/Workaround: It's easy not to treat error 36 as a fatal error, so that no sound shutdown happens thereafter. We've tested that in an analysis version of LiveTraffic.
But I'm not convinced to remove the final call to FMOD_System_Release
during plugin shutdown, as that would mean not to properly clean up FMOD resources. So for the moment the few affected users might need to live with a freeze during shutdown if using XPMP2 sound.
Describe the bug User report: X-Plane froze, last line in log is
To Reproduce / Source Code Example Unclear. But can probably be forced in debugger by sending wrong coordinates into
FMOD_System_Set3DListenerAttributes
.Expected behavior
Version
Log.txt Log-Snd_Freeze.txt
Additional context Original user report is a comment to LiveTraffic. More discussion then tracked in a support thread.