One of our (twilio) customers noticed this bug. They found it on iOS 15.4, but I see that we can reproduce it on Safari 15.4 running on MacOS as well. Easy repro steps using https://codepen.io/makarand-patwardhan/pen/yLvyJgB 1. Click on Start Demo: This will establish webrtc between two peer connection with one party publishing an audio track 2. Notice that packets are flowing nicely between Peers. 3. Check on Music Mode and click on Update Track This will cause a new audio track to get acquired using different constrains than used originally. This new track is then used to replaceTrack (https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/replaceTrack) At this point notice that the packets stop flowing and after about 20 seconds you see an error "A MediaStreamTrack ended due to a capture failure" on console. Notice that in Step 3 if you did not change the music Mode (that is use the same constraints as before you do not see this error)
This might be related or similar to https://bugs.webkit.org/show_bug.cgi?id=239956, probably a fall out of using VPIO for audio rendering.
<rdar://problem/92624773>
Created attachment 458788 [details] Patch
Comment on attachment 458788 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=458788&action=review > Source/WebCore/ChangeLog:9 > + We should always reconfigure thr microphone processor even if we are not using it, s/thr/the/
Hello Youenn, Thank you for looking at this - Can you please let us know which version will have the fix ? And in the meanwhile what can our customer do to workaround this?
In the fiddle, the workaround is to not stop the audio track before getting another one (or stop it after getting the new one). Another approach is to stop audio rendering just before starting capture. And restart audio rendering once capture started.
Created attachment 458853 [details] Patch for landing
Committed r293827 (250300@main): <https://commits.webkit.org/250300@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 458853 [details].
Hello, Which version will have the fix? We have tried one of the latest builds in https://webkit.org/build-archives/#mac-monterey-x86_64%20arm64 MAY 6, 2022, 12:25 PM GMT+3, and we could still reproduce the issue.