Skip to contentSkip to conversation

ALSA: hda/realtek: Fix speakers on ASUS ExpertBook PM3606CHA

PATCH Applied Saim Masood 2 participants 2 messages Sep 19 – Sep 28 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda/realtek: Fix speakers on ASUS ExpertBook PM3606CHA

The internal speakers of the ASUS ExpertBook PM3606CHA (Realtek ALC256, PCI SSID 1043:3501) stay silent with the default codec setup, and the headphone jack is not detected either. The codec needs COEF values that differ from its power-on defaults: COEF 0x10, 0x16, 0x35, 0x37 and 0x57 on NID 0x20 have to be set to the values used by the Windows driver. Toggling the codec GPIOs, and the existing ALC256 fixups alone, make no difference.

Apply the COEFs from a new fixup at the INIT action, so that they are restored after resume as well. Chain to ALC256_FIXUP_ASUS_MIC_NO_PRESENCE to keep the headset mic and the jack detection working, which the fallback pin quirk provided before for this machine.

The COEF values were found by the reporter of the Ubuntu bug below, who compared the codec state against the one under the Windows driver.

Tested on an ASUS ExpertBook PM3606CHA (BIOS PM3606CHA.304) with the change applied to v7.2.5: with this fixup alone, the speakers, the headphones with jack detection, and the headset mic all work, also after suspend and resume.

---
 sound/hda/codecs/realtek/alc269.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
sound/hda/codecs/realtek/alc269.c +29 -0
index 8f55c3c00..f8efe6c88 100644
@@ -3552,6 +3552,27 @@ static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
 	alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
 }
 
+static const struct coef_fw alc256_asus_speaker_coefs[] = {
+	WRITE_COEF(0x10, 0x7f20), WRITE_COEF(0x16, 0x0c50), WRITE_COEF(0x35, 0x8d6a),
+	WRITE_COEF(0x37, 0xfe06), WRITE_COEF(0x57, 0x7f7f),
+	{}
+};
+
+static void alc256_fixup_asus_speaker_coefs(struct hda_codec *codec,
+					    const struct hda_fixup *fix,
+					    int action)
+{
+	/*
+	 * The internal speakers of the ASUS ExpertBook PM3606CHA stay silent
+	 * with the default COEF values. These are the values set by the
+	 * Windows driver. They are applied on every init so that they are
+	 * restored after resume, too.
+	 */
+	if (action != HDA_FIXUP_ACT_INIT)
+		return;
+	alc_process_coef_fw(codec, alc256_asus_speaker_coefs);
+}
+
 static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
 						    const struct hda_fixup *fix,
 						    int action)
@@ -4398,6 +4419,7 @@ enum {
 	ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN_HEADSET,
 	ALC285_LENOVO_DAC_RENAME,
 	ALC287_FIXUP_YOGA9_SPEAKER2_TO_DAC1,
+	ALC256_FIXUP_ASUS_SPEAKER_COEFS,
 };
 
 /* A special fixup for Lenovo C940 and Yoga Duet 7;
@@ -7142,6 +7164,12 @@ static const struct hda_fixup alc269_fixups[] = {
 		.chained = true,
 		.chain_id = ALC287_FIXUP_TXNW2781_I2C,
 	},
+	[ALC256_FIXUP_ASUS_SPEAKER_COEFS] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc256_fixup_asus_speaker_coefs,
+		.chained = true,
+		.chain_id = ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
+	},
 };
 
 static const struct hda_quirk alc269_fixup_tbl[] = {
@@ -7900,6 +7928,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x1043, 0x31e1, "ASUS B5605CCA", ALC294_FIXUP_ASUS_CS35L41_SPI_2),
 	SND_PCI_QUIRK(0x1043, 0x31f1, "ASUS B3605CCA", ALC294_FIXUP_ASUS_CS35L41_SPI_2),
 	SND_PCI_QUIRK(0x1043, 0x3391, "ASUS PM3606CKA", ALC287_FIXUP_CS35L41_I2C_2),
+	SND_PCI_QUIRK(0x1043, 0x3501, "ASUS PM3606CHA", ALC256_FIXUP_ASUS_SPEAKER_COEFS),
 	SND_PCI_QUIRK(0x1043, 0x3601, "ASUS PM5406CGA", ALC287_FIXUP_CS35L41_I2C_2),
 	SND_PCI_QUIRK(0x1043, 0x3611, "ASUS PM5606CGA", ALC287_FIXUP_CS35L41_I2C_2),
 	SND_PCI_QUIRK(0x1043, 0x3701, "ASUS P5406CCA", ALC245_FIXUP_CS35L41_SPI_2),
Signature · 1 line
2.55.0
Applied
#1 lore raw
Quoted 17 lines · Saim Masood

The internal speakers of the ASUS ExpertBook PM3606CHA (Realtek ALC256, PCI SSID 1043:3501) stay silent with the default codec setup, and the headphone jack is not detected either. The codec needs COEF values that differ from its power-on defaults: COEF 0x10, 0x16, 0x35, 0x37 and 0x57 on NID 0x20 have to be set to the values used by the Windows driver. Toggling the codec GPIOs, and the existing ALC256 fixups alone, make no difference.

Apply the COEFs from a new fixup at the INIT action, so that they are restored after resume as well. Chain to ALC256_FIXUP_ASUS_MIC_NO_PRESENCE to keep the headset mic and the jack detection working, which the fallback pin quirk provided before for this machine.

The COEF values were found by the reporter of the Ubuntu bug below, who compared the codec state against the one under the Windows driver.

Quoted 7 lines

Tested on an ASUS ExpertBook PM3606CHA (BIOS PM3606CHA.304) with the change applied to v7.2.5: with this fixup alone, the speakers, the headphones with jack detection, and the headset mic all work, also after suspend and resume.

Applied to for-next branch. Thanks.

Takashi