Skip to content
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

fix(audio): review in/out device management and switching #15582

Conversation

prlanzarin
Copy link
Member

What does this PR do?

There's no rollback procedure in case a device switch fails right now,
nor does the code entrypoints that call the switching procedures wait
for resolution or failure before marking the new device as chosen. That
may cause inconsistent states in a couple of ways:

  • No rollback: switch fails, audio is still on but no actual
    microphone input is being transmitted
  • Not waiting for resolutions: inconsistent chosen devices on failures
    Device switching errors are also not surfaced to the end user

This commit:

  • Adds device rollback and proper resolution/failure response
    awaits to try and make the state a bit more consistent.
  • Centralizes the input device switching code to be reused between
    different bridges
  • Centralizes device ID state management in audio-manager to try and
    mantain them a bit more consistent across the board
  • Surface device switching failures to the end user
  • Guarantee device IDs are set to the session storage on all
    appropriate scenarios

Closes Issue(s)

Closes #

Motivation

In/out device changes are mostly silent which makes it hard to track
them to look for problems.
@prlanzarin prlanzarin force-pushed the u26/refactor/mic-inout-logs-26 branch from 3b9ca6b to d95f5d2 Compare August 23, 2022 17:02
@prlanzarin prlanzarin added this to the Release 2.6 milestone Aug 23, 2022
There's no rollback procedure in case a device switch fails right now,
nor does the code entrypoints that call the switching procedures wait
for resolution or failure before marking the new device as chosen. That
may cause inconsistent states in a couple of ways:
  - No rollback: switch fails, audio is still on but no actual
    microphone input is being transmitted
  - Not waiting for resolutions: inconsistent chosen devices on failures
Device switching errors are also not surfaced to the end user

This commit:
  - Adds device rollback and proper resolution/failure response
    awaits to try and make the state a bit more consistent.
  - Centralizes the input device switching code to be reused between
    different bridges
  - Centralizes device ID state management in audio-manager to try and
    mantain them a bit more consistent across the board
  - Surface device switching failures to the end user
  - Guarantee device IDs are set to the session storage on all
    appropriate scenarios
Extract the deviceId again from the stream to guarantee consistency
between stream DID vs chosen DID. That's necessary in scenarios where,
eg, there's no default/pre-set deviceId ('') and the browser's
default device has been altered by the user (browser default != system's
default).
@prlanzarin prlanzarin force-pushed the u26/refactor/mic-inout-logs-26 branch from d95f5d2 to ec1879f Compare August 24, 2022 14:39
@prlanzarin prlanzarin marked this pull request as ready for review August 24, 2022 14:43
@sonarcloud
Copy link

sonarcloud bot commented Aug 25, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@prlanzarin prlanzarin merged commit 9c4707b into bigbluebutton:v2.6.x-release Sep 9, 2022
@prlanzarin prlanzarin deleted the u26/refactor/mic-inout-logs-26 branch September 9, 2022 12:22
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.

None yet

1 participant