Hi,
I’ve been trying to track down some odd gameplay bugs with my Linux build when running on Steam Deck, and it appears to be caused by FMOD.
Essentially, I have two problems that I know of. The first is that my game hangs on exit. The second is that parts of the gameplay break because the Unity Mathf.Approximately function is broken. My theory is that something in FMOD is changing some FPU state or rounding mode or something along those lines.
To test this, I created a blank Unity project with a 3D text object in, and added this code to a script:
void Start()
{
float testFloat = 0f;
if (!Mathf.Approximately(testFloat, 0f))
{
GetComponent<TextMesh>().text = "0 is not approximately 0!";
}
else
{
GetComponent<TextMesh>().text = "0 is approximately 0!";
}
}
As you’d expect, running the project displays “0 is approximately 0!” on screen. Making a Linux build and running it on Steam Deck, I get the same correct output and the game exits when I alt-f4.
I then imported the FMOD package and rebuilt. Now, running on Steam Deck I get “0 is not approximately 0!” and the game hangs on exit. Note, I’m not calling any FMOD functions, just adding the package.
The somewhat odd thing is that running the same build on Ubuntu gives the correct result, and a clean exit. I also have no problems with Windows or console builds (or, indeed, running the Windows build on Steam Deck via Proton). So it’s a bit of an odd one.
I’m using FMOD 2.01.11 currently, with Unity 2020.3 (though I also tried the newest LTS Unity with the same results). I can supply repro projects and builds if needed.