[PATCH] ALSA: hda/realtek: Fix speaker pop on Star Labs

Sean Rhodes posted 1 patch 1 month, 1 week ago
sound/hda/codecs/realtek/alc269.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
[PATCH] ALSA: hda/realtek: Fix speaker pop on Star Labs
Posted by Sean Rhodes 1 month, 1 week ago
From a673e45b345d494b7ec7143a8ace72faf6aa85f1 Mon Sep 17 00:00:00 2001
From: Sean Rhodes <sean@starlabs.systems>
Date: Tue, 17 Feb 2026 11:53:41 +0000
Subject: [PATCH v2] ALSA: hda/realtek: Fix speaker pop on Star Labs
 StarFighter
To: linux-kernel@vger.kernel.org
Cc: tiwai@suse.com,
    perex@perex.cz,
    sbinding@opensource.cirrus.com,
    kailang@realtek.com,
    chris.chiu@canonical.com,
    edip@medip.dev,
    david.henningsson@canonical.com,
    linux-sound@vger.kernel.org

On Star Labs StarFighter (Realtek ALC233/235), the internal speakers can
emit an audible pop when entering or leaving runtime suspend.

The default Realtek shutup path powers down the codec by toggling EAPD and
adjusting pin widget control. When the speaker path is still unmuted, this
can lead to a pop.

Mute the speaker output paths via snd_hda_gen_shutup_speakers() before
running the normal Realtek shutup path.

Test results: fixes the runtime PM suspend/resume speaker pop.
Pops that can occur on cold boot (G3 exit) and around display manager
start/shutdown are not addressed.

Suggested-by: Takashi Iwai <tiwai@suse.com>
Tested-by: Sean Rhodes <sean@starlabs.systems>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
---
 sound/hda/codecs/realtek/alc269.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/sound/hda/codecs/realtek/alc269.c
b/sound/hda/codecs/realtek/alc269.c
index b66965a52107..fe74cc550322 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -1017,6 +1017,26 @@ static int alc269_resume(struct hda_codec *codec)
 	return 0;
 }

+#define STARLABS_STARFIGHTER_SHUTUP_DELAY_MS	30
+
+static void starlabs_starfighter_shutup(struct hda_codec *codec)
+{
+	if (snd_hda_gen_shutup_speakers(codec))
+		msleep(STARLABS_STARFIGHTER_SHUTUP_DELAY_MS);
+
+	alc_default_shutup(codec);
+}
+
+static void alc233_fixup_starlabs_starfighter(struct hda_codec *codec,
+					      const struct hda_fixup *fix,
+					      int action)
+{
+	struct alc_spec *spec = codec->spec;
+
+	if (action == HDA_FIXUP_ACT_PRE_PROBE)
+		spec->shutup = starlabs_starfighter_shutup;
+}
+
 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
 						 const struct hda_fixup *fix, int action)
 {
@@ -3802,6 +3822,7 @@ enum {
 	ALC245_FIXUP_CLEVO_NOISY_MIC,
 	ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE,
 	ALC233_FIXUP_MEDION_MTL_SPK,
+	ALC233_FIXUP_STARLABS_STARFIGHTER,
 	ALC294_FIXUP_BASS_SPEAKER_15,
 	ALC283_FIXUP_DELL_HP_RESUME,
 	ALC294_FIXUP_ASUS_CS35L41_SPI_2,
@@ -6238,6 +6259,10 @@ static const struct hda_fixup alc269_fixups[] = {
 			{ }
 		},
 	},
+	[ALC233_FIXUP_STARLABS_STARFIGHTER] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc233_fixup_starlabs_starfighter,
+	},
 	[ALC294_FIXUP_BASS_SPEAKER_15] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc294_fixup_bass_speaker_15,
@@ -7370,6 +7395,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x2782, 0x1705, "MEDION E15433", ALC269VC_FIXUP_INFINIX_Y4_MAX),
 	SND_PCI_QUIRK(0x2782, 0x1707, "Vaio VJFE-ADL", ALC298_FIXUP_SPK_VOLUME),
 	SND_PCI_QUIRK(0x2782, 0x4900, "MEDION E15443", ALC233_FIXUP_MEDION_MTL_SPK),
+	SND_PCI_QUIRK(0x7017, 0x2014, "Star Labs StarFighter",
ALC233_FIXUP_STARLABS_STARFIGHTER),
 	SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
 	SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged",
ALC256_FIXUP_INTEL_NUC8_RUGGED),
 	SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
@@ -7466,6 +7492,7 @@ static const struct hda_model_fixup
alc269_fixup_models[] = {
 	{.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
 	{.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
 	{.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
+	{.id = ALC233_FIXUP_STARLABS_STARFIGHTER, .name = "starlabs-starfighter"},
 	{.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
 	{.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
 	{.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
-- 
2.51.0
Re: [PATCH] ALSA: hda/realtek: Fix speaker pop on Star Labs
Posted by Takashi Iwai 1 month, 1 week ago
On Wed, 18 Feb 2026 09:18:42 +0100,
Sean Rhodes wrote:
> 
> From a673e45b345d494b7ec7143a8ace72faf6aa85f1 Mon Sep 17 00:00:00 2001
> From: Sean Rhodes <sean@starlabs.systems>
> Date: Tue, 17 Feb 2026 11:53:41 +0000
> Subject: [PATCH v2] ALSA: hda/realtek: Fix speaker pop on Star Labs
>  StarFighter
> To: linux-kernel@vger.kernel.org
> Cc: tiwai@suse.com,
>     perex@perex.cz,
>     sbinding@opensource.cirrus.com,
>     kailang@realtek.com,
>     chris.chiu@canonical.com,
>     edip@medip.dev,
>     david.henningsson@canonical.com,
>     linux-sound@vger.kernel.org

Those lines appear in the patch description by some reason.
I guess your mailer put it wrongly...

> On Star Labs StarFighter (Realtek ALC233/235), the internal speakers can
> emit an audible pop when entering or leaving runtime suspend.
> 
> The default Realtek shutup path powers down the codec by toggling EAPD and
> adjusting pin widget control. When the speaker path is still unmuted, this
> can lead to a pop.
> 
> Mute the speaker output paths via snd_hda_gen_shutup_speakers() before
> running the normal Realtek shutup path.

Actually, with this setup, any other shutup function is called.
That is, solely muting the outputs suffices for your machine.

> Test results: fixes the runtime PM suspend/resume speaker pop.
> Pops that can occur on cold boot (G3 exit) and around display manager
> start/shutdown are not addressed.

The cold boot might be harder to tackle, but I wonder how the display
manager start/shutdown causes the pop noise.  Does it mean a runtime
resume causes the pop noise, too?


Takashi
Re: [PATCH] ALSA: hda/realtek: Fix speaker pop on Star Labs
Posted by Takashi Iwai 1 month, 1 week ago
On Wed, 18 Feb 2026 09:37:46 +0100,
Takashi Iwai wrote:
> 
> On Wed, 18 Feb 2026 09:18:42 +0100,
> Sean Rhodes wrote:
> > 
> > From a673e45b345d494b7ec7143a8ace72faf6aa85f1 Mon Sep 17 00:00:00 2001
> > From: Sean Rhodes <sean@starlabs.systems>
> > Date: Tue, 17 Feb 2026 11:53:41 +0000
> > Subject: [PATCH v2] ALSA: hda/realtek: Fix speaker pop on Star Labs
> >  StarFighter
> > To: linux-kernel@vger.kernel.org
> > Cc: tiwai@suse.com,
> >     perex@perex.cz,
> >     sbinding@opensource.cirrus.com,
> >     kailang@realtek.com,
> >     chris.chiu@canonical.com,
> >     edip@medip.dev,
> >     david.henningsson@canonical.com,
> >     linux-sound@vger.kernel.org
> 
> Those lines appear in the patch description by some reason.
> I guess your mailer put it wrongly...

Also, when resubmitting a new patch, please put 'v2' or such prefix
("[PATCH v2] ALSA: hda/realtek: ....") to distinguish from the
previous submission.


thanks,

Takashi