NEW 239996
Audio input and output are silent when joining WebRTC call and using AudioContext
https://bugs.webkit.org/show_bug.cgi?id=239996
Summary Audio input and output are silent when joining WebRTC call and using AudioCon...
Teodor
Reported 2022-05-02 21:31:29 PDT
User joins a video call on their iPhone, either via WKWebView or via Safari. At least 80% of the time, there will be no audio coming *out* from the iPhone and there will be no audio coming *in* (server gets zeroed audio stream). Usually, opening Control Center (swipe down) and changing "Mic Mode" instantly "unlocks" the stuck audio - server gets non-zeroed stream and the device starts playing incoming audio. Sometimes this doesn't have any effect and audio remains muted in both directions. Sometimes, it is possible to break a working two-way audio by locking the screen and then unlocking it and refocusing the app. This *never* happens when putting Safari or WKWebView in background (minimizing) - refocusing the app instantly resumes playback. In both cases (locked screen and minimized) the AudioContext is suspended. In both cases an attempt to resume it is made. In case of locked screen it sometimes works and sometimes it does not. If no attempt to resume the AudioContext is made, then no audio will play in *both* cases (locked screen and minimized). This bug is occurring on iOS 15.4 and 15.5 Beta 3, on iPhone 8 through iPhone 13, including iPhone XR, as well as iPads. It is possibly caused by AudioContext not being resumed when requested. We create AudioContext when page loads - there is a lot of bootstrapping happening thanks to bug 230902 and other issues that need to be worked around on iOS (e.g., inability to obtain two instances of the microphone stream from different places in code). Once the microphone/camera permission is granted, AudioContext is resumed (or at least attempted to be resumed). I believe that there is either a race condition between microphone capture and AudioContext resuming, or there is some blocking condition, which requires reinitialization of the audio graph to get past it (by changing Mic Mode). If it works upon page load, then it will almost certainly continue working until Safari/WKWebView are restarted, then you are back to 20/80 chances. <WishfulThinking> It would be delightful if a clean rewrite of WebRTC/AudioContext audio stack materializes itself into iOS 16 </WishfulThinking> Note: I can also still reproduce bug 230902 on iOS 15.4 in less than 5% of the tests - that issue is *not* fixed and may or may not be related to this one.
Attachments
PhungDuong
Comment 1 2022-05-05 03:24:45 PDT
We also had the same problem with audio on safari. Detail: We use iPad gen 4th OS 14.4. Visit our product link using webRTC: https://it.dev-akameet.link/video/room/demo Actual: When joining a meeting, turn off the microphone & camera, after about 2 to 3 minutes no longer hear other people's sounds. But when you speak, others can still hear you. Occurrence is about 50%. Expected: Can hear other people's sounds normally.
PhungDuong
Comment 2 2022-05-06 02:13:08 PDT
(In reply to PhungDuong from comment #1) > We also had the same problem with audio on safari. > Detail: > We use iPad gen 4th OS 14.4. > Visit our product link using webRTC: > https://it.dev-akameet.link/video/room/demo > > Actual: When joining a meeting, turn off the microphone & camera, after > about 2 to 3 minutes no longer hear other people's sounds. But when you > speak, others can still hear you. Occurrence is about 50%. > > Expected: Can hear other people's sounds normally. In addition, we also checked the state of the audio of others while not listening from others people. Everything is fine. audioObject.volume = 1 audioObject.autoplay = true audioObject.muted = false audioObject.paused = false
youenn fablet
Comment 3 2022-05-06 02:43:44 PDT
(In reply to PhungDuong from comment #1) > We also had the same problem with audio on safari. > Detail: > We use iPad gen 4th OS 14.4. > Visit our product link using webRTC: > https://it.dev-akameet.link/video/room/demo > > Actual: When joining a meeting, turn off the microphone & camera, after > about 2 to 3 minutes no longer hear other people's sounds. But when you > speak, others can still hear you. Occurrence is about 50%. > > Expected: Can hear other people's sounds normally. @PhungDuong, is it iOS 14.4 or 15.4? Are you also using AudioContext to render audio? If you are not @Teodor, a few thoughts/questions: - is it new in iOS 15.4 or is it also happening before? - instead of trying to resume, what happens if you create a brand new AudioContext? - a sysdiagnose would help validating whether this is due to AudioContext being suspended. Can you send me one (youenn@apple.com) with timestamp of when the issue happens?
youenn fablet
Comment 4 2022-05-06 02:44:19 PDT
> @PhungDuong, is it iOS 14.4 or 15.4? Are you also using AudioContext to > render audio? If you are not, I might be best to file a different bug.
PhungDuong
Comment 5 2022-05-06 05:07:59 PDT
(In reply to youenn fablet from comment #4) > > @PhungDuong, is it iOS 14.4 or 15.4? Are you also using AudioContext to > > render audio? > If you are not, I might be best to file a different bug. @youennfablet Thanks for your replying. It is iPad OS 14.4, currently, we cannot reproduce the above error with another OS version. We also use AudioContext to render audio.
Radar WebKit Bug Importer
Comment 6 2022-05-09 21:32:14 PDT
PhungDuong
Comment 7 2022-05-10 03:43:47 PDT
(In reply to PhungDuong from comment #5) > (In reply to youenn fablet from comment #4) > > > @PhungDuong, is it iOS 14.4 or 15.4? Are you also using AudioContext to > > > render audio? > > If you are not, I might be best to file a different bug. > > @youennfablet > Thanks for your replying. > > It is iPad OS 14.4, currently, we cannot reproduce the above error with > another OS version. We also use AudioContext to render audio. Hi @youennfablet We also reproduce this bug on an iPhone 8 (iOS 14.4.1) but with a lower frequency, about 10%. I'm add this information, hope this helps.
youenn fablet
Comment 8 2022-05-10 04:07:42 PDT
(In reply to PhungDuong from comment #7) > (In reply to PhungDuong from comment #5) > > (In reply to youenn fablet from comment #4) > > > > @PhungDuong, is it iOS 14.4 or 15.4? Are you also using AudioContext to > > > > render audio? > > > If you are not, I might be best to file a different bug. > > > > @youennfablet > > Thanks for your replying. > > > > It is iPad OS 14.4, currently, we cannot reproduce the above error with > > another OS version. We also use AudioContext to render audio. > > Hi @youennfablet > > We also reproduce this bug on an iPhone 8 (iOS 14.4.1) but with a lower > frequency, about 10%. > I'm add this information, hope this helps. It seems to work fine for me on iOS recent versions. If you cannot repro on iOS 15.4 or above, a Webkit fix might not be needed (though you might want iOS 14 workarounds).
PhungDuong
Comment 9 2022-05-12 00:44:58 PDT
(In reply to youenn fablet from comment #8) > (In reply to PhungDuong from comment #7) > > (In reply to PhungDuong from comment #5) > > > (In reply to youenn fablet from comment #4) > > > > > @PhungDuong, is it iOS 14.4 or 15.4? Are you also using AudioContext to > > > > > render audio? > > > > If you are not, I might be best to file a different bug. > > > > > > @youennfablet > > > Thanks for your replying. > > > > > > It is iPad OS 14.4, currently, we cannot reproduce the above error with > > > another OS version. We also use AudioContext to render audio. > > > > Hi @youennfablet > > > > We also reproduce this bug on an iPhone 8 (iOS 14.4.1) but with a lower > > frequency, about 10%. > > I'm add this information, hope this helps. > > It seems to work fine for me on iOS recent versions. > If you cannot repro on iOS 15.4 or above, a Webkit fix might not be needed > (though you might want iOS 14 workarounds). We suggest our customers upgrade to the new iOS version to try again. It doesn't seem to appear anymore. But if possible hope you can investigate more about this issue. Because there are some devices that cannot upgrade to recent iOS version.
Note You need to log in before you can comment on or make changes to this bug.