Skip to content

Commit

Permalink
ALSA: hda - Enable stereo mix as default for AD and VIA codecs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Takashi Iwai committed Dec 9, 2013
1 parent e8648e5 commit f1e762d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
19 changes: 18 additions & 1 deletion sound/pci/hda/hda_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -3033,6 +3033,8 @@ static int parse_capture_source(struct hda_codec *codec, hda_nid_t pin,
spec->imux_pins[imux->num_items] = pin;
snd_hda_add_imux_item(imux, label, cfg_idx, NULL);
imux_added = true;
if (spec->dyn_adc_switch)
spec->dyn_adc_idx[imux_idx] = c;
}
}

Expand Down Expand Up @@ -3130,7 +3132,9 @@ static int create_input_ctls(struct hda_codec *codec)
}
}

if (mixer && spec->add_stereo_mix_input) {
/* add stereo mix when explicitly enabled via hint */
if (mixer && spec->add_stereo_mix_input &&
snd_hda_get_bool_hint(codec, "add_stereo_mix_input") > 0) {
err = parse_capture_source(codec, mixer, CFG_IDX_MIX, num_adcs,
"Stereo Mix", 0);
if (err < 0)
Expand Down Expand Up @@ -4403,6 +4407,19 @@ int snd_hda_gen_parse_auto_config(struct hda_codec *codec,
if (err < 0)
return err;

/* add stereo mix if available and not enabled yet */
if (!spec->auto_mic && spec->mixer_nid &&
spec->add_stereo_mix_input &&
spec->input_mux.num_items > 1 &&
snd_hda_get_bool_hint(codec, "add_stereo_mix_input") < 0) {
err = parse_capture_source(codec, spec->mixer_nid,
CFG_IDX_MIX, spec->num_all_adcs,
"Stereo Mix", 0);
if (err < 0)
return err;
}


err = create_capture_mixers(codec);
if (err < 0)
return err;
Expand Down
1 change: 1 addition & 0 deletions sound/pci/hda/patch_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ static int ad198x_parse_auto_config(struct hda_codec *codec)
codec->no_sticky_stream = 1;

spec->gen.indep_hp = 1;
spec->gen.add_stereo_mix_input = 1;

err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0);
if (err < 0)
Expand Down
1 change: 1 addition & 0 deletions sound/pci/hda/patch_via.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ static struct via_spec *via_new_spec(struct hda_codec *codec)
spec->gen.indep_hp = 1;
spec->gen.keep_eapd_on = 1;
spec->gen.pcm_playback_hook = via_playback_pcm_hook;
spec->gen.add_stereo_mix_input = 1;
return spec;
}

Expand Down

0 comments on commit f1e762d

Please sign in to comment.