* [PATCH 1/2] ALSA: hda/realtek: Accelerate the front MIC charging and discharging of the 897 codec
@ 2025-08-04 3:05 wangdich9700
2025-08-04 3:05 ` [PATCH 2/2] ALSA: hda/realtek: Fix ALC662 codec pop noise on recording wangdich9700
2025-08-04 6:17 ` [PATCH 1/2] ALSA: hda/realtek: Accelerate the front MIC charging and discharging of the 897 codec Takashi Iwai
0 siblings, 2 replies; 4+ messages in thread
From: wangdich9700 @ 2025-08-04 3:05 UTC (permalink / raw)
To: lgirdwood, broonie, perex, tiwai
Cc: linux-kernel, alsa-devel, linux-arm-kernel, wangdicheng
From: wangdicheng <wangdicheng@kylinos.cn>
The front MIC capacitance of the Inspur board is too large, resulting in a longer charging and discharging time required,
which in turn prevents recording for 5 seconds before startup.
Therefore, software is used to increase the delay by 2 seconds to avoid this issue.
Signed-off-by: wangdicheng <wangdicheng@kylinos.cn>
---
sound/pci/hda/patch_realtek.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 877137cb09ac..88675eae9447 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1001,6 +1001,14 @@ static int alc_resume(struct hda_codec *codec)
if (!spec->no_depop_delay)
msleep(150); /* to avoid pop noise */
codec->patch_ops.init(codec);
+
+ if (codec->core.subsystem_id == 0x10ec1304) {
+ snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x04);
+ msleep(50);
+ snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x44);
+ msleep(2000);
+ snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80);
+ }
snd_hda_regmap_sync(codec);
hda_call_check_power_status(codec, 0x01);
return 0;
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 2/2] ALSA: hda/realtek: Fix ALC662 codec pop noise on recording
2025-08-04 3:05 [PATCH 1/2] ALSA: hda/realtek: Accelerate the front MIC charging and discharging of the 897 codec wangdich9700
@ 2025-08-04 3:05 ` wangdich9700
2025-08-04 6:17 ` [PATCH 1/2] ALSA: hda/realtek: Accelerate the front MIC charging and discharging of the 897 codec Takashi Iwai
1 sibling, 0 replies; 4+ messages in thread
From: wangdich9700 @ 2025-08-04 3:05 UTC (permalink / raw)
To: lgirdwood, broonie, perex, tiwai
Cc: linux-kernel, alsa-devel, linux-arm-kernel, wangdicheng
From: wangdicheng <wangdicheng@kylinos.cn>
Pop noise originates from unstable mic_vref during power_save transitions.
Remediation: Disable VREF at resume, delay 1000ms before re-enabling to guarantee circuit stabilization pre-capture.
Signed-off-by: wangdicheng <wangdicheng@kylinos.cn>
---
sound/pci/hda/patch_realtek.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 88675eae9447..665e291dea75 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -997,16 +997,21 @@ static int alc_suspend(struct hda_codec *codec)
static int alc_resume(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
+ int vref_delay = 0;
if (!spec->no_depop_delay)
msleep(150); /* to avoid pop noise */
codec->patch_ops.init(codec);
- if (codec->core.subsystem_id == 0x10ec1304) {
+ if (codec->core.subsystem_id == 0x10ec1304)
+ vref_delay = 2000;
+ else if (codec->core.subsystem_id == 0x1b505809)
+ vref_delay = 1000;
+ if (vref_delay > 0) {
snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x04);
msleep(50);
snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x44);
- msleep(2000);
+ msleep(vref_delay);
snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80);
}
snd_hda_regmap_sync(codec);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 1/2] ALSA: hda/realtek: Accelerate the front MIC charging and discharging of the 897 codec
2025-08-04 3:05 [PATCH 1/2] ALSA: hda/realtek: Accelerate the front MIC charging and discharging of the 897 codec wangdich9700
2025-08-04 3:05 ` [PATCH 2/2] ALSA: hda/realtek: Fix ALC662 codec pop noise on recording wangdich9700
@ 2025-08-04 6:17 ` Takashi Iwai
2025-08-04 7:08 ` Takashi Iwai
1 sibling, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2025-08-04 6:17 UTC (permalink / raw)
To: wangdich9700
Cc: lgirdwood, broonie, perex, tiwai, linux-kernel, alsa-devel,
linux-arm-kernel, wangdicheng
On Mon, 04 Aug 2025 05:05:17 +0200,
wangdich9700@163.com wrote:
>
> From: wangdicheng <wangdicheng@kylinos.cn>
>
> The front MIC capacitance of the Inspur board is too large, resulting in a longer charging and discharging time required,
> which in turn prevents recording for 5 seconds before startup.
> Therefore, software is used to increase the delay by 2 seconds to avoid this issue.
First off, the HD-audio code was replaced in the latest Linus tree to
sound/hda/* directories, so please adapt the patches accordingly.
About the code change:
- The 2.5 seconds wait is way too long and inappropriate to be put in
the resume callback. It has to be fixed differently.
- Does it apply really to all devices with 0x10ec1304? It's Realtek's
vendor id, so this can match to many devices.
- Last but not least, it's not nice to have a code that depends on the
certain vendor id there. Again, please implement in a different way
so that it can be handled in more device-specific code rather than
the common function.
thanks,
Takashi
>
> Signed-off-by: wangdicheng <wangdicheng@kylinos.cn>
> ---
> sound/pci/hda/patch_realtek.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
> index 877137cb09ac..88675eae9447 100644
> --- a/sound/pci/hda/patch_realtek.c
> +++ b/sound/pci/hda/patch_realtek.c
> @@ -1001,6 +1001,14 @@ static int alc_resume(struct hda_codec *codec)
> if (!spec->no_depop_delay)
> msleep(150); /* to avoid pop noise */
> codec->patch_ops.init(codec);
> +
> + if (codec->core.subsystem_id == 0x10ec1304) {
> + snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x04);
> + msleep(50);
> + snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x44);
> + msleep(2000);
> + snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80);
> + }
> snd_hda_regmap_sync(codec);
> hda_call_check_power_status(codec, 0x01);
> return 0;
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH 1/2] ALSA: hda/realtek: Accelerate the front MIC charging and discharging of the 897 codec
2025-08-04 6:17 ` [PATCH 1/2] ALSA: hda/realtek: Accelerate the front MIC charging and discharging of the 897 codec Takashi Iwai
@ 2025-08-04 7:08 ` Takashi Iwai
0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2025-08-04 7:08 UTC (permalink / raw)
To: wangdich9700
Cc: lgirdwood, broonie, perex, tiwai, linux-kernel, alsa-devel,
linux-arm-kernel, wangdicheng
On Mon, 04 Aug 2025 08:17:58 +0200,
Takashi Iwai wrote:
>
> On Mon, 04 Aug 2025 05:05:17 +0200,
> wangdich9700@163.com wrote:
> >
> > From: wangdicheng <wangdicheng@kylinos.cn>
> >
> > The front MIC capacitance of the Inspur board is too large, resulting in a longer charging and discharging time required,
> > which in turn prevents recording for 5 seconds before startup.
> > Therefore, software is used to increase the delay by 2 seconds to avoid this issue.
>
> First off, the HD-audio code was replaced in the latest Linus tree to
> sound/hda/* directories, so please adapt the patches accordingly.
>
> About the code change:
>
> - The 2.5 seconds wait is way too long and inappropriate to be put in
> the resume callback. It has to be fixed differently.
>
> - Does it apply really to all devices with 0x10ec1304? It's Realtek's
> vendor id, so this can match to many devices.
>
> - Last but not least, it's not nice to have a code that depends on the
> certain vendor id there. Again, please implement in a different way
> so that it can be handled in more device-specific code rather than
> the common function.
One more thing: the mailing list for Linux kernel sound stuff is
linux-sound@vger.kernel.org. Please use this one instead of
alsa-devel ML.
thanks,
Takashi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-08-04 7:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-04 3:05 [PATCH 1/2] ALSA: hda/realtek: Accelerate the front MIC charging and discharging of the 897 codec wangdich9700
2025-08-04 3:05 ` [PATCH 2/2] ALSA: hda/realtek: Fix ALC662 codec pop noise on recording wangdich9700
2025-08-04 6:17 ` [PATCH 1/2] ALSA: hda/realtek: Accelerate the front MIC charging and discharging of the 897 codec Takashi Iwai
2025-08-04 7:08 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox