WebRTC - Automatic Ear Detection freezes realtime (unbuffered) video, confusing users
Categories
(Core :: WebRTC: Audio/Video, defect, P2)
Tracking
()
People
(Reporter: jib, Assigned: alwu)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
+++ This bug was initially created as a clone of Bug #1688981 +++
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36
Steps to reproduce:
- Open one (or both) of the following webRTC test pages in Firefox with Airpods connected: https://webrtc.github.io/test-pages/src/single-audio/ or https://webrtc.github.io/test-pages/src/audio-and-video/
- Remove your Airpods from your ears
and put them back in their case, effectively disconnecting that audio source
Actual results:
- Video freezes
Expected results:
- Video should not freeze
Reporter | ||
Comment 1•4 years ago
|
||
When I did a mozRegression on Mac, it failed with "Unable to find enough data to bisect" here:
Tested mozilla-central build: 2020-01-03 (verdict: b)
Tested mozilla-central build: 2020-01-02 (verdict: g)
Also the detail behaviors are interesting. First the OS:
- When I take the airpods out of my ears, macOS switches output to speakers, but airpod mic remains hot (tap them together)
- When I put them back in my ears, macOS switches output back to airpods
- When I put them in the case, the airPod microphone turns off
In the bad (b) build:
- Video freezes as soon as I take the airPods out of my years (suggesting this is tied to output?)
- If I put them back into my ears, the video resumes (!)
- If I take them out again the video freezes again
- If I put them in the case, the microphone track ends ("ended" printed on screen)
In the "good" (g) build:
- Video keeps playing when I take the airPods out of my years, airpod mic remains hot (tap them together)
- If I put them in the case, the microphone track ends ("ended" printed on screen)
Reporter | ||
Comment 2•4 years ago
|
||
Interestingly, the video freezes and resumes exactly the same way in Safari (14.0.2 and 14.1). Chrome does not freeze. 🤷🏼♂️
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 3•4 years ago
|
||
Turns out this is Automatic Ear Detection 😆
Alastor, is this expected behavior?
Seems confusing for real-time (unbuffered) media like a web conference. Maybe even a potential privacy issue if someone thinks they're muted in this case, when the other party can still see and hear them (verified with https://jsfiddle.net/jib1/r9x5tchq/show in two browser windows).
Should we perhaps limit this to non-realtime (as in buffered) media, like YouTube?
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 4•4 years ago
|
||
(verified with https://jsfiddle.net/jib1/r9x5tchq/show in two browser windows)
Note it only pauses unmuted video elements, which was a clue. If I turn off auto ear detection they don't pause either.
I'm going to guess media controller here, either bug 1606588 or bug 1571493 from the patchlog.
Comment 5•4 years ago
|
||
The only downside I can really think of if we constrain MediaController pausing to only apply to non-MediaStream media providers is that the OS might automatically switch to speakers which start blaring something from an ongoing call or webrtc-based broadcast.
Updated•4 years ago
|
Assignee | ||
Comment 6•4 years ago
|
||
I don't have Airpods , so I'm not able to test that. But could you help me confirm that if the media element was paused by here? If so, we can simply add a constraint to avoid the media with real-time streaming won't be affected by media control.
(In reply to Andreas Pehrson [:pehrsons] from comment #5)
The only downside I can really think of if we constrain MediaController pausing to only apply to non-MediaStream media providers is that the OS might automatically switch to speakers which start blaring something from an ongoing call or webrtc-based broadcast.
Will Airpods automatically get disconnected from computer by Automatic Ear Detection? It sounds like that it just sends a media key singal to pause media, but it still keep connecting, which means the sound would still be sent to Airpods?
Comment 7•4 years ago
|
||
(In reply to Alastor Wu [:alwu] from comment #6)
Will Airpods automatically get disconnected from computer by Automatic Ear Detection? It sounds like that it just sends a media key singal to pause media, but it still keep connecting, which means the sound would still be sent to Airpods?
Could very well be. ni? jib to check that and the confirmation.
Reporter | ||
Comment 8•4 years ago
|
||
(In reply to Alastor Wu [:alwu] from comment #6)
I don't have Airpods , so I'm not able to test that. But could you help me confirm that if the media element was paused by here?
Confirmed in the debugger.
If so, we can simply add a constraint to avoid the media with real-time streaming won't be affected by media control.
WFM, but see below.
(In reply to Andreas Pehrson [:pehrsons] from comment #5)
The only downside I can really think of if we constrain MediaController pausing to only apply to non-MediaStream media providers is that the OS might automatically switch to speakers which start blaring something from an ongoing call or webrtc-based broadcast.
This is what happens in Chrome, which appears to have this exception for MediaStreams AFAICT. That is: ear detection still affects Youtube in Chrome, but not the demo links in comment 0 which causes audio redirected to speakers, thanks to macOS.
It's bad for those local-loop demos, and causes microphone feedback.
But demos aside, and for real WebRTC calls, this doesn't seem terrible at all. I mean I clearly can't "pause" my other participants from speaking, and having them muted by this action seems surprising. — I think I would still expect to hear them talking if I take off my AirPods mid-call. That others can hear them now even seems like a feature. I think that's the right action, and is what would happen if I finished putting them in the case anyway, or if I was using and disconnecting any other brand of headsets. If that's undesirable, I can mute the tab.
Will Airpods automatically get disconnected from computer by Automatic Ear Detection? It sounds like that it just sends a media key singal to pause media, but it still keep connecting, which means the sound would still be sent to Airpods?
The AirPods overall remain connected, and the AirPod microphone is still active, but macOS instantly redirects sound output to the MacBook Pro Speakers. E.g. With comment 0 in Chrome, if I remove the AirPods and click them together, I hear clicking sounds coming out of the laptop speakers.
Reporter | ||
Comment 9•4 years ago
|
||
I'm marking this S2 since it represents a regression in behavior from the view of an end-user (i.e. the introduction of a desirable feature extended too far to cover areas where it is not desirable).
Reporter | ||
Comment 10•4 years ago
|
||
[Tracking Requested - why for this release]: Not a major issue, just causing some confusion for AirPod users in web conferencing.
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Comment 11•4 years ago
|
||
S3 and longstanding issue, doesn't sound like I need to track for 87.
Reporter | ||
Comment 12•4 years ago
|
||
we can simply add a constraint to avoid the media with real-time streaming won't be affected by media control.
Sounds like this is what we need to do (I assume you mean a condition, not a constraint). Where exactly would this go?
Let me know if you need help testing this.
Reporter | ||
Comment 13•4 years ago
|
||
Would it be possible to leave other volume controls alone, by narrowly only defeating the video pausing? This seems like it would achieve parity with Chrome here.
Assignee | ||
Comment 14•4 years ago
|
||
Sorry, I will start working this in next Fx release. But I'm not sure how to determine if the input stream is from real time media or not, (eg. input media stream can be captured from another media element), do we have any way to distinguish them?
Comment 15•4 years ago
|
||
(In reply to Alastor Wu [:alwu] from comment #14)
(eg. input media stream can be captured from another media element)
In this case, for all intents and purposes, it's considered real-time.
Assignee | ||
Comment 17•4 years ago
|
||
Comment 18•4 years ago
|
||
Comment 19•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Comment 20•4 years ago
|
||
The patch landed in nightly and beta is affected.
:alwu, is this bug important enough to require an uplift?
If not please set status_beta
to wontfix
.
For more information, please visit auto_nag documentation.
Updated•4 years ago
|
Description
•