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

Issue 6591095: Mute ALSA audio completely (Closed)

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

Description

Mute ALSA audio completely The PCM control is needed to mute audio completely, but it is not available until at least one pcm stream is opened. This fix just opens and closes a pcm stream before gathering information about which mixer controls are available. BUG=chromium-os:12151 TEST=Manual, play audio then mute. No audio should be heard through headphones. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=76943

Patch Set 1 #

Total comments: 4

Patch Set 2 : cleanup #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -4 lines) Patch
M chrome/browser/chromeos/audio_mixer_alsa.cc View 1 3 chunks +15 lines, -4 lines 1 comment Download

Messages

Total messages: 4 (0 generated)
davejcool
This should fix http://crosbug.com/12151 if the problem is that some audio at a low volume ...
9 years, 9 months ago (2011-03-02 02:12:10 UTC) #1
Daniel Erat
LGTM I noticed some warnings getting printed when I pressed the mute key on a ...
9 years, 9 months ago (2011-03-02 17:45:07 UTC) #2
scherkus (not reviewing)
LGTM w/ recommendation http://codereview.chromium.org/6591095/diff/1/chrome/browser/chromeos/audio_mixer_alsa.cc File chrome/browser/chromeos/audio_mixer_alsa.cc (right): http://codereview.chromium.org/6591095/diff/1/chrome/browser/chromeos/audio_mixer_alsa.cc#newcode249 chrome/browser/chromeos/audio_mixer_alsa.cc:249: PingPCM(); maybe inline this code considering ...
9 years, 9 months ago (2011-03-02 19:07:11 UTC) #3
davejcool
9 years, 9 months ago (2011-03-03 20:05:02 UTC) #4
I think it's ready to go now.

> I noticed some warnings getting printed when I pressed the mute key on a Mario
> device in a build that I did a day or two ago.  Does this fix that?  (Sorry,
I'm
> unable to repro it on a different machine right now -- I'll let you know the
> exact text if I see it again.)

Before this change there was an error, "ALSA unable to find simple control PCM"
which should not happen anymore.  I noticed a new warning after this CL when
hitting Mute (snd_mixer_selem_set_playback_switch_all() failed:) but that is
fixed now as well since there is no need to set mute on the PCM control.

http://codereview.chromium.org/6591095/diff/1/chrome/browser/chromeos/audio_m...
File chrome/browser/chromeos/audio_mixer_alsa.cc (right):

http://codereview.chromium.org/6591095/diff/1/chrome/browser/chromeos/audio_m...
chrome/browser/chromeos/audio_mixer_alsa.cc:249: PingPCM();
It is remarkably close to the other calls in InitializeAlsaMixer(), so I'm now
inlining instead.

http://codereview.chromium.org/6591095/diff/1/chrome/browser/chromeos/audio_m...
File chrome/browser/chromeos/audio_mixer_alsa.h (right):

http://codereview.chromium.org/6591095/diff/1/chrome/browser/chromeos/audio_m...
chrome/browser/chromeos/audio_mixer_alsa.h:86: void PingPCM();
I thought about returning bool here as well, but Andrew suggested just in-lining
it... which I'm also fine with since it's not called from anywhere else, and is
very similar to the other code in that area.

http://codereview.chromium.org/6591095/diff/7001/chrome/browser/chromeos/audi...
File chrome/browser/chromeos/audio_mixer_alsa.cc (left):

http://codereview.chromium.org/6591095/diff/7001/chrome/browser/chromeos/audi...
chrome/browser/chromeos/audio_mixer_alsa.cc:179:
SetElementMuted_Locked(elem_pcm_, mute);
It turns out the PCM mixer element does have a mute control and does not need to
be muted as well.  Before this change CL, the PCM element was not even being
found, so this was not noticed.

Powered by Google App Engine
This is Rietveld 408576698