fix and optimize sounds and music (on macos?)#1216
Open
nnmrts wants to merge 2 commits intoSteamodded:mainfrom
Open
fix and optimize sounds and music (on macos?)#1216nnmrts wants to merge 2 commits intoSteamodded:mainfrom
nnmrts wants to merge 2 commits intoSteamodded:mainfrom
Conversation
Contributor
Author
|
This PR causes https://github.com/SiIvaGunner/qualatro to crash on start because of this: https://github.com/SiIvaGunner/qualatro/blob/3661d6472b83008a6d8ea3f7ff0e06aa122e4dff/lovely/Music.toml#L86-L252 |
Contributor
Author
|
Just pushed a commit to fix the qualatro crash. The fix is ugly, I know... |
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.
On MacOS, with enough mods enabled which load sounds and/or music, the game goes completely silent. I think I have tracked down the root issue for this: OpenAL has a maximum playing instances limit (see MonoGame/MonoGame#4403). And if I understood the code correctly, vanilla loads and plays all songs simultaneously and just changes the volume when switching from one song to another. This is fine for the limited songs in vanilla, but seemingly exhausts that OpenAL limit with mods. I couldn't find much more info on this, but this fix, to only load vanilla songs and the one
desired_trackactually needed, at least worked on my machine. 😝 This may cause either "unexpected" additional calls ofRESTART_MUSICor even delays, when a mod tries to play a song mid-game. But I guess that's better than silence.The
should_streamthing was my first attempt at fixing this when I first thought this was a memory issue...it still seems useful, because if I understood everything correctly, it should avoid sounds being fully decoded into memory in runtime. Feel free to remove it from this PR, if this is too out-of-scope.I tested neither of those on a Windows PC though, so I wouldn't merge this before checking that.
Additional Info: