New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 638823 link

Starred by 11 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Reusing MediaStreamDestination breaks sound

Reported by asherco...@audyx.com, Aug 18 2016

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36

Example URL:
https://jsfiddle.net/ashercoren/98LoLtep/

Steps to reproduce the problem:
1. Open the provided url
2. Click on the Toggle button
3. Listen to the sound
4. Click on the toggle button to stop the sound
5. Click again on the toggle button to start the sound

What is the expected behavior?
The sound played in the second time should sound exactly as the sound played the first time

What went wrong?
The sound played in the second time doesn't sound good

Did this work before? N/A 

Is it a problem with Flash or HTML5? HTML5

Does this work in other browsers? Yes 

Chrome version: 52.0.2743.116  Channel: stable
OS Version: 
Flash Version: Shockwave Flash 22.0 r0

We have to use this way of connecting a MediaStreamDestination to an Audio element since in our app we allow the user to play the sound not through the devices default audio output device.
 

Comment 1 by rtoy@chromium.org, Aug 18 2016

Components: Blink>WebAudio

Comment 2 by rtoy@chromium.org, Aug 22 2016

Status: Untriaged (was: Unconfirmed)
I can reproduce this strange effect. What I hear is the second time the pitch of the oscillator is much lower than the first time.
@rtoy Do you have an idea of why this happens, and when it will be fixed?

Comment 4 by rtoy@chromium.org, Sep 2 2016

Status: Available (was: Untriaged)
I have no idea why this happens.  We don't normally give out timelines for when things will be fixed.
Here is another strange behavior: When connecting a permanent empty source node to the MediaStreamDestination, it fixes the issue. See here: https://jsfiddle.net/dLvLr0n7/

Comment 6 by rinam...@gmail.com, Sep 21 2016

We had the same problem of non precise sound when connecting a media-stream-destination to an audio element. 
Will this bug be fixed in the near future? 

Comment 7 by rtoy@chromium.org, Nov 3 2016

For something fun, use any of the test urls above and in a new tab do:

c = new AudioContext();
o = c.createOscillator()
o.connect(c.destination)
o.start()

Listen to the funny output.  Press the Toggle button in the test urls.  Wait several seconds or minutes.  The audio is constantly changing, and at some point, it's almost silent as if the audio from the two tabs are 180 deg out of phase.  But the audio comes back.

I suspect this is caused by the MediaStream stuff being driven by, basically, performanceNow time, but the audio is running on a different clock that is not synchronized.

I think  issue 335335  is relevant to this.  If so, this is outside the scope of WebAudio itself and is a much bigger issue.
Raymond,
The only reason we use the hybrid creature of a WebAudio graph connected to an Audio Element is that this is currently the only way to play the sound do an audio device other than the default device. This hybrid creature seems to cause multiple issues.
I beleive the abiltiy to set a sinkId for an AudioContext will fix these issues. Altohugh it is still in draft (https://www.w3.org/TR/2016/WD-audio-output-20161014/#audiocontext-constructor-argument), do you have plans to implement this in the near future?

Comment 9 by rtoy@chromium.org, Nov 7 2016

We can't really launch this because it's not in the WebAudio spec yet. It's unlikely that the spec will get this changed this year, unfortunately.  But the good news that it's a relatively simple change to the spec, so it is useful, even if enumerateDevices can't do what we want to do.
Project Member

Comment 10 by sheriffbot@chromium.org, Nov 8 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Components: -Internals>Media Internals>Media>Audio
Owner: dalecur...@chromium.org
Status: Assigned (was: Untriaged)
This issue still repro. the original repro url is also valid. 
Dale, do you want to take a look? or feel free to resolve it.
Components: -Internals>Media>Audio
Owner: ----
Status: Available (was: Assigned)
Project Member

Comment 13 by sheriffbot@chromium.org, Nov 15

Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: olka@chromium.org
Status: Available (was: Untriaged)
I don't think this is WebAudio's problem. WebAudio doesn't do any resampling or sample-filling within the graph.

See the comment #7:

> Wait several seconds or minutes.  The audio is constantly changing, and at some point, it's almost silent as if the audio from the two tabs are 180 deg out of phase.  But the audio comes back.

This sounds like AudioShifter is kicking in for some reasons. Perhaps FIFO buffer size mismatch is happening somewhere?

olka@ WDYT?
What do we see in the traces (chrome://traces) for audio and webaudio categories?
Cc: hongchan@chromium.org
Unfortunatly the repro code does not work on the latest Canary anymore. I need to fix it first before we can grab the trace.

Sign in to add a comment