Skip to content

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

Description

@ChunMinChang

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.

Activity

  1. self-assigned this
    on Mar 22, 2022
  2. ChunMinChang commented on Mar 22, 2022

    @ChunMinChang
    MemberAuthor

    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
  3. ChunMinChang commented on Mar 23, 2022

    @ChunMinChang
    MemberAuthor

    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.

  4. nathanzachary commented on Apr 10, 2024

    @nathanzachary

    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?

  5. nathanzachary commented on Apr 11, 2024

    @nathanzachary

    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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions