Skip to content

Commit

Permalink
ALSA: hda - Fix "PCM" name being used on one DAC when there are two DACs
Browse files Browse the repository at this point in the history
In the scenario where there is one "Line Out", one "Speaker" and one
"Headphone", and there are only two DACs, two outputs will share a DAC.
Currently any mixer on such a DAC will get the "PCM" name, which is
misleading. Instead use "Headphone+LO" or "Speaker+LO" to better
specify what the volume actually controls.

[fixed missing slave string additions by tiwai]

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
David Henningsson authored and tiwai committed Oct 20, 2014
1 parent c8b00fd commit 03ad6a8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion sound/pci/hda/hda_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,19 @@ static const char *get_line_out_pfx(struct hda_codec *codec, int ch,
break;
*index = ch;
return "Headphone";
case AUTO_PIN_LINE_OUT:
/* This deals with the case where we have two DACs and
* one LO, one HP and one Speaker */
if (!ch && cfg->speaker_outs && cfg->hp_outs) {
bool hp_lo_shared = !path_has_mixer(codec, spec->hp_paths[0], ctl_type);
bool spk_lo_shared = !path_has_mixer(codec, spec->speaker_paths[0], ctl_type);
if (hp_lo_shared && spk_lo_shared)
return spec->vmaster_mute.hook ? "PCM" : "Master";
if (hp_lo_shared)
return "Headphone+LO";
if (spk_lo_shared)
return "Speaker+LO";
}
}

/* for a single channel output, we don't have to name the channel */
Expand Down Expand Up @@ -4524,7 +4537,7 @@ static const char * const slave_pfxs[] = {
"CLFE", "Bass Speaker", "PCM",
"Speaker Front", "Speaker Surround", "Speaker CLFE", "Speaker Side",
"Headphone Front", "Headphone Surround", "Headphone CLFE",
"Headphone Side",
"Headphone Side", "Headphone+LO", "Speaker+LO",
NULL,
};

Expand Down

0 comments on commit 03ad6a8

Please sign in to comment.