aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-12-09 10:02:24 -0500
committerTakashi Iwai <tiwai@suse.de>2013-12-09 10:02:24 -0500
commitf1e762ddc8035f803d15f8c524151bf788482ec2 (patch)
tree100e4074bc4a015ec68e891f9b6747d2ab3454e4
parente8648e5e33e45fa2bb8706107eafc8ef42ed0774 (diff)
ALSA: hda - Enable stereo mix as default for AD and VIA codecs
AD and VIA codecs had stereo mixer input enabled as default before moving to the generic parser, and people think the lack of such a regression. In this patch, the stereo mixer input is added back to the input selection if no auto-mic is available, and if it's not disabled explicitly via hint. This should satisfy most of demands, i.e. stereo mix on desktop machines like what it worked before, and it still keeps the new auto-mic feature on laptops. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/hda_generic.c19
-rw-r--r--sound/pci/hda/patch_analog.c1
-rw-r--r--sound/pci/hda/patch_via.c1
3 files changed, 20 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 058318de1af4..44be167d1cad 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -3033,6 +3033,8 @@ static int parse_capture_source(struct hda_codec *codec, hda_nid_t pin,
3033 spec->imux_pins[imux->num_items] = pin; 3033 spec->imux_pins[imux->num_items] = pin;
3034 snd_hda_add_imux_item(imux, label, cfg_idx, NULL); 3034 snd_hda_add_imux_item(imux, label, cfg_idx, NULL);
3035 imux_added = true; 3035 imux_added = true;
3036 if (spec->dyn_adc_switch)
3037 spec->dyn_adc_idx[imux_idx] = c;
3036 } 3038 }
3037 } 3039 }
3038 3040
@@ -3130,7 +3132,9 @@ static int create_input_ctls(struct hda_codec *codec)
3130 } 3132 }
3131 } 3133 }
3132 3134
3133 if (mixer && spec->add_stereo_mix_input) { 3135 /* add stereo mix when explicitly enabled via hint */
3136 if (mixer && spec->add_stereo_mix_input &&
3137 snd_hda_get_bool_hint(codec, "add_stereo_mix_input") > 0) {
3134 err = parse_capture_source(codec, mixer, CFG_IDX_MIX, num_adcs, 3138 err = parse_capture_source(codec, mixer, CFG_IDX_MIX, num_adcs,
3135 "Stereo Mix", 0); 3139 "Stereo Mix", 0);
3136 if (err < 0) 3140 if (err < 0)
@@ -4403,6 +4407,19 @@ int snd_hda_gen_parse_auto_config(struct hda_codec *codec,
4403 if (err < 0) 4407 if (err < 0)
4404 return err; 4408 return err;
4405 4409
4410 /* add stereo mix if available and not enabled yet */
4411 if (!spec->auto_mic && spec->mixer_nid &&
4412 spec->add_stereo_mix_input &&
4413 spec->input_mux.num_items > 1 &&
4414 snd_hda_get_bool_hint(codec, "add_stereo_mix_input") < 0) {
4415 err = parse_capture_source(codec, spec->mixer_nid,
4416 CFG_IDX_MIX, spec->num_all_adcs,
4417 "Stereo Mix", 0);
4418 if (err < 0)
4419 return err;
4420 }
4421
4422
4406 err = create_capture_mixers(codec); 4423 err = create_capture_mixers(codec);
4407 if (err < 0) 4424 if (err < 0)
4408 return err; 4425 return err;
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 34d86ec5d3dd..05280033c302 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -194,6 +194,7 @@ static int ad198x_parse_auto_config(struct hda_codec *codec)
194 codec->no_sticky_stream = 1; 194 codec->no_sticky_stream = 1;
195 195
196 spec->gen.indep_hp = 1; 196 spec->gen.indep_hp = 1;
197 spec->gen.add_stereo_mix_input = 1;
197 198
198 err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0); 199 err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0);
199 if (err < 0) 200 if (err < 0)
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index 0bc20ef5687a..f84195f3ea31 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -138,6 +138,7 @@ static struct via_spec *via_new_spec(struct hda_codec *codec)
138 spec->gen.indep_hp = 1; 138 spec->gen.indep_hp = 1;
139 spec->gen.keep_eapd_on = 1; 139 spec->gen.keep_eapd_on = 1;
140 spec->gen.pcm_playback_hook = via_playback_pcm_hook; 140 spec->gen.pcm_playback_hook = via_playback_pcm_hook;
141 spec->gen.add_stereo_mix_input = 1;
141 return spec; 142 return spec;
142} 143}
143 144