Skip to contentSkip to conversation

ALSA: hda/realtek: Fix speaker on ASUS ExpertBook B7402FEA after Windows

PATCH Applied Martin Szathmari 2 participants 2 messages Nov 22 – Nov 24 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda/realtek: Fix speaker on ASUS ExpertBook B7402FEA after Windows

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.

---
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(+)
sound/hda/codecs/realtek/alc269.c +21 -0
index a6b5e8987..cdda02054 100644
@@ -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),
Signature · 1 line
2.56.1
Applied
#1 lore raw
Quoted 21 lines · Martin Szathmari

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.

Quoted 5 lines

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.

Applied to for-next branch. Thanks.

Takashi