New issue
Advanced search Search tips

Issue 683188 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

AnalyserNode holds last output if there are no inputs

Project Member Reported by rtoy@chromium.org, Jan 20 2017

Issue description

OS: All

What steps will reproduce the problem?
(1) Visit http://thomastortorini.free.fr/bug-analysernode/
(2)
(3)

What is the expected result?
Output should be a straight line when the sound stops playing.  Compare what happens in Chrome with what happens in Firefox.

What happens instead?
The output appears to be held with the same data as the last previous call, before the sound stopped.


 
Here: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/webaudio/AnalyserNode.cpp?l=53

We can see:
```
if (!isInitialized() || !input(0).isConnected()) {
  outputBus->zero();
  return;
}
```

My problem is visible only when no input is connected to the Node,
so maybe we need to call this line:

`m_analyser.writeInput(inputBus, framesToProcess);`

before the `return`.

Project Member

Comment 2 by bugdroid1@chromium.org, Feb 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c9ef493e1d238a655011a872886903a1d44d52bd

commit c9ef493e1d238a655011a872886903a1d44d52bd
Author: rtoy <rtoy@chromium.org>
Date: Thu Feb 09 19:58:21 2017

Continue to process AnalyserNode if inputs are silent.

If the input to an AnalyserNode is not connected or it is silent
(because of the silent hint), we must still process the node so that
the internal state is updated with the silent input.

This requires several things to be changed:

1. propagatesSilence() must return false so that
   AnalyserNode::process() is called even if the input is silent.
2. Can't disable output of an AnalyserNode when the input
   disconnects.  If the output were disabled, the node would not get
   called to process any more.
3. If the input is disconnected and the output is not connected, we
   cannot remove the node from the automatic pull list because then
   process() stops getting called.

Basically, process() must always get called as long as the AnalyserNode
is alive.

BUG= 683188 
TEST=Analyser/handle-silent-inputs.html

Review-Url: https://codereview.chromium.org/2666063003
Cr-Commit-Position: refs/heads/master@{#449379}

[add] https://crrev.com/c9ef493e1d238a655011a872886903a1d44d52bd/third_party/WebKit/LayoutTests/webaudio/Analyser/handle-silent-inputs.html
[modify] https://crrev.com/c9ef493e1d238a655011a872886903a1d44d52bd/third_party/WebKit/Source/modules/webaudio/AnalyserNode.cpp
[modify] https://crrev.com/c9ef493e1d238a655011a872886903a1d44d52bd/third_party/WebKit/Source/modules/webaudio/AnalyserNode.h
[modify] https://crrev.com/c9ef493e1d238a655011a872886903a1d44d52bd/third_party/WebKit/Source/modules/webaudio/AudioBasicInspectorNode.cpp
[modify] https://crrev.com/c9ef493e1d238a655011a872886903a1d44d52bd/third_party/WebKit/Source/modules/webaudio/AudioBasicInspectorNode.h
[modify] https://crrev.com/c9ef493e1d238a655011a872886903a1d44d52bd/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp

Comment 3 by rtoy@chromium.org, Feb 13 2017

Owner: rtoy@chromium.org
Status: Fixed (was: Available)
Ran repro test case and the output is now zero as expected.

Sign in to add a comment