Skip to content

Commit f48652b

Browse files
jason77-wangtiwai
authored andcommitted
ALSA: hda: generic: change the DAC ctl name for LO+SPK or LO+HP
Without this change, the DAC ctl's name could be changed only when the machine has both Speaker and Headphone, but we met some machines which only has Lineout and Headhpone, and the Lineout and Headphone share the Audio Mixer0 and DAC0, the ctl's name is set to "Front". On most of machines, the "Front" is used for Speaker only or Lineout only, but on this machine it is shared by Lineout and Headphone, This introduces an issue in the pipewire and pulseaudio, suppose users want the Headphone to be on and the Speaker/Lineout to be off, they could turn off the "Front", this works on most of the machines, but on this machine, the "Front" couldn't be turned off otherwise the headphone will be off too. Here we do some change to let the ctl's name change to "Headphone+LO" on this machine, and pipewire and pulseaudio already could handle "Headphone+LO" and "Speaker+LO". (https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/747) BugLink: http://bugs.launchpad.net/bugs/804178 Signed-off-by: Hui Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 5d84b53 commit f48652b

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

sound/pci/hda/hda_generic.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,11 +1204,17 @@ static const char *get_line_out_pfx(struct hda_codec *codec, int ch,
12041204
*index = ch;
12051205
return "Headphone";
12061206
case AUTO_PIN_LINE_OUT:
1207-
/* This deals with the case where we have two DACs and
1208-
* one LO, one HP and one Speaker */
1209-
if (!ch && cfg->speaker_outs && cfg->hp_outs) {
1210-
bool hp_lo_shared = !path_has_mixer(codec, spec->hp_paths[0], ctl_type);
1211-
bool spk_lo_shared = !path_has_mixer(codec, spec->speaker_paths[0], ctl_type);
1207+
/* This deals with the case where one HP or one Speaker or
1208+
* one HP + one Speaker need to share the DAC with LO
1209+
*/
1210+
if (!ch) {
1211+
bool hp_lo_shared = false, spk_lo_shared = false;
1212+
1213+
if (cfg->speaker_outs)
1214+
spk_lo_shared = !path_has_mixer(codec,
1215+
spec->speaker_paths[0], ctl_type);
1216+
if (cfg->hp_outs)
1217+
hp_lo_shared = !path_has_mixer(codec, spec->hp_paths[0], ctl_type);
12121218
if (hp_lo_shared && spk_lo_shared)
12131219
return spec->vmaster_mute.hook ? "PCM" : "Master";
12141220
if (hp_lo_shared)

0 commit comments

Comments
 (0)