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

Issue 6118006: Save/Restore ALSA volume/mute (Closed)

Created:
9 years, 11 months ago by davejcool
Modified:
9 years, 7 months ago
CC:
chromium-reviews, davemoore+watch_chromium.org
Visibility:
Public.

Description

Save/Restore ALSA volume/mute When the ALSA volume mixer is used (if PulseAudio is disabled), the current volume and mute settings will be stored in the browser prefs so they can be restored when starting a new session. BUG=chromium-os:10470 TEST=Manual, volume and mute setting via keyboard should persist after rebooting. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=71734

Patch Set 1 : cleaned #

Total comments: 6

Patch Set 2 : Simplified prefs #

Total comments: 2

Patch Set 3 : responded to comments #

Total comments: 7

Patch Set 4 : final fixing up #

Total comments: 2

Patch Set 5 : Fixed mute not set case #

Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -8 lines) Patch
M chrome/browser/chromeos/audio_mixer_alsa.h View 1 2 3 4 3 chunks +13 lines, -1 line 0 comments Download
M chrome/browser/chromeos/audio_mixer_alsa.cc View 1 2 3 4 14 chunks +82 lines, -7 lines 0 comments Download
M chrome/browser/prefs/browser_prefs.cc View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/common/pref_names.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/common/pref_names.cc View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
davejcool
This patch saves the current volume and mute settings into the browser prefs so that ...
9 years, 11 months ago (2011-01-12 23:51:08 UTC) #1
zhurunz
http://codereview.chromium.org/6118006/diff/2001/chrome/browser/chromeos/audio_mixer_alsa.cc File chrome/browser/chromeos/audio_mixer_alsa.cc (right): http://codereview.chromium.org/6118006/diff/2001/chrome/browser/chromeos/audio_mixer_alsa.cc#newcode448 chrome/browser/chromeos/audio_mixer_alsa.cc:448: if (!local_state) { Could we add a util function ...
9 years, 11 months ago (2011-01-13 00:19:25 UTC) #2
scherkus (not reviewing)
http://codereview.chromium.org/6118006/diff/2001/chrome/browser/chromeos/audio_mixer_alsa.cc File chrome/browser/chromeos/audio_mixer_alsa.cc (right): http://codereview.chromium.org/6118006/diff/2001/chrome/browser/chromeos/audio_mixer_alsa.cc#newcode404 chrome/browser/chromeos/audio_mixer_alsa.cc:404: PrefService* local_state = g_browser_process->local_state(); take a look at PrefMember ...
9 years, 11 months ago (2011-01-13 00:54:52 UTC) #3
davejcool
I've simplified things quite a bit here by using PrefMember variables. http://codereview.chromium.org/6118006/diff/2001/chrome/browser/chromeos/audio_mixer_alsa.cc File chrome/browser/chromeos/audio_mixer_alsa.cc (right): ...
9 years, 11 months ago (2011-01-13 21:31:13 UTC) #4
Daniel Erat
http://codereview.chromium.org/6118006/diff/19001/chrome/browser/chromeos/audio_mixer_alsa.cc File chrome/browser/chromeos/audio_mixer_alsa.cc (right): http://codereview.chromium.org/6118006/diff/19001/chrome/browser/chromeos/audio_mixer_alsa.cc#newcode289 chrome/browser/chromeos/audio_mixer_alsa.cc:289: if (volume_pref_.GetValue() != kPrefVolumeNotSet) Could you do something like ...
9 years, 11 months ago (2011-01-13 21:37:21 UTC) #5
Daniel Erat
On 2011/01/13 21:37:21, Daniel Erat wrote: > http://codereview.chromium.org/6118006/diff/19001/chrome/browser/chromeos/audio_mixer_alsa.cc > File chrome/browser/chromeos/audio_mixer_alsa.cc (right): > > http://codereview.chromium.org/6118006/diff/19001/chrome/browser/chromeos/audio_mixer_alsa.cc#newcode289 ...
9 years, 11 months ago (2011-01-13 21:37:45 UTC) #6
davejcool
Small update... I'm using kSilenceDb as the minimum valid value, and defaulting the pref volume ...
9 years, 11 months ago (2011-01-14 00:14:11 UTC) #7
scherkus (not reviewing)
http://codereview.chromium.org/6118006/diff/25001/chrome/browser/chromeos/audio_mixer_alsa.cc File chrome/browser/chromeos/audio_mixer_alsa.cc (right): http://codereview.chromium.org/6118006/diff/25001/chrome/browser/chromeos/audio_mixer_alsa.cc#newcode123 chrome/browser/chromeos/audio_mixer_alsa.cc:123: // switching the element off can be guaranteed to ...
9 years, 11 months ago (2011-01-14 00:54:48 UTC) #8
davejcool
Thanks for the careful reviews! here are some responses... http://codereview.chromium.org/6118006/diff/25001/chrome/browser/chromeos/audio_mixer_alsa.cc File chrome/browser/chromeos/audio_mixer_alsa.cc (right): http://codereview.chromium.org/6118006/diff/25001/chrome/browser/chromeos/audio_mixer_alsa.cc#newcode186 chrome/browser/chromeos/audio_mixer_alsa.cc:186: ...
9 years, 11 months ago (2011-01-14 02:23:47 UTC) #9
davejcool
And here's an update addressing Andrew's latest comments.
9 years, 11 months ago (2011-01-14 21:48:19 UTC) #10
scherkus (not reviewing)
LGTM w/ one tiny nit feel free to checkin! http://codereview.chromium.org/6118006/diff/31001/chrome/browser/chromeos/audio_mixer_alsa.cc File chrome/browser/chromeos/audio_mixer_alsa.cc (right): http://codereview.chromium.org/6118006/diff/31001/chrome/browser/chromeos/audio_mixer_alsa.cc#newcode152 chrome/browser/chromeos/audio_mixer_alsa.cc:152: ...
9 years, 11 months ago (2011-01-14 23:38:50 UTC) #11
davejcool
The case of simply muting and restarting would not restore the mute (since volume was ...
9 years, 11 months ago (2011-01-15 03:49:07 UTC) #12
NEHoban
Will these only save the "master volume" and "mute" settings? I need something to save ...
9 years, 10 months ago (2011-02-11 20:06:41 UTC) #13
davejcool
9 years, 10 months ago (2011-02-11 20:31:39 UTC) #14
Hi,

The only user adjustable audio settings on Chrome-os currently are volume
and mute, so these are getting saved the same way other user preferences for
a browser session are saved.

What other mixer settings are you looking to save?  Another method could be
to add an upstart script to save and restore all mixer settings, or if you
can do a bash shell script, take a look at the alsactl command, which if
used at shutdown and startup can save and restore all your settings.  If you
want to make default settings, see
http://codereview.chromium.org/6410072/which just added an upstart
script to set some initial mixer settings.

If you've sync'd to the latest Chromium and are building the chrome-os
version of Chromium from local source, you should have this change already.
 If you have an older Chromium checkout, then download the patch set for
this change to a file, and do a 'patch -p1 < patchfile' while in the /src
folder.  If your checkout isn't too old, it might work.

-David.

On Fri, Feb 11, 2011 at 12:06 PM, <NEHoban@gmail.com> wrote:

> Will these only save the "master volume" and "mute" settings? I need
> something
> to save all mixer settings, as most of mine default to 00 at boot.
> If so, how do I apply your patches?
> Thanks. I'm new at this. I just like the idea of Chrome-os.
>
> http://codereview.chromium.org/6118006/
>

Powered by Google App Engine
This is Rietveld 408576698