aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-12-10 11:33:49 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-20 10:45:07 -0500
commit3d0ed796879a3d63593eee271e3acafb3cffb7d6 (patch)
tree7777e4d2ac982fe03d215d8d45da271b5cdf5993
parent2a9f683edd34578a3d1e789781f4499af4990d63 (diff)
ALSA: hda - Mute all aamix inputs as default
commit ebb93c057dda376414fbc499ad6ace9b527dff5a upstream. Not all channels have been initialized, so far, especially when aamix NID itself doesn't have amps but its leaves have. This patch fixes these holes. Otherwise you might get unexpected loopback inputs, e.g. from surround channels. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--sound/pci/hda/hda_generic.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index b4e4dd6fd91c..8536266e4004 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -4222,6 +4222,26 @@ static unsigned int snd_hda_gen_path_power_filter(struct hda_codec *codec,
4222 return AC_PWRST_D3; 4222 return AC_PWRST_D3;
4223} 4223}
4224 4224
4225/* mute all aamix inputs initially; parse up to the first leaves */
4226static void mute_all_mixer_nid(struct hda_codec *codec, hda_nid_t mix)
4227{
4228 int i, nums;
4229 const hda_nid_t *conn;
4230 bool has_amp;
4231
4232 nums = snd_hda_get_conn_list(codec, mix, &conn);
4233 has_amp = nid_has_mute(codec, mix, HDA_INPUT);
4234 for (i = 0; i < nums; i++) {
4235 if (has_amp)
4236 snd_hda_codec_amp_stereo(codec, mix,
4237 HDA_INPUT, i,
4238 0xff, HDA_AMP_MUTE);
4239 else if (nid_has_volume(codec, conn[i], HDA_OUTPUT))
4240 snd_hda_codec_amp_stereo(codec, conn[i],
4241 HDA_OUTPUT, 0,
4242 0xff, HDA_AMP_MUTE);
4243 }
4244}
4225 4245
4226/* 4246/*
4227 * Parse the given BIOS configuration and set up the hda_gen_spec 4247 * Parse the given BIOS configuration and set up the hda_gen_spec
@@ -4360,6 +4380,10 @@ int snd_hda_gen_parse_auto_config(struct hda_codec *codec,
4360 } 4380 }
4361 } 4381 }
4362 4382
4383 /* mute all aamix input initially */
4384 if (spec->mixer_nid)
4385 mute_all_mixer_nid(codec, spec->mixer_nid);
4386
4363 dig_only: 4387 dig_only:
4364 parse_digital(codec); 4388 parse_digital(codec);
4365 4389