steam-audio
steam-audio copied to clipboard
Unity - SetSpatializerFloat is a consistent source of crashing
I've still noticed crashes after the 4.0.2 patch was released. They were a lot more infrequent, but they're still there - in both builds and the editor. A sore spot seems to be switching levels. There's a much higher chance of a crash occurring there. Perhaps SteamAudio classes are initializing themselves in an unexpected order? Perhaps they are being used before being initialized, or before other classes they depend on are initialized?
Here are crash logs I recovered for the editor in which Steam Audio was the cause: crash.zip crash2.zip
Current unity version: 2021.3.1f1 Current steam audio version: 4.0.2
The changes from 4.0.2 to 4.0.3 don't seem to contain anything that'd address this crash; changes are to:
- README.md - Version bump.
- CMakeLists.txt - Android-specific compiler arguments added, version bump.
- build.py - Android-specific cmake arguments added.
- phonon_version.h - Version bump.
(Though "Performance improvement in Ambisonics Panning/Decode Effect" doesn't appear in the diffs either.)
See this bug report for more details others have reported: https://github.com/ValveSoftware/steam-audio/issues/169
Since getting a repro project seems to be difficult according to other users who have reported this issue, an alternative might be to create a branch where checks occur in the crashy spot, and then diagnostic information is provided when those checks detect something?
At the very least, a version with checks to prevent crashes would be preferred, even if there's some overhead involved.
The crash occurs when the RAM is full, most likely when the swap is activated
The crash occurs when the RAM is full, most likely when the swap is activated
Unlikely. I have 64 GB of RAM on my machine. 😎
For the sake of organization, I'll link the other two recently reported bugs that seem to deal with the same problem: https://github.com/ValveSoftware/steam-audio/issues/189 https://github.com/ValveSoftware/steam-audio/issues/185
The crash occurs when the RAM is full, most likely when the swap is activated
Unlikely. I have 64 GB of RAM on my machine. 😎
Do you have confidence that the memory did not run out at the time of the crash? There is a memory leak in Steam Audio and I can even play it.
Do you have confidence that the memory did not run out at the time of the crash? There is a memory leak in Steam Audio and I can even play it.
I currently pool most of the audio sources, and the pool is created at level start - which is when it sometimes crashes. BUT, it happens very early on, the first couple of level switches, so it is unlikely RAM ran out already. Plus, my computer runs like crap when the RAM runs out, and it is very noticeable when it happens (and I didn't notice it during the last crash); one of our devs is currently looking into memory without reporting dozens of GB of memory being taken up.
That being said, I'll keep an eye on RAM usage, but I doubt it is the cause.
Good find on the memory leak though. It is likely a problem we'd have to deal with anyway!
Replying to https://github.com/ValveSoftware/steam-audio/issues/198#issuecomment-1133063993
https://github.com/ValveSoftware/steam-audio/issues/199
I can confirm that the cause of the last crash wasn't due to out-of-memory, as I had more than half of my RAM available when it happened.
I've removed ALL instances of SteamAudioSource from our project. This seems to fix the crashing while still allowing audio sources to have ambisonic/holophonic spatialization. This obviously means certain features will not work, sadly.
Strangely though, after playing for a while, sometimes the audio will just stop. No sound. Until you restart the app. Better than crashing.
I've removed ALL instances of SteamAudioSource from our project. This seems to fix the crashing while still allowing audio sources to have ambisonic/holophonic spatialization. This obviously means certain features will not work, sadly.
Strangely though, after playing for a while, sometimes the audio will just stop. No sound. Until you restart the app. Better than crashing.
you can try to just comment out the lines from https://github.com/ValveSoftware/steam-audio/issues/199. and return some functions
you can try to just comment out the lines from #199. and return some functions
I'll try it at some point. Currently, we can't afford to have any crashes and this plugin just smells of bad null-checking coding hygeine - but it is an advertised feature, so we can't just remove it either.
I've removed ALL instances of SteamAudioSource from our project. This seems to fix the crashing while still allowing audio sources to have ambisonic/holophonic spatialization. This obviously means certain features will not work, sadly. Strangely though, after playing for a while, sometimes the audio will just stop. No sound. Until you restart the app. Better than crashing.
you can try to just comment out the lines from #199. and return some functions
Sorry, just to clarify, what do you mean by return some functions? I've been struggling with this error myself, and am not sure how to fix the issue with the memory allocation.
I've removed ALL instances of SteamAudioSource from our project. This seems to fix the crashing while still allowing audio sources to have ambisonic/holophonic spatialization. This obviously means certain features will not work, sadly. Strangely though, after playing for a while, sometimes the audio will just stop. No sound. Until you restart the app. Better than crashing.
you can try to just comment out the lines from #199. and return some functions
Sorry, just to clarify, what do you mean by return some functions? I've been struggling with this error myself, and am not sure how to fix the issue with the memory allocation.
a memory leak occurs in the reflection property. all other properties like occlusion, spatial, binaural, etc. will work correctly
We've just released Steam Audio 4.1.0, which includes various crash fixes: https://github.com/ValveSoftware/steam-audio/releases/tag/v4.1.0.
Try it out and let us know if these crashes persist in the new version.
We've just released Steam Audio 4.1.0, which includes various crash fixes: https://github.com/ValveSoftware/steam-audio/releases/tag/v4.1.0.
Try it out and let us know if these crashes persist in the new version.
the problem exists
We've just released Steam Audio 4.1.2, which contains a potential fix for this issue: https://github.com/ValveSoftware/steam-audio/releases/tag/v4.1.2. Try it out, and let us know if the issue persists.
Closing pending feedback.