Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: "René Rebe" <rene@exactco.de>
Cc: linux-sound@vger.kernel.org, kailang@realtek.com
Subject: Re: [PATCH] fixup realtek/alc288 headphone for MS Surface 2, 3 and
Date: Wed, 19 Nov 2025 16:44:42 +0100	[thread overview]
Message-ID: <877bvmc9hx.wl-tiwai@suse.de> (raw)
In-Reply-To: <87a50icaxv.wl-tiwai@suse.de>

On Wed, 19 Nov 2025 16:13:32 +0100,
Takashi Iwai wrote:
> 
> On Mon, 17 Nov 2025 21:07:34 +0100,
> René Rebe wrote:
> > 
> > On Mon, 17 Nov 2025 17:20:03 +0100, Takashi Iwai <tiwai@suse.de> wrote:
> > 
> > > On Sun, 16 Nov 2025 16:26:33 +0100,
> > > René Rebe wrote:
> > > > 
> > > > 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 for
> > > > the built-in speakers?
> > > > 
> > > > I later noticed the Lenovo Ideapad 720S (AMD) exhibited the same
> > > > problem, so this may be a more wide-spread general bug w/ Realtek
> > > > codecs and the hda_auto_parser, ...
> > > 
> > > Usually in a case like this, we provide a fixed wiring by a static DAC
> > > table, or do some other tricks instead of directly writing a verb.
> > > 
> > > Could you give the alsa-info.sh outputs from those?
> > 
> > Sure, here is an slightly older 6.16 kernel I had at hand that did had
> > my fixes applied:
> 
> Thanks.  Could you give the output from the unpatched kernel, too?
> Just to make sure.

... and if the purpose is to just swap DAC assignments between the
headphone and the speaker pins, a patch like below could work better.
(The entry is 


Takashi

-- 8< --
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -3418,6 +3418,21 @@ static void alc283_fixup_dell_hp_resume(struct hda_codec *codec,
 		alc_write_coef_idx(codec, 0xd, 0x2800);
 }
 
+/* Swap DAC assignments for HP and speaker */
+static void alc288_fixup_surface_swap_dacs(struct hda_codec *codec,
+					   const struct hda_fixup *fix, int action)
+{
+	struct alc_spec *spec = codec->spec;
+	static hda_nid_t preferred_pairs[] = {
+		0x21, 0x03, 0x14, 0x02, 0
+	};
+
+	if (action != HDA_FIXUP_ACT_PRE_PROBE)
+		return;
+
+	spec->gen.preferred_dacs = preferred_pairs;
+}
+
 enum {
 	ALC269_FIXUP_GPIO2,
 	ALC269_FIXUP_SONY_VAIO,
@@ -3737,6 +3752,7 @@ enum {
 	ALC269_FIXUP_POSITIVO_P15X_HEADSET_MIC,
 	ALC289_FIXUP_ASUS_ZEPHYRUS_DUAL_SPK,
 	ALC256_FIXUP_VAIO_RPL_MIC_NO_PRESENCE,
+	ALC288_FIXUP_SURFACE_SWAP_DACS,
 };
 
 /* A special fixup for Lenovo C940 and Yoga Duet 7;
@@ -6183,7 +6199,11 @@ static const struct hda_fixup alc269_fixups[] = {
 		},
 		.chained = true,
 		.chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
-	}
+	},
+	[ALC288_FIXUP_SURFACE_SWAP_DACS] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc288_fixup_surface_swap_dacs,
+	},
 };
 
 static const struct hda_quirk alc269_fixup_tbl[] = {
@@ -6883,6 +6903,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
 	SND_PCI_QUIRK(0x10ec, 0x12f6, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
 	SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
+	SND_PCI_QUIRK(0x1414, 0x9c20, "Microsoft Surface Pro 2/3", ALC288_FIXUP_SURFACE_SWAP_DACS),
 	SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
 	SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
 	SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),

  reply	other threads:[~2025-11-19 15:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-16 15:26 [PATCH] fixup realtek/alc288 headphone for MS Surface 2, 3 and René Rebe
2025-11-17 16:20 ` Takashi Iwai
2025-11-17 20:07   ` René Rebe
2025-11-19 15:13     ` Takashi Iwai
2025-11-19 15:44       ` Takashi Iwai [this message]
2025-11-19 17:17         ` René Rebe
2025-11-20  6:52           ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877bvmc9hx.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=kailang@realtek.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=rene@exactco.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox