Skip to content

Commit c4cfcf6

Browse files
jason77-wangtiwai
authored andcommitted
ALSA: hda/realtek - fix the pop noise on headphone for lenovo laptops
We have several Lenovo laptops with the codec alc285, when playing sound via headphone, we can hear click/pop noise in the headphone, if we let the headphone share the DAC of NID 0x2 with the speaker, the noise disappears. The Lenovo laptops here include P52, P72, X1 yoda2 and X1 carbon. I have tried to set preferred_dacs and override_conn, but neither of them worked. Thanks for Kailang, he told me to invalidate the NID 0x3 through override_wcaps. BugLink: https://bugs.launchpad.net/bugs/1805079 Cc: <stable@vger.kernel.org> Signed-off-by: Kailang Yang <kailang@realtek.com> Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent e1a7bfe commit c4cfcf6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

sound/pci/hda/patch_realtek.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5358,6 +5358,16 @@ static void alc274_fixup_bind_dacs(struct hda_codec *codec,
53585358
spec->gen.preferred_dacs = preferred_pairs;
53595359
}
53605360

5361+
/* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
5362+
static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
5363+
const struct hda_fixup *fix, int action)
5364+
{
5365+
if (action != HDA_FIXUP_ACT_PRE_PROBE)
5366+
return;
5367+
5368+
snd_hda_override_wcaps(codec, 0x03, 0);
5369+
}
5370+
53615371
/* for hda_fixup_thinkpad_acpi() */
53625372
#include "thinkpad_helper.c"
53635373

@@ -5495,6 +5505,7 @@ enum {
54955505
ALC255_FIXUP_DELL_HEADSET_MIC,
54965506
ALC295_FIXUP_HP_X360,
54975507
ALC221_FIXUP_HP_HEADSET_MIC,
5508+
ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
54985509
};
54995510

55005511
static const struct hda_fixup alc269_fixups[] = {
@@ -6362,6 +6373,10 @@ static const struct hda_fixup alc269_fixups[] = {
63626373
.chained = true,
63636374
.chain_id = ALC269_FIXUP_HEADSET_MIC
63646375
},
6376+
[ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
6377+
.type = HDA_FIXUP_FUNC,
6378+
.v.func = alc285_fixup_invalidate_dacs,
6379+
},
63656380
};
63666381

63676382
static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -7035,6 +7050,11 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
70357050
{0x12, 0x90a60130},
70367051
{0x19, 0x03a11020},
70377052
{0x21, 0x0321101f}),
7053+
SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
7054+
{0x12, 0x90a60130},
7055+
{0x14, 0x90170110},
7056+
{0x19, 0x04a11040},
7057+
{0x21, 0x04211020}),
70387058
SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
70397059
{0x12, 0x90a60120},
70407060
{0x14, 0x90170110},

0 commit comments

Comments
 (0)