From: wangdich9700@163.com
To: tiwai@suse.com, wangdich9700@163.com, perex@perex.cz
Cc: wangdicheng@kylinos.cn, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v2] ALSA: hda/realtek: Limit Line In boost and ADC gain on DECENTA MATX03
Date: Thu, 15 Oct 2026 10:12:10 +0800 [thread overview]
Message-ID: <20261015021210.106392-1-wangdich9700@163.com> (raw)
From: wangdicheng <wangdicheng@kylinos.cn>
The DECENTA MATX03 (ALC897, SSID 1e0b:1297) exposes a high gain
range on both the Line In pin boost and the ADC input amp. Pin 0x1a
reports nsteps=0x03 with stepsize=0x27, that is 0, 9.75, 19.5 and
29.25 dB. ADC 0x08 reports nsteps=0x3f with stepsize=0x02, that is
0 to 31.5 dB in 0.5 dB steps, and defaults to 0x3f (maximum). The
combined 60.75 dB analogue cascade overloads the front-end when the
source level is high, producing audible noise during Line In
monitoring.
Add a new fixup alc897_fixup_limit_linein_boost that overrides the
amp capabilities of pin 0x1a to nsteps=1 (max ~11.75 dB) and ADC
0x08 to nsteps=1 (max ~0.5 dB). The total gain drops from 60.75 dB
to ~12.25 dB, eliminating the clipping.
Signed-off-by: wangdicheng <wangdicheng@kylinos.cn>
---
v1->v2:
- Simplify the fixup function to use hard-coded NIDs (0x1a, 0x08)
instead of generic pin/ADC iteration.
- Move the SND_PCI_QUIRK entry to the proper position sorted by
PCI SSID order.
- Drop the model name addition from alc662_fixup_models[] since it
is not needed.
---
sound/hda/codecs/realtek/alc662.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/sound/hda/codecs/realtek/alc662.c b/sound/hda/codecs/realtek/alc662.c
index eff7c83b9c59..c1c7277b6754 100644
--- a/sound/hda/codecs/realtek/alc662.c
+++ b/sound/hda/codecs/realtek/alc662.c
@@ -198,6 +198,24 @@ static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec,
}
}
+static void alc897_fixup_limit_linein_boost(struct hda_codec *codec,
+ const struct hda_fixup *fix, int action)
+{
+ if (action != HDA_FIXUP_ACT_PROBE)
+ return;
+
+ snd_hda_override_amp_caps(codec, 0x1a, HDA_INPUT,
+ (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
+ (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
+ (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
+ (0 << AC_AMPCAP_MUTE_SHIFT));
+ snd_hda_override_amp_caps(codec, 0x08, HDA_INPUT,
+ (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
+ (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
+ (0x02 << AC_AMPCAP_STEP_SIZE_SHIFT) |
+ (0 << AC_AMPCAP_MUTE_SHIFT));
+}
+
static const struct coef_fw alc668_coefs[] = {
WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
@@ -326,6 +344,7 @@ enum {
ALC897_FIXUP_HEADSET_MIC_PIN3,
ALC662_FIXUP_CSL_GPIO,
ALC897_FIXUP_BEELINK_SER6_AMP,
+ ALC897_FIXUP_LIMIT_LINEIN_BOOST,
};
static const struct hda_fixup alc662_fixups[] = {
@@ -787,6 +806,10 @@ static const struct hda_fixup alc662_fixups[] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc_fixup_gpio4,
},
+ [ALC897_FIXUP_LIMIT_LINEIN_BOOST] = {
+ .type = HDA_FIXUP_FUNC,
+ .v.func = alc897_fixup_limit_linein_boost,
+ },
};
static const struct hda_quirk alc662_fixup_tbl[] = {
@@ -857,6 +880,7 @@ static const struct hda_quirk alc662_fixup_tbl[] = {
SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
SND_PCI_QUIRK(0x1c6c, 0x1239, "Compaq N14JP6-V2", ALC897_FIXUP_HP_HSMIC_VERB),
+ SND_PCI_QUIRK(0x1e0b, 0x1297, "DECENTA MATX03", ALC897_FIXUP_LIMIT_LINEIN_BOOST),
SND_PCI_QUIRK(0x1e63, 0x6d9a, "F+ FLAPTOP r", ALC897_FIXUP_HP_HSMIC_VERB),
SND_PCI_QUIRK(0x1f66, 0x0202, "Beelink SER6 Max 6900", ALC897_FIXUP_BEELINK_SER6_AMP),
--
2.25.1
next reply other threads:[~2026-10-15 2:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 2:12 wangdich9700 [this message]
2026-10-15 7:19 ` Takashi Iwai
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=20261015021210.106392-1-wangdich9700@163.com \
--to=wangdich9700@163.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--cc=wangdicheng@kylinos.cn \
/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®