Repository navigation
Conversation
FMOD loads sounds asynchronously, on a thread of its own, and it takes a while after launching for it to get through all of them. Quitting before then had the audio system get released with sounds still loading (around 980 of them one sim update into an Activity launched straight into), which every so often crashed on that thread. AudioMan now waits for the loading to finish before it releases the audio system. That only takes any time when quitting that soon after launching, and then a second or two. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d on Waiting for FMOD to be done loading sounds before releasing the audio system was done by checking each sound's state in a loop, sleeping in between. FMOD does that waiting itself when a sound that is still being loaded gets released, and it wants all sounds released before the audio system anyway, which was never done. So the sounds get released now, and the loop is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Got a more sensible solution instead of the hack sleep that Claude initially used. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FMOD loads sounds asynchronously, on a thread of its own, and it takes a while after launching for it to get through all of them. This would cause a crash if the game exited soon after launch.
Claude used a literal sleep here, which feels ugly (we don't have a promise to wait on from FMOD?) but I don't care because this is such an edge case.