* [PATCH] ALSA: hda/conexant: Fix microphone mute after power-on reboot
@ 2026-07-01 6:55 dengxiang
2026-07-01 7:37 ` Takashi Iwai
2026-08-12 23:21 ` kernel test robot
0 siblings, 2 replies; 5+ messages in thread
From: dengxiang @ 2026-07-01 6:55 UTC (permalink / raw)
To: tiwai, bo.liu; +Cc: linux-sound, linux-kernel, alsa-devel, dengxiang
Some devices have mute settings in their firmware set by the factory.
This is to stop popping noise when the devices turn on. But this setting
makes the microphones unable to record sound properly. This patch
solves this problem and is compatible with conexant chips.
Signed-off-by: dengxiang <os_dengxiang82@126.com>
---
sound/hda/codecs/conexant.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/sound/hda/codecs/conexant.c b/sound/hda/codecs/conexant.c
index 3d92262763f6..3229f9ef5969 100644
--- a/sound/hda/codecs/conexant.c
+++ b/sound/hda/codecs/conexant.c
@@ -1184,6 +1184,24 @@ static void add_cx5051_fake_mutes(struct hda_codec *codec)
spec->gen.dac_min_mute = true;
}
+static void cxt_fixed_mic_boost(struct hda_codec *codec, hda_nid_t node_id)
+{
+ struct conexant_spec *spec = codec->spec;
+ unsigned int value = 0;
+
+ value = snd_hda_codec_read(codec, node_id, 0, AC_VERB_GET_AMP_GAIN_MUTE, 0);
+ snd_hda_codec_amp_stereo(codec, node_id, HDA_INPUT, 0, HDA_AMP_VOLMASK, value);
+}
+
+static void cxt_capture_hook(struct hda_pcm_stream *hinfo, struct hda_codec *codec,
+ struct snd_pcm_substream *substream, int action)
+{
+ struct conexant_spec *spec = codec->spec;
+ hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
+
+ cxt_fixed_mic_boost(codec, mux_pin);
+}
+
static int cx_probe(struct hda_codec *codec, const struct hda_device_id *id)
{
struct conexant_spec *spec;
@@ -1271,6 +1289,9 @@ static int cx_probe(struct hda_codec *codec, const struct hda_device_id *id)
if (err < 0)
goto error;
+ if (spec->gen.pcm_capture_hook == NULL)
+ spec->gen.pcm_capture_hook = cxt_capture_hook;
+
/* Some laptops with Conexant chips show stalls in S3 resume,
* which falls into the single-cmd mode.
* Better to make reset, then.
--
2.39.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ALSA: hda/conexant: Fix microphone mute after power-on reboot
2026-07-01 6:55 [PATCH] ALSA: hda/conexant: Fix microphone mute after power-on reboot dengxiang
@ 2026-07-01 7:37 ` Takashi Iwai
[not found] ` <235d28fc.65dd.19f1cc1a68d.Coremail.os_dengxiang82@126.com>
2026-08-12 23:21 ` kernel test robot
1 sibling, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2026-07-01 7:37 UTC (permalink / raw)
To: dengxiang; +Cc: tiwai, bo.liu, linux-sound, linux-kernel, alsa-devel
On Wed, 01 Jul 2026 08:55:33 +0200,
dengxiang wrote:
>
> Some devices have mute settings in their firmware set by the factory.
> This is to stop popping noise when the devices turn on. But this setting
> makes the microphones unable to record sound properly. This patch
> solves this problem and is compatible with conexant chips.
>
> Signed-off-by: dengxiang <os_dengxiang82@126.com>
Hmm, this doesn't look like a right solution.
Is it only the problem after the boot? Or is it an issue after the
runtime PM suspend? The amp value must be restored by the runtime
resume, and if this doesn't work expected, it's a thing to be
addressed there, not in the PCM hook at all.
thanks,
Takashi
> ---
> sound/hda/codecs/conexant.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/sound/hda/codecs/conexant.c b/sound/hda/codecs/conexant.c
> index 3d92262763f6..3229f9ef5969 100644
> --- a/sound/hda/codecs/conexant.c
> +++ b/sound/hda/codecs/conexant.c
> @@ -1184,6 +1184,24 @@ static void add_cx5051_fake_mutes(struct hda_codec *codec)
> spec->gen.dac_min_mute = true;
> }
>
> +static void cxt_fixed_mic_boost(struct hda_codec *codec, hda_nid_t node_id)
> +{
> + struct conexant_spec *spec = codec->spec;
> + unsigned int value = 0;
> +
> + value = snd_hda_codec_read(codec, node_id, 0, AC_VERB_GET_AMP_GAIN_MUTE, 0);
> + snd_hda_codec_amp_stereo(codec, node_id, HDA_INPUT, 0, HDA_AMP_VOLMASK, value);
> +}
> +
> +static void cxt_capture_hook(struct hda_pcm_stream *hinfo, struct hda_codec *codec,
> + struct snd_pcm_substream *substream, int action)
> +{
> + struct conexant_spec *spec = codec->spec;
> + hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
> +
> + cxt_fixed_mic_boost(codec, mux_pin);
> +}
> +
> static int cx_probe(struct hda_codec *codec, const struct hda_device_id *id)
> {
> struct conexant_spec *spec;
> @@ -1271,6 +1289,9 @@ static int cx_probe(struct hda_codec *codec, const struct hda_device_id *id)
> if (err < 0)
> goto error;
>
> + if (spec->gen.pcm_capture_hook == NULL)
> + spec->gen.pcm_capture_hook = cxt_capture_hook;
> +
> /* Some laptops with Conexant chips show stalls in S3 resume,
> * which falls into the single-cmd mode.
> * Better to make reset, then.
> --
> 2.39.5
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ALSA: hda/conexant: Fix microphone mute after power-on reboot
[not found] ` <235d28fc.65dd.19f1cc1a68d.Coremail.os_dengxiang82@126.com>
@ 2026-07-01 8:30 ` Takashi Iwai
[not found] ` <4932c551.6ece.19f1cdd10ba.Coremail.os_dengxiang82@126.com>
0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2026-07-01 8:30 UTC (permalink / raw)
To: os_dengxiang82; +Cc: tiwai, bo.liu, linux-sound, linux-kernel, alsa-devel
On Wed, 01 Jul 2026 10:18:00 +0200,
os_dengxiang82 wrote:
>
>
> Hi Takashi,
>
> This failure occurs during bootup as well as after runtime resume. Does
> runtime resume here refer to the resume handler, like .resume = cx_resume? or
> something else? Looking forward to your reply.
It's hda_codec_runtime_resume(). We have no Conexant-specific resume
callback, hence the standard procedure is applied, i.e.
regcache_mark_dirty() and snd_hda_regmap_sync() make the codec verbs
resumed that have been touched. So, you'd need to check whether the
needed amp has been already accessed via regmap, and check whether the
value gets restored properly in the procedure above.
Takashi
>
> xiang
>
> At 2026-07-01 15:37:22, "Takashi Iwai" <tiwai@suse.de> wrote:
> >On Wed, 01 Jul 2026 08:55:33 +0200,
> >dengxiang wrote:
> >>
> >> Some devices have mute settings in their firmware set by the factory.
> >> This is to stop popping noise when the devices turn on. But this setting
> >> makes the microphones unable to record sound properly. This patch
> >> solves this problem and is compatible with conexant chips.
> >>
> >> Signed-off-by: dengxiang <os_dengxiang82@126.com>
> >
> >Hmm, this doesn't look like a right solution.
> >
> >Is it only the problem after the boot? Or is it an issue after the
> >runtime PM suspend? The amp value must be restored by the runtime
> >resume, and if this doesn't work expected, it's a thing to be
> >addressed there, not in the PCM hook at all.
> >
> >
> >thanks,
> >
> >Takashi
> >
> >> ---
> >> sound/hda/codecs/conexant.c | 21 +++++++++++++++++++++
> >> 1 file changed, 21 insertions(+)
> >>
> >> diff --git a/sound/hda/codecs/conexant.c b/sound/hda/codecs/conexant.c
> >> index 3d92262763f6..3229f9ef5969 100644
> >> --- a/sound/hda/codecs/conexant.c
> >> +++ b/sound/hda/codecs/conexant.c
> >> @@ -1184,6 +1184,24 @@ static void add_cx5051_fake_mutes(struct hda_codec *codec)
> >> spec->gen.dac_min_mute = true;
> >> }
> >>
> >> +static void cxt_fixed_mic_boost(struct hda_codec *codec, hda_nid_t node_id)
> >> +{
> >> + struct conexant_spec *spec = codec->spec;
> >> + unsigned int value = 0;
> >> +
> >> + value = snd_hda_codec_read(codec, node_id, 0, AC_VERB_GET_AMP_GAIN_MUTE, 0);
> >> + snd_hda_codec_amp_stereo(codec, node_id, HDA_INPUT, 0, HDA_AMP_VOLMASK, value);
> >> +}
> >> +
> >> +static void cxt_capture_hook(struct hda_pcm_stream *hinfo, struct hda_codec *codec,
> >> + struct snd_pcm_substream *substream, int action)
> >> +{
> >> + struct conexant_spec *spec = codec->spec;
> >> + hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
> >> +
> >> + cxt_fixed_mic_boost(codec, mux_pin);
> >> +}
> >> +
> >> static int cx_probe(struct hda_codec *codec, const struct hda_device_id *id)
> >> {
> >> struct conexant_spec *spec;
> >> @@ -1271,6 +1289,9 @@ static int cx_probe(struct hda_codec *codec, const struct hda_device_id *id)
> >> if (err < 0)
> >> goto error;
> >>
> >> + if (spec->gen.pcm_capture_hook == NULL)
> >> + spec->gen.pcm_capture_hook = cxt_capture_hook;
> >> +
> >> /* Some laptops with Conexant chips show stalls in S3 resume,
> >> * which falls into the single-cmd mode.
> >> * Better to make reset, then.
> >> --
> >> 2.39.5
> >>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ALSA: hda/conexant: Fix microphone mute after power-on reboot
[not found] ` <4932c551.6ece.19f1cdd10ba.Coremail.os_dengxiang82@126.com>
@ 2026-07-01 8:50 ` Takashi Iwai
0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2026-07-01 8:50 UTC (permalink / raw)
To: os_dengxiang82; +Cc: tiwai, bo.liu, linux-sound, linux-kernel, alsa-devel
On Wed, 01 Jul 2026 10:47:57 +0200,
os_dengxiang82 wrote:
>
>
> I have already tried calling regcache_mark_dirty() and snd_hda_regmap_sync()
> inside the resume callback, and I’ve also attempted this during the bootup
> phase. But the issue is still present.
Then you need to investigate why this doesn't suffice, instead of an
ad hoc workaround :) We can take a workaround fix, too, but only when
it's the only appropriate solution.
thanks,
Takashi
> At 2026-07-01 16:30:22, "Takashi Iwai" <tiwai@suse.de> wrote:
> >On Wed, 01 Jul 2026 10:18:00 +0200,
> >os_dengxiang82 wrote:
> >>
> >>
> >> Hi Takashi,
> >>
> >> This failure occurs during bootup as well as after runtime resume. Does
> >> runtime resume here refer to the resume handler, like .resume = cx_resume? or
> >> something else? Looking forward to your reply.
> >
> >It's hda_codec_runtime_resume(). We have no Conexant-specific resume
> >callback, hence the standard procedure is applied, i.e.
> >regcache_mark_dirty() and snd_hda_regmap_sync() make the codec verbs
> >resumed that have been touched. So, you'd need to check whether the
> >needed amp has been already accessed via regmap, and check whether the
> >value gets restored properly in the procedure above.
> >
> >
> >Takashi
> >
> >>
> >> xiang
> >>
> >> At 2026-07-01 15:37:22, "Takashi Iwai" <tiwai@suse.de> wrote:
> >> >On Wed, 01 Jul 2026 08:55:33 +0200,
> >> >dengxiang wrote:
> >> >>
> >> >> Some devices have mute settings in their firmware set by the factory.
> >> >> This is to stop popping noise when the devices turn on. But this setting
> >> >> makes the microphones unable to record sound properly. This patch
> >> >> solves this problem and is compatible with conexant chips.
> >> >>
> >> >> Signed-off-by: dengxiang <os_dengxiang82@126.com>
> >> >
> >> >Hmm, this doesn't look like a right solution.
> >> >
> >> >Is it only the problem after the boot? Or is it an issue after the
> >> >runtime PM suspend? The amp value must be restored by the runtime
> >> >resume, and if this doesn't work expected, it's a thing to be
> >> >addressed there, not in the PCM hook at all.
> >> >
> >> >
> >> >thanks,
> >> >
> >> >Takashi
> >> >
> >> >> ---
> >> >> sound/hda/codecs/conexant.c | 21 +++++++++++++++++++++
> >> >> 1 file changed, 21 insertions(+)
> >> >>
> >> >> diff --git a/sound/hda/codecs/conexant.c b/sound/hda/codecs/conexant.c
> >> >> index 3d92262763f6..3229f9ef5969 100644
> >> >> --- a/sound/hda/codecs/conexant.c
> >> >> +++ b/sound/hda/codecs/conexant.c
> >> >> @@ -1184,6 +1184,24 @@ static void add_cx5051_fake_mutes(struct hda_codec *codec)
> >> >> spec->gen.dac_min_mute = true;
> >> >> }
> >> >>
> >> >> +static void cxt_fixed_mic_boost(struct hda_codec *codec, hda_nid_t node_id)
> >> >> +{
> >> >> + struct conexant_spec *spec = codec->spec;
> >> >> + unsigned int value = 0;
> >> >> +
> >> >> + value = snd_hda_codec_read(codec, node_id, 0, AC_VERB_GET_AMP_GAIN_MUTE, 0);
> >> >> + snd_hda_codec_amp_stereo(codec, node_id, HDA_INPUT, 0, HDA_AMP_VOLMASK, value);
> >> >> +}
> >> >> +
> >> >> +static void cxt_capture_hook(struct hda_pcm_stream *hinfo, struct hda_codec *codec,
> >> >> + struct snd_pcm_substream *substream, int action)
> >> >> +{
> >> >> + struct conexant_spec *spec = codec->spec;
> >> >> + hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
> >> >> +
> >> >> + cxt_fixed_mic_boost(codec, mux_pin);
> >> >> +}
> >> >> +
> >> >> static int cx_probe(struct hda_codec *codec, const struct hda_device_id *id)
> >> >> {
> >> >> struct conexant_spec *spec;
> >> >> @@ -1271,6 +1289,9 @@ static int cx_probe(struct hda_codec *codec, const struct hda_device_id *id)
> >> >> if (err < 0)
> >> >> goto error;
> >> >>
> >> >> + if (spec->gen.pcm_capture_hook == NULL)
> >> >> + spec->gen.pcm_capture_hook = cxt_capture_hook;
> >> >> +
> >> >> /* Some laptops with Conexant chips show stalls in S3 resume,
> >> >> * which falls into the single-cmd mode.
> >> >> * Better to make reset, then.
> >> >> --
> >> >> 2.39.5
> >> >>
> >>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ALSA: hda/conexant: Fix microphone mute after power-on reboot
2026-07-01 6:55 [PATCH] ALSA: hda/conexant: Fix microphone mute after power-on reboot dengxiang
2026-07-01 7:37 ` Takashi Iwai
@ 2026-08-12 23:21 ` kernel test robot
1 sibling, 0 replies; 5+ messages in thread
From: kernel test robot @ 2026-08-12 23:21 UTC (permalink / raw)
To: dengxiang, tiwai, bo.liu
Cc: oe-kbuild-all, linux-sound, linux-kernel, alsa-devel, dengxiang
Hi dengxiang,
kernel test robot noticed the following build warnings:
[auto build test WARNING on tiwai-sound/for-next]
[also build test WARNING on tiwai-sound/for-linus linus/master v7.2-rc7 next-20260811]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/dengxiang/ALSA-hda-conexant-Fix-microphone-mute-after-power-on-reboot/20260813-035114
base: https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
patch link: https://lore.kernel.org/r/20260701065533.72517-1-os_dengxiang82%40126.com
patch subject: [PATCH] ALSA: hda/conexant: Fix microphone mute after power-on reboot
config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20260813/202608130757.AUMlBDHD-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260813/202608130757.AUMlBDHD-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202608130757.AUMlBDHD-lkp@intel.com/
All warnings (new ones prefixed by >>):
sound/hda/codecs/conexant.c: In function 'cxt_fixed_mic_boost':
>> sound/hda/codecs/conexant.c:1198:31: warning: unused variable 'spec' [-Wunused-variable]
1198 | struct conexant_spec *spec = codec->spec;
| ^~~~
vim +/spec +1198 sound/hda/codecs/conexant.c
1195
1196 static void cxt_fixed_mic_boost(struct hda_codec *codec, hda_nid_t node_id)
1197 {
> 1198 struct conexant_spec *spec = codec->spec;
1199 unsigned int value = 0;
1200
1201 value = snd_hda_codec_read(codec, node_id, 0, AC_VERB_GET_AMP_GAIN_MUTE, 0);
1202 snd_hda_codec_amp_stereo(codec, node_id, HDA_INPUT, 0, HDA_AMP_VOLMASK, value);
1203 }
1204
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-08-12 23:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01 6:55 [PATCH] ALSA: hda/conexant: Fix microphone mute after power-on reboot dengxiang
2026-07-01 7:37 ` Takashi Iwai
[not found] ` <235d28fc.65dd.19f1cc1a68d.Coremail.os_dengxiang82@126.com>
2026-07-01 8:30 ` Takashi Iwai
[not found] ` <4932c551.6ece.19f1cdd10ba.Coremail.os_dengxiang82@126.com>
2026-07-01 8:50 ` Takashi Iwai
2026-08-12 23:21 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox