wasapi: Trigger device reconfig if the audio session is disconnected.#834
Open
wasapi: Trigger device reconfig if the audio session is disconnected.#834
Conversation
Listen for IAudioSessionEvents::OnSessionDisconnected and direct disconnection notifications to the reconfigure_event to ensure streams reconfigure rather than freezing in WFMO when the audio session is disconnected.
0b581c3 to
388d39c
Compare
Collaborator
|
It doesn't seem enough but we should probably take this anyway. What's a WFMO? |
Collaborator
Author
|
Sorry, by WFMO I mean WaitForMultipleObjects, where we get stuck in the render loop if we don't notice the device has gone and stop being woken up by the OS. |
Collaborator
Author
|
I think this is a good fix to have, but I'll hold off landing until BMO 2011578 is understood. |
Stop() on the stream we're switching away from can return S_FALSE in some situations, resulting in a failure to start the stream we're switching to. The was_running check was made obsolete by the introduction of the stm->active check anyway, which better represent the running state of the stream from the API caller's perspective.
Collaborator
Author
|
@padenot I'm pretty confident the second commit fixes this, please review that one. I'll keep the IAudioSessionEvents::OnSessionDisconnected change despite it not being relevant for this particular bug since it's something we should be handling anyway and may fix some older bugs we have on file. |
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.
Listen for IAudioSessionEvents::OnSessionDisconnected and direct disconnection notifications to the reconfigure_event to ensure streams reconfigure rather than freezing in WFMO when the audio session is disconnected.
This is intended to fix BMO 2011578.