Hi,

On Tue, Mar 25, 2025 at 09:06:10PM +0100, Salvatore Bonaccorso wrote:
> Hi Craig, all
> 
> On Sat, Mar 22, 2025 at 08:55:17AM +0100, Salvatore Bonaccorso wrote:
> > Control: tags -1 + moreinfo upstream
> > 
> > Hi
> > 
> > On Thu, Mar 20, 2025 at 10:55:32AM -0400, C.D. MacEachern wrote:
> > > Package: src:linux
> > > Version: 6.1.129-1
> > > Severity: important
> > > X-Debbugs-Cc: craig.daniel.maceach...@gmail.com
> > > 
> > > Dear Maintainer,
> > > 
> > > After update to kernel image 6.1.0-32 on Debian bookworm my builtin 
> > > microphone
> > > would no longer record
> > > anything - no levels detected and I checked for muted channels with tools 
> > > like
> > > pavucontrol and alsamixer.
> > > 
> > > I found that my microphone was using the `snd_hda_intel` driver in the 
> > > kernel,
> > > so tried rebooting and choosing
> > > the 6.1.0-31 kernel instead to rule out hardware issue. Previous kernel 
> > > works
> > > as expected, mic records and playback
> > > is fine, so some update related to this driver, or the driver itself was
> > > updated and no longer works correctly with
> > > the builtin microphone.
> > 
> > Thanks for reproting the issue (leaving boot log context, hw used,
> > below for context).
> > 
> > I think this might be introduced with 3b4309546b48 ("ALSA: hda: Fix
> > headset detection failure due to unstable sort") wich landed as well
> > in 6.1.129.
> > 
> > If you revert that commit on top of 6.1.129, does that fixes your
> > issue? Would you be able to test this?
> > 
> > #regzbot introduced: v6.1.128..v6.1.129
> > #regzbot link: https://bugs.debian.org/1100928
> > 
> > The solution might be similar to c6557ccf8094 ("ALSA: hda/realtek: Fix
> > microphone regression on ASUS N705UD") from 6.14-rc5 (which got
> > backported to 6.13.6, 6.12.18, 6.6.81 but not yet 6.1.y).
> 
> In case you need help in trying a kernel build with the revet applied,
> I'm attaching the revert patch. With that you can follow
> https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#id-1.6.6.4
> to build a kernel using the `test-patches` helper script to test with.
> 
> Is that enough help so we can confirm the breaking commit?

And now really with the patch attached.

Regards,
Salvatore
>From 99eeccf9207811eb07986f441020b61beffa759b Mon Sep 17 00:00:00 2001
From: Salvatore Bonaccorso <car...@debian.org>
Date: Tue, 25 Mar 2025 21:02:57 +0100
Subject: [PATCH] Revert "ALSA: hda: Fix headset detection failure due to
 unstable sort"

This reverts commit 3b4309546b48fc167aa615a2d881a09c0a97971f.
---
 sound/pci/hda/hda_auto_parser.c | 8 +-------
 sound/pci/hda/hda_auto_parser.h | 1 -
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c
index 58b2e25c448e..7c6b1fe8dfcc 100644
--- a/sound/pci/hda/hda_auto_parser.c
+++ b/sound/pci/hda/hda_auto_parser.c
@@ -80,11 +80,7 @@ static int compare_input_type(const void *ap, const void *bp)
 
 	/* In case one has boost and the other one has not,
 	   pick the one with boost first. */
-	if (a->has_boost_on_pin != b->has_boost_on_pin)
-		return (int)(b->has_boost_on_pin - a->has_boost_on_pin);
-
-	/* Keep the original order */
-	return a->order - b->order;
+	return (int)(b->has_boost_on_pin - a->has_boost_on_pin);
 }
 
 /* Reorder the surround channels
@@ -404,8 +400,6 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec,
 	reorder_outputs(cfg->speaker_outs, cfg->speaker_pins);
 
 	/* sort inputs in the order of AUTO_PIN_* type */
-	for (i = 0; i < cfg->num_inputs; i++)
-		cfg->inputs[i].order = i;
 	sort(cfg->inputs, cfg->num_inputs, sizeof(cfg->inputs[0]),
 	     compare_input_type, NULL);
 
diff --git a/sound/pci/hda/hda_auto_parser.h b/sound/pci/hda/hda_auto_parser.h
index 8bb8202cf284..df63d66af1ab 100644
--- a/sound/pci/hda/hda_auto_parser.h
+++ b/sound/pci/hda/hda_auto_parser.h
@@ -35,7 +35,6 @@ struct auto_pin_cfg_item {
 	unsigned int is_headset_mic:1;
 	unsigned int is_headphone_mic:1; /* Mic-only in headphone jack */
 	unsigned int has_boost_on_pin:1;
-	int order;
 };
 
 struct auto_pin_cfg;
-- 
2.49.0

Reply via email to