From 53f90d9c6a49b466a6689e83413b92195b6961c7 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Thu, 4 Oct 2018 16:57:11 +0300 Subject: [PATCH] Topology: DMIC: Reduce PCM capabilities to DMIC configuration This patch impacts topologies sof-apl-nocodec, sof-apl-da7219, and sof-glk-da7219 those use the pipe-passthrough-capture macro for DMIC. The PCM saple rate is limited to 48 kHz (was 8 - 192 kHz). The capture channels count can be only PIPELINE_CHANNELS (was 1 - PIPELINE_CHANNELS). This prevents corrupted audio capture that happens when DMIC topology parameters and capture parameters differ. It happens because DMIC FIFOs drop samples or add unwanted samples when the configuration does not match. In sof-apl-nocodec topology the PIPELINE_CHANNELS is set to 2 that matches the configuration. Signed-off-by: Seppo Ingalsuo --- topology/sof-apl-nocodec.m4 | 4 ++-- topology/sof/pipe-passthrough-capture.m4 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/topology/sof-apl-nocodec.m4 b/topology/sof-apl-nocodec.m4 index da61ece..2a99560 100644 --- a/topology/sof-apl-nocodec.m4 +++ b/topology/sof-apl-nocodec.m4 @@ -112,10 +112,10 @@ PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, 12, 5, 2, s16le, 48, 1000, 0, 0) -# Passthrough capture pipeline 13 on PCM 6 using max 4 channels. +# Passthrough capture pipeline 13 on PCM 6 using max 2 channels. # Schedule 48 frames per 1000us deadline on core 0 with priority 0 PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, - 13, 6, 4, s32le, + 13, 6, 2, s32le, 48, 1000, 0, 0) # diff --git a/topology/sof/pipe-passthrough-capture.m4 b/topology/sof/pipe-passthrough-capture.m4 index 5eb29a2..072b569 100644 --- a/topology/sof/pipe-passthrough-capture.m4 +++ b/topology/sof/pipe-passthrough-capture.m4 @@ -44,4 +44,4 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Capture PCM_ID # PCM Configuration # -PCM_CAPABILITIES(Passthrough Capture PCM_ID, COMP_FORMAT_NAME(PIPELINE_FORMAT), 8000, 192000, 1, PIPELINE_CHANNELS, 2, 16, 192, 16384, 65536, 65536) +PCM_CAPABILITIES(Passthrough Capture PCM_ID, COMP_FORMAT_NAME(PIPELINE_FORMAT), 48000, 48000, PIPELINE_CHANNELS, PIPELINE_CHANNELS, 2, 16, 192, 16384, 65536, 65536)