Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Martin Szathmari <martin.szathmari@gmail.com>
To: Takashi Iwai <tiwai@suse.com>, Jaroslav Kysela <perex@perex.cz>
Cc: linux-sound@vger.kernel.org
Subject: [PATCH] ALSA: hda/realtek: Fix speaker on ASUS ExpertBook B7402FEA after Windows
Date: Sun, 22 Nov 2026 22:58:57 +0100	[thread overview]
Message-ID: <20261122215857.4580-1-martin.szathmari@gmail.com> (raw)

On the ASUS ExpertBook B7402FEA (ALC294, SSID 1043:1b02), the internal
speaker is silent after a warm reboot from Windows. The Windows driver
leaves two vendor coefficients in a state that the generic init path
does not reset:

  - COEF 0x66 bit 4 is set, which mutes the speaker.
  - COEF 0x1b bit 10 is clear, which distorts the output once the
    speaker is unmuted. This is the same bit ALC294_FIXUP_ASUS_COEF_1B
    sets for the UX431DA.

A cold boot clears both. Comparing all 256 coefficients of node 0x20
after a cold boot and after a reboot from Windows showed five
differences; writing them back one at a time showed only these two
matter.

Add a fixup that clears COEF 0x66 bit 4 and sets COEF 0x1b bit 10 at
init, so they are also restored on resume. ALC294_FIXUP_ASUS_COEF_1B is
not reused because it chains to the GA401 pin fixup, which does not
apply to this machine.

Tested on a B7402FEA (BIOS 308): sound is clean after a reboot from
Windows, and after suspend/resume with both bits forced back to the
Windows values first.

Signed-off-by: Martin Szathmari <martin.szathmari@gmail.com>
---
Based on sound.git for-next.

Note: This patch was developed with the help of an AI coding assistant
(Claude Opus 5.5). I reviewed the change and tested it myself on my
ASUS ExpertBook B7402FEA as described above.

 sound/hda/codecs/realtek/alc269.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index a6b5e8987..cdda02054 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -1116,6 +1116,21 @@ static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
 		alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
 }
 
+/*
+ * After a warm reboot from Windows, bit 4 of COEF 0x66 is left set, which
+ * mutes the internal speaker, and bit 10 of COEF 0x1b is left clear, which
+ * distorts the output. Restore both at init and resume.
+ */
+static void alc294_fixup_asus_spk_coefs(struct hda_codec *codec,
+					const struct hda_fixup *fix,
+					int action)
+{
+	if (action != HDA_FIXUP_ACT_INIT)
+		return;
+	alc_update_coef_idx(codec, 0x66, 1 << 4, 0);
+	alc_update_coef_idx(codec, 0x1b, 0, 1 << 10);
+}
+
 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
 				 const struct hda_fixup *fix, int action)
 {
@@ -4372,6 +4387,7 @@ enum {
 	ALC294_FIXUP_ASUS_ALLY_VERBS,
 	ALC294_FIXUP_ASUS_HPE,
 	ALC294_FIXUP_ASUS_COEF_1B,
+	ALC294_FIXUP_ASUS_SPK_COEFS,
 	ALC294_FIXUP_ASUS_GX502_HP,
 	ALC294_FIXUP_ASUS_GX502_PINS,
 	ALC294_FIXUP_ASUS_GX502_VERBS,
@@ -6249,6 +6265,10 @@ static const struct hda_fixup alc269_fixups[] = {
 		.chained = true,
 		.chain_id = ALC289_FIXUP_ASUS_GA401,
 	},
+	[ALC294_FIXUP_ASUS_SPK_COEFS] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc294_fixup_asus_spk_coefs,
+	},
 	[ALC285_FIXUP_HP_GPIO_LED] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc285_fixup_hp_gpio_led,
@@ -8207,6 +8227,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA", ALC287_FIXUP_CS35L41_I2C_2),
 	SND_PCI_QUIRK(0x1043, 0x1a8e, "ASUS G712LWS", ALC294_FIXUP_LENOVO_MIC_LOCATION),
 	SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
+	SND_PCI_QUIRK(0x1043, 0x1b02, "ASUS ExpertBook B7402FEA", ALC294_FIXUP_ASUS_SPK_COEFS),
 	SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
 	SND_PCI_QUIRK(0x1043, 0x1b13, "ASUS U41SV/GA403U", ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC),
 	SND_PCI_QUIRK(0x1043, 0x1b93, "ASUS G614JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
-- 
2.56.1


             reply	other threads:[~2026-11-22 21:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22 21:58 Martin Szathmari [this message]
2026-11-24 12:53 ` [PATCH] ALSA: hda/realtek: Fix speaker on ASUS ExpertBook B7402FEA after Windows 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=20261122215857.4580-1-martin.szathmari@gmail.com \
    --to=martin.szathmari@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /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