Skip to content

fix and optimize sounds and music (on macos?)#1216

Open
nnmrts wants to merge 2 commits intoSteamodded:mainfrom
pumpncode:sound-fixes
Open

fix and optimize sounds and music (on macos?)#1216
nnmrts wants to merge 2 commits intoSteamodded:mainfrom
pumpncode:sound-fixes

Conversation

@nnmrts
Copy link
Contributor

@nnmrts nnmrts commented Feb 18, 2026

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_track actually needed, at least worked on my machine. 😝 This may cause either "unexpected" additional calls of RESTART_MUSIC or even delays, when a mod tries to play a song mid-game. But I guess that's better than silence.

The should_stream thing 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:

  • I didn't modify api's or I've made a PR to the wiki repo.
  • I didn't modify api's or I've updated lsp definitions.
  • I didn't make new lovely files or all new lovely files have appropriate priority.

@nnmrts
Copy link
Contributor Author

nnmrts commented Feb 18, 2026

@nnmrts
Copy link
Contributor Author

nnmrts commented Feb 18, 2026

Just pushed a commit to fix the qualatro crash. The fix is ugly, I know...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant