-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP,DRAFT] Fix disabled Music & sound crash #1050
base: master
Are you sure you want to change the base?
Conversation
OK, I tested a bit more and I'm hearing music & laser shooting sounds, also voice communications. But the two separate settings in config file are now broken, if you enable music, you'll also have sounds. But at least the crash is gone... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good, @vincele . Thanks for the PR. Tentatively approving, pending further testing.
I'll keep this as WIP until I understand why the "music off" option also disable the sounds. Either we want a single option or both should be properly working independently. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems reasonable; let's get this play tested to validate
72f2440
to
7e63edc
Compare
Issue is that audio system initialization order was not right and some audio processing was not properly guarded by checks. * `AUDInit()` returns a boolean value telling audio system initialization status, use that to set `g_game.sound_enabled` which is now used everywhere needed. This reflects either failures, or music & sound being disabled in the config file. Then only call the other initialization / close functions: * `initALRenderer()` * `Music::InitMuzak()` * `initSceneManager()` * `initScenes()` * `closeRenderer()` if the audio susbystem has been properly initialized Then the `initALRenderer()` function does not need to check for the sound system being enabled. Call `Music::InitMuzak()` after `initALRenderer()`, not sure if this is absolutely required, but seemed sensible anyways. Move the `Music::MuzakCycle()` function out of `bootstrap_draw()` into a more sensible place in `bootstrap_first_loop()`. Then guard: * `Music::MuzakCycle()` * `muzak->GotoSong()` with an `if (g_game.sound_enabled)` check. Remove the FIXME comment in OpenALRenderer.cpp `RendererData::suspend()` as the exception is not thrown there any more. Fixes issue: vegastrike#1040 Related issue: vegastrike#859 Signed-off-by: Vincent Legoll <[email protected]>
7e63edc
to
0f6ac8b
Compare
Still WIP, but slight progress:
|
Issue is that audio system initialization order was not right and some audio processing was not properly guarded by checks.
More details in the commit message.
Code Changes:
Issues:
On void-linux x86_64 musl libc, bare ALSA sound system (no pulseaudio, no pipewire, nor jack).
But music disabled & "All Sounds" enabled did not output anything, I don't know if this has been broken or if there are any sounds that should have been played...
Please test under windows, macos, and other linuxes...
Purpose:
What is this pull request trying to do?
What release is this for? Next one
Is there a project or milestone we should apply this to? Next one