Skip to content

Commit 1099f48

Browse files
khfengtiwai
authored andcommitted
ALSA: hda/realtek: Reduce the Headphone static noise on XPS 9350/9360
Headphone on XPS 9350/9360 produces a background white noise. The The noise level somehow correlates with "Headphone Mic Boost", when it sets to 1 the noise disappears. However, doing this has a side effect, which also decreases the overall headphone volume so I didn't send the patch upstream. The noise was bearable back then, but after commit 717f43d ("ALSA: hda/realtek - Update headset mode for ALC256") the noise exacerbates to a point it starts hurting ears. So let's use the workaround to set "Headphone Mic Boost" to 1 and lock it so it's not touchable by userspace. Fixes: 717f43d ("ALSA: hda/realtek - Update headset mode for ALC256") BugLink: https://bugs.launchpad.net/bugs/1654448 BugLink: https://bugs.launchpad.net/bugs/1845810 Signed-off-by: Kai-Heng Feng <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent da0c9ea commit 1099f48

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

sound/pci/hda/patch_realtek.c

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5358,6 +5358,17 @@ static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
53585358
}
53595359
}
53605360

5361+
static void alc256_fixup_dell_xps_13_headphone_noise2(struct hda_codec *codec,
5362+
const struct hda_fixup *fix,
5363+
int action)
5364+
{
5365+
if (action != HDA_FIXUP_ACT_PRE_PROBE)
5366+
return;
5367+
5368+
snd_hda_codec_amp_stereo(codec, 0x1a, HDA_INPUT, 0, HDA_AMP_VOLMASK, 1);
5369+
snd_hda_override_wcaps(codec, 0x1a, get_wcaps(codec, 0x1a) & ~AC_WCAP_IN_AMP);
5370+
}
5371+
53615372
static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
53625373
const struct hda_fixup *fix,
53635374
int action)
@@ -5822,6 +5833,7 @@ enum {
58225833
ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
58235834
ALC275_FIXUP_DELL_XPS,
58245835
ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE,
5836+
ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE2,
58255837
ALC293_FIXUP_LENOVO_SPK_NOISE,
58265838
ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
58275839
ALC255_FIXUP_DELL_SPK_NOISE,
@@ -6558,6 +6570,12 @@ static const struct hda_fixup alc269_fixups[] = {
65586570
.chained = true,
65596571
.chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
65606572
},
6573+
[ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE2] = {
6574+
.type = HDA_FIXUP_FUNC,
6575+
.v.func = alc256_fixup_dell_xps_13_headphone_noise2,
6576+
.chained = true,
6577+
.chain_id = ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
6578+
},
65616579
[ALC293_FIXUP_LENOVO_SPK_NOISE] = {
65626580
.type = HDA_FIXUP_FUNC,
65636581
.v.func = alc_fixup_disable_aamix,
@@ -7001,17 +7019,17 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
70017019
SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
70027020
SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
70037021
SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7004-
SND_PCI_QUIRK(0x1028, 0x0704, "Dell XPS 13 9350", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE),
7022+
SND_PCI_QUIRK(0x1028, 0x0704, "Dell XPS 13 9350", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE2),
70057023
SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
70067024
SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
70077025
SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
7008-
SND_PCI_QUIRK(0x1028, 0x075b, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE),
7026+
SND_PCI_QUIRK(0x1028, 0x075b, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE2),
70097027
SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
70107028
SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
70117029
SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
70127030
SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
70137031
SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
7014-
SND_PCI_QUIRK(0x1028, 0x082a, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE),
7032+
SND_PCI_QUIRK(0x1028, 0x082a, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE2),
70157033
SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
70167034
SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
70177035
SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),

0 commit comments

Comments
 (0)