Bug 215964 - iPad: Audio streams received by WebRTC and fed to Web Audio are killed when switching to another app
Summary: iPad: Audio streams received by WebRTC and fed to Web Audio are killed when s...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Other
Hardware: iPhone / iPad iOS 13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-08-28 18:46 PDT by Justin Uberti
Modified: 2021-03-12 06:46 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Uberti 2020-08-28 18:46:21 PDT
Observed on iPadOS14b6, but occurred in earlier iPadOS revs as well.

When receiving an audio stream in WebRTC, and then feeding that stream into createMediaStreamSource, and then connecting that source to AudioContext.destination, this graph gets broken when switching to another app. The context continues as 'running', and the stream is not muted, but all playout stops, and stays stopped even when switching back to Safari.

This does not happen when:
1) WebRTC is fed into an <audio/> element (i.e., no Web Audio)
2) A Web Audio oscillator node is connected to a destination (i.e., no WebRTC)

JSFiddle demonstrating this issue: https://jsfiddle.net/juberti/sr078wyj/
1) Load it up and hit the play button. A tone will start to play out (using WebRTC and Web Audio).
2) Switch to another app. Audio will stop.
3) Switch back to Safari. As seen in the console, the context is still running, but no audio plays out.
Comment 1 Radar WebKit Bug Importer 2020-08-29 11:24:59 PDT
<rdar://problem/68000812>
Comment 2 Daniel Rossi 2021-03-12 06:46:38 PST
Sound is being disabled when creating another createMediaStreamSource when changing to a new stream. Its not related to stopping the audio track.  Is there a work around ? Another painful time consuming time to find a work around. Really awful. 



https://jsfiddle.net/danrossi303/gsLy96hc/2/