Created attachment 371341 [details]
sysdiagnose of the issue
Once in awhile, a user on iOS is not able to hear audio from a remote peer. In a multi-party call, it shows up as one person on iOS safari not being able to hear one of the other participants.
This one is hard to reproduce. I've managed to reproduce it only a couple of times after trying for several hours. I've just been establishing calls over and over again with our app. No specific action seems to cause it. I started looking into it after several of our users reported the issue. I used an iPhone 5s running iOS 12.3.1 to reproduce it. Due to to the amount of time it takes to reproduce with our app, I haven't tried to reproduce with a bare-bones p2p setup yet. Let me know if you'd like me to try that.
AFAIK, there's no way to detect the issue. Everything looks normal. The remote audio track is enabled, not ended, not muted, "live", etc. The audio element is playing, not muted, etc. You just can't hear it. I also used the Web Audio API to log the volume level from the remote track and it looks normal as well.
Once it happens, it's fairly easy to fix. Calling .pause() then .play() on the audio element fixes it, as does refreshing the page. Note that just calling .play() has no impact. The problem for us is that you we detect it.
I've attached a sysdiagnose for reference. The issue occurred at 2:18pm PST, about 20 seconds before I ran the sysdiagnose. Hope that helps!
Has anyone been able to reproduce this or have any ideas for what might cause it?
The network data is flowing correctly.
Given pause/play works, that probably makes sense.
We fixed recently some threading issues that might help there.
These are not yet testable in devices though.
One possibility is that the device is a little bit slow and we are trying to read outside the available ring buffer data. We could add some logging there.
Filed https://bugs.webkit.org/show_bug.cgi?id=199814 to improve release logging for the ring buffer.