Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: realtek/alc288 fix headphone for MS Surface 2/3

The Surface Pro 2 and 3 have a strange headphone frequency response
and miss most of the bass. I discovered connecting the HP out to the
main DAC fixes this. Maybe the other is mono or intentionally filtered
signal for the built-in speakers? (At least the Lenovo Ideapad 720S
(AMD) (0x17aa, 0x3812) exhibited the same problem, but I don't have it
anymore for testing V2 changes.)

Signed-off-by: René Rebe <rene@exactco.de>
Co-developed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20251120.124240.139462482701146043.rene@exactco.de

authored by

René Rebe and committed by
Takashi Iwai
c639065e 9afbbf49

+21
+21
sound/hda/codecs/realtek/alc269.c
··· 3453 3453 alc_write_coef_idx(codec, 0xd, 0x2800); 3454 3454 } 3455 3455 3456 + /* Swap DAC assignments for HP and speaker */ 3457 + static void alc288_fixup_surface_swap_dacs(struct hda_codec *codec, 3458 + const struct hda_fixup *fix, int action) 3459 + { 3460 + struct alc_spec *spec = codec->spec; 3461 + static hda_nid_t preferred_pairs[] = { 3462 + 0x21, 0x03, 0x14, 0x02, 0 3463 + }; 3464 + 3465 + if (action != HDA_FIXUP_ACT_PRE_PROBE) 3466 + return; 3467 + 3468 + spec->gen.preferred_dacs = preferred_pairs; 3469 + } 3470 + 3456 3471 enum { 3457 3472 ALC269_FIXUP_GPIO2, 3458 3473 ALC269_FIXUP_SONY_VAIO, ··· 3789 3774 ALC256_FIXUP_VAIO_RPL_MIC_NO_PRESENCE, 3790 3775 ALC245_FIXUP_HP_TAS2781_SPI_MUTE_LED, 3791 3776 ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED, 3777 + ALC288_FIXUP_SURFACE_SWAP_DACS, 3792 3778 }; 3793 3779 3794 3780 /* A special fixup for Lenovo C940 and Yoga Duet 7; ··· 6245 6229 .type = HDA_FIXUP_FUNC, 6246 6230 .v.func = alc245_tas2781_i2c_hp_fixup_muteled, 6247 6231 }, 6232 + [ALC288_FIXUP_SURFACE_SWAP_DACS] = { 6233 + .type = HDA_FIXUP_FUNC, 6234 + .v.func = alc288_fixup_surface_swap_dacs, 6235 + }, 6248 6236 }; 6249 6237 6250 6238 static const struct hda_quirk alc269_fixup_tbl[] = { ··· 6949 6929 SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 6950 6930 SND_PCI_QUIRK(0x10ec, 0x12f6, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 6951 6931 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_ASPIRE_HEADSET_MIC), 6932 + SND_PCI_QUIRK(0x1414, 0x9c20, "Microsoft Surface Pro 2/3", ALC288_FIXUP_SURFACE_SWAP_DACS), 6952 6933 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), 6953 6934 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP), 6954 6935 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),