From 8818e50b6a2d21905133e9e4e79e5b5885d12442 Mon Sep 17 00:00:00 2001 From: Rander Wang Date: Mon, 31 Oct 2022 16:41:09 +0800 Subject: [PATCH] topology2: hda: share deep buffer conf setting Deep buffer is mixed with HDA analog. Signed-off-by: Rander Wang --- .../topology2/avs-tplg/CMakeLists.txt | 9 ++-- .../topology2/cavs-mixin-mixout-hda.conf | 46 ++++++------------- .../topology2/sof-ace-tplg/CMakeLists.txt | 10 ++-- 3 files changed, 24 insertions(+), 41 deletions(-) diff --git a/tools/topology/topology2/avs-tplg/CMakeLists.txt b/tools/topology/topology2/avs-tplg/CMakeLists.txt index 00a216453..45ba5df47 100644 --- a/tools/topology/topology2/avs-tplg/CMakeLists.txt +++ b/tools/topology/topology2/avs-tplg/CMakeLists.txt @@ -3,16 +3,17 @@ # Array of "input-file-name;output-file-name;comma separated pre-processor variables" set(TPLGS # CAVS HDMI only topology with passthrough pipelines -"sof-hda-generic\;sof-hda-generic-idisp\;USE_CHAIN_DMA=true" +"sof-hda-generic\;sof-hda-generic-idisp\;USE_CHAIN_DMA=true,DEEPBUFFER_FW_DMA_MS=100" # CAVS HDA topology with mixer-based pipelines for HDA and passthrough pipelines for HDMI -"sof-hda-generic\;sof-hda-generic\;HDA_CONFIG=mix,USE_CHAIN_DMA=true" +"sof-hda-generic\;sof-hda-generic\;HDA_CONFIG=mix,USE_CHAIN_DMA=true,DEEPBUFFER_FW_DMA_MS=100" # If the alsatplg plugins for NHLT are not available, the NHLT blobs will not be added to the # topologies below. "sof-hda-generic\;sof-hda-generic-2ch\;\ -HDA_CONFIG=mix,NUM_DMICS=2,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-2ch.bin,USE_CHAIN_DMA=true" +HDA_CONFIG=mix,NUM_DMICS=2,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-2ch.bin,USE_CHAIN_DMA=true,\ +DEEPBUFFER_FW_DMA_MS=100" "sof-hda-generic\;sof-hda-generic-4ch\;\ HDA_CONFIG=mix,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ -PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-4ch.bin,USE_CHAIN_DMA=true" +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-4ch.bin,USE_CHAIN_DMA=true,DEEPBUFFER_FW_DMA_MS=100" # CAVS SDW topology with passthrough pipelines "cavs-sdw\;cavs-sdw\;DEEPBUFFER_FW_DMA_MS=100" diff --git a/tools/topology/topology2/cavs-mixin-mixout-hda.conf b/tools/topology/topology2/cavs-mixin-mixout-hda.conf index c7f13fac6..d459481d2 100644 --- a/tools/topology/topology2/cavs-mixin-mixout-hda.conf +++ b/tools/topology/topology2/cavs-mixin-mixout-hda.conf @@ -1,7 +1,17 @@ Define { - ANALOG_PLAYBACK_PCM 'Analog Playback' - ANALOG_CAPTURE_PCM 'Analog Capture' - HDA_ANALOG_DAI_NAME 'Analog Playback and Capture' + ANALOG_PLAYBACK_PCM 'Analog Playback' + ANALOG_CAPTURE_PCM 'Analog Capture' + HDA_ANALOG_DAI_NAME 'Analog Playback and Capture' + DEEP_BUFFER_PIPELINE_ID 15 + DEEP_BUFFER_PCM_ID 31 + DEEP_BUFFER_PIPELINE_SRC 'mixin.15.1' + DEEP_BUFFER_PIPELINE_SINK 'mixout.2.1' + DEEP_BUFFER_PCM_NAME 'Deepbuffer HDA Analog' +} + +# include deep buffer config if buffer size is in 1 - 1000 ms. +IncludeByKey.DEEPBUFFER_FW_DMA_MS{ + "[1-1000]" "platform/intel/deep-buffer.conf" } Object.Dai { @@ -43,20 +53,6 @@ Object.Pipeline { } } - deepbuffer-playback.0 { - index 5 - - Object.Widget.copier.1 { - stream_name 'Analog Deepbuffer Playback' - } - - Object.Widget.gain.1 { - Object.Control.mixer.1 { - name '5 3nd Playback Volume' - } - } - } - passthrough-capture.1 { index 3 Object.Widget.copier.1 { @@ -99,18 +95,6 @@ Object.PCM { } direction duplex } - - pcm.1 { - id 1 - name 'DeepBuffer' - Object.Base.fe_dai.'DeepBuffer' {} - Object.PCM.pcm_caps.playback { - name 'Analog Deepbuffer Playback' - formats 'S32_LE,S24_LE,S16_LE' - } - direction playback - } - } # top-level pipeline connections @@ -127,8 +111,4 @@ Object.Base { source 'copier.HDA.4.1' sink 'copier.host.3.1' } - route.4 { - source 'mixin.5.1' - sink 'mixout.2.1' - } } diff --git a/tools/topology/topology2/sof-ace-tplg/CMakeLists.txt b/tools/topology/topology2/sof-ace-tplg/CMakeLists.txt index 4588dac58..f1efa27d0 100644 --- a/tools/topology/topology2/sof-ace-tplg/CMakeLists.txt +++ b/tools/topology/topology2/sof-ace-tplg/CMakeLists.txt @@ -3,15 +3,17 @@ # Array of "input-file-name;output-file-name;comma separated pre-processor variables" set(TPLGS # HDMI only topology with passthrough pipelines -"sof-hda-generic\;sof-hda-generic-idisp\;USE_CHAIN_DMA=true" +"sof-hda-generic\;sof-hda-generic-idisp\;USE_CHAIN_DMA=true,DEEPBUFFER_FW_DMA_MS=100" # HDA topology with mixer-based pipelines for HDA and passthrough pipelines for HDMI -"sof-hda-generic\;sof-hda-generic\;HDA_CONFIG=mix,USE_CHAIN_DMA=true" +"sof-hda-generic\;sof-hda-generic\;HDA_CONFIG=mix,USE_CHAIN_DMA=true,DEEPBUFFER_FW_DMA_MS=100" # If the alsatplg plugins for NHLT are not available, the NHLT blobs will not be added to the # topologies below. "sof-hda-generic\;sof-hda-generic-4ch\;PLATFORM=mtl,\ -HDA_CONFIG=mix,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-4ch.bin" +HDA_CONFIG=mix,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,PREPROCESS_PLUGINS=nhlt,\ +NHLT_BIN=nhlt-sof-hda-generic-4ch.bin,DEEPBUFFER_FW_DMA_MS=100" "sof-hda-generic\;sof-hda-generic-2ch\;PLATFORM=mtl,\ -HDA_CONFIG=mix,NUM_DMICS=2,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-2ch.bin" +HDA_CONFIG=mix,NUM_DMICS=2,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-2ch.bin,\ +DEEPBUFFER_FW_DMA_MS=100" # SDW topology with passthrough pipelines "cavs-sdw\;mtl-sdw"