Chrome crash when utilizing multiple ScriptProcessor and Analyser nodes

207 Views Asked by At

I'm building a web app that allows users to evolve webaudio synthesizers (https://gensynth.ou.edu/#/evolve). However, on chrome, whenever you click refresh a few times with mutation amount turned all the way up and play around during evolution, the app will crash unpredictably (The tab just shows the 'aw snap' crash screen).

When a synthesizer loads it plays through a scriptProcessor and analyser nodes connected to a silent gain node so it can render out the initial spectogram (initially tried using an offline context for this, but that just brakes horribly). Then, when a user clicks to play the instrument it plays through a different set of script/analyser nodes. Each subsequent play, the oscillators and filters get regenerated and connected to this same set of script/analyser nodes.

It seems like it crashes whenever older script nodes try to get garbage collected since it happens less often when I try and keep references to the node and not set its onaudioprocess function to null (which really hits the memory hard). Is there a better or more standard way of doing this?

I'm not entirely what code to put in this post since the issue only comes up most of the time when everything is pulled together. The main widget that utilizes the script/analyser nodes is here.

Works fine in firefox and let me know if there's any other information that would be helpful for me to provide.

Edit: Isolating just the visualizer code on this page, you can get the crash (albeit less often) by clicking the new x30 button a few times.

1

There are 1 best solutions below

0
On BEST ANSWER

After updating to chrome 40 I haven't seen the issue come up. I'm assuming it was caused by one of the memory corruption or webaudio bugs that was fixed (http://googlechromereleases.blogspot.com/2015/01/stable-update.html)