AudioParam clamping to current time is very slow |
||
Issue description
Chrome Version: 63.0.3239.18 (Official Build) beta (64-bit)
What steps will reproduce the problem?
Run this bit of code (with some AudioBuffer source that's at least many seconds long):
c = new AudioContext();
b = /* some long audio buffer of audio */;
s = new AudioBufferSourceNode(c, {loop: true, buffer: b});
gains = new Array(400);
for (let k = 0; k < gains.length; ++k) {
gains[k] = new GainNode(c);
s.connect(gains[k]).connect(c.destination);
}
ct = c.currenTime;
for (let t = 0; t < 20; t += 0.02) {
let v = (t - Math.floor(t)) / gains.length;
for (let k = 0; k < gains.length; ++k) {
gains[k].gain.linearRampToValueAtTime(v, ct + t);
}
}
What is the expected result?
Audio is smooth and glitch free, with varying volume
What happens instead?
Audio glitches.
,
Nov 2 2017
Raymond, Is it connected to our issue ? Thanks
,
Nov 2 2017
hameshiv@ I don't know, since you don't link to any issue.
,
Nov 4 2017
Talking about this one: https://bugs.chromium.org/p/chromium/issues/detail?id=766198
,
Nov 14 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/aa260864abeb2898f711578e864673a5ec7bc43a commit aa260864abeb2898f711578e864673a5ec7bc43a Author: Raymond Toy <rtoy@chromium.org> Date: Tue Nov 14 17:16:50 2017 Handle AudioParam start clamping more efficiently. Add a new vector to keep track of all newly inserted events. This vector is processed once in the audio thread to clamp the start time of the event if needed. Once processed, this vector is cleared. Previously, the clamp check would process the entire event list to see if any event needed to be clamped. Most of the time, this is wasted because there are no events to be clamped because they're all in the future or because they've already been clamped. Also removed unneeded member functions and variables. Bug: 780125 Test: Change-Id: I73b871d8fa87a68e482cb98d48af33e05d1f0cfb Reviewed-on: https://chromium-review.googlesource.com/747071 Reviewed-by: Hongchan Choi <hongchan@chromium.org> Commit-Queue: Raymond Toy <rtoy@chromium.org> Cr-Commit-Position: refs/heads/master@{#516336} [modify] https://crrev.com/aa260864abeb2898f711578e864673a5ec7bc43a/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp [modify] https://crrev.com/aa260864abeb2898f711578e864673a5ec7bc43a/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.h
,
Nov 15 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by rtoy@chromium.org
, Nov 1 2017Status: Started (was: Available)