Patch "ALSA: hda: generic: change the DAC ctl name for LO+SPK or LO+HP" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ALSA: hda: generic: change the DAC ctl name for LO+SPK or LO+HP

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     alsa-hda-generic-change-the-dac-ctl-name-for-lo-spk-.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit b81c10ca3c9857d537dfbf6aedbbb483428a4d4c
Author: Hui Wang <hui.wang@xxxxxxxxxxxxx>
Date:   Tue May 4 15:39:17 2021 +0800

    ALSA: hda: generic: change the DAC ctl name for LO+SPK or LO+HP
    
    [ Upstream commit f48652bbe3ae62ba2835a396b7e01f063e51c4cd ]
    
    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 <hui.wang@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20210504073917.22406-1-hui.wang@xxxxxxxxxxxxx
    Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 96903295a967..7c49a7e92dd2 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -1202,11 +1202,17 @@ static const char *get_line_out_pfx(struct hda_codec *codec, int ch,
 		*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);
+		/* This deals with the case where one HP or one Speaker or
+		 * one HP + one Speaker need to share the DAC with LO
+		 */
+		if (!ch) {
+			bool hp_lo_shared = false, spk_lo_shared = false;
+
+			if (cfg->speaker_outs)
+				spk_lo_shared = !path_has_mixer(codec,
+								spec->speaker_paths[0],	ctl_type);
+			if (cfg->hp_outs)
+				hp_lo_shared = !path_has_mixer(codec, spec->hp_paths[0], ctl_type);
 			if (hp_lo_shared && spk_lo_shared)
 				return spec->vmaster_mute.hook ? "PCM" : "Master";
 			if (hp_lo_shared)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux