RESOLVED FIXED 100885
Automating gain AudioParam with linearRampToValueAtTime introduces buzzing distortion
https://bugs.webkit.org/show_bug.cgi?id=100885
Summary Automating gain AudioParam with linearRampToValueAtTime introduces buzzing di...
Matt Grounds
Reported 2012-10-31 14:08:45 PDT
Created attachment 171716 [details] Regression HTML page with debug FFT and time output to show distortion. There seems to be a problem with the implementation of linearRampToValueAtTime in AudioParamTimeline.cpp, which on the GainNode causes a buzzing distortion to begin when audioContext.currentTime reaches certain powers of 2. This suggests it has something to do with representing time as a floating point number during the for loop which calculates the sample accurate values. I have confirmed the bug with the nightly build on the following platforms: Windows XP - Intel Core 4 Quad 6600 Mac OS X Snow Leopard - Intel Core 2 Duo The problem is significantly worse on the Windows platform. On both platforms, distortion can be seen in the FFT view after 128.0s. But on Windows, after 256.0s an extremely audible buzzing begins. I presume this is because there are differences in the floating point code generated by the Visual Studio and gcc compilers? This makes it next to impossible to use ADSR style envelopes on parameters, since they cannot be relied upon without introducing distortion. I have attached a regression HTML page which demonstrates the problem.
Attachments
Regression HTML page with debug FFT and time output to show distortion. (1.60 KB, text/html)
2012-10-31 14:08 PDT, Matt Grounds
no flags
Patch (8.29 KB, patch)
2012-11-02 15:34 PDT, Chris Rogers
kbr: review+
Chris Rogers
Comment 1 2012-11-01 20:52:32 PDT
Matt, thanks for taking the time to make such a nice reduced test. I've been able to repro, and am taking a look...
Chris Rogers
Comment 2 2012-11-02 15:34:39 PDT
Kenneth Russell
Comment 3 2012-11-02 15:41:56 PDT
Comment on attachment 172160 [details] Patch Interesting. Looks fine. r=me
Chris Rogers
Comment 4 2012-11-02 16:11:26 PDT
Matt Grounds
Comment 5 2012-11-06 10:01:36 PST
Thanks for taking the time to deal with this so quickly Chris. I have tested with nightly build r133576 on OS X, and the problem seems to be fixed. I will test on Windows once there is a new nightly build (the Windows buildbot seems to have been broken since 16th October)
Note You need to log in before you can comment on or make changes to this bug.