Bug 235713

Summary: [macOS] Acquiring stream from one microphone breaks all previous streams from another microphones
Product: WebKit Reporter: ivan.zahrodskyi
Component: WebRTCAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Critical CC: olena.bezkrovna, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: Mac (Intel)   
OS: macOS 12   
Attachments:
Description Flags
Example to reproduce this problem none

ivan.zahrodskyi
Reported 2022-01-27 06:54:21 PST
I want to get several audio MediaStreams from different mics, but getting new stream breaks previous. To reproduce this we need machine with 2 microphones connected. Steps: 1) get stream from first microphone (str1) 2) attach this stream to some audio node (or put to peer connection) 3) get another stream from second microphone (str2) actual result: observe that str1 now starts playing audio from second microphone some code example to try this //******************************// //get all available microphones let devices = await navigator.mediaDevices.enumerateDevices(); let microphones = devices.filter(d => d.kind === 'audioinput'); //get audio from first microphone let str1 = await navigator.mediaDevices.getUserMedia({audio: {deviceId: microphones[0].deviceId}}); //play first stream let audio = new Audio(); audio.srcObject = str1; audio.play(); //get audio from second microphone let str2 = await navigator.mediaDevices.getUserMedia({audio: {deviceId: microphones[1].deviceId}}); //observe that audio now starts playing audio from second microphone (not from str1) //******************************//
Attachments
Example to reproduce this problem (2.04 KB, text/html)
2022-12-03 13:43 PST, ivan.zahrodskyi
no flags
Radar WebKit Bug Importer
Comment 1 2022-02-03 06:55:17 PST
youenn fablet
Comment 2 2022-02-07 11:22:29 PST
Can you clarify which platform/application is the target for this request? Is it MacOS? iOS? Safari?
olena.bezkrovna
Comment 3 2022-03-16 08:36:24 PDT
(In reply to youenn fablet from comment #2) > Can you clarify which platform/application is the target for this request? > Is it MacOS? iOS? Safari? The issue was updated (problem was observed on macOS 12, 11 on Safari 15)
ivan.zahrodskyi
Comment 4 2022-12-03 13:43:01 PST
Created attachment 463876 [details] Example to reproduce this problem Issue is still reproducible I tested on MacBook Pro 16 (2019) MacOS 13.1 Beta (22C5059b) Safari Version 16.2 (18614.3.7.1.3) I created small example. - press GET FIRST - make sure you can hear audio from first microphone - select another microphone in second select - press GET_SECOND after getting second microphone - first is lost you can open console and see that stream1 is not active and audio track has readyState === 'ended' this is in 90% tries..but sometimes first track is still active but audio source is wrong (audio plays from second microphone) In our application there is a case when we have 2 different audio from different microphones which we send via webrtc to remote participants. But because of this issue it doesnt work in safari.
Note You need to log in before you can comment on or make changes to this bug.