diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-03-09 17:51:10 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-03-09 17:55:30 +0100 |
commit | 18478e8b626edc2d181dcb1b93e1f99ad72095e9 (patch) | |
tree | 572587c5e3ce39669e4dff26b165e93ba3181946 /sound/pci/hda/patch_analog.c | |
parent | 785f857d1cb0856b612b46a0545b74aa2596e44a (diff) | |
download | blackbird-op-linux-18478e8b626edc2d181dcb1b93e1f99ad72095e9.tar.gz blackbird-op-linux-18478e8b626edc2d181dcb1b93e1f99ad72095e9.zip |
ALSA: hda - Initialize vmaster slave volumes
When the driver is changed to use vmaster or a new slave element is
added by the improvement of the parser code, user may face often the
silent output because of the muted slave mixer although Master volume
is properly set. And they complain. And I get upset.
Although such a mixer element should be initialized via "alsactl init",
it'd be more user-friendly if the known output slaves are unmuted and
set to 0dB so that user can control the volume only with Master as
default. Since Master is still set muted as default even with this
change, no risk of the speaker blow up, too.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_analog.c')
-rw-r--r-- | sound/pci/hda/patch_analog.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 9771b0702455..fa97a0c5ced0 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c @@ -82,6 +82,7 @@ struct ad198x_spec { unsigned int inv_jack_detect: 1;/* inverted jack-detection */ unsigned int inv_eapd: 1; /* inverted EAPD implementation */ unsigned int analog_beep: 1; /* analog beep input present */ + unsigned int avoid_init_slave_vol:1; #ifdef CONFIG_SND_HDA_POWER_SAVE struct hda_loopback_check loopback; @@ -223,11 +224,12 @@ static int ad198x_build_controls(struct hda_codec *codec) unsigned int vmaster_tlv[4]; snd_hda_set_vmaster_tlv(codec, spec->vmaster_nid, HDA_OUTPUT, vmaster_tlv); - err = snd_hda_add_vmaster(codec, "Master Playback Volume", + err = __snd_hda_add_vmaster(codec, "Master Playback Volume", vmaster_tlv, (spec->slave_vols ? spec->slave_vols : ad_slave_pfxs), - "Playback Volume"); + "Playback Volume", + !spec->avoid_init_slave_vol); if (err < 0) return err; } @@ -3604,6 +3606,8 @@ static int patch_ad1884(struct hda_codec *codec) spec->vmaster_nid = 0x04; /* we need to cover all playback volumes */ spec->slave_vols = ad1884_slave_vols; + /* slaves may contain input volumes, so we can't raise to 0dB blindly */ + spec->avoid_init_slave_vol = 1; codec->patch_ops = ad198x_patch_ops; |