Web Audio BiquadFilterNode can get stuck in a bad state where it produces no output
Reported by
r...@rsimmons.org,
May 2 2017
|
|||
Issue description
Chrome Version : 57.0.2987.133
OS Version: OS X 10.11.6
URLs (if applicable) :
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
Safari 9: OK
Firefox 52: OK
What steps will reproduce the problem?
1. Load the attached page
2. Hear a low-pitched raspy sound being produced (adjust volume if necessary)
3. Click anywhere on the page. There will be short "whoop" sound.
4. Wait a second
5. Note that there is now silence
What is the expected result?
The expected result is that after a second, the original sound should come back, since a timer reverts the parameters back to what they were before you clicked.
What happens instead of that?
After being given certain input/modulation, the filter gets stuck in a state where it only outputs silence. Having tested different scenarios, I've found that this commonly arises when the filter frequency is modulated with an audio-rate signal. I assume this is because some resonance causes the internal state values to become denormalized/infinite/NaN and they get stuck that way.
Please provide any additional information below. Attach a screenshot if
possible.
UserAgentString: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36
,
May 3 2017
After removing the limiter from the example, the filter does go unstable and runs off to +/- infinity and shortly after that, it starts producing NaN, which then gets converted to 0 before going to the output device. The filter has a cutoff of 200 Hz, and the example makes detune go from -3600 to 3600 in 1 ms (1000 Hz). This makes the cutoff vary from 25 Hz to 1600 Hz in 1 ms. Not sure if this linear time-varying filter is stable or not. The biquad filters with fixed parameters are, themselves, always stable.
,
May 3 2017
In the repro test, if you change the frequency from 1000 to 3000 or more, the filter doesn't appear to be unstable anymore. One thing that we should consider doing is to allow the biquad filter to get back into a good state if things change. The issue is that once a NaN is generated, it basically propagates forever because of the memory. We could reset the value to 0 when this happens. This would cause a strange glitch, but since we were already generating infinity or NaN, one more glitch is probably ok. This doesn't, however, fix the apparent stability issue.
,
May 4 2018
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 7
Hey, first off, thank you for your work on web audio support for Chrome. It's capable of truly amazing stuff. I've been having similar issues with the BiquadFilterNode. The filter will correctly filter an audio signal but then eventually "turns off" and no output is passed through the filter anymore. I think this might be caused by the issue raised in this thread. In my case, the audio signal is a drum hi-hat that plays every few seconds, so there is some silence between the hits. I've found that when the audio signal is constant, there's less of a chance of this problem occurring.
,
Jul 17
alecresende@ Can you provide a simple repro case for us to look at? Or better yet file a new issue with the repro case. For the original issue, I think the filter should just detect if the internal state is NaN and reset to 0 so that NaN doesn't propagate forever. It won't fix the unstable filter issue, but if the automations stop thereby making the filter stable, the filter will produce sensible output. |
|||
►
Sign in to add a comment |
|||
Comment 1 by rtoy@chromium.org
, May 2 2017Status: Available (was: Unconfirmed)