Bug 262569 - REGRESSION (iOS 17): mediaDevices.enumerateDevices() breaks audio
Summary: REGRESSION (iOS 17): mediaDevices.enumerateDevices() breaks audio
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari 17
Hardware: iPhone / iPad iOS 17
: P2 Major
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-10-03 14:19 PDT by evancarlson
Modified: 2023-10-11 03:01 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description evancarlson 2023-10-03 14:19:31 PDT
This is a regression between iOS 16 and iOS 17. 

It appears that when the microphone is disabled and mediaDevices.enumerateDevices() is called, audio only comes from the call speaker on the top of the phone (making it very hard to hear). 

Prior to iOS 17, audio came from both the call speaker on the top of the phone and from the device speakers on the bottom of the phone.

Minimal Repro:
1. Add an audio element to the "choose camera, microphone and speaker" demo: https://webrtc.github.io/samples/src/content/devices/input-output/
2. Set the audio constraint to false
3. Open the camera and play audio

This is impacting live web experiences for Sesame Street, Kraft, Pandora, & more.
Comment 1 Radar WebKit Bug Importer 2023-10-03 16:44:24 PDT
<rdar://problem/116433066>
Comment 2 youenn fablet 2023-10-06 02:01:08 PDT
Can you be more specific about the repro steps.
I wrote https://codepen.io/youennf/pen/jOXQZEo to try reproducing.

In this webpage, I did the following:
1. click play (get some audio playing)
2. click enumerate (to call enumerateDevices).
3. Observe whether there is a change of audio.

I was not able to reproduce the issue with these 3 steps so far.

Is there a step where camera capture should also happen?
Which iOS device are you using for testing?
Comment 3 evancarlson 2023-10-06 13:25:32 PDT
Yes, I can reproduce the issue on the codepen with the following steps:

1. Click enumerate
2. Click start camera
3. Play audio

Note that if you skip step one, the audio plays as expected.

iOS 17.0.3, iPhone 12 Pro Max
Comment 4 youenn fablet 2023-10-09 05:12:36 PDT
I was able to reproduce as well with:
1. Click enumerate
2. Click start camera
3. Click enumerate
4. Play audio

The issue is probably that the auxiliary unit stays live while it should be stopped.
Comment 5 youenn fablet 2023-10-09 06:16:15 PDT
Pull request: https://github.com/WebKit/WebKit/pull/18835
Comment 6 EWS 2023-10-11 03:01:32 PDT
Committed 269196@main (1bf29719b104): <https://commits.webkit.org/269196@main>

Reviewed commits have been landed. Closing PR #18835 and removing active labels.