Bug 248534 - Creating and destroying lots of IIRFilterNodes corrupts AudioContext
Summary: Creating and destroying lots of IIRFilterNodes corrupts AudioContext
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: Safari 15
Hardware: iPhone / iPad iOS 15
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-11-30 07:37 PST by ae
Modified: 2022-12-08 12:31 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ae 2022-11-30 07:37:18 PST
I have an audio application where the user is able to interactively adjust the parameters of a custom EQ created using createIIRFilter. While the user moves the frequency, gain and Q sliders, the old IIRFilterNode needs to be disconnected and a new one created and connected, as it is apparently not possible to update the coefficients on an existing node (really?).

Very quickly, the audio context will start "lagging behind" (context.currentTime updates much slower than the wall clock), and for example, DynamicsCompressor.reduction will still update in 'realtime'.

I have found no workaround. Even limiting the updates to like 10 per second still makes the problem appear.
Comment 1 ae 2022-11-30 07:43:15 PST
BTW, I've just realized that I've reported some bugs 6 years ago, which have been confirmed by others, and they haven't even been assigned yet. It would be great if QA were a higher priority!
Comment 2 ae 2022-11-30 08:42:24 PST
I've also noticed that after a few hundred calls to createIIRFilter(), one single call will often take more than one second to complete.

(Maybe I'm missing something and this is not the correct way to provide realtime adjustments of IIR Filter coefficients...)
Comment 3 ae 2022-12-03 05:48:58 PST
The problem seems to be related to memory management: It apparently only becomes serious when there's a large (> 100 MB) AudioBuffer object in memory that is being played through a AudioBufferSourceNode. I couldn't reproduce the issue with small (~ 1 MB) buffers.
Comment 4 Radar WebKit Bug Importer 2022-12-08 12:31:03 PST
<rdar://problem/103141531>