From: Rithvik Vibhu <rithvikvibhu@gmail.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: Jaroslav Kysela <perex@perex.cz>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
Rithvik Vibhu <rithvikvibhu@gmail.com>
Subject: [PATCH v2 2/2] ALSA: hda/realtek: Fix Acer Nitro 5 AN515-57 mic switching
Date: Mon, 14 Sep 2026 18:06:57 -0700 [thread overview]
Message-ID: <20260915010657.36140-3-rithvikvibhu@gmail.com> (raw)
In-Reply-To: <20260915010657.36140-1-rithvikvibhu@gmail.com>
On the Acer Nitro 5 AN515-57 (1025:1539), headset-mic pin 0x19 can
report presence with nothing plugged in after suspend-to-RAM (S3).
It can also report absence after a headset is reinserted. This causes
microphone autoswitching to select the wrong input. Headphone pin
0x21 continues to report plug presence reliably.
Use 0x21 as the presence source for 0x19. Retain the existing mic pin
configuration and coefficient initialization, and enable the existing
Realtek headset-mode fixup to restore the combo jack's input mode
during initialization, resume and jack events.
Headphone presence cannot distinguish three-pole headphones from
four-pole headsets. A three-pole plug is therefore also reported as a
headset microphone and selected by microphone autoswitching.
Tested with the internal microphone and a four-pole headset, including
unplug, reinsertion and S3 suspend/resume.
Fixes: 51db05283f7c ("ALSA: hda/realtek: Enable headset mic for Acer Nitro 5")
Assisted-by: LLM
Signed-off-by: Rithvik Vibhu <rithvikvibhu@gmail.com>
---
sound/hda/codecs/realtek/alc269.c | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index 5127a111c..40b9d1221 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -3740,6 +3740,23 @@ static void alc2xx_fixup_headset_mic(struct hda_codec *codec,
}
}
+static void alc295_fixup_acer_nitro_headset_mode(struct hda_codec *codec,
+ const struct hda_fixup *fix,
+ int action)
+{
+ int err;
+
+ alc2xx_fixup_headset_mic(codec, fix, action);
+ if (action == HDA_FIXUP_ACT_PROBE) {
+ /* Mic pin 0x19 can report either state incorrectly after S3. */
+ err = snd_hda_jack_set_presence_source(codec, 0x19, 0x21);
+ if (err < 0)
+ codec_warn(codec, "failed to set headset presence source: %d\n",
+ err);
+ }
+ alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
+}
+
static void alc245_fixup_hp_spectre_x360_eu0xxx(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
@@ -4336,6 +4353,7 @@ enum {
ALC287_FIXUP_THINKPAD_I2S_SPK,
ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD,
ALC2XX_FIXUP_HEADSET_MIC,
+ ALC295_FIXUP_ACER_NITRO_HEADSET_MODE,
ALC289_FIXUP_DELL_CS35L41_SPI_2,
ALC256_FIXUP_ACER_SFG16_MICMUTE_LED,
ALC256_FIXUP_HEADPHONE_AMP_VOL,
@@ -6861,6 +6879,10 @@ static const struct hda_fixup alc269_fixups[] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc2xx_fixup_headset_mic,
},
+ [ALC295_FIXUP_ACER_NITRO_HEADSET_MODE] = {
+ .type = HDA_FIXUP_FUNC,
+ .v.func = alc295_fixup_acer_nitro_headset_mode,
+ },
[ALC289_FIXUP_DELL_CS35L41_SPI_2] = {
.type = HDA_FIXUP_FUNC,
.v.func = cs35l41_fixup_spi_two,
@@ -7184,7 +7206,8 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
- SND_PCI_QUIRK(0x1025, 0x1539, "Acer Nitro 5 AN515-57", ALC2XX_FIXUP_HEADSET_MIC),
+ SND_PCI_QUIRK(0x1025, 0x1539, "Acer Nitro 5 AN515-57",
+ ALC295_FIXUP_ACER_NITRO_HEADSET_MODE),
SND_PCI_QUIRK(0x1025, 0x159c, "Acer Nitro 5 AN515-58", ALC287_FIXUP_ACER_MICMUTE_LED),
SND_PCI_QUIRK(0x1025, 0x1597, "Acer Nitro 5 AN517-55", ALC2XX_FIXUP_HEADSET_MIC),
SND_PCI_QUIRK(0x1025, 0x159e, "Acer Nitro 5 AN515-46", ALC2XX_FIXUP_HEADSET_MIC),
--
2.55.0
prev parent reply other threads:[~2026-09-15 1:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 23:15 [PATCH] ALSA: hda/realtek: Fix Acer Nitro 5 AN515-57 mic resume Rithvik Vibhu
2026-09-14 16:23 ` Takashi Iwai
2026-09-15 1:06 ` [PATCH v2 0/2] ALSA: hda: Fix Acer Nitro 5 AN515-57 mic switching Rithvik Vibhu
2026-09-15 1:06 ` [PATCH v2 1/2] ALSA: hda: Allow jack presence to follow another pin Rithvik Vibhu
2026-09-15 1:06 ` Rithvik Vibhu [this message]
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=20260915010657.36140-3-rithvikvibhu@gmail.com \
--to=rithvikvibhu@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.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
all inboxes | Powered by JetHome®