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

Issue 668250 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
OOO Dec 22 - Jan 8
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , All
Pri: 1
Type: Bug

Blocking:
issue 663546



Sign in to add a comment

AudioRendererSinkCacheImpl::GetSink() should never return sinks in a bad state.

Project Member Reported by dalecur...@chromium.org, Nov 23 2016

Issue description

Today a cache hit may include a sink which encountered an error since the error may occur when no mixer is connected. AudioRendererMixerManager::GetMixer() returns nullptr in this case, but it shouldn't as that will result is no-audio/broken playback. It should delete the old sink and try returning a fresh one. If the device status is still bad then the GetMixer() code may be return null.

Specifically this block of code:

https://cs.chromium.org/chromium/src/content/renderer/media/audio_renderer_sink_cache_impl.cc?l=160

Should loop over the cache and delete any sinks which are in an invalid state. If none remain a new sink should be created for the requested parameters.

It's possible this is contributing to our above normal audio error rates. 
 

Comment 1 by olka@chromium.org, Nov 24 2016

Status: Started (was: Assigned)

Comment 2 by olka@chromium.org, Nov 25 2016

I think in this case there is no point in caching unused sinks in invalid state.
Both issues can occur; but in either case the cache should never vend a sink in a known-bad state. Vending unknown is okay, i.e. direct result of creation, but it should never cache one that is bad, and never serve one from the cache which has gone bad.
Project Member

Comment 4 by bugdroid1@chromium.org, Dec 2 2016

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

commit 3e07bf0ac5733215f2b670b42d4cbf90037ea673
Author: olka <olka@chromium.org>
Date: Fri Dec 02 15:20:16 2016

AudioRendererSinKCache: Do not use unhealthy sinks

Cache an unused sink only if it is healthy (has an OK status);
Get output parameters only from healthy cached sinks.

Note that we still can have used sinks in the cache those become unhealthy.

BUG= 668250 ,663546

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

[modify] https://crrev.com/3e07bf0ac5733215f2b670b42d4cbf90037ea673/content/renderer/media/audio_renderer_sink_cache_impl.cc
[modify] https://crrev.com/3e07bf0ac5733215f2b670b42d4cbf90037ea673/content/renderer/media/audio_renderer_sink_cache_impl.h
[modify] https://crrev.com/3e07bf0ac5733215f2b670b42d4cbf90037ea673/content/renderer/media/audio_renderer_sink_cache_unittest.cc

Comment 5 by strobe@google.com, Dec 7 2016

Thanks for the fix, I hope it has a positive impact.

Can we still add some method of tracking how often a null sink is used, or a mechanism of turning it off? I fear this will become a P0 when this hits stable; our track record of picking up these problems from Beta feedback isn't great.

Comment 6 by olka@chromium.org, Dec 7 2016

Yes, it landed here: https://codereview.chromium.org/2533443002/
Media.WebAudioSourceProvider.SinkStatus is a UMA stat to track.
Labels: Merge-Request-56
This fix should be merged to m56 too.
Ditto for the one in c#6 once it's soaked a bit more.

Comment 10 by dimu@chromium.org, Dec 7 2016

Labels: -Merge-Request-56 Merge-Approved-56 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M56 (branch: 2924)

Comment 11 by olka@chromium.org, Dec 8 2016

For Wednesday we have 0.1% of timed out authorizations for WASP and 0.5% for AudioOutputDevice (now that we don't cache timed out sinks, % of timeouts for AOD may grow). Percentage is about the same on Mac and Win (which smells)

https://uma.googleplex.com/histograms/?endDate=20161207&dayCount=1&histograms=Media.Audio.Render.OutputDeviceStatus%2CMedia.WebAudioSourceProvider.SinkStatus&fixupData=true&showMax=true&filters=isofficial%2Ceq%2CTrue&implicitFilters=isofficial
***BULK EDIT***

Your change has been approved for M56. Please ensure to verify the fix and merge ASAP so that we could take it for next Beta Release.

If the change is already merged and no pending work please remove Merge-Approved-56 label and add merge-merged-2924.
It's diverged a fair bit now, .32% on OSX, still ~0.09% on Windows. Can you merge this fix olka@? We probably also want to merge https://codereview.chromium.org/2533443002/

Comment 14 by strobe@google.com, Dec 10 2016

How much do we trust unique user grouping? The results suggest that this isn't necessarily specific to a hardware configuration, e.g. 3.7% of Win10 and 2.2% of OSX unique users hit this condition. It's not quite as high as what we would expect if the event had no per-device correlation, but it's still higher than what would happen if the event was deterministic or at least strongly coupled to some hardware.
Those numbers are higher than I'd expect, but it's hard to say yet, the change is still only on canary. It'll be more interesting on dev next week.

Comment 16 by olka@chromium.org, Dec 12 2016

Blocking: 663546
Project Member

Comment 17 by bugdroid1@chromium.org, Dec 12 2016

Labels: -merge-approved-56 merge-merged-2924
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/18152911205ff73d2df9be6798dd252b82d3a25d

commit 18152911205ff73d2df9be6798dd252b82d3a25d
Author: olka <olka@chromium.org>
Date: Mon Dec 12 12:07:17 2016

AudioRendererSinKCache: Do not use unhealthy sinks

Cache an unused sink only if it is healthy (has an OK status);
Get output parameters only from healthy cached sinks.

Note that we still can have used sinks in the cache those become unhealthy.

BUG= 668250 ,663546

Review-Url: https://codereview.chromium.org/2533443003
Cr-Commit-Position: refs/heads/master@{#435937}
(cherry picked from commit 3e07bf0ac5733215f2b670b42d4cbf90037ea673)

TBR=dalecurtis@chromium.org
NOTRY=true
NOPRESUBMIT=true

Review-Url: https://codereview.chromium.org/2566113002
Cr-Commit-Position: refs/branch-heads/2924@{#453}
Cr-Branched-From: 3a87aecc31cd1ffe751dd72c04e5a96a1fc8108a-refs/heads/master@{#433059}

[modify] https://crrev.com/18152911205ff73d2df9be6798dd252b82d3a25d/content/renderer/media/audio_renderer_sink_cache_impl.cc
[modify] https://crrev.com/18152911205ff73d2df9be6798dd252b82d3a25d/content/renderer/media/audio_renderer_sink_cache_impl.h
[modify] https://crrev.com/18152911205ff73d2df9be6798dd252b82d3a25d/content/renderer/media/audio_renderer_sink_cache_unittest.cc

Comment 18 by olka@chromium.org, Dec 12 2016

Status: Fixed (was: Started)

Sign in to add a comment