WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
190552
UI / DOM blocks audio thread, causing crackles
https://bugs.webkit.org/show_bug.cgi?id=190552
Summary
UI / DOM blocks audio thread, causing crackles
ae
Reported
2018-10-13 09:14:56 PDT
We're developing a WebAudio-based DAW running in a WKWebView. This works amazingly well and we're thrilled how far the Web Audio API has come. However, when the engine is under high load (roundabout 500 nodes for the entire loaded project), interacting with the DOM (scrolling, adding / removing elements, etc.) in any way causes severe buffer underruns, even at 1024 frames buffer size (set by starting another app that sets that buffer size and records in the background). Shouldn't the audio thread run with high priority and not be blocked by the UI / DOM thread?
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2018-10-17 10:28:47 PDT
<
rdar://problem/45342528
>
Jer Noble
Comment 2
2018-10-17 12:59:05 PDT
(In reply to ae from
comment #0
)
> We're developing a WebAudio-based DAW running in a WKWebView. This works > amazingly well and we're thrilled how far the Web Audio API has come. > > However, when the engine is under high load (roundabout 500 nodes for the > entire loaded project), interacting with the DOM (scrolling, adding / > removing elements, etc.) in any way causes severe buffer underruns, even at > 1024 frames buffer size (set by starting another app that sets that buffer > size and records in the background). > > Shouldn't the audio thread run with high priority and not be blocked by the > UI / DOM thread?
Can you provide sample code? Unless you're using javascript-based nodes, WebAudio should be entirely off the main-thread.
ae
Comment 3
2018-10-18 04:49:37 PDT
(In reply to Jer Noble from
comment #2
)
> (In reply to ae from
comment #0
) > > Shouldn't the audio thread run with high priority and not be blocked by the > > UI / DOM thread? > > Can you provide sample code? Unless you're using javascript-based nodes, > WebAudio should be entirely off the main-thread.
Thanks, I will try to put together a testcase. Essentially though, it should be easy: Just create ~ 500 mixed nodes (oscillators, gains, filters, etc.), start all the oscs and make connections so it all actually uses CPU, run all of that in a WKWebView, and then do some manipulation on a DOM with ~ 1000 nodes, or some heavy redrawing in a <canvas>, that should be enough to trigger the problem.
ae
Comment 4
2018-10-18 04:50:19 PDT
Oh, not using any ScriptProcessor nodes!
ae
Comment 5
2018-12-14 15:07:48 PST
I've realized that this is not even related to the DOM at all -- even pressing one of the volume buttons on a connected headset leads to massive crackles during the fade in and fade out animations of the iOS volume overlay! So it seems like in general, the whole WKWebView Web Audio thread is not decoupled from UI rendering, no matter where it happens...
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug