Chrome should set media.role=phone when recording audio
Reported by
asweintr...@gmail.com,
Jul 20 2017
|
|||||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.66 Safari/537.36 Example URL: hangouts.google.com Steps to reproduce the problem: 1. Pair a set of bluetooth headphones that support both A2DP and HFP/HSP. Leave them in A2DP mode. 2. Open a webpage in Chrome that needs to use the microphone such as a Hangouts call What is the expected behavior? Bluetooth headphones automatically switch to HFP/HSP mode when the microphone is activated in Chrome. PulseAudio 10 supports automatic switching when an application recording stream has media.role=phone. https://www.freedesktop.org/wiki/Software/PulseAudio/Notes/10.0/ What went wrong? Bluetooth headphones stay in A2DP mode, meaning the microphone is unusable until the bluetooth profile is manually switched. Did this work before? No Is it a problem with Flash or HTML5? HTML5 Does this work in other browsers? Yes Chrome version: 60.0.3112.66 Channel: beta OS Version: Debian Testing Flash Version: Shockwave Flash 26.0 r0 Contents of chrome://gpu:
,
Jul 31 2017
,
Sep 13 2017
,
Sep 14 2017
,
Nov 14 2017
,
Mar 20 2018
,
Mar 20 2018
asweintraub: My understanding is that your BT microphone can't be used. If you (manually) switch to HFP/HSP it starts working. Is this correct? Switching profile should not be necessary in order for the mic to work. (It's been supported in PulseAudio only for around a year.) Interesting though that switching profile makes the mic start working. It would be great to have a repro case to look closer at. What device did you use? Also - does this repro with the latest Chrome release?
,
Mar 20 2018
That said, it might also make sense to switch to HFP/HSP regardless of this.
,
Mar 20 2018
> My understanding is that your BT microphone can't be used. If you (manually) switch to HFP/HSP it starts working. Is this correct? This is correct. See below for explanation. > Switching profile should not be necessary in order for the mic to work. (It's been supported in PulseAudio only for around a year.) Interesting though that switching profile makes the mic start working. This is a limitation of Bluetooth and is completely expected. There are a number of different Bluetooth profiles that support different capabilities. The relevant profiles are these: * A2DP: Supports high-bitrate _unidirectional_ audio. This is suitable for listening to music, but since audio is unidirectional, the microphone is disabled. * HFP/HSP (technically two different profiles, but the limitations are similar): Supports bi-directional audio, but at a low bitrate. The audio quality is sufficient for phone calls, but listening to music while using HFP/HSP is painful. Most operating systems (macOS, Windows, Android, iOS, etc) default to A2DP in order to provide a good listening experience, but will automatically switch to HFP/HSP when the microphone is required and/or a phone call is started. Again, this is necessary since A2DP only provides unidirectional audio. Pulseaudio on Linux is gaining support for automatic switching as well to support the same use cases as other operating systems. Pulseaudio 10.0 added the auto_switch parameter to module-bluetooth-policy (prior to this, manual profile switching was necessary). When enabled, Pulseaudio will detect when audio streams with media role set to "phone" are created and automatically switch Bluetooth sinks to HFP/HSP in order to support the microphone. When those streams are destroyed, Pulseaudio switches back to A2DP for better audio quality. Pulseaudio 11 adds support for auto_switch=2 (which is not the default on most distros AFAIK), which allows Pulseaudio to switch Bluetooth sinks to HFP/HSP when it detects any recording (input) stream and switch back to A2DP when that recording stream is destroyed. On my Linux computer that has Pulseaudio 11, I've enabled this option, and it works properly with Chrome. > It would be great to have a repro case to look closer at. What device did you use? Pick any Bluetooth device with a microphone :) (I've tried several). You might need to manually select A2DP in audio or Bluetooth preferences since sometimes headsets don't default to A2DP. It helps to play music and manually switch between the two profiles so you can hear the difference in audio quality. > Also - does this repro with the latest Chrome release? I've enabled auto_switch=2, and haven't tested with auto_switch=1 (the pulseaudio 10.0 option that requires media role = phone). I'll report back after testing with the old option.
,
Mar 20 2018
> That said, it might also make sense to switch to HFP/HSP regardless of this. Please don't do this. The audio quality of HFP/HSP is not sufficient for most applications.
,
Mar 20 2018
I just confirmed that I can still reproduce this issue on Chrome Version 66.0.3359.33 (Official Build) beta (64-bit). Bluetooth headsets will switch to HFP/HSP automatically if auto_switch=2, but not if auto_switch=1.
,
Mar 20 2018
One last comment. The documentation for how to set the media role is here: https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/Developer/Clients/ApplicationProperties/
,
Mar 21 2018
Re #9: Thanks for the great run-through. I wasn't aware that A2DP was unidirectional. So this means that on Linux you always have to (and always have had to) switch profile manually when using a BT headset to get the Mic to work. Re #10: No, I didn't mean permanently. I meant to set the role as you suggest to let PulseAudio switch automatically, regardless of if there's another issue or not. (Which there doesn't seem to be.) It should make sense to set the role. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by ajha@chromium.org
, Jul 21 2017Labels: TE-NeedsTriageFromMTV