# --- T2-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # T2 SDE: package/.../linux/surface-audio.patch # Copyright (C) 2017 - 2018 The T2 SDE Project # # More information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # --- T2-COPYRIGHT-NOTE-END --- The Surface Pro 2 and 3 have a strage 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 whatever strangely mixed signal? As the Lenovo Ideapad 720S (AMD) and possibly the Dell XPS13 are also affected, this may be a general bug w/ most Realtek codecs and the hda_auto_parser, ... - Signed-off-by: René Rebe --- linux-4.14/sound/pci/hda/patch_realtek.c.orig 2017-11-17 18:21:34.235707036 +0100 +++ linux-4.14/sound/pci/hda/patch_realtek.c 2017-11-18 16:21:44.736931487 +0100 @@ -4421,8 +4424,7 @@ struct alc_spec *spec = codec->spec; static struct coef_fw coef0255[] = { WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/ - WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref - conteol) */ + WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref control)*/ {} }; static struct coef_fw coef0288[] = { @@ -4755,6 +4757,18 @@ present); } +static void alc288_fixup_headset(struct hda_codec *codec, + const struct hda_fixup *fix, int action) +{ + if (action == HDA_FIXUP_ACT_INIT) { + /* Surface Pro 2 or 3? */ + int nid = codec->core.vendor_id == 0x10ec0280 ? 0x15 : 0x21; + /* DAC node 0x0c is giving low bass output, reverse default order. */ + snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CONNECT_SEL, 1); + + } +} + static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec, const struct hda_fixup *fix, int action) { @@ -5061,7 +5079,7 @@ /* DAC node 0x03 is giving mono output. We therefore want to make sure 0x14 (front speaker) and 0x15 (headphones) use the stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */ - hda_nid_t conn1[2] = { 0x0c }; + hda_nid_t conn1[1] = { 0x0c }; snd_hda_override_conn_list(codec, 0x14, 1, conn1); snd_hda_override_conn_list(codec, 0x15, 1, conn1); } @@ -5386,6 +5386,7 @@ ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, ALC298_FIXUP_TPT470_DOCK, ALC255_FIXUP_DUMMY_LINEOUT_VERB, + ALC288_FIXUP_HEADSET, }; static const struct hda_fixup alc269_fixups[] = { @@ -6083,6 +6102,10 @@ {} } }, + [ALC288_FIXUP_HEADSET] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc288_fixup_headset, + }, }; static const struct snd_pci_quirk alc269_fixup_tbl[] = { @@ -6235,6 +6258,8 @@ SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN), SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), + SND_PCI_QUIRK(0x1414, 0x9c20, "Microsoft Surface Pro 2/3", ALC288_FIXUP_HEADSET), + SND_PCI_QUIRK(0x17aa, 0x3812, "Lenovo ideapad 720S", ALC288_FIXUP_HEADSET), SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),