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

Issue 5859003: Add ALSA support to volume keys (Closed)

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

Description

Add ALSA support to volume keys If PulseAudio is running, everything should behave as before, otherwise use ALSA API for adjusting volume. The previous PulseAudioMixer was split into AudioMixerBase and audioMixerPusle, then AudioMixerAlsa was added. BUG=chromium-os:10470 TEST=Volume keys should work even if pulseaudio disabled Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=71115

Patch Set 1 : Adding ALSA volume support #

Total comments: 7

Patch Set 2 : cleanups #

Total comments: 62

Patch Set 3 : Updated from comments #

Patch Set 4 : more cleanup #

Total comments: 5

Patch Set 5 : fix nits #

Total comments: 3

Patch Set 6 : cleaning #

Total comments: 1

Patch Set 7 : holding lock during operations #

Total comments: 2

Patch Set 8 : alphabetize headers #

Patch Set 9 : base/thread.h now in base/threading/thread.h #

Patch Set 10 : using snd_mixer_selem_id_malloc #

Total comments: 32

Patch Set 11 : Responded to comments #

Total comments: 1

Patch Set 12 : fix comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+734 lines, -143 lines) Patch
M chrome/browser/chromeos/audio_handler.h View 1 2 3 4 5 6 7 8 9 10 4 chunks +27 lines, -5 lines 0 comments Download
M chrome/browser/chromeos/audio_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +90 lines, -33 lines 0 comments Download
A chrome/browser/chromeos/audio_mixer.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +67 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/audio_mixer_alsa.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +100 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/audio_mixer_alsa.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +366 lines, -0 lines 0 comments Download
A + chrome/browser/chromeos/audio_mixer_pulse.h View 1 2 3 4 5 6 7 8 9 10 4 chunks +19 lines, -47 lines 0 comments Download
A + chrome/browser/chromeos/audio_mixer_pulse.cc View 1 2 3 4 5 6 7 8 9 10 17 chunks +60 lines, -56 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 2 chunks +5 lines, -2 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
davejcool
Here's a medium-ish sized code review...
10 years ago (2010-12-20 21:28:15 UTC) #1
Daniel Erat
I didn't look at the ALSA code with the hope that someone else on the ...
10 years ago (2010-12-20 22:01:12 UTC) #2
davejcool
Integrated initial suggestions. http://codereview.chromium.org/5859003/diff/12001/chrome/browser/chromeos/audio_handler.cc File chrome/browser/chromeos/audio_handler.cc (right): http://codereview.chromium.org/5859003/diff/12001/chrome/browser/chromeos/audio_handler.cc#newcode137 chrome/browser/chromeos/audio_handler.cc:137: ++using_mixer_; On 2010/12/20 22:01:12, Daniel Erat ...
10 years ago (2010-12-21 02:00:21 UTC) #3
zhurunz
http://codereview.chromium.org/5859003/diff/19001/chrome/browser/chromeos/audio_handler.cc File chrome/browser/chromeos/audio_handler.cc (right): http://codereview.chromium.org/5859003/diff/19001/chrome/browser/chromeos/audio_handler.cc#newcode116 chrome/browser/chromeos/audio_handler.cc:116: return true; Prefer early-return only on error cases, and ...
10 years ago (2010-12-22 22:21:26 UTC) #4
scherkus (not reviewing)
http://codereview.chromium.org/5859003/diff/19001/chrome/browser/chromeos/audio_handler.cc File chrome/browser/chromeos/audio_handler.cc (right): http://codereview.chromium.org/5859003/diff/19001/chrome/browser/chromeos/audio_handler.cc#newcode12 chrome/browser/chromeos/audio_handler.cc:12: #include "chrome/browser/chromeos/audio_mixer_alsa.h" nit: alphabetize include order http://codereview.chromium.org/5859003/diff/19001/chrome/browser/chromeos/audio_mixer_alsa.cc File chrome/browser/chromeos/audio_mixer_alsa.cc ...
10 years ago (2010-12-22 22:31:58 UTC) #5
davejcool
Thanks for all the great feedback! It's looking cleaner now. http://codereview.chromium.org/5859003/diff/19001/chrome/browser/chromeos/audio_handler.cc File chrome/browser/chromeos/audio_handler.cc (right): http://codereview.chromium.org/5859003/diff/19001/chrome/browser/chromeos/audio_handler.cc#newcode116 ...
10 years ago (2010-12-23 03:09:02 UTC) #6
davejcool
If this looks good now, I'd like to check this in soon. Thanks!
9 years, 11 months ago (2011-01-05 00:57:09 UTC) #7
Daniel Erat
Just a few nits; I didn't look at the ALSA or PulseAudio code in detail. ...
9 years, 11 months ago (2011-01-05 01:06:52 UTC) #8
davejcool
http://codereview.chromium.org/5859003/diff/32002/chrome/browser/chromeos/audio_handler.h File chrome/browser/chromeos/audio_handler.h (right): http://codereview.chromium.org/5859003/diff/32002/chrome/browser/chromeos/audio_handler.h#newcode82 chrome/browser/chromeos/audio_handler.h:82: MixerType using_mixer_; On 2011/01/05 01:06:53, Daniel Erat wrote: > ...
9 years, 11 months ago (2011-01-05 01:42:15 UTC) #9
Daniel Erat
On Tue, Jan 4, 2011 at 5:42 PM, <davej@chromium.org> wrote: > > http://codereview.chromium.org/5859003/diff/32002/chrome/browser/chromeos/audio_handler.h > File ...
9 years, 11 months ago (2011-01-05 01:47:36 UTC) #10
zhurunz
http://codereview.chromium.org/5859003/diff/39001/chrome/browser/chromeos/audio_mixer_alsa.cc File chrome/browser/chromeos/audio_mixer_alsa.cc (right): http://codereview.chromium.org/5859003/diff/39001/chrome/browser/chromeos/audio_mixer_alsa.cc#newcode76 chrome/browser/chromeos/audio_mixer_alsa.cc:76: if (mixer_state_ != READY) Do we need a lock ...
9 years, 11 months ago (2011-01-05 18:44:44 UTC) #11
davejcool
To ensure proper shutdown, I changed to holding the lock for the duration of the ...
9 years, 11 months ago (2011-01-05 21:31:07 UTC) #12
davejcool
Keeping lock held during operations so FreeAlsaMixer will not close mixer if another operation is ...
9 years, 11 months ago (2011-01-05 23:41:50 UTC) #13
davejcool
Headers changed in project (base/thread.h ==> base/threading/thread.h)
9 years, 11 months ago (2011-01-06 01:16:25 UTC) #14
davejcool
I think this is ready to check in now. http://codereview.chromium.org/5859003/diff/63001/chrome/browser/chromeos/audio_mixer_alsa.cc File chrome/browser/chromeos/audio_mixer_alsa.cc (right): http://codereview.chromium.org/5859003/diff/63001/chrome/browser/chromeos/audio_mixer_alsa.cc#newcode276 chrome/browser/chromeos/audio_mixer_alsa.cc:276: ...
9 years, 11 months ago (2011-01-06 23:19:12 UTC) #15
scherkus (not reviewing)
few more comments but looking good sorry for taking a while to review! http://codereview.chromium.org/5859003/diff/63001/chrome/browser/chromeos/audio_handler.cc File ...
9 years, 11 months ago (2011-01-11 00:24:12 UTC) #16
davejcool
Made some changes after Andrew's cavalcade of comments. Thanks, Andrew! http://codereview.chromium.org/5859003/diff/63001/chrome/browser/chromeos/audio_handler.cc File chrome/browser/chromeos/audio_handler.cc (right): http://codereview.chromium.org/5859003/diff/63001/chrome/browser/chromeos/audio_handler.cc#newcode142 ...
9 years, 11 months ago (2011-01-11 02:52:53 UTC) #17
scherkus (not reviewing)
9 years, 11 months ago (2011-01-11 20:10:39 UTC) #18
LGTM!

looks really awesome!

http://codereview.chromium.org/5859003/diff/63001/chrome/browser/chromeos/aud...
File chrome/browser/chromeos/audio_handler.cc (right):

http://codereview.chromium.org/5859003/diff/63001/chrome/browser/chromeos/aud...
chrome/browser/chromeos/audio_handler.cc:195: connected_ = TryToConnect(false);
On 2011/01/11 02:52:54, davejcool wrote:
> On 2011/01/11 00:24:12, scherkus wrote:
> > so to confirm (as a sanity check) we'll do a synchronous audio connection on
> the
> > UI thread if needed?
> > 
> > do we know how often this can get triggered?
> 
> I've had it happen once after hours of usage, where the system had to restart
> pulseaudio and this case would have reconnected.  It is on the UI thread, but
a
> rare case.
> 
> I could change this to init asynchronously, but it adds a bit more complexity
> for a very uncommon case.

Cool -- thanks for explainin!

http://codereview.chromium.org/5859003/diff/79001/chrome/browser/chromeos/aud...
chrome/browser/chromeos/audio_handler.cc:161: break;
nit: add () to function names and get rid of blank lines since comment goes w/
code

Powered by Google App Engine
This is Rietveld 408576698