Open Bug 1567777 Opened 6 years ago Updated 6 months ago

Web audio gain node "ramp" methods do not work

Categories

(Core :: Web Audio, defect, P3)

68 Branch
defect

Tracking

()

REOPENED
Tracking Status
firefox-esr60 --- wontfix
firefox-esr68 --- wontfix
firefox68 --- wontfix
firefox69 --- affected
firefox70 --- affected

People

(Reporter: s0ren, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0

Steps to reproduce:

The methods "exponentialRampToValueAtTime" and "linearRampToValueAtTime" do not work (and havent worked for some months)

Reproducible using your own examples:
https://mdn.github.io/webaudio-examples/audio-param/

The "ramp" methods sometime work the second time you call them, but never the first time. Reloading the page is required to trigger the bug more than once.

Btw the example link in your docs is broken -> https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/linearRampToValueAtTime

Actual results:

Instead of fading to the desired gain value, it just jumps to said value at the end of the time period specified when calling the methods

Expected results:

the ramp methods should gradually fade the volume instead of setting the volume instantly.

Component: Untriaged → Web Audio
Product: Firefox → Core

Went back to 2016-07 build and still see the issue. Doesn't appear to be a regression, rather a long standing issue. Repros under Windows 10 and Linux for me.

Paul, is this something on your radar?

Status: UNCONFIRMED → NEW
Has Regression Range: --- → irrelevant
Has STR: --- → yes
Ever confirmed: true
Flags: needinfo?(padenot)
Priority: -- → P3
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(padenot)
Resolution: --- → DUPLICATE

Paul just closed 1171438 as resolved with a comment that it was fixed, but the bug I reported here still exists in version 134 and is reproducible as described in my original description.
Thus, this is not a duplicate of 1171438.

Status: RESOLVED → REOPENED
No longer duplicate of bug: 1171438
Resolution: DUPLICATE → ---

https://mdn.github.io/webaudio-examples/audio-param/ works similarly in Chrome and Firefox for me, regardless of if I load the page for the first time or not, linear and exp ramps work as expected.

Can you please reproduce this with logging enabled, here are instructions:

  • In Firefox, ideally freshly started with no other tabs, go to about:logging in a new tab
  • Select the Media preset and click Start Logging
  • Reproduce the bug
  • Back on about:logging, click Stop Logging
  • In the new tab that appears with the Firefox Profiler web application, in the top right click the button to upload the profile
  • Make sure hidden threads are included and upload, then share the link here or send privately to a Mozilla developer (e.g. me: padenot@mozilla.com).

Here are the same instructions, in video form, if you prefer that https://paul.cx/public/about-logging-presentation.webm

Thanks, hopefully we can get to the bottom of this.

Flags: needinfo?(s0ren)

On the example page (Windows):

  • Press play
  • Press "Target at time 0 in 1s"
  • Wait
  • Press "Exponential ramp gain to 1 in 2 seconds"
    Result: After two seconds the volume instantly goes from 0 to 1.
    Expected: Volume should ramp exponentially to 1.

There are several other combos that recreate the issue, and random errors where suddenly none of the buttons do anything (which may be a problem with the page, have not investigated further).

Flags: needinfo?(s0ren)
Flags: needinfo?(karlt)

AFAICT the ramp methods are behaving as expected in these examples if used on their own, since bug 1171438 was fixed.

There are some remaining issues with combinations of events, such as setTargetAtTime() followed by exponentialRampToValueAtTime(), as reported in comment 5.

A separate issue is that "Target at time 0 in 1s" triggers

gainNode.gain.value = 0;
gainNode.gain.setTargetAtTime(0, audioCtx.currentTime + 1, 0.5);

but the value = 0 appears to have no effect.

The example page ignores any button clicks before the audio element is playing.

Blocks: 1184057
Flags: needinfo?(karlt)
You need to log in before you can comment on or make changes to this bug.