From 90a6efd154515c07b0342659caaa2844e5c7fd1b Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Tue, 16 Apr 2019 17:34:09 +0300 Subject: [PATCH] TPLG: Change volume capture pipeline gain range to -50 .. +30 dB This patch replaces the -64 to 0 dB volume scale for capture with more practical -50 to +30 dB gain. The step is 1 dB. It allows to compensate for different microphone model sensitivities when constant acoustical decibels to digital decibels level is needed in a microphone capture application. Signed-off-by: Seppo Ingalsuo --- tools/topology/common/tlv.m4 | 10 ++++++++++ tools/topology/sof-apl-dmic.m4 | 6 +++--- tools/topology/sof/pipe-volume-capture.m4 | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/tools/topology/common/tlv.m4 b/tools/topology/common/tlv.m4 index f1a9effc3..cd349ccbd 100644 --- a/tools/topology/common/tlv.m4 +++ b/tools/topology/common/tlv.m4 @@ -12,3 +12,13 @@ SectionTLV."vtlv_m90s3" { mute "1" } } + +SectionTLV."vtlv_m50s1" { + Comment "-50dB step 1dB" + + scale { + min "-5000" + step "100" + mute "1" + } +} diff --git a/tools/topology/sof-apl-dmic.m4 b/tools/topology/sof-apl-dmic.m4 index da3ce9292..19eb0777e 100644 --- a/tools/topology/sof-apl-dmic.m4 +++ b/tools/topology/sof-apl-dmic.m4 @@ -33,14 +33,14 @@ dnl frames, deadline, priority, core) # Passthrough capture pipeline 6 on PCM 6 using max channels defined by CHANNELS. # Schedule 48 frames per 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, +PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, 6, 6, CHANNELS, s32le, 48, 1000, 0, 0) # Passthrough capture pipeline 7 on PCM 7 using max channels defined by CHANNELS. # Schedule 48 frames per 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, - 7, 7, CHANNELS, s16le, +PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, + 7, 7, CHANNELS, s32le, 48, 1000, 0, 0) # diff --git a/tools/topology/sof/pipe-volume-capture.m4 b/tools/topology/sof/pipe-volume-capture.m4 index d8ad46ef4..7f2d27aaa 100644 --- a/tools/topology/sof/pipe-volume-capture.m4 +++ b/tools/topology/sof/pipe-volume-capture.m4 @@ -19,9 +19,9 @@ include(`pipeline.m4') # Volume Mixer control with max value of 32 C_CONTROLMIXER(Master Capture Volume, PIPELINE_ID, CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), - CONTROLMIXER_MAX(, 32), + CONTROLMIXER_MAX(, 80), false, - CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB, vtlv_m90s3), + CONTROLMIXER_TLV(TLV 80 steps from -50dB to +30dB for 1dB, vtlv_m50s1), Channel register and shift for Front Left/Right, LIST(` ', KCONTROL_CHANNEL(FL, 1, 0), KCONTROL_CHANNEL(FR, 1, 1)))