Bug 234595

Summary: Connecting a Bluetooth headset will cause iOS 15 Safari to play a very weird sound.
Product: WebKit Reporter: rychouwei
Component: WebRTCAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Critical CC: daginge, eric.carlson, nienkedekker, webkit-bug-importer, youennf, zale
Priority: P1 Keywords: InRadar
Version: Safari 15   
Hardware: iPhone / iPad   
OS: iOS 15   
Attachments:
Description Flags
screen record(sounds like a baby)
none
screen record(sounds like a monster)
none
Chipmunk voice none

Description rychouwei 2021-12-22 01:11:46 PST
Created attachment 447785 [details]
screen record(sounds like a baby)

Two cases, one sounds like a baby, another sounds like a monster.
Devices: iOS 15.2 Safari, iPhone 12.

Steps to reproduce:
Baby voice:
1. Open this sample(https://sdk-web-1252463788.cos.ap-hongkong.myqcloud.com/trtc/webrtc/test/rychou-test/webrtc-samples/audio/index.html) on iOS Safari.
2. Connect a bluetooth headset.
3. Close Safari and reopen it.
4. Click "start" to capture microphone and play. Try to say something and you can hear your voice.
5. Disconnect bluetooth headset, then audio will output from phone speaker.
6. Click "replay" to re-create audio element to replay audio.
7. Now, say something, your voice will sounds like a baby!

Monster voice:
1. Open this sample(https://sdk-web-1252463788.cos.ap-hongkong.myqcloud.com/trtc/webrtc/test/rychou-test/webrtc-samples/audio/index.html) on iOS Safari.
2. Don't connect bluetooth headset.
3. Close Safari and reopen it.
4. Click "start" to capture microphone and play. Try to say something and you can hear your voice.
5. Connect a bluetooth headset, then audio will output from bluetooth headset.
6. Click "replay" to re-create audio element to replay audio.
7. Now, say something, your voice will sounds like a monster!

Sample source code: https://github.com/Rychou/samples/blob/gh-pages/src/content/getusermedia/audio/index.html
Comment 1 rychouwei 2021-12-22 01:12:37 PST
Created attachment 447786 [details]
screen record(sounds like a monster)
Comment 2 Radar WebKit Bug Importer 2021-12-22 11:59:11 PST
<rdar://problem/86820817>
Comment 3 ztb 2022-01-04 19:19:35 PST
I too am hitting both of these bugs consistently and wondering if there is a fix and/or known workaround as this is a show stopper bug for iOS and WebRTC using bluetooth?
Comment 4 nienke 2022-01-05 01:33:39 PST
We are running into the same issue.

Steps to replicate:

1. Go to [https://codepen.io/daginge/full/abLKZQZ](https://codepen.io/daginge/full/abLKZQZ)
2. Click ‘Get Permissions’, make sure AirPods are the selected audio device
3. Click ‘Start Call’ and verify AirPods are working by saying something
4. Hang up
5. Remove AirPods, click ‘Start Call’
6. Try saying something, you voice will sound very high-pitched (like a chipmunk).
7. Refresh the page, and try starting a call again: the chipmunk voice should still be there.

The only way to get rid of the chipmunk is by killing Safari. If you do that and then go back to the CodePen and start a call, the voice is normal.

I've tested this on the 15.3 beta:
Device: iPad Air, 4th gen (A2316)
OS: 15.3 (19D5026g)

And on iOS 15.2:
Device: iPhone 11
OS: 15.2 (19C56)
Comment 5 nienke 2022-01-05 01:36:28 PST
Created attachment 448368 [details]
Chipmunk voice
Comment 6 Eric Carlson 2022-01-05 10:30:36 PST
This should be fixed by the changes for bug 232822

*** This bug has been marked as a duplicate of bug 232822 ***