From 5e0ebca252f5da4a4723acdf7dba86a0e3928c1e Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 14 Feb 2024 00:11:23 +0000 Subject: [PATCH 1/5] topology2: add -ace and -cavs25 suffixes to HDA topologies This also drops the NHLT-free, cavs25 variants of the HDA generic topologies, keeping only the ace variants. See below. This prepares for merging avs-tplg/ and sof-ace-tplg/ as done in main branch mega commit 65e4c1f8b519 ("topology2: Merge avs-tplg and sof-ace-tplg under production directory") But unlike that mega commit, it's easy to compare outputs before and after this commit and make sure they're the same (they are). Note this does _not_ include the "Deep Buffer cleanups" commit 80f283de0cf4 ("topology2: Mark DeepBuffer D0I3 compatible by default") and commit 4bb48758ad27 ("topology2: Remove redundant DEEPBUFFER_FW_DMA_MS=100 settings") that got rid of the copy/paste/diverge between cavs and ace variants HDA generic and ace HDA generic. Signed-off-by: Marc Herbert --- tools/topology/topology2/avs-tplg/tplg-targets.cmake | 10 +++++----- .../topology/topology2/sof-ace-tplg/tplg-targets.cmake | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/topology/topology2/avs-tplg/tplg-targets.cmake b/tools/topology/topology2/avs-tplg/tplg-targets.cmake index 5dffcab26004..525d1ffeb002 100644 --- a/tools/topology/topology2/avs-tplg/tplg-targets.cmake +++ b/tools/topology/topology2/avs-tplg/tplg-targets.cmake @@ -1,18 +1,18 @@ # SPDX-License-Identifier: BSD-3-Clause # Array of "input-file-name;output-file-name;comma separated pre-processor variables" -set(TPLGS +list(APPEND TPLGS # CAVS HDMI only topology with passthrough pipelines "sof-hda-generic\;sof-hda-generic-idisp\;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,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,\ +"sof-hda-generic\;sof-hda-generic-cavs25-2ch\;\ +HDA_CONFIG=mix,NUM_DMICS=2,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-cavs25-2ch.bin,\ DEEPBUFFER_FW_DMA_MS=100" -"sof-hda-generic\;sof-hda-generic-4ch\;\ -HDA_CONFIG=mix,NUM_DMICS=4,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-4ch.bin,\ +"sof-hda-generic\;sof-hda-generic-cavs25-4ch\;\ +HDA_CONFIG=mix,NUM_DMICS=4,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-cavs25-4ch.bin,\ DEEPBUFFER_FW_DMA_MS=100,\ PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1" diff --git a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake b/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake index 866163d8b001..b7e91e8869f4 100644 --- a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake +++ b/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Array of "input-file-name;output-file-name;comma separated pre-processor variables" -set(TPLGS +list(APPEND TPLGS # HDMI only topology with passthrough pipelines "sof-hda-generic\;sof-hda-generic-idisp\;DEEPBUFFER_FW_DMA_MS=100,\ DEEPBUFFER_D0I3_COMPATIBLE=true" @@ -10,12 +10,12 @@ DEEPBUFFER_D0I3_COMPATIBLE=true" DEEPBUFFER_D0I3_COMPATIBLE=true" # 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,\ +"sof-hda-generic\;sof-hda-generic-ace1-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,DEEPBUFFER_FW_DMA_MS=100,\ +NHLT_BIN=nhlt-sof-hda-generic-ace1-4ch.bin,DEEPBUFFER_FW_DMA_MS=100,\ DEEPBUFFER_D0I3_COMPATIBLE=true" -"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,\ +"sof-hda-generic\;sof-hda-generic-ace1-2ch\;PLATFORM=mtl,\ +HDA_CONFIG=mix,NUM_DMICS=2,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-ace1-2ch.bin,\ DEEPBUFFER_FW_DMA_MS=100,DEEPBUFFER_D0I3_COMPATIBLE=true" # SDW + DMIC topology with passthrough pipelines From f9a07e1e34cfb60768364287f87f7d631a4e552d Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 14 Feb 2024 01:15:42 +0000 Subject: [PATCH 2/5] avs-tplg: drop the NHLT-free, cavs25 variants of HDA generic Keeping only the ace variants that would clash with these. This prepares for merging avs-tplg/ and sof-ace-tplg/ as was done in main branch mega commit 65e4c1f8b519 ("topology2: Merge avs-tplg and sof-ace-tplg under production directory") But unlike that mega commit, it's easy to compare outputs before and after this commit and make sure they're the same (they are). Note this does _not_ include the "Deep Buffer cleanups" commit 80f283de0cf4 ("topology2: Mark DeepBuffer D0I3 compatible by default") and commit 4bb48758ad27 ("topology2: Remove redundant DEEPBUFFER_FW_DMA_MS=100 settings") that got rid of the copy/paste/diverge between cavs and ace variants HDA generic and ace HDA generic. Signed-off-by: Marc Herbert --- tools/topology/topology2/avs-tplg/tplg-targets.cmake | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/topology/topology2/avs-tplg/tplg-targets.cmake b/tools/topology/topology2/avs-tplg/tplg-targets.cmake index 525d1ffeb002..2c23c1b21e03 100644 --- a/tools/topology/topology2/avs-tplg/tplg-targets.cmake +++ b/tools/topology/topology2/avs-tplg/tplg-targets.cmake @@ -2,10 +2,7 @@ # Array of "input-file-name;output-file-name;comma separated pre-processor variables" list(APPEND TPLGS -# CAVS HDMI only topology with passthrough pipelines -"sof-hda-generic\;sof-hda-generic-idisp\;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,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-cavs25-2ch\;\ From 0b2d2678bc648dafbc57125cbceeb8885a629e8a Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 4 Jan 2024 14:19:00 +0200 Subject: [PATCH 3/5] topology2: ONLY merge avs-tplg/ and sof-ace-tplg/ under production/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Main branch commit 65e4c1f8b519 ("topology2: Merge avs-tplg and sof-ace-tplg under production directory") did too many things in the same commit. It should have been split into 2 or 3 different commits. Renaming and splitting a file in the same commit is almost never a good idea. Making actual coding changes at the same time adds insult to injury: it makes these changes almost impossible to spot in the git diff. When you add the usual "stable versus main" branch divergence on top, it all compounds to make a backport incredibly complex, time-consuming and error-prone. So this backport to stable-v2.8 does NOT do all those things at once. It does only the MINIMUM to achieve the "merge of avs-tplg/ and sof-ace-tplg/ under production/" and that's it. Unlike the mega commit, it's very easy to look at the diff. It's also easy to compare outputs before and after this commit and make sure they're the same - they are. When a file is renamed, it _only_ renames that file - as should have been done in the original pull request. All other changes from that original commit are dropped and should be manually cherry-picked to stable-v2.8 if desired or wanted as a dependency and foundation for further backports. -------- original commit message for reference ------- Merge the avs-tplg and sof-ace-tplg under a common production directory. After a successful build CMake will copy the topology files to a target directory from where they can be copied to DUT/release: $ tree tools/build_tools/topology/topology2/target tools/build_tools/topology/topology2/target ├── development │   ├── cavs-sdw-hdmi.tplg │   ├── cavs-sdw-src-gain-mixin.tplg ... │   ├── sof-tgl-nocodec-rtcaec.tplg │   └── sof-tgl-nocodec.tplg ├── sof-ace-tplg -> sof-ipc4-tplg └── sof-ipc4-tplg ├── sof-adl-rt711-4ch.tplg ├── sof-adl-rt711-l0-rt1316-l12-rt714-l3.tplg ... ├── sof-tgl-rt712.tplg └── sof-tgl-rt715-rt711-rt1308-mono.tplg As noted in the documentation, on the deployed system a symlink is needed for ACE1/2 platforms for backwards compatibility: sof-ace-tplg -> sof-ipc4-tplg Link: https://github.com/thesofproject/sof-docs/blob/master/getting_started/intel_debug/introduction.rst#2-topology-file The sof-hda-generic-2/4ch.tplg will be generated without embedded NHLT as it is not used under normal circumstance. Two flavor of the generic topology is generated for CAVS2.5 and ACE1/2 with included NHLT binary in case it is used by existing users, but it is unlikely. Signed-off-by: Peter Ujfalusi (cherry picked from commit 65e4c1f8b5192f0ee13f773da6002581054c270f) --- tools/topology/topology2/CMakeLists.txt | 15 ++++++++--- .../{avs-tplg => production}/CMakeLists.txt | 9 ++++--- .../tplg-targets-ace.cmake} | 0 .../tplg-targets-cavs25.cmake} | 0 .../topology2/sof-ace-tplg/CMakeLists.txt | 27 ------------------- 5 files changed, 16 insertions(+), 35 deletions(-) rename tools/topology/topology2/{avs-tplg => production}/CMakeLists.txt (75%) rename tools/topology/topology2/{sof-ace-tplg/tplg-targets.cmake => production/tplg-targets-ace.cmake} (100%) rename tools/topology/topology2/{avs-tplg/tplg-targets.cmake => production/tplg-targets-cavs25.cmake} (100%) delete mode 100644 tools/topology/topology2/sof-ace-tplg/CMakeLists.txt diff --git a/tools/topology/topology2/CMakeLists.txt b/tools/topology/topology2/CMakeLists.txt index b2742b956dff..2a1ee5483e7e 100644 --- a/tools/topology/topology2/CMakeLists.txt +++ b/tools/topology/topology2/CMakeLists.txt @@ -3,7 +3,15 @@ # 3.17 required: foreach(... IN ZIP_LISTS ) cmake_minimum_required(VERSION 3.17) -add_custom_target(topologies2) +add_custom_target(topologies2 ALL + # Create directory structure to be provided for deployment + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/target/sof-ipc4-tplg + COMMAND ${CMAKE_COMMAND} -E create_symlink sof-ipc4-tplg ${CMAKE_CURRENT_BINARY_DIR}/target/sof-ace-tplg + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/target/development + # copy the topology files only to target + COMMAND ${CMAKE_COMMAND} -E copy_if_different production/*.tplg ${CMAKE_CURRENT_BINARY_DIR}/target/sof-ipc4-tplg/ + COMMAND ${CMAKE_COMMAND} -E copy_if_different development/*.tplg ${CMAKE_CURRENT_BINARY_DIR}/target/development/ +) # Check alsatplg version and build topology2 if alsatplg version is # 1.2.7 or greater, see https://github.com/thesofproject/sof/issues/5323 @@ -29,7 +37,6 @@ add_custom_target(abi_target DEPENDS abi.conf ) -add_dependencies(topologies2 topology2_cavs topology2_ace topology2_dev) -add_subdirectory(avs-tplg) +add_dependencies(topologies2 topology2_dev topology2_prod) add_subdirectory(development) -add_subdirectory(sof-ace-tplg) +add_subdirectory(production) diff --git a/tools/topology/topology2/avs-tplg/CMakeLists.txt b/tools/topology/topology2/production/CMakeLists.txt similarity index 75% rename from tools/topology/topology2/avs-tplg/CMakeLists.txt rename to tools/topology/topology2/production/CMakeLists.txt index 3dd21c511d89..997b8b5da2b1 100644 --- a/tools/topology/topology2/avs-tplg/CMakeLists.txt +++ b/tools/topology/topology2/production/CMakeLists.txt @@ -1,8 +1,9 @@ # SPDX-License-Identifier: BSD-3-Clause -include(tplg-targets.cmake) +include(tplg-targets-cavs25.cmake) +include(tplg-targets-ace.cmake) -add_custom_target(topology2_cavs) +add_custom_target(topology2_prod) foreach(tplg ${TPLGS}) set(defines "") @@ -22,6 +23,6 @@ foreach(tplg ${TPLGS}) "${CMAKE_CURRENT_SOURCE_DIR}/../${input}" "${output}" "${CMAKE_CURRENT_SOURCE_DIR}/../" "${defines}") - add_custom_target(topology2_avs_${output} DEPENDS ${output}.tplg) - add_dependencies(topology2_cavs topology2_avs_${output}) + add_custom_target(topology2_${output} DEPENDS ${output}.tplg) + add_dependencies(topology2_prod topology2_${output}) endforeach() diff --git a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake b/tools/topology/topology2/production/tplg-targets-ace.cmake similarity index 100% rename from tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake rename to tools/topology/topology2/production/tplg-targets-ace.cmake diff --git a/tools/topology/topology2/avs-tplg/tplg-targets.cmake b/tools/topology/topology2/production/tplg-targets-cavs25.cmake similarity index 100% rename from tools/topology/topology2/avs-tplg/tplg-targets.cmake rename to tools/topology/topology2/production/tplg-targets-cavs25.cmake diff --git a/tools/topology/topology2/sof-ace-tplg/CMakeLists.txt b/tools/topology/topology2/sof-ace-tplg/CMakeLists.txt deleted file mode 100644 index 2e512cd14e56..000000000000 --- a/tools/topology/topology2/sof-ace-tplg/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause - -include(tplg-targets.cmake) - -add_custom_target(topology2_ace) - -foreach(tplg ${TPLGS}) - set(defines "") - list(LENGTH tplg length) - list(GET tplg 0 input) - list(GET tplg 1 output) - - math(EXPR last_index "${length}-1") - - # Get the pre-processor definitions from the 3rd item in the list for each topology - # ex: "hda-generic\;hda-generic-2ch\;HDA_CONFIG=gain,DMIC_CH=2", "defines" would contain "HDA_CONFIG=gain,DMIC_CH=2" - if (${last_index} EQUAL 2) - list(GET tplg ${last_index} defines) - endif() - - add_alsatplg2_command("${CMAKE_CURRENT_BINARY_DIR}/../abi.conf" abi_target - "${CMAKE_CURRENT_SOURCE_DIR}/../${input}" "${output}" - "${CMAKE_CURRENT_SOURCE_DIR}/../" "${defines}") - - add_custom_target(topology2_ace_${output} DEPENDS ${output}.tplg) - add_dependencies(topology2_ace topology2_ace_${output}) -endforeach() From 95c488c1165f9d6d06882c7dde9da28842f5cd86 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 14 Feb 2024 01:29:54 +0000 Subject: [PATCH 4/5] topology2: move HDA generic to new -hda-generic.cmake file Zero functional change. Signed-off-by: Marc Herbert --- tools/topology/topology2/production/CMakeLists.txt | 2 ++ .../topology/topology2/production/tplg-targets-ace.cmake | 6 ------ .../topology2/production/tplg-targets-hda-generic.cmake | 9 +++++++++ 3 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 tools/topology/topology2/production/tplg-targets-hda-generic.cmake diff --git a/tools/topology/topology2/production/CMakeLists.txt b/tools/topology/topology2/production/CMakeLists.txt index 997b8b5da2b1..fbaff16bb5bb 100644 --- a/tools/topology/topology2/production/CMakeLists.txt +++ b/tools/topology/topology2/production/CMakeLists.txt @@ -2,6 +2,8 @@ include(tplg-targets-cavs25.cmake) include(tplg-targets-ace.cmake) +include(tplg-targets-hda-generic.cmake) + add_custom_target(topology2_prod) diff --git a/tools/topology/topology2/production/tplg-targets-ace.cmake b/tools/topology/topology2/production/tplg-targets-ace.cmake index b7e91e8869f4..fbdab3c49863 100644 --- a/tools/topology/topology2/production/tplg-targets-ace.cmake +++ b/tools/topology/topology2/production/tplg-targets-ace.cmake @@ -2,12 +2,6 @@ # Array of "input-file-name;output-file-name;comma separated pre-processor variables" list(APPEND TPLGS -# HDMI only topology with passthrough pipelines -"sof-hda-generic\;sof-hda-generic-idisp\;DEEPBUFFER_FW_DMA_MS=100,\ -DEEPBUFFER_D0I3_COMPATIBLE=true" -# HDA topology with mixer-based pipelines for HDA and passthrough pipelines for HDMI -"sof-hda-generic\;sof-hda-generic\;HDA_CONFIG=mix,DEEPBUFFER_FW_DMA_MS=100,\ -DEEPBUFFER_D0I3_COMPATIBLE=true" # 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-ace1-4ch\;PLATFORM=mtl,\ diff --git a/tools/topology/topology2/production/tplg-targets-hda-generic.cmake b/tools/topology/topology2/production/tplg-targets-hda-generic.cmake new file mode 100644 index 000000000000..e86aa0b7a296 --- /dev/null +++ b/tools/topology/topology2/production/tplg-targets-hda-generic.cmake @@ -0,0 +1,9 @@ + +list(APPEND TPLGS +# HDMI only topology with passthrough pipelines +"sof-hda-generic\;sof-hda-generic-idisp\;DEEPBUFFER_FW_DMA_MS=100,\ +DEEPBUFFER_D0I3_COMPATIBLE=true" +# HDA topology with mixer-based pipelines for HDA and passthrough pipelines for HDMI +"sof-hda-generic\;sof-hda-generic\;HDA_CONFIG=mix,DEEPBUFFER_FW_DMA_MS=100,\ +DEEPBUFFER_D0I3_COMPATIBLE=true" +) From cef03a9097a2d1289195f3eae52f3f77b61c28ab Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 14 Feb 2024 01:38:08 +0000 Subject: [PATCH 5/5] topology2: add NHTL-free, 2 DMIC and 4 DMIC HDA generic topologies Addition modelled after main branch mega commit 65e4c1f8b519 ("topology2: Merge avs-tplg and sof-ace-tplg under production directory") As the "Deep Buffer cleanups" commit 80f283de0cf4 ("topology2: Mark DeepBuffer D0I3 compatible by default") and commit 4bb48758ad27 ("topology2: Remove redundant DEEPBUFFER_FW_DMA_MS=100 settings") are not in this stable-v2.8 branch, the following parameters are present here: DEEPBUFFER_FW_DMA_MS=100, DEEPBUFFER_D0I3_COMPATIBLE=true Signed-off-by: Marc Herbert --- .../topology2/production/tplg-targets-hda-generic.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/topology/topology2/production/tplg-targets-hda-generic.cmake b/tools/topology/topology2/production/tplg-targets-hda-generic.cmake index e86aa0b7a296..063901d6d0f0 100644 --- a/tools/topology/topology2/production/tplg-targets-hda-generic.cmake +++ b/tools/topology/topology2/production/tplg-targets-hda-generic.cmake @@ -6,4 +6,13 @@ DEEPBUFFER_D0I3_COMPATIBLE=true" # HDA topology with mixer-based pipelines for HDA and passthrough pipelines for HDMI "sof-hda-generic\;sof-hda-generic\;HDA_CONFIG=mix,DEEPBUFFER_FW_DMA_MS=100,\ DEEPBUFFER_D0I3_COMPATIBLE=true" + +# HDA topology with mixer-based pipelines for HDA and +# passthrough pipelines for HDMI and +# 2 or 4 DMIC, no NHLT blob included in topology +"sof-hda-generic\;sof-hda-generic-2ch\;HDA_CONFIG=mix,NUM_DMICS=2,\ +DEEPBUFFER_FW_DMA_MS=100,DEEPBUFFER_D0I3_COMPATIBLE=true" +"sof-hda-generic\;sof-hda-generic-4ch\;HDA_CONFIG=mix,NUM_DMICS=4,\ +DEEPBUFFER_FW_DMA_MS=100,DEEPBUFFER_D0I3_COMPATIBLE=true,\ +PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1" )