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

Disable automatic device switching if user doesn't follow the system default device #694

Open
ChunMinChang opened this issue Mar 22, 2022 · 4 comments
Assignees

Comments

@ChunMinChang
Copy link
Member

To unblock BMO 1735201 and BMO 1238038, we should disable automatic device switching by default unless users ask to follow the system default device. That should be the default behavior in Firefox.

@ChunMinChang ChunMinChang self-assigned this Mar 22, 2022
@ChunMinChang
Copy link
Member Author

ChunMinChang commented Mar 22, 2022

To clarify a bit more, we should only switch devices automatically when user asks to use the system default device. Using the system default means that the users pass a NULL cubeb_devid in cubeb_stream_init.

@param input_device Device for the input side of the stream. If NULL the

@param output_device Device for the output side of the stream. If NULL the

If users pass a non-NULL cubeb_devid, then it's not the default device, even if the device happens to be the current system default device. User must pass NULL explicitly to follow the system default.

In brief, switching device or not can be summarized into the following situations:

For input stream:

device unplug input device unplug output device default input change default output change
default Yes N/A Yes N/A
non-default No N/A No N/A

For output stream:

device unplug input device unplug output device default input change default output change
default N/A Yes N/A Yes
non-default N/A No N/A No

For duplex stream:

device unplug input device unplug output device default input change default output change
default input, default output Yes Yes Yes Yes
default input, non-default output Yes No Yes No
non-default input, default output No Yes No Yes
non-default input, non-default output No No No No

@ChunMinChang
Copy link
Member Author

ChunMinChang commented Mar 23, 2022

I think it's a good time to revisit #167 again. I believe the WebRTC spec allow users to select the output device now: https://webrtc.github.io/samples/src/content/devices/input-output/, and Chrome has implemented that but we haven't. In addition, we need to support the setSinkId as well. We should check the WebRTC and setSinkId's spec and then think how we should handle the device-switching policy in cubeb. We also have a few special cases for the output device selection (e.g., Bluetooth Handsfree, Loopback). That's something we need to take into our consideration, and we need to document this policy somewhere.

@nathanzachary
Copy link

I think it's a good time to revisit #167 again. I believe the WebRTC spec allow users to select the output device now: https://webrtc.github.io/samples/src/content/devices/input-output/, and Chrome has implemented that but we haven't.

@ChunMinChang,
Looking at the WebRTC link that you provided, I can confirm that I am able to switch input and output devices in Chromium, but not in Firefox. There are some related Mozilla bugs that could be resolved with this implementation as well:

https://bugzilla.mozilla.org/show_bug.cgi?id=1650131
https://bugzilla.mozilla.org/show_bug.cgi?id=1716249

Is there any roadmap tracking the progress of implementing this WebRTC specification in Firefox that we can vote on and/or contribute to?

@nathanzachary
Copy link

Firefox only shows the 'default' input source:
firefox_webrtc_input_source




Chromium shows all four available input sources:
chromium_webrtc_input_sources

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

No branches or pull requests

2 participants