Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Issue 1248543002: Remove device change deduplication based on device id. (Closed)

Created:
5 years, 5 months ago by DaleCurtis
Modified:
5 years, 5 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, tommi (sloooow) - chröme
Base URL:
http://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove device change deduplication based on device id. It looks like some software changes internal flows instead of changing the device id. In place of this deduplication logic I've added a rate limit of 1 change per 250ms, which is enough to fix the original issue of multiple events. Also fixes an issue where we were firing device changes four times (!) --[eRender, eCapture] * [eConsole, eCommunications]. The AudioManager only supports output device notifications so we should only be firing the listener callback for eRender. With the rate limiting logic and only firing notifications for eRender, this takes us down from four device changes to just 1 for unplug / replug of a device. BUG=506712 TEST=device changes work, single stream created per multiple events. TBR=henrika Committed: https://crrev.com/0a021e87fa8e211bdf5c9f9d2293f2d95fdd76dd Cr-Commit-Position: refs/heads/master@{#339815}

Patch Set 1 #

Total comments: 7

Patch Set 2 : Fix tests. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+53 lines, -47 lines) Patch
M media/audio/win/audio_device_listener_win.h View 1 3 chunks +13 lines, -4 lines 0 comments Download
M media/audio/win/audio_device_listener_win.cc View 1 4 chunks +24 lines, -35 lines 0 comments Download
M media/audio/win/audio_device_listener_win_unittest.cc View 1 5 chunks +16 lines, -8 lines 1 comment Download

Messages

Total messages: 19 (7 generated)
DaleCurtis
WDYT? Simplifies the code a fair bit and greatly speeds up device changes. Will have ...
5 years, 5 months ago (2015-07-20 22:57:38 UTC) #2
henrika_webrtc
Sounds like a great idea to clean up this area. Thanks! LGTM
5 years, 5 months ago (2015-07-21 09:42:16 UTC) #3
henrika_webrtc
https://codereview.chromium.org/1248543002/diff/1/media/audio/win/audio_device_listener_win.cc File media/audio/win/audio_device_listener_win.cc (left): https://codereview.chromium.org/1248543002/diff/1/media/audio/win/audio_device_listener_win.cc#oldcode72 media/audio/win/audio_device_listener_win.cc:72: default_render_device_id_ = GetDeviceId(eRender, eConsole); Nice to get rid of ...
5 years, 5 months ago (2015-07-21 09:42:24 UTC) #5
DaleCurtis
Thanks for review! https://codereview.chromium.org/1248543002/diff/1/media/audio/win/audio_device_listener_win.cc File media/audio/win/audio_device_listener_win.cc (right): https://codereview.chromium.org/1248543002/diff/1/media/audio/win/audio_device_listener_win.cc#newcode151 media/audio/win/audio_device_listener_win.cc:151: now - last_device_change_time_ > base::TimeDelta::FromMilliseconds(250)) { ...
5 years, 5 months ago (2015-07-21 19:03:36 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1248543002/1
5 years, 5 months ago (2015-07-21 19:04:34 UTC) #8
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/82790)
5 years, 5 months ago (2015-07-21 19:45:57 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1248543002/20001
5 years, 5 months ago (2015-07-22 00:26:24 UTC) #13
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 5 months ago (2015-07-22 01:58:06 UTC) #14
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/0a021e87fa8e211bdf5c9f9d2293f2d95fdd76dd Cr-Commit-Position: refs/heads/master@{#339815}
5 years, 5 months ago (2015-07-22 01:58:37 UTC) #15
Nico
The win/clang bot complains: ..\..\media\audio\win\audio_device_listener_win_unittest.cc(24,19) : error: unused variable 'kNoDevice' [-Werror,-Wunused-const-variable] static const char kNoDevice[] ...
5 years, 5 months ago (2015-07-22 02:25:31 UTC) #17
Nico
…looks like you're out already. https://codereview.chromium.org/1250933002 fixes.
5 years, 5 months ago (2015-07-22 02:32:29 UTC) #18
henrika (OOO until Aug 14)
5 years, 5 months ago (2015-07-22 07:58:20 UTC) #19
Message was sent while issue was closed.
Minor comment.

https://codereview.chromium.org/1248543002/diff/1/media/audio/win/audio_devic...
File media/audio/win/audio_device_listener_win.cc (right):

https://codereview.chromium.org/1248543002/diff/1/media/audio/win/audio_devic...
media/audio/win/audio_device_listener_win.cc:151: now - last_device_change_time_
> base::TimeDelta::FromMilliseconds(250)) {
On 2015/07/21 19:03:36, DaleCurtis wrote:
> On 2015/07/21 09:42:23, henrika_webrtc wrote:
> > How did you come up with 250?
> 
> Dice roll! Well actually... I physically couldn't plug/unplug devices any
slower
> than 250ms, so it seems reasonable.

Acknowledged.

https://codereview.chromium.org/1248543002/diff/1/media/audio/win/audio_devic...
media/audio/win/audio_device_listener_win.cc:154: did_run_listener_cb = true;
On 2015/07/21 19:03:36, DaleCurtis wrote:
> On 2015/07/21 09:42:23, henrika_webrtc wrote:
> > Is did_run_listener_cb ever used?
> 
> In the DVLOG() below.

Acknowledged.

https://codereview.chromium.org/1248543002/diff/20001/media/audio/win/audio_d...
File media/audio/win/audio_device_listener_win_unittest.cc (right):

https://codereview.chromium.org/1248543002/diff/20001/media/audio/win/audio_d...
media/audio/win/audio_device_listener_win_unittest.cc:46: void
AdvanceLastDeviceChangeTime() {
Perhaps add a comment here to explain why you add 1 ms here. At least I will
forget the details ;-)

Powered by Google App Engine
This is Rietveld 408576698