Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH] ASoC: es9356: fix the capture gain dB scale
@ 2026-11-06 15:47 Zachary Huang
  2026-11-06 15:55 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Zachary Huang @ 2026-11-06 15:47 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood, Jaroslav Kysela, Takashi Iwai
  Cc: linux-sound, Mario Limonciello, Vijendar Mukunda, zhangyi,
	Charles Keepax

The two capture gain controls are declared with a TLV step of 3 (FU33,
analog mic) and 6 (FU11, DMIC).  The TLV step is expressed in 0.01 dB
units, so this advertises 0.03 dB and 0.06 dB per step: with a value
range of 0..10 and 0..3 the whole controls appear to span only 0.30 dB
and 0.18 dB.

The hardware steps are 3 dB and 6 dB, i.e. 0..30 dB and 0..18 dB.
Measured on a MECHREVO WUJIE 14SAH (ES9356 on SoundWire link 0) by
recording the same signal at all four FU11 settings:

    FU11=0   rms  523  (-35.9 dBFS)
    FU11=1   rms 1007  (-30.3 dBFS)
    FU11=2   rms 2011  (-24.2 dBFS)
    FU11=3   rms 3794  (-18.7 dBFS)

That is about +6 dB per step, matching the hardware definition rather
than the advertised 0.06 dB.

Because userspace (alsamixer, PipeWire/WirePlumber) derives the volume
from this TLV, the capture gain currently looks like a control without
any usable range, which is also why the default setting seems impossible
to raise from the desktop.

Assisted-by: LLM
Signed-off-by: Zachary Huang <zuzhenhuang365@gmail.com>
---
 sound/soc/codecs/es9356.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/es9356.c b/sound/soc/codecs/es9356.c
index c54bf05..ce48b1e 100644
--- a/sound/soc/codecs/es9356.c
+++ b/sound/soc/codecs/es9356.c
@@ -74,8 +74,8 @@ static int es9356_sdw_component_probe(struct snd_soc_component *component)
 }
 
 static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -9600, 12, 0);
-static const DECLARE_TLV_DB_SCALE(amic_gain_tlv, 0, 3, 0);
-static const DECLARE_TLV_DB_SCALE(dmic_gain_tlv, 0, 6, 0);
+static const DECLARE_TLV_DB_SCALE(amic_gain_tlv, 0, 300, 0);
+static const DECLARE_TLV_DB_SCALE(dmic_gain_tlv, 0, 600, 0);
 
 static const struct snd_kcontrol_new es9356_sdca_controls[] = {
 	SDCA_SINGLE_Q78_TLV("FU41 Left Playback Volume",
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-06 15:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-06 15:47 [PATCH] ASoC: es9356: fix the capture gain dB scale Zachary Huang
2026-11-06 15:55 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox