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

Issue 14314002: Implement new audio handler which talks to the new audio dbus apis. (Closed)

Created:
7 years, 8 months ago by jennyz
Modified:
7 years, 8 months ago
CC:
chromium-reviews, stevenjb+watch_chromium.org, oshima+watch_chromium.org
Visibility:
Public.

Description

Implement new audio handler which talks to the new audio dbus apis, and adds a new AudioClientRestarted signal in CrasAudioClient. BUG=160311, 232032 TBR=sky TBR=battre Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=195067

Patch Set 1 #

Total comments: 16

Patch Set 2 : Refactor audio prefs code into a separate interface AudioPrefHandler. #

Patch Set 3 : Add audio_pref_observer.h #

Patch Set 4 : Fix clang complaining. #

Patch Set 5 : Fix browser_tests compiling issue. #

Total comments: 6

Patch Set 6 : Fix nits. #

Patch Set 7 : Move static RegisterPrefs out of the AudioPrefHandler interface. #

Patch Set 8 : Add comments in class header file and todo for cleaning up legacy code. #

Total comments: 12
Unified diffs Side-by-side diffs Delta from patch set Stats (+892 lines, -80 lines) Patch
M chrome/browser/chromeos/audio/audio_handler.h View 1 2 3 4 5 6 7 5 chunks +18 lines, -16 lines 0 comments Download
M chrome/browser/chromeos/audio/audio_handler.cc View 1 9 chunks +29 lines, -44 lines 0 comments Download
A chrome/browser/chromeos/audio/audio_pref_handler_impl.h View 1 2 3 4 5 6 7 1 chunk +57 lines, -0 lines 1 comment Download
A chrome/browser/chromeos/audio/audio_pref_handler_impl.cc View 1 2 3 4 5 6 1 chunk +109 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/chrome_browser_main_chromeos.cc View 1 2 3 4 5 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/prefs/browser_prefs.cc View 1 2 3 4 5 6 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/ui/ash/volume_controller_browsertest_chromeos.cc View 1 2 3 4 5 6 2 chunks +5 lines, -3 lines 0 comments Download
M chrome/chrome_browser_chromeos.gypi View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
A chromeos/audio/audio_pref_handler.h View 1 2 3 4 5 6 7 1 chunk +59 lines, -0 lines 0 comments Download
A chromeos/audio/audio_pref_observer.h View 1 2 3 4 5 6 7 1 chunk +28 lines, -0 lines 0 comments Download
A chromeos/audio/cras_audio_handler.h View 1 1 chunk +160 lines, -0 lines 0 comments Download
A chromeos/audio/cras_audio_handler.cc View 1 2 3 4 5 1 chunk +297 lines, -0 lines 11 comments Download
M chromeos/chromeos.gyp View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M chromeos/dbus/cras_audio_client.h View 1 chunk +17 lines, -1 line 0 comments Download
M chromeos/dbus/cras_audio_client.cc View 1 2 3 4 5 6 chunks +102 lines, -14 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
jennyz
7 years, 8 months ago (2013-04-16 23:41:45 UTC) #1
jennyz
7 years, 8 months ago (2013-04-17 00:16:04 UTC) #2
stevenjb
https://codereview.chromium.org/14314002/diff/1/chromeos/audio/audio_pref_names.cc File chromeos/audio/audio_pref_names.cc (right): https://codereview.chromium.org/14314002/diff/1/chromeos/audio/audio_pref_names.cc#newcode12 chromeos/audio/audio_pref_names.cc:12: // chrome/common/pref_names.cc, once we retire the old AudioHandler code. ...
7 years, 8 months ago (2013-04-17 01:25:11 UTC) #3
jennyz
https://codereview.chromium.org/14314002/diff/1/chromeos/audio/audio_pref_names.cc File chromeos/audio/audio_pref_names.cc (right): https://codereview.chromium.org/14314002/diff/1/chromeos/audio/audio_pref_names.cc#newcode12 chromeos/audio/audio_pref_names.cc:12: // chrome/common/pref_names.cc, once we retire the old AudioHandler code. ...
7 years, 8 months ago (2013-04-18 01:21:19 UTC) #4
jennyz
I fixed all the little glitches with clang and tests. Ready for another look, thanks!
7 years, 8 months ago (2013-04-18 15:48:28 UTC) #5
stevenjb
Much nicer, thanks. LGTM with nits. https://codereview.chromium.org/14314002/diff/38001/chromeos/audio/audio_pref_observer.h File chromeos/audio/audio_pref_observer.h (right): https://codereview.chromium.org/14314002/diff/38001/chromeos/audio/audio_pref_observer.h#newcode18 chromeos/audio/audio_pref_observer.h:18: virtual ~AudioPrefObserver() {} ...
7 years, 8 months ago (2013-04-18 17:10:26 UTC) #6
jennyz
https://codereview.chromium.org/14314002/diff/38001/chromeos/audio/audio_pref_observer.h File chromeos/audio/audio_pref_observer.h (right): https://codereview.chromium.org/14314002/diff/38001/chromeos/audio/audio_pref_observer.h#newcode18 chromeos/audio/audio_pref_observer.h:18: virtual ~AudioPrefObserver() {} On 2013/04/18 17:10:26, stevenjb (chromium) wrote: ...
7 years, 8 months ago (2013-04-18 17:44:21 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jennyz@chromium.org/14314002/51001
7 years, 8 months ago (2013-04-18 17:44:38 UTC) #8
commit-bot: I haz the power
Presubmit check for 14314002-51001 failed and returned exit status 1. INFO:root:Found 15 file(s). Running presubmit ...
7 years, 8 months ago (2013-04-18 17:44:44 UTC) #9
jennyz
derat@: would you please review: hrome/browser/ui/ash/volume_controller_browsertest_chromeos.cc? battre: Would you please review: chrome/browser/prefs/browser_prefs.cc These are small ...
7 years, 8 months ago (2013-04-18 18:00:58 UTC) #10
jennyz
7 years, 8 months ago (2013-04-18 18:01:44 UTC) #11
jennyz
jamescook@: would you please review: hrome/browser/ui/ash/volume_controller_browsertest_chromeos.cc?
7 years, 8 months ago (2013-04-18 18:32:43 UTC) #12
James Cook
On 2013/04/18 18:32:43, jennyz wrote: > jamescook@: would you please review: > hrome/browser/ui/ash/volume_controller_browsertest_chromeos.cc? chrome/browser/ui/ash LGTM ...
7 years, 8 months ago (2013-04-18 18:37:11 UTC) #13
Daniel Erat
I'm finding the big picture confusing here. We used to have a single AudioHandler implementation ...
7 years, 8 months ago (2013-04-18 19:25:30 UTC) #14
Daniel Erat
At the very least, every class should have a comment describing what it is and ...
7 years, 8 months ago (2013-04-18 19:26:49 UTC) #15
jennyz
AudioHandler is the old audio handler, and I am wring a new audio handler, ie, ...
7 years, 8 months ago (2013-04-18 20:07:41 UTC) #16
jennyz
7 years, 8 months ago (2013-04-18 20:21:54 UTC) #17
Daniel Erat
Thanks. Please also add TODOs at the tops of the class(es) that you plan to ...
7 years, 8 months ago (2013-04-18 20:26:18 UTC) #18
jennyz
On 2013/04/18 20:26:18, Daniel Erat wrote: > Thanks. Please also add TODOs at the tops ...
7 years, 8 months ago (2013-04-18 20:45:03 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jennyz@chromium.org/14314002/72001
7 years, 8 months ago (2013-04-18 20:45:49 UTC) #20
Daniel Erat
https://codereview.chromium.org/14314002/diff/72001/chrome/browser/chromeos/audio/audio_pref_handler_impl.h File chrome/browser/chromeos/audio/audio_pref_handler_impl.h (right): https://codereview.chromium.org/14314002/diff/72001/chrome/browser/chromeos/audio/audio_pref_handler_impl.h#newcode17 chrome/browser/chromeos/audio/audio_pref_handler_impl.h:17: // Class which implements AudioPrefHandler interface and register audio ...
7 years, 8 months ago (2013-04-18 20:55:22 UTC) #21
jennyz
On 2013/04/18 20:55:22, Daniel Erat wrote: > https://codereview.chromium.org/14314002/diff/72001/chrome/browser/chromeos/audio/audio_pref_handler_impl.h > File chrome/browser/chromeos/audio/audio_pref_handler_impl.h (right): > > https://codereview.chromium.org/14314002/diff/72001/chrome/browser/chromeos/audio/audio_pref_handler_impl.h#newcode17 ...
7 years, 8 months ago (2013-04-18 21:18:38 UTC) #22
jennyz
Committed patchset #8 manually as r195067 (presubmit successful).
7 years, 8 months ago (2013-04-19 03:28:30 UTC) #23
dgreid
https://codereview.chromium.org/14314002/diff/72001/chromeos/audio/cras_audio_handler.cc File chromeos/audio/cras_audio_handler.cc (right): https://codereview.chromium.org/14314002/diff/72001/chromeos/audio/cras_audio_handler.cc#newcode120 chromeos/audio/cras_audio_handler.cc:120: SetOutputVolumeInternal(volume_percent); Should these be reversed? Is it possible that ...
7 years, 8 months ago (2013-04-19 04:20:18 UTC) #24
jennyz
https://codereview.chromium.org/14314002/diff/72001/chromeos/audio/cras_audio_handler.cc File chromeos/audio/cras_audio_handler.cc (right): https://codereview.chromium.org/14314002/diff/72001/chromeos/audio/cras_audio_handler.cc#newcode120 chromeos/audio/cras_audio_handler.cc:120: SetOutputVolumeInternal(volume_percent); On 2013/04/19 04:20:18, dgreid wrote: > Should these ...
7 years, 8 months ago (2013-04-19 16:48:18 UTC) #25
dgreid
https://codereview.chromium.org/14314002/diff/72001/chromeos/audio/cras_audio_handler.cc File chromeos/audio/cras_audio_handler.cc (right): https://codereview.chromium.org/14314002/diff/72001/chromeos/audio/cras_audio_handler.cc#newcode120 chromeos/audio/cras_audio_handler.cc:120: SetOutputVolumeInternal(volume_percent); On 2013/04/19 16:48:18, jennyz wrote: > On 2013/04/19 ...
7 years, 8 months ago (2013-04-22 16:23:26 UTC) #26
jennyz
7 years, 8 months ago (2013-04-23 17:22:55 UTC) #27
Message was sent while issue was closed.
https://codereview.chromium.org/14314002/diff/72001/chromeos/audio/cras_audio...
File chromeos/audio/cras_audio_handler.cc (right):

https://codereview.chromium.org/14314002/diff/72001/chromeos/audio/cras_audio...
chromeos/audio/cras_audio_handler.cc:120:
SetOutputVolumeInternal(volume_percent);
On 2013/04/22 16:23:26, dgreid wrote:
> On 2013/04/19 16:48:18, jennyz wrote:
> > On 2013/04/19 04:20:18, dgreid wrote:
> > > Should these be reversed?  Is it possible that some amount of audio creeps
> out
> > > at the previous volume level after the unmute and before the set volume?
> > 
> > This clones the exact logic we used in AudioHandler::SetVolumePercent, which
> is
> > the current behavior of audio UI. I tested it on lumpy, the audio works just
> > like the old AudioHandler. It should be pretty subtle behavior. I am not
sure
> > user can tell the difference. For better order, do you suggest I move line
120
> > before line 116?
> 
> I think that is safer.  It will most likely not happen often (i'd worry more
> about mario and daisy) but might as well avoid it if possible.  Especially now
> that we switched to using dbus witch adds and extra few process hops where
> scheduling latency could be encountered.
> 
Will changed in the next cl.

https://codereview.chromium.org/14314002/diff/72001/chromeos/audio/cras_audio...
chromeos/audio/cras_audio_handler.cc:137: if (output_volume_ <=
kMuteThresholdPercent) {
On 2013/04/22 16:23:26, dgreid wrote:
> On 2013/04/19 16:48:18, jennyz wrote:
> > On 2013/04/19 04:20:18, dgreid wrote:
> > > If SetOutputVolumePercent(50) is called when currently at zero or one,
will
> > this
> > > set the volume to 4 before setting it to 50?
> > It could if the audio is muted when user sets it to 50, but it will be set
to
> 50
> > just a little later, user should not be able to tell the difference. This is
> > what AudioHander::SetMuted() does.
> 
> I was less worried about the user noticing and more about wasting cycles
setting
> the volume twice for no reason.
> 
Shouldn't happen after the change made in SetOutputVolumePercent.

https://codereview.chromium.org/14314002/diff/72001/chromeos/audio/cras_audio...
chromeos/audio/cras_audio_handler.cc:245:
SetOutputVolumeInternal(output_volume_);
On 2013/04/19 16:48:18, jennyz wrote:
> On 2013/04/19 04:20:18, dgreid wrote:
> > similar comment to above about the order of this.  In general assert mute
> first
> > and unassert mute last.
> Same as we discussed in previous comment.
Changed in the next cl.

Powered by Google App Engine
This is Rietveld 408576698