Bug 183253
Summary: | Multiple calls to setTargetAtTime with separate timestamps has unpredictable behavior | ||
---|---|---|---|
Product: | WebKit | Reporter: | ae |
Component: | Web Audio | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | jer.noble, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | iPhone / iPad | ||
OS: | iOS 11 |
ae
I've spent the last 2 days trying to make a simple ADSR envelope generator using setTargetAtTime. It's hard to isolate a testcase, but I can say that as soon as several targets are added to the timeline, for example: 0 at 1 second, 1 at 2 seconds, 0.5 at 3 seconds, and 0 at 4 seconds), the resulting curves are unpredictable, especially when interrupted with cancelScheduledValues and then re-constructed (both are necessary for making a working real-world ADSR generator). The same code works flawlessly in Chrome and Firefox... I could possibly provide a testcase if needed.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
ae
OK, sorry for the original inaccurate report. More investigation revealed the following:
node.gain.setValueAtTime(1, timestamp)
node.gain.setTargetAtTime(0.5, timestamp, 1)
This code seems to cause a race condition when both timestamps are equal. If I use "timestamp + 0.001" in the second line, the problem goes away.
Radar WebKit Bug Importer
<rdar://problem/38088304>