From c75a236b902c79a3157e8690623e02620dbb6a55 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Mon, 5 Oct 2026 13:13:53 +0300 Subject: [PATCH] topology2: host-gateway-tdfb-drc-capture: fix channel map/cfg regression Same problem with IncludeByKey + nested Define pattern as present earlier in sdw-dmic-generic: the TDFB_DMIC_CHANNEL_CFG/TDFB_DMIC_CHANNEL_MAP variables are set to zero because outer constants ($CHANNEL_CONFIG_STEREO etc.) evaluate to 0 inside a Define block nested within IncludeByKey. Also another issue in the "8"-channel case: it incorrectly uses TDFB_SDW_DMIC_CHANNEL_CFG/MAP instead of TDFB_DMIC_CHANNEL_CFG/MAP, so this needs a fix as well. Fix by removing the broken initialization block entirely and replacing all four uses of $TDFB_DMIC_CHANNEL_CFG/$TDFB_DMIC_CHANNEL_MAP in the tdfb and drc widget format blocks with direct IncludeByKey.TDFB_DMIC_PCM_CHANNELS blocks using the correct constants. Stereo (2-channel) is handled by defaults. This restores token1904/1905 (in_ch_map/cfg) and token1934/1935 (out_ch_map/cfg) to correct stereo values in the tdfb.40.1 and drc.40.1 widgets when SDW_DMIC_ENHANCED_CAPTURE=true. Fixes: 87dc5819a7ed ("topology2: sdw-dmic-generic: add multiple DMIC number support") Signed-off-by: Kai Vehmanen --- .../cavs/host-gateway-tdfb-drc-capture.conf | 90 ++++++++++++------- 1 file changed, 56 insertions(+), 34 deletions(-) diff --git a/tools/topology/topology2/include/pipelines/cavs/host-gateway-tdfb-drc-capture.conf b/tools/topology/topology2/include/pipelines/cavs/host-gateway-tdfb-drc-capture.conf index 352ffb2389a3..3f681eba391e 100644 --- a/tools/topology/topology2/include/pipelines/cavs/host-gateway-tdfb-drc-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/host-gateway-tdfb-drc-capture.conf @@ -23,32 +23,6 @@ Define { TDFB_DMIC_PCM_CHANNELS 2 } -IncludeByKey.TDFB_DMIC_PCM_CHANNELS { - "1" { - Define { - TDFB_DMIC_CHANNEL_CFG $CHANNEL_CONFIG_MONO - TDFB_DMIC_CHANNEL_MAP $CHANNEL_MAP_MONO - } - } - "2" { - Define { - TDFB_DMIC_CHANNEL_CFG $CHANNEL_CONFIG_STEREO - TDFB_DMIC_CHANNEL_MAP $CHANNEL_MAP_STEREO - } - } - "4" { - Define { - TDFB_DMIC_CHANNEL_CFG $CHANNEL_CONFIG_3_POINT_1 - TDFB_DMIC_CHANNEL_MAP $CHANNEL_MAP_3_POINT_1 - } - } - "8" { - Define { - TDFB_SDW_DMIC_CHANNEL_CFG $CHANNEL_CONFIG_7_POINT_1 - TDFB_SDW_DMIC_CHANNEL_MAP $CHANNEL_MAP_7_POINT_1 - } - } -} Class.Pipeline."host-gateway-tdfb-drc-capture" { @@ -88,8 +62,20 @@ Class.Pipeline."host-gateway-tdfb-drc-capture" { in_bit_depth 32 in_valid_bit_depth 32 in_channels $TDFB_DMIC_PCM_CHANNELS - in_ch_cfg $TDFB_DMIC_CHANNEL_CFG - in_ch_map $TDFB_DMIC_CHANNEL_MAP + IncludeByKey.TDFB_DMIC_PCM_CHANNELS { + "1" { + in_ch_cfg $CHANNEL_CONFIG_MONO + in_ch_map $CHANNEL_MAP_MONO + } + "4" { + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + "8" { + in_ch_cfg $CHANNEL_CONFIG_7_POINT_1 + in_ch_map $CHANNEL_MAP_7_POINT_1 + } + } } ] Object.Base.output_audio_format [ @@ -97,8 +83,20 @@ Class.Pipeline."host-gateway-tdfb-drc-capture" { out_bit_depth 32 out_valid_bit_depth 32 out_channels $TDFB_DMIC_PCM_CHANNELS - out_ch_cfg $TDFB_DMIC_CHANNEL_CFG - out_ch_map $TDFB_DMIC_CHANNEL_MAP + IncludeByKey.TDFB_DMIC_PCM_CHANNELS { + "1" { + out_ch_cfg $CHANNEL_CONFIG_MONO + out_ch_map $CHANNEL_MAP_MONO + } + "4" { + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + "8" { + out_ch_cfg $CHANNEL_CONFIG_7_POINT_1 + out_ch_map $CHANNEL_MAP_7_POINT_1 + } + } } ] } @@ -119,8 +117,20 @@ Class.Pipeline."host-gateway-tdfb-drc-capture" { in_bit_depth 32 in_valid_bit_depth 32 in_channels $TDFB_DMIC_PCM_CHANNELS - in_ch_cfg $TDFB_DMIC_CHANNEL_CFG - in_ch_map $TDFB_DMIC_CHANNEL_MAP + IncludeByKey.TDFB_DMIC_PCM_CHANNELS { + "1" { + in_ch_cfg $CHANNEL_CONFIG_MONO + in_ch_map $CHANNEL_MAP_MONO + } + "4" { + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + "8" { + in_ch_cfg $CHANNEL_CONFIG_7_POINT_1 + in_ch_map $CHANNEL_MAP_7_POINT_1 + } + } } ] Object.Base.output_audio_format [ @@ -128,8 +138,20 @@ Class.Pipeline."host-gateway-tdfb-drc-capture" { out_bit_depth 32 out_valid_bit_depth 32 out_channels $TDFB_DMIC_PCM_CHANNELS - out_ch_cfg $TDFB_DMIC_CHANNEL_CFG - out_ch_map $TDFB_DMIC_CHANNEL_MAP + IncludeByKey.TDFB_DMIC_PCM_CHANNELS { + "1" { + out_ch_cfg $CHANNEL_CONFIG_MONO + out_ch_map $CHANNEL_MAP_MONO + } + "4" { + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + "8" { + out_ch_cfg $CHANNEL_CONFIG_7_POINT_1 + out_ch_map $CHANNEL_MAP_7_POINT_1 + } + } } ] }