From b5445054cc97f910a411ad773354f0ae1bd5f5dc Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Tue, 21 Jul 2020 14:37:10 +0100 Subject: [PATCH] Topology2: introduction to topology2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit About ----- This is a high level keyword extension on top of the existing ALSA conf topology format designed to: 1) Simplify the ALSA conf topology definitions by providing high level "classes" so topology designers need to write less config for common object definitions. 2) Allow simple reuse of objects. Define once and reuse (like M4) with the ability to alter objects configuration attributes from defaults. 3) Allow data type and value verification. This is not done today and frequently crops up in FW bug reports. Common Topology Classes ----------------------- Topology today has some common classes that are often reused throughout with slightly altered configurations. i.e. widgets (components), pipelines, dais and controls. This PR introduces the high level concept of reusable "class" like definitions that can be used to create topology objects e.g. Class.Component - Class for widgets that can be instantiated by pipeline classes/objects. See volume.conf, buffer.conf, host.conf, dai.conf in Class.Pipeline - Class for pipelines that can be instantiated in the top-level conf files. See pipeline-volume.conf in Class.DAI - Class for DAIs such as SSP/DMIC/HDA etc. See ssp.conf in Class.Control- Class for mixers, byte controls, enum controls etc. See mixer.conf in Class.Base - Class for generic objects that cannot be inherited and are not usually instantiated as stand-alone objects but embedded within classes/objects of the above types. Ex: hw_config class for SSP hw_config params, see ssp_hw_config.conf in Common Topology Attributes -------------------------- Topology defines a lot of attributes per object with different types and constraints. Today there is no easy way to validate type or constraints and this can lead to many hard to find problems in FW at runtime. A new keyword "DefineAttribute" has been added to define attribute type, size, min value, max value, enum_values. This then allows alsatplg to validate each topology object attribute. Topology Classes define the list of attributes that they use and whether the attribute is mandatory, can be overridden by parent users or is immutable. This also helps alsatplg emit the appropriate errors for attribute misuse. Common Topology Arguments ------------------------- Arguments are used to pass essential data needed for instantiating an object particularly needed for the object name. Ex: host."5.playback". The first part in the object name stands for the class name “host” and the remaining “5.playback” stand for the 2 arguments needed to instantiate the host object i.e.. pipeline_id and direction. ALSA Conf Parser ---------------- All the changes being proposed and discussed here must be 100% compliant with the ALSA conf parser. i.e. no syntax changes or changes to semantics for any existing keyword. It's intended that there will be NO changes to the ALSA conf parser (unless new keywords require this ?) and all topology building changes will be in the alsatplg compiler. alsatplg Compiler ----------------- The alsatplg compiler requires changes to construct and validate objects based on the new keywords. No changes to existing keywords. Existing topologies will not require any changes. The only two new keywords proposed at the top-level are “Class” and “Object”. All other keywords for class arguments and attributes are limited within the tplg2 compiler changes. Topology2 compiler changes also re-uses most of the code in the conf parser for parsing the configuration for widgets, controls, DAI, hw_config, backends etc. Opens ----- Add platform constraints and capabilities and include them so that alsatplg can apply these platform constraints on top of existing class attribute constraints such as valid SSP port number is 3 or 6 depending on the platform. Signed-off-by: Liam Girdwood Signed-off-by: Ranjani Sridharan --- scripts/build-tools.sh | 10 +- tools/CMakeLists.txt | 1 + tools/topology2/CMakeLists.txt | 38 ++ tools/topology2/cavs-nocodec.conf | 69 +++ tools/topology2/get_abi.sh | 28 ++ .../topology2/include/common/connection.conf | 27 ++ tools/topology2/include/common/data.conf | 8 + tools/topology2/include/common/endpoint.conf | 33 ++ tools/topology2/include/common/manifest.conf | 5 + tools/topology2/include/common/pcm.conf | 37 ++ tools/topology2/include/common/pcm_caps.conf | 71 ++++ tools/topology2/include/common/tokens.conf | 157 +++++++ tools/topology2/include/components/asrc.conf | 93 +++++ .../topology2/include/components/buffer.conf | 91 ++++ .../include/components/component.conf | 64 +++ .../topology2/include/components/copier.conf | 95 +++++ tools/topology2/include/components/dai.conf | 87 ++++ .../topology2/include/components/detect.conf | 78 ++++ .../include/components/detect_data.conf | 17 + .../topology2/include/components/eq-fir.conf | 68 +++ .../topology2/include/components/eq-iir.conf | 71 ++++ .../include/components/eq_iir_coef.conf | 19 + tools/topology2/include/components/host.conf | 80 ++++ tools/topology2/include/components/kpb.conf | 75 ++++ tools/topology2/include/components/mixer.conf | 66 +++ .../include/components/muxdemux.conf | 74 ++++ .../include/components/pipeline.conf | 94 +++++ .../include/components/selector.conf | 73 ++++ .../include/components/smart_amp.conf | 80 ++++ .../include/components/smart_amp_data.conf | 23 + tools/topology2/include/components/src.conf | 78 ++++ .../include/components/virtual_widget.conf | 46 ++ .../topology2/include/components/volume.conf | 133 ++++++ tools/topology2/include/controls/bytes.conf | 62 +++ tools/topology2/include/controls/common.conf | 92 ++++ tools/topology2/include/controls/mixer.conf | 49 +++ tools/topology2/include/dais/alh.conf | 96 +++++ tools/topology2/include/dais/dmic.conf | 132 ++++++ tools/topology2/include/dais/hda.conf | 106 +++++ tools/topology2/include/dais/hw_config.conf | 45 ++ tools/topology2/include/dais/pdm_config.conf | 53 +++ .../include/dais/pipe-copier-capture.conf | 11 + .../include/dais/pipe-copier-playback.conf | 10 + .../include/dais/pipe-dai-capture.conf | 12 + .../include/dais/pipe-dai-playback.conf | 12 + tools/topology2/include/dais/ssp.conf | 136 ++++++ .../cavs/pipeline-passthrough-capture.conf | 82 ++++ .../cavs/pipeline-passthrough-playback.conf | 82 ++++ .../include/pipelines/pipeline-common.conf | 78 ++++ .../include/pipelines/pipeline-detect.conf | 182 ++++++++ .../pipelines/pipeline-highpass-capture.conf | 170 ++++++++ .../pipelines/pipeline-kpb-vol-capture.conf | 193 +++++++++ .../pipeline-passthrough-capture.conf | 106 +++++ .../pipeline-smart-amp-playback.conf | 200 +++++++++ .../pipeline-smart-amp-ref-capture.conf | 160 +++++++ .../pipelines/pipeline-volume-capture.conf | 133 ++++++ .../pipelines/pipeline-volume-playback.conf | 131 ++++++ .../topology2/include/platform/intel/bxt.conf | 21 + tools/topology2/sof-cnl-nocodec.conf | 76 ++++ tools/topology2/sof-hda-generic-2ch.conf | 344 +++++++++++++++ tools/topology2/sof-hda-generic-4ch.conf | 346 +++++++++++++++ tools/topology2/sof-tgl-max98373-rt5682.conf | 381 +++++++++++++++++ .../sof-tgl-sdw-max98373-rt5682-2ch.conf | 393 +++++++++++++++++ .../sof-tgl-sdw-max98373-rt5682-4ch.conf | 394 ++++++++++++++++++ 64 files changed, 6274 insertions(+), 3 deletions(-) create mode 100644 tools/topology2/CMakeLists.txt create mode 100644 tools/topology2/cavs-nocodec.conf create mode 100755 tools/topology2/get_abi.sh create mode 100644 tools/topology2/include/common/connection.conf create mode 100644 tools/topology2/include/common/data.conf create mode 100644 tools/topology2/include/common/endpoint.conf create mode 100644 tools/topology2/include/common/manifest.conf create mode 100644 tools/topology2/include/common/pcm.conf create mode 100644 tools/topology2/include/common/pcm_caps.conf create mode 100644 tools/topology2/include/common/tokens.conf create mode 100644 tools/topology2/include/components/asrc.conf create mode 100644 tools/topology2/include/components/buffer.conf create mode 100644 tools/topology2/include/components/component.conf create mode 100644 tools/topology2/include/components/copier.conf create mode 100644 tools/topology2/include/components/dai.conf create mode 100644 tools/topology2/include/components/detect.conf create mode 100644 tools/topology2/include/components/detect_data.conf create mode 100644 tools/topology2/include/components/eq-fir.conf create mode 100644 tools/topology2/include/components/eq-iir.conf create mode 100644 tools/topology2/include/components/eq_iir_coef.conf create mode 100644 tools/topology2/include/components/host.conf create mode 100644 tools/topology2/include/components/kpb.conf create mode 100644 tools/topology2/include/components/mixer.conf create mode 100644 tools/topology2/include/components/muxdemux.conf create mode 100644 tools/topology2/include/components/pipeline.conf create mode 100644 tools/topology2/include/components/selector.conf create mode 100644 tools/topology2/include/components/smart_amp.conf create mode 100644 tools/topology2/include/components/smart_amp_data.conf create mode 100644 tools/topology2/include/components/src.conf create mode 100644 tools/topology2/include/components/virtual_widget.conf create mode 100644 tools/topology2/include/components/volume.conf create mode 100644 tools/topology2/include/controls/bytes.conf create mode 100644 tools/topology2/include/controls/common.conf create mode 100644 tools/topology2/include/controls/mixer.conf create mode 100644 tools/topology2/include/dais/alh.conf create mode 100644 tools/topology2/include/dais/dmic.conf create mode 100644 tools/topology2/include/dais/hda.conf create mode 100644 tools/topology2/include/dais/hw_config.conf create mode 100644 tools/topology2/include/dais/pdm_config.conf create mode 100644 tools/topology2/include/dais/pipe-copier-capture.conf create mode 100644 tools/topology2/include/dais/pipe-copier-playback.conf create mode 100644 tools/topology2/include/dais/pipe-dai-capture.conf create mode 100644 tools/topology2/include/dais/pipe-dai-playback.conf create mode 100644 tools/topology2/include/dais/ssp.conf create mode 100644 tools/topology2/include/pipelines/cavs/pipeline-passthrough-capture.conf create mode 100644 tools/topology2/include/pipelines/cavs/pipeline-passthrough-playback.conf create mode 100644 tools/topology2/include/pipelines/pipeline-common.conf create mode 100644 tools/topology2/include/pipelines/pipeline-detect.conf create mode 100644 tools/topology2/include/pipelines/pipeline-highpass-capture.conf create mode 100644 tools/topology2/include/pipelines/pipeline-kpb-vol-capture.conf create mode 100644 tools/topology2/include/pipelines/pipeline-passthrough-capture.conf create mode 100644 tools/topology2/include/pipelines/pipeline-smart-amp-playback.conf create mode 100644 tools/topology2/include/pipelines/pipeline-smart-amp-ref-capture.conf create mode 100644 tools/topology2/include/pipelines/pipeline-volume-capture.conf create mode 100644 tools/topology2/include/pipelines/pipeline-volume-playback.conf create mode 100644 tools/topology2/include/platform/intel/bxt.conf create mode 100644 tools/topology2/sof-cnl-nocodec.conf create mode 100644 tools/topology2/sof-hda-generic-2ch.conf create mode 100644 tools/topology2/sof-hda-generic-4ch.conf create mode 100644 tools/topology2/sof-tgl-max98373-rt5682.conf create mode 100644 tools/topology2/sof-tgl-sdw-max98373-rt5682-2ch.conf create mode 100644 tools/topology2/sof-tgl-sdw-max98373-rt5682-4ch.conf diff --git a/scripts/build-tools.sh b/scripts/build-tools.sh index 6718f915689d..15a137471f38 100755 --- a/scripts/build-tools.sh +++ b/scripts/build-tools.sh @@ -16,6 +16,7 @@ usage: $0 [-c|-f|-h|-l|-p|-t|-T] -p Rebuild probes -t Rebuild test topologies -T Rebuild topologies + -z Rebuild topology2 -C No build, only CMake re-configuration EOFUSAGE } @@ -62,6 +63,7 @@ Build commands for respective tools: probes: make -C "$BUILD_TOOLS_DIR" sof-probes tests: make -C "$BUILD_TOOLS_DIR" tests topologies: make -C "$BUILD_TOOLS_DIR" topologies + topology2: make -C "$BUILD_TOOLS_DIR" topology2 fuzzer: make -C "$BUILD_TOOLS_DIR/fuzzer" EOFUSAGE } @@ -70,7 +72,7 @@ main() { local DO_BUILD_ctl DO_BUILD_fuzzer DO_BUILD_logger DO_BUILD_probes \ DO_BUILD_tests DO_BUILD_topologies SCRIPT_DIR SOF_REPO CMAKE_ONLY \ - BUILD_ALL + DO_BUILD_topology2 BUILD_ALL SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) SOF_REPO=$(dirname "$SCRIPT_DIR") : "${BUILD_TOOLS_DIR:=$SOF_REPO/tools/build_tools}" @@ -87,11 +89,12 @@ main() DO_BUILD_probes=false DO_BUILD_tests=false DO_BUILD_topologies=false + DO_BUILD_topology2=false CMAKE_ONLY=false # eval is a sometimes necessary evil # shellcheck disable=SC2034 - while getopts "cfhlptTC" OPTION; do + while getopts "cfhlptTzC" OPTION; do case "$OPTION" in c) DO_BUILD_ctl=true ;; f) DO_BUILD_fuzzer=true ;; @@ -99,6 +102,7 @@ main() p) DO_BUILD_probes=true ;; t) DO_BUILD_tests=true ;; T) DO_BUILD_topologies=true ;; + z) DO_BUILD_topology2=true ;; C) CMAKE_ONLY=true ;; h) print_usage; exit 1;; *) print_usage; exit 1;; @@ -124,7 +128,7 @@ main() fi done - for util in tests topologies; do + for util in tests topologies topology2; do if eval '$DO_BUILD_'$util; then make_tool $util fi diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 076dd3e5a83b..ffce01e72e84 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -26,4 +26,5 @@ add_subdirectory(probes) add_subdirectory(logger) add_subdirectory(ctl) add_subdirectory(topology) +add_subdirectory(topology2) add_subdirectory(test) diff --git a/tools/topology2/CMakeLists.txt b/tools/topology2/CMakeLists.txt new file mode 100644 index 000000000000..e9b727682f9b --- /dev/null +++ b/tools/topology2/CMakeLists.txt @@ -0,0 +1,38 @@ +# SPDX-License-Identifier: BSD-3-Clause + +# Array of "input-file-name;output-file-name;" +# Array of "input-file-name;output-file-name;" +set(TPLGS + "sof-cnl-nocodec\;sof-cnl-nocodec\;" + "cavs-nocodec\;cavs-nocodec\;" + "sof-hda-generic-4ch\;sof-hda-generic-4ch\;" + "sof-hda-generic-2ch\;sof-hda-generic-2ch\;" + "sof-tgl-max98373-rt5682\;sof-tgl-max98373-rt5682\;" + "sof-tgl-sdw-max98373-rt5682-2ch\;sof-tgl-sdw-max98373-rt5682-2ch\;" + "sof-tgl-sdw-max98373-rt5682-4ch\;sof-tgl-sdw-max98373-rt5682-4ch\;" +) + +add_custom_target(topology2 ALL) + +foreach(tplg ${TPLGS}) + list(GET tplg 0 input) + list(GET tplg 1 output) +# Note: this does NOT use VERBATIM, see explanation in ../topology/CMakeLists.txt + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${output}.conf + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/get_abi.sh ${SOF_ROOT_SOURCE_DIRECTORY} + ${CMAKE_CURRENT_SOURCE_DIR}/${input}.conf > ${CMAKE_CURRENT_BINARY_DIR}/${output}.conf + USES_TERMINAL + ) + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${output}.tplg + COMMAND alsatplg \$\${VERBOSE:+-v 1} -c ${CMAKE_CURRENT_BINARY_DIR}/${output}.conf -o ${output}.tplg + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${output}.conf + USES_TERMINAL + ) + + add_custom_target(topology2_${output} DEPENDS ${output}.tplg) + add_dependencies(topology2 topology2_${output}) +endforeach() diff --git a/tools/topology2/cavs-nocodec.conf b/tools/topology2/cavs-nocodec.conf new file mode 100644 index 000000000000..61140d2ddded --- /dev/null +++ b/tools/topology2/cavs-nocodec.conf @@ -0,0 +1,69 @@ +# +# Simple Machine - High level topology - Maps to machine driver. +# +# PCM 0 <-> copier.host.N.0 <-> copier.SSP.0.M <-> SSP0 +# + + + + + + + + + +# +# Pipeline definitions +# + +# Pipeline ID:1 PCM ID: 0 +Object.pipeline-passthrough-playback."1.0" { + pcm_name "Port0" + format "s32le" + channels 2 + rate 48000 +} + +# Pipeline ID:2 PCM ID: 0 +Object.pipeline-passthrough-capture."2.0" { + pcm_name "Port0" + format "s32le" + channels 2 + rate 48000 +} + +# +# List of all DAIs +# +#SSP Index: 0, Direction: duplex +Object.SSP."0.0.duplex" { + dai_name "NoCodec-0" + id 0 + format "s24le" + sample_bits 32 + quirks 64 + hw_config."0" { + mclk_freq 24000000 + bclk_freq 4800000 + tdm_slot_width 32 + } + + # include DAI copier components + + +} + +# +# List of all endpoint connections +# +# Connect: Pipeline 1 -> SSP 0 DAI_IN +Object.connection."endpoint.1.0" { + source "endpoint.sink.pipeline.1.0" + sink "endpoint.source.SSP.0.0" +} + +# Connect: Pipeline 2 <- SSP 0 DAI_OUT +Object.connection."endpoint.2.0" { + source "endpoint.sink.SSP.0.0" + sink "endpoint.source.pipeline.2.0" +} diff --git a/tools/topology2/get_abi.sh b/tools/topology2/get_abi.sh new file mode 100755 index 000000000000..a9ca9c086505 --- /dev/null +++ b/tools/topology2/get_abi.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2019 Intel Corporation. All rights reserved. + +MAJOR=`grep '#define SOF_ABI_MAJOR ' $1/src/include/kernel/abi.h | grep -E ".[[:digit:]]$" -o` +MINOR=`grep '#define SOF_ABI_MINOR ' $1/src/include/kernel/abi.h | grep -E ".[[:digit:]]$" -o` +PATCH=`grep '#define SOF_ABI_PATCH ' $1/src/include/kernel/abi.h | grep -E ".[[:digit:]]$" -o` +MAJOR_SHIFT=`grep '#define SOF_ABI_MAJOR_SHIFT'\ + $1/src/include/kernel/abi.h | grep -E ".[[:digit:]]$" -o` +MINOR_SHIFT=`grep '#define SOF_ABI_MINOR_SHIFT'\ + $1/src/include/kernel/abi.h | grep -E ".[[:digit:]]$" -o` + +major_val=$(($MAJOR << $MAJOR_SHIFT)) +minor_val=$(($MINOR << $MINOR_SHIFT)) +abi_version_3_8=$((3<<$MAJOR_SHIFT | 8<<$MINOR_SHIFT)) +abi_version=$(($major_val | $minor_val)) +abi_version_3_9_or_greater=$(($abi_version > $abi_version_3_8)) +abi_version_3_17=$((3<<$MAJOR_SHIFT | 17<<$MINOR_SHIFT)) +abi_version_3_17_or_greater=$(($abi_version >= $abi_version_3_17)) + +cat $2 +printf "Object.manifest.\"sof_manifest\" {\n" +printf "\tdata.\"sof_manifest\" {\n" +printf "\t\tbytes\t\"0x%02x," $MAJOR +printf "0x%02x," $MINOR +printf "0x%02x\"\n" $PATCH +printf "\t}\n" +printf "}" diff --git a/tools/topology2/include/common/connection.conf b/tools/topology2/include/common/connection.conf new file mode 100644 index 000000000000..44fcf2dcdc53 --- /dev/null +++ b/tools/topology2/include/common/connection.conf @@ -0,0 +1,27 @@ +Class.Custom."connection" { + + @args."type" { + type "string" + } + + @args."pipeline_id" { + type "integer" + } + + @args."index" { + type "integer" + } + + DefineAttribute."source" {} + + DefineAttribute."sink" {} + + DefineAttribute."control" {} + + attributes { + mandatory [ + "source" + "sink" + ] + } +} diff --git a/tools/topology2/include/common/data.conf b/tools/topology2/include/common/data.conf new file mode 100644 index 000000000000..04945eacdbb8 --- /dev/null +++ b/tools/topology2/include/common/data.conf @@ -0,0 +1,8 @@ +Class.Base."data" { + + @args."name" { + type "string" + } + + DefineAttribute."bytes" {} +} diff --git a/tools/topology2/include/common/endpoint.conf b/tools/topology2/include/common/endpoint.conf new file mode 100644 index 000000000000..fc6d81c01821 --- /dev/null +++ b/tools/topology2/include/common/endpoint.conf @@ -0,0 +1,33 @@ +Class.Base."endpoint" { + + # sink/source + @args."type" { + type "string" + constraints { + values [ + "sink" + "source" + ] + } + } + + @args."class_name" { + type "string" + } + + @args."id" { + type "integer" + } + + @args."index" { + type "integer" + } + + DefineAttribute."widget" {} + + attributes { + mandatory [ + "widget" + ] + } +} diff --git a/tools/topology2/include/common/manifest.conf b/tools/topology2/include/common/manifest.conf new file mode 100644 index 000000000000..9436bcccaa0a --- /dev/null +++ b/tools/topology2/include/common/manifest.conf @@ -0,0 +1,5 @@ +Class.Base."manifest" { + @args."name" { + type "string" + } +} diff --git a/tools/topology2/include/common/pcm.conf b/tools/topology2/include/common/pcm.conf new file mode 100644 index 000000000000..fcd3326a549c --- /dev/null +++ b/tools/topology2/include/common/pcm.conf @@ -0,0 +1,37 @@ +Class.PCM."pcm" { + # + # Argument used to construct PCM + # + @args."pcm_name" { + type "string" + } + + @args."direction" { + type "string" + } + + @args."pcm_id" { + type "integer" + } + + DefineAttribute.compress {} + + DefineAttribute.playback_compatible_d0i3 { + # Token reference and type + token_ref "sof_tkn_stream.bool" + } + + DefineAttribute.capture_compatible_d0i3 { + # Token reference and type + token_ref "sof_tkn_stream.bool" + } + + attributes { + mandatory [ + "compress" + ] + } + + # Default values for PCM attributes + compress "false" +} diff --git a/tools/topology2/include/common/pcm_caps.conf b/tools/topology2/include/common/pcm_caps.conf new file mode 100644 index 000000000000..6a01b4c80153 --- /dev/null +++ b/tools/topology2/include/common/pcm_caps.conf @@ -0,0 +1,71 @@ +Class.PCM."pcm_caps" { + # + # Argument used to construct PCM Capabilities + # + @args."pcm_name" { + type "string" + } + + @args."direction" { + type "string" + } + + @args."pcm_id" { + type "integer" + } + + DefineAttribute.formats {} + + DefineAttribute.rates {} + + DefineAttribute.sigbits {} + + DefineAttribute.rate_min {} + + DefineAttribute.rate_max {} + + DefineAttribute.channels_min {} + + DefineAttribute.channels_max {} + + DefineAttribute.periods_min {} + + DefineAttribute.periods_max {} + + DefineAttribute.period_size_min {} + + DefineAttribute.period_size_max {} + + DefineAttribute.buffer_size_min {} + + DefineAttribute.buffer_size_max {} + + attributes { + mandatory [ + "formats " + "rate_min" + "rate_max" + "channels_min" + "channels_max" + "periods_min" + "periods_max" + "period_size_min" + "period_size_max" + "buffer_size_min" + "buffer_size_max" + ] + } + + # Default attribute values for PCM capabilities + formats "S32_LE,S24_LE,S16_LE" + rate_min 48000 + rate_max 48000 + channels_min 2 + channels_max 2 + periods_min 2 + periods_max 16 + period_size_min 192 + period_size_max 16384 + buffer_size_min 65536 + buffer_size_max 65536 +} diff --git a/tools/topology2/include/common/tokens.conf b/tools/topology2/include/common/tokens.conf new file mode 100644 index 000000000000..ff6d39b15a30 --- /dev/null +++ b/tools/topology2/include/common/tokens.conf @@ -0,0 +1,157 @@ + +# +# SOF Tokens for differentiation. +# +# Differentiation can be done at the platform and machine level. +# +# Tokens are GUIDs + +# only the top-level conf file should include this file + +SectionVendorTokens."sof_tkn_volume_ramp_type" { + linear "0" + log "1" + linear_zc "2" + log_zc "3" +} + +SectionVendorTokens."sof_tkn_direction" { + playback "0" + capture "1" +} + +SectionVendorTokens."sof_tkn_buffer" { + size "100" + caps "101" +} + +SectionVendorTokens."sof_dai_tokens" { +# Token retired with ABI 3.2, do not use for new capabilities + dmac_config "153" + type "154" + index "155" + direction "156" +} + +SectionVendorTokens."sof_tkn_scheduler" { + period "200" + priority "201" + mips "202" + core "203" + frames "204" + time_domain "205" + dynamic "206" + lp_mode "207" +} + +SectionVendorTokens."sof_tkn_scheduler_time_domain" { + dma "0" + timer "1" +} + +SectionVendorTokens."sof_tkn_volume" { + ramp_step_type "250" + ramp_step_ms "251" +} + +SectionVendorTokens."sof_tkn_copier" { + cpc "1600" +} + +SectionVendorTokens."sof_tkn_src" { + rate_in "300" + rate_out "301" +} + +SectionVendorTokens."sof_tkn_asrc" { + rate_in "320" + rate_out "321" + asynchronous_mode "322" + operation_mode "323" +} + +SectionVendorTokens."sof_pcm_tokens" { + SOF_TKN_PCM_DMAC_CONFIG "353" +} + +SectionVendorTokens."sof_tkn_comp" { + period_sink_count "400" + period_source_count "401" + format "402" +# Token retired with ABI 3.2, do not use for new capabilities + preload_count "403" + core_id "404" + uuid "405" +} + +SectionVendorTokens."sof_ssp_quirks" { + lbm_mode "64" +} + +SectionVendorTokens."sof_ssp_tokens" { + clks_control "500" + mclk_id "501" + sample_bits "502" + frame_pulse_width "503" + quirks "504" + tdm_padding_per_slot "505" + bclk_delay "506" +} + +SectionVendorTokens."sof_tkn_dmic" { + driver_version "600" + clk_min "601" + clk_max "602" + duty_min "603" + duty_max "604" + num_pdm_active "605" + sample_rate "608" + fifo_word_length "609" + unmute_ramp_time_ms "610" +} + +SectionVendorTokens."sof_tkn_dmic_pdm" { + ctrl_id "700" + mic_a_enable "701" + mic_b_enable "702" + polarity_a "703" + polarity_b "704" + clk_edge "705" + skew "706" +} + +SectionVendorTokens."sof_tone_tokens" { + SOF_TKN_TONE_SAMPLE_RATE "800" +} + +SectionVendorTokens."sof_tkn_process" { + process_type "900" +} + +SectionVendorTokens."sof_sai_tokens" { + SOF_TKN_IMX_SAI_MCLK_ID "1000" +} + +SectionVendorTokens."sof_esai_tokens" { + SOF_TKN_IMX_ESAI_MCLK_ID "1100" +} + +SectionVendorTokens."sof_tkn_stream" { + playback_compatible_d0i3 "1200" + capture_compatible_d0i3 "1201" +} + +SectionVendorTokens."sof_led_tokens" { + SOF_TKN_MUTE_LED_USE "1300" + SOF_TKN_MUTE_LED_DIRECTION "1301" +} + +SectionVendorTokens."sof_tkn_alh" { + rate "1400" + ch "1401" +} + +SectionVendorTokens."sof_tkn_hda" { + rate "1500" + ch "1501" +} diff --git a/tools/topology2/include/components/asrc.conf b/tools/topology2/include/components/asrc.conf new file mode 100644 index 000000000000..da65668bf472 --- /dev/null +++ b/tools/topology2/include/components/asrc.conf @@ -0,0 +1,93 @@ +# +# +# A generic ASRC component. All attributes defined herein are namespaced +# by alsatplg to "src.attribute_name" +# +# Usage: this component can be used by declaring in the "widgets" field of +# a parent object. i.e. +# +# widgets [ +# "asrc.M.N" { +# period_sink_count 2 +# period_source_count 2 +# format "s24le" +# rate_out 48000 +# asynchronous_mode 1 +# operation_mode 0 +# } +# ] + +# +# Where M is pipeline ID and N is a unique integer in the parent object. + +Class.Component."asrc" { + # + # Argument used to construct component: pipeline ID + # + @args."pipeline_id" { + type "integer" + } + + # + # Argument used to construct component: unique index for ASRC widget + # + @args."index" { + type "integer" + } + + #include common component definition + + + DefineAttribute.uuid { + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + DefineAttribute."rate_in" { + # Token set reference name and type + token_ref "sof_tkn_asrc.word" + + } + + DefineAttribute."rate_out" { + # Token set reference name and type + token_ref "sof_tkn_asrc.word" + } + + DefineAttribute."asynchronous_mode" { + # Token set reference name and type + token_ref "sof_tkn_asrc.word" + } + + DefineAttribute."operation_mode" { + # Token set reference name and type + token_ref "sof_tkn_asrc.word" + } + + attributes { + mandatory [ + "no_pm" + "uuid" + "widget_type" + "format" + "rate_out" + "asynchronous_mode" + "operation_mode" + ] + immutable [ + "uuid" + "widget_type" + ] + deprecated [ + "preload_count" + ] + } + + # + # Default attributes for asrc + # + uuid "f6:72:ec:c8:26:85:af:4f:9d:39:a2:3d:0b:54:1d:e2" + widget_type "asrc" + no_pm "true" + core_id 0 +} diff --git a/tools/topology2/include/components/buffer.conf b/tools/topology2/include/components/buffer.conf new file mode 100644 index 000000000000..ba655ff52512 --- /dev/null +++ b/tools/topology2/include/components/buffer.conf @@ -0,0 +1,91 @@ + +# +# Common pipeline buffer +# +# A generic buffer component. All attributes defined herein are namespaced +# by alsatplg to "buffer.attribute_name" +# +# Usage: this component can be used by instantiating it in the parent object. i.e. +# +# buffer."M.N" { +# size "384" +# caps "101" +# } +# +# Where M is pipeline ID and N is a unique integer in the parent object. + +Class.Component."buffer" { + + # + # Argument used to construct component: pipeline ID + # + @args."pipeline_id" { + type "integer" + } + # + # Unique index per widget type in pipeline. + # + @args."index" { + type "integer" + } + + #include common component definition + + + DefineAttribute.uuid { + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + # + # Bespoke Attribute Definitions for Buffers + # + # Buffer size in bytes. Will be calculated based on pipeline params + DefineAttribute.size { + # Token reference and type + token_ref "sof_tkn_buffer.word" + } + + DefineAttribute.periods {} + DefineAttribute.channels {} + + # Buffer memory capabilities + DefineAttribute.caps { + # Token reference and type + token_ref "sof_tkn_buffer.word" + constraints { + value_ref "sof_tkn_mem" + values [ + "dai" + "host" + "pass" + "comp" + ] + } + } + + attributes { + mandatory [ + "no_pm" + "uuid" + "widget_type" + "periods" + "caps" + ] + immutable [ + "uuid" + "widget_type" + ] + deprecated [ + "preload_count" + ] + } + + # + # Default attributes for Buffers + # + widget_type "buffer" + uuid "92:4c:54:42:92:8e:41:4e:b6:79:34:51:9f:1c:1d:28" + no_pm "true" + core_id 0 +} diff --git a/tools/topology2/include/components/component.conf b/tools/topology2/include/components/component.conf new file mode 100644 index 000000000000..731cd396461c --- /dev/null +++ b/tools/topology2/include/components/component.conf @@ -0,0 +1,64 @@ +# Common widget definitions + +# +# Attributes +# + +# +# no_pm - maps to the DAPM widget's reg field +# "false" value indicates that there is no direct DAPM for this widget +# +DefineAttribute."no_pm" {} + +# +# Widget Type - maps to the widget ID with values of type enum SND_SOC_TPLG_DAPM_* +# +DefineAttribute.widget_type {} + +# +# Stream name - maps to the widget's sname +# +DefineAttribute."stream_name" {} + +# +# Widget events to bind to +# +DefineAttribute.event_flags {} +DefineAttribute.event_type {} + +# +# Tuple definitions added to widget's private data +# + +DefineAttribute.period_sink_count { + # Token set reference name and type + token_ref "sof_tkn_comp.word" +} + +DefineAttribute.period_source_count { + # Token set reference name and type + token_ref "sof_tkn_comp.word" +} + +DefineAttribute.format { + # Token set reference name and type + token_ref "sof_tkn_comp.string" + constraints { + values [ + "s16le" + "s24le" + "s32le" + "float" + ] + } +} + +DefineAttribute.core_id { + # Token set reference name and type + token_ref "sof_tkn_comp.word" +} + +DefineAttribute.preload_count { + # Token set reference name and type + token_ref "sof_tkn_comp.word" +} diff --git a/tools/topology2/include/components/copier.conf b/tools/topology2/include/components/copier.conf new file mode 100644 index 000000000000..89746deaca34 --- /dev/null +++ b/tools/topology2/include/components/copier.conf @@ -0,0 +1,95 @@ + +# +# Common pipeline copier +# +# A generic copier component. All attributes defined herein are namespaced +# by alsatplg to "copier.attribute_name" +# +# Usage: this component can be used by instantiating it in the parent object. i.e. +# +# copier."M.N" { +# cpc 100000 +# } +# +# Where M is pipeline ID and N is a unique integer in the parent object. + +Class.Component."copier" { + + # + # copier type in pipeline. + # "host" type for host-facing copiers, "dai" type for copiers interfacing with the BE DAI + # "module" type for module-facing copiers. + # + @args."type" { + constraints { + values [ + "host" + "SSP" #TODO: add more DAIs + "module" + ] + } + } + + + # + # Argument used to construct component + # + @args."pipeline_id" { + type "integer" + } + + # + # Argument used to construct component: unique index + # + @args."index" { + type "integer" + } + + #include common component definition + + + DefineAttribute.uuid { + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + # + # Bespoke Attribute Definitions for Copiers + DefineAttribute.cpc { + # Token set reference name and type + token_ref "sof_tkn_copier.word" + } + + DefineAttribute.direction { + constraints { + values [ + "playback" + "capture" + ] + } + } + + attributes { + mandatory [ + "no_pm" + "uuid" + "widget_type" + "cpc" + ] + immutable [ + "uuid" + ] + deprecated [ + "preload_count" + ] + } + + # + # Default attributes for Buffers + # + #UUID: 9BA00C83-CA12-4A83-943C-1FA2E82F9DDA + uuid "83:0c:a0:9b:12:CA:83:4a:94:3c:1f:a2:e8:2f:9d:da" + no_pm "true" + core_id 0 + cpc 100000 +} diff --git a/tools/topology2/include/components/dai.conf b/tools/topology2/include/components/dai.conf new file mode 100644 index 000000000000..34f0e2f815fd --- /dev/null +++ b/tools/topology2/include/components/dai.conf @@ -0,0 +1,87 @@ +# +# A generic dai component. All attributes defined herein are namespaced +# by alsatplg to "dai.attribute_name" +# +# Usage: this component cannot be instantiated by user. It will be instantiated +# when creating a DAI class object +# + +Class.Component."dai" { + # + # Argument used to construct DAI: type + # + @args."type" { + type "string" + token_ref "sof_dai_tokens.string" + constraints { + values [ + "SSP" + "DMIC" + "HDA" + "ALH" + "ESAI" + ] + } + } + + # DAI Index + @args."index" { + # Token reference and type + token_ref "sof_dai_tokens.word" + type "integer" + } + + # + # DAI direction + # + @args."direction" { + token_ref "sof_dai_tokens.word" + type "string" + constraints { + value_ref "sof_tkn_direction" + values [ + "playback" + "capture" + ] + } + } + + #include common component definition + + + DefineAttribute.uuid { + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + # Bespoke attributes for DAI + DefineAttribute.format { + # Token reference and type + token_ref "sof_tkn_comp.string" + } + + attributes { + mandatory [ + "no_pm" + "uuid" + "widget_type" + "type" + "stream_name" + "format" + "index" + ] + immutable [ + "uuid" + ] + deprecated [ + "preload_count" + ] + } + + # Default attributes for DAI + uuid "27:0d:b0:c2:bc:ff:50:41:a5:1a:24:5c:79:c5:e5:4b" + type "$type" + no_pm "true" + format "$format" + core_id 0 +} diff --git a/tools/topology2/include/components/detect.conf b/tools/topology2/include/components/detect.conf new file mode 100644 index 000000000000..f9cf97dea7d0 --- /dev/null +++ b/tools/topology2/include/components/detect.conf @@ -0,0 +1,78 @@ +# +# +# A generic MIXER component. All attributes defined herein are namespaced +# by alsatplg to "detect.attribute_name" +# +# Usage: this component can be used by declaring in the "widgets" field of +# a parent object. i.e. +# +# widgets [ +# "detect.M.N" { +# period_sink_count 2 +# period_source_count 2 +# } +# ] + +# +# Where M is pipeline ID and N is a unique integer in the parent object. + +Class.Component."detect" { + # + # Argument used to construct component: pipeline ID + # + @args."pipeline_id" { + type "integer" + } + + # + # Argument used to construct component: unique index for Detect widget + # + @args."index" { + type "integer" + } + + #include common component definition + + + DefineAttribute.uuid { + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + DefineAttribute.process_type { + # Token set reference name and type + token_ref "sof_tkn_process.string" + } + + DefineAttribute."detect_config" {} + DefineAttribute."detect_model" {} + + attributes { + mandatory [ + "no_pm" + "uuid" + "widget_type" + "stream_name" + "process_type" + ] + immutable [ + "uuid" + "process_type" + ] + deprecated [ + "preload_count" + ] + } + + # + # Default attributes for detect component + # + uuid "1f:d5:a8:eb:27:78:b5:47:82:ee:de:6e:77:43:af:67" + widget_type "effect" + process_type "KEYWORD_DETECT" + period_source_count 2 + period_sink_count 0 + format "$format" + no_pm "true" + core_id 0 +} diff --git a/tools/topology2/include/components/detect_data.conf b/tools/topology2/include/components/detect_data.conf new file mode 100644 index 000000000000..f4353760d774 --- /dev/null +++ b/tools/topology2/include/components/detect_data.conf @@ -0,0 +1,17 @@ +Object.data."dummy_detect_model" { + bytes "0x53,0x4f,0x46,0x00,0x01,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00" +} + +Object.data."dummy_detect_config" { + bytes "0x53,0x4f,0x46,0x00,0x00,0x00,0x00,0x00, + 0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x34,0x08,0x00,0x00, + 0x03,0x00,0x18,0x00,0x00,0x00,0x00,0x00, + 0xD0,0x07,0x00,0x00,0x00,0x00,0x00,0x00" +} diff --git a/tools/topology2/include/components/eq-fir.conf b/tools/topology2/include/components/eq-fir.conf new file mode 100644 index 000000000000..ccd61a680e69 --- /dev/null +++ b/tools/topology2/include/components/eq-fir.conf @@ -0,0 +1,68 @@ +# +# +# A generic EQ FIR component. All attributes defined herein are namespaced +# by alsatplg to "eqfir.attribute_name" +# +# Usage: this component can be used by declaring in the "widgets" field of +# a parent object. i.e. +# +# widgets [ +# "eqfir.M.N" { +# period_sink_count 2 +# period_source_count 2 +# format "s24le" +# } +# ] + +# +# Where M is pipeline ID and N is a unique integer in the parent object. + +Class.Component."eqfir" { + # + # Argument used to construct component: pipeline ID + # + @args."pipeline_id" { + type "integer" + } + + # + # Argument used to construct component: unique index for EQ FIR widget + # + @args."index" { + type "integer" + } + + #include common component definition + + + DefineAttribute.uuid { + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + DefineAttribute."eqfir_filter" {} + + attributes { + mandatory [ + "no_pm" + "uuid" + "widget_type" + "format" + ] + immutable [ + "uuid" + "widget_type" + ] + deprecated [ + "preload_count" + ] + } + + # + # Default attributes for eqfir + # + uuid "e7:0c:a9:43:a5:f3:df:41:ac:06:ba:98:65:1a:e6:a3" + widget_type "effect" + no_pm "true" + core_id 0 +} diff --git a/tools/topology2/include/components/eq-iir.conf b/tools/topology2/include/components/eq-iir.conf new file mode 100644 index 000000000000..d917b901e0e2 --- /dev/null +++ b/tools/topology2/include/components/eq-iir.conf @@ -0,0 +1,71 @@ +# +# +# A generic EQ IIR component. All attributes defined herein are namespaced +# by alsatplg to "eqiir.attribute_name" +# +# Usage: this component can be used by declaring in the "widgets" field of +# a parent object. i.e. +# +# widgets [ +# "eqiir.M.N" { +# period_sink_count 2 +# period_source_count 2 +# format "s24le" +# } +# ] + +# +# Where M is pipeline ID and N is a unique integer in the parent object. + + +Class.Component."eqiir" { + # + # Argument used to construct component: pipeline ID + # + @args."pipeline_id" { + type "integer" + } + + # + # Argument used to construct component: unique index for EQ IIR widget + # + @args."index" { + type "integer" + } + + #include common component definition + + + DefineAttribute.uuid { + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + DefineAttribute."eqiir_filter" {} + + attributes { + mandatory [ + "no_pm" + "uuid" + "widget_type" + "format" + ] + immutable [ + "uuid" + "widget_type" + ] + deprecated [ + "preload_count" + ] + } + + # + # Default attributes for eqiir + # + uuid "e6:c0:50:51:f9:27:c8:4e:83:51:c7:05:b6:42:d1:2f" + widget_type "effect" + no_pm "true" + period_sink_count 2 + period_source_count 2 + core_id 0 +} diff --git a/tools/topology2/include/components/eq_iir_coef.conf b/tools/topology2/include/components/eq_iir_coef.conf new file mode 100644 index 000000000000..bd73c3711d05 --- /dev/null +++ b/tools/topology2/include/components/eq_iir_coef.conf @@ -0,0 +1,19 @@ + + +Object.data.highpass_50Hz_0dB_48kHz { + bytes "0x53,0x4f,0x46,0x00,0x00,0x00,0x00,0x00, + 0x58,0x00,0x00,0x00,0x00,0xc0,0x00,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x58,0x00,0x00,0x00,0x02,0x00,0x00,0x00, + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x63,0xf3,0x96,0xc0, + 0xc6,0x59,0x68,0x7f,0x6d,0x89,0xed,0x1f, + 0x27,0xed,0x24,0xc0,0x6d,0x89,0xed,0x1f, + 0x00,0x00,0x00,0x00,0xb2,0x7f,0x00,0x00" +} diff --git a/tools/topology2/include/components/host.conf b/tools/topology2/include/components/host.conf new file mode 100644 index 000000000000..da54456b820c --- /dev/null +++ b/tools/topology2/include/components/host.conf @@ -0,0 +1,80 @@ +# +# +# A generic host component. All attributes defined herein are namespaced +# by alsatplg to "host.attribute_name" +# +# Usage: this component can be used by declaring in the "widgets" field of +# a parent object. i.e. +# +# For playback +# widgets [ +# "host.M.N.playback" { +# period_sink_count "2" +# period_source_count "2" +# } +# ] +# For Capture +# widgets [ +# "host.M.N.capture" { +# period_sink_count "2" +# period_source_count "2" +# } +# ] + +# +# Where M is pipeline ID and N is a unique integer in the parent object. + +Class.Component."host" { + # + # Argument used to construct component: pipeline ID + # + @args."pipeline_id" { + type "integer" + } + + # + # PCM direction + # + @args."direction" { + type "string" + } + + #include common component definition + + + DefineAttribute.uuid { + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + DefineAttribute."stream_name" {} + + attributes { + mandatory [ + "no_pm" + "uuid" + "widget_type" + "stream_name" + ] + immutable [ + "uuid" + ] + deprecated [ + "preload_count" + ] + } + + # + # Default attributes for host + # + uuid "0c:10:9d:8b:78:6d:8f:41:90:a3:e0:e8:05:d0:85:2b" + # + # Host widget type depends on @args.direction + # + no_pm "true" + # + # PCM name and ID are inherited from parent pipeline arguments. + # + stream_name "$pcm_name.$direction.$pcm_id" + core_id 0 +} diff --git a/tools/topology2/include/components/kpb.conf b/tools/topology2/include/components/kpb.conf new file mode 100644 index 000000000000..74c5ee0e75c6 --- /dev/null +++ b/tools/topology2/include/components/kpb.conf @@ -0,0 +1,75 @@ +# +# +# A generic KPB component. All attributes defined herein are namespaced +# by alsatplg to "kpb.attribute_name" +# +# Usage: this component can be used by declaring in the "widgets" field of +# a parent object. i.e. +# +# widgets [ +# "kpb.M.N" { +# period_sink_count 2 +# period_source_count 2 +# } +# ] + +# +# Where M is pipeline ID and N is a unique integer in the parent object. + +Class.Component."kpb" { + # + # Argument used to construct component: pipeline ID + # + @args."pipeline_id" { + type "integer" + } + + # + # Argument used to construct component: unique index for Detect widget + # + @args."index" { + type "integer" + } + + #include common component definition + + + DefineAttribute.uuid { + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + DefineAttribute.process_type { + # Token set reference name and type + token_ref "sof_tkn_process.string" + } + + attributes { + mandatory [ + "no_pm" + "uuid" + "widget_type" + "process_type" + "format" + ] + immutable [ + "uuid" + "process_type" + "widget_type" + ] + deprecated [ + "preload_count" + ] + } + + # + # Default attributes for KPB + # + uuid "43:84:21:d8:f3:5f:4c:4a:b3:88:6c:fe:07:b9:56:2e" + widget_type "effect" + period_sink_count 2 + period_source_count 2 + process_type "KPB" + no_pm "true" + core_id 0 +} diff --git a/tools/topology2/include/components/mixer.conf b/tools/topology2/include/components/mixer.conf new file mode 100644 index 000000000000..41c77d137038 --- /dev/null +++ b/tools/topology2/include/components/mixer.conf @@ -0,0 +1,66 @@ +# +# +# A generic MIXER component. All attributes defined herein are namespaced +# by alsatplg to "mixer.attribute_name" +# +# Usage: this component can be used by declaring in the "widgets" field of +# a parent object. i.e. +# +# widgets [ +# "mixer.M.N" { +# period_sink_count 2 +# period_source_count 2 +# format "s24le" +# } +# ] + +# +# Where M is pipeline ID and N is a unique integer in the parent object. + +Class.Component."mixer" { + # + # Argument used to construct component: pipeline ID + # + @args."pipeline_id" { + type "integer" + } + + # + # Argument used to construct component: unique index for MIXER widget + # + @args."index" { + type "integer" + } + + #include common component definition + + + DefineAttribute.uuid { + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + attributes { + mandatory [ + "no_pm" + "uuid" + "widget_type" + "format" + ] + immutable [ + "uuid" + "widget_type" + ] + deprecated [ + "preload_count" + ] + } + + # + # Default attributes for mixer + # + uuid "37:c0:06:bc:aa:12:7c:41:9a:97:89:28:2e:32:1a:76" + widget_type "mixer" + no_pm "true" + core_id 0 +} diff --git a/tools/topology2/include/components/muxdemux.conf b/tools/topology2/include/components/muxdemux.conf new file mode 100644 index 000000000000..5276a1907cb4 --- /dev/null +++ b/tools/topology2/include/components/muxdemux.conf @@ -0,0 +1,74 @@ +# +# +# A generic MUX/DEMUX component. All attributes defined herein are namespaced +# by alsatplg to "muxdemux.attribute_name" +# +# Usage: this component can be used by declaring in the "widgets" field of +# a parent object. i.e. +# +# widgets [ +# "muxdemux.M.N" { +# period_sink_count 2 +# period_source_count 2 +# format "s24le" +# } +# ] + +# +# Where M is pipeline ID and N is a unique integer in the parent object. + +Class.Component."muxdemux" { + # + # Argument used to construct component: pipeline ID + # + @args."pipeline_id" { + type "integer" + } + + # + # Argument used to construct component: unique index for MUX/DEMUX widget + # + @args."index" { + type "integer" + } + + #include common component definition + + + DefineAttribute.uuid { + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + DefineAttribute.process_type { + # Token set reference name and type + token_ref "sof_tkn_process.string" + } + + attributes { + mandatory [ + "no_pm" + "uuid" + "widget_type" + "format" + ] + immutable [ + "uuid" + "widget_type" + ] + deprecated [ + "preload_count" + ] + } + + # + # Default attributes for muxdemux + # + uuid "68:68:b2:c4:30:14:0e:47:a0:89:15:d1:c7:7f:85:1a" + period_source_count 2 + period_sink_count 2 + process_type "DEMUX" + widget_type "effect" + no_pm "true" + core_id 0 +} diff --git a/tools/topology2/include/components/pipeline.conf b/tools/topology2/include/components/pipeline.conf new file mode 100644 index 000000000000..55f0335ea856 --- /dev/null +++ b/tools/topology2/include/components/pipeline.conf @@ -0,0 +1,94 @@ + +# +# Common pipeline widget definition +# +# This should be included within a pipeline class +# + +Class.Component."pipeline" { + # + # Argument used to construct component: pipeline ID + # + @args."pipeline_id" { + type "integer" + } + + #include common component definition + + + # + # Bespoke Tuples for Pipelines + # + + # Scheduling period + DefineAttribute.period { + # Token reference and type + token_ref "sof_tkn_scheduler.word" + constraints { + min 333 + max 1000 + } + } + + # Scheduler time domain + DefineAttribute.time_domain { + # Token reference and type + token_ref "sof_tkn_scheduler.word" + constraints { + # Acceptable values + value_ref "sof_tkn_scheduler_time_domain" + values [ + "timer" + "dma" + ] + } + } + + DefineAttribute.priority { + # Token reference and type + token_ref "sof_tkn_scheduler.word" + } + + DefineAttribute.lp_mode { + # Token reference and type + token_ref "sof_tkn_scheduler.word" + } + + DefineAttribute.core { + # Token reference and type + token_ref "sof_tkn_scheduler.word" + } + + DefineAttribute.frames { + # Token reference and type + token_ref "sof_tkn_scheduler.word" + } + + DefineAttribute.mips { + # Token reference and type + token_ref "sof_tkn_scheduler.word" + } + + DefineAttribute.dynamic { + # Token reference and type + token_ref "sof_tkn_scheduler.word" + } + + attributes { + mandatory [ + "no_pm" + "widget_type" + "dynamic" + ] + immutable [ + "widget_type" + ] + deprecated [ + "preload_count" + ] + } + + # Default attributes for pipeline + widget_type "scheduler" + no_pm "true" +} diff --git a/tools/topology2/include/components/selector.conf b/tools/topology2/include/components/selector.conf new file mode 100644 index 000000000000..0b071592a2db --- /dev/null +++ b/tools/topology2/include/components/selector.conf @@ -0,0 +1,73 @@ +# +# +# Channel Selector component. All attributes defined herein are namespaced +# by alsatplg to "kpb.attribute_name" +# +# Usage: this component can be used by declaring in the "widgets" field of +# a parent object. i.e. +# +# "selector.M.N" { +# period_sink_count 2 +# period_source_count 2 +# } +# +# Where M is pipeline ID and N is a unique integer in the parent object. + +Class.Component."selector" { + # + # Argument used to construct component: pipeline ID + # + @args."pipeline_id" { + type "integer" + } + + # + # Argument used to construct component: unique index for Detect widget + # + @args."index" { + type "integer" + } + + #include common component definition + + + DefineAttribute.process_type { + # Token set reference name and type + token_ref "sof_tkn_process.string" + } + + DefineAttribute.uuid { + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + attributes { + mandatory [ + "no_pm" + "uuid" + "widget_type" + "format" + "process_type" + ] + immutable [ + "uuid" + "widget_type" + "process_type" + ] + deprecated [ + "preload_count" + ] + } + + # + # Default attributes for KPB + # + uuid "d5:8e:a8:55:18:3d:ca:46:88:f1:0e:e6:ea:e9:93:0f" + widget_type "effect" + period_sink_count 2 + period_source_count 2 + process_type "CHAN_SELECTOR" + no_pm "true" + format "$format" + core_id 0 +} diff --git a/tools/topology2/include/components/smart_amp.conf b/tools/topology2/include/components/smart_amp.conf new file mode 100644 index 000000000000..4b4d827f54b7 --- /dev/null +++ b/tools/topology2/include/components/smart_amp.conf @@ -0,0 +1,80 @@ +# +# +# A generic SMART AMP component. All attributes defined herein are namespaced +# by alsatplg to "smart_amp.attribute_name" +# +# Usage: this component can be used by declaring in the "widgets" field of +# a parent object. i.e. +# +# widgets [ +# "smart_amp.M.N" { +# period_sink_count 2 +# period_source_count 2 +# format "s24le" +# } +# ] + +# +# Where M is pipeline ID and N is a unique integer in the parent object. + +Class.Component."smart_amp" { + # + # Argument used to construct component: pipeline ID + # + @args."pipeline_id" { + type "integer" + } + + # + # Argument used to construct component: unique index for smart amp widget + # + @args."index" { + type "integer" + } + + #include common component definition + + + DefineAttribute.uuid { + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + DefineAttribute.process_type { + # Token set reference name and type + token_ref "sof_tkn_process.string" + } + + DefineAttribute.smart_amp_config {} + DefineAttribute.smart_amp_model {} + DefineAttribute.smart_amp_model_get {} + + attributes { + mandatory [ + "no_pm" + "uuid" + "widget_type" + "process_type" + "format" + ] + immutable [ + "uuid" + "process_type" + "widget_type" + ] + deprecated [ + "preload_count" + ] + } + + # + # Default attributes for smart amp + # + uuid "1e:96:7a:16:e4:8a:ea:11:89:f1:00:0c:29:ce:16:35" + widget_type "effect" + no_pm "true" + process_type "SMART_AMP" + period_sink_count 2 + period_source_count 2 + core_id 0 +} diff --git a/tools/topology2/include/components/smart_amp_data.conf b/tools/topology2/include/components/smart_amp_data.conf new file mode 100644 index 000000000000..06d8fb0e3219 --- /dev/null +++ b/tools/topology2/include/components/smart_amp_data.conf @@ -0,0 +1,23 @@ +Object.data."dummy_amp_model_get" { + bytes "0x53,0x4f,0x46,0x00,0x01,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00" +} + +Object.data."dummy_amp_model" { + bytes "0x53,0x4f,0x46,0x00,0x01,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00" +} + +Object.data."dummy_amp_config" { + bytes "0x53,0x4f,0x46,0x00,0x00,0x00,0x00,0x00, + 0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x18,0x00,0x00,0x00,0x04,0x00,0x00,0x00, + 0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff, + 0x00,0x01,0x02,0x03,0xff,0xff,0xff,0xff" +} diff --git a/tools/topology2/include/components/src.conf b/tools/topology2/include/components/src.conf new file mode 100644 index 000000000000..55c8fc019c61 --- /dev/null +++ b/tools/topology2/include/components/src.conf @@ -0,0 +1,78 @@ +# +# +# A generic SRC component. All attributes defined herein are namespaced +# by alsatplg to "src.attribute_name" +# +# Usage: this component can be used by declaring in the "widgets" field of +# a parent object. i.e. +# +# widgets [ +# "src.M.N" { +# period_sink_count 2 +# period_source_count 2 +# format "s24le" +# rate_out 48000 +# } +# ] + +# +# Where M is pipeline ID and N is a unique integer in the parent object. + +Class.Component."src" { + # + # Argument used to construct component: pipeline ID + # + @args."pipeline_id" { + type "integer" + } + + # + # Argument used to construct component: unique index for SRC widget + # + @args."index" { + type "integer" + } + + #include common component definition + + + DefineAttribute.uuid { + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + DefineAttribute."rate_in" { + # Token set reference name and type + token_ref "sof_tkn_src.word" + + } + DefineAttribute."rate_out" { + # Token set reference name and type + token_ref "sof_tkn_src.word" + } + + attributes { + mandatory [ + "no_pm" + "uuid" + "widget_type" + "format" + "rate_out" + ] + immutable [ + "uuid" + "widget_type" + ] + deprecated [ + "preload_count" + ] + } + + # + # Default attributes for src + # + uuid "6d:32:c5:c1:90:83:b4:46:aa:47:95:c3:be:ca:65:50" + widget_type "src" + no_pm "true" + core_id 0 +} diff --git a/tools/topology2/include/components/virtual_widget.conf b/tools/topology2/include/components/virtual_widget.conf new file mode 100644 index 000000000000..35e87d81acff --- /dev/null +++ b/tools/topology2/include/components/virtual_widget.conf @@ -0,0 +1,46 @@ +# +# SOF virtual widget +# +# A generic volume component. All attributes defined herein are namespaced +# by alsatplg to "pga.attribute_name" +# +# Usage: this component can be used by declaring in the "widgets" field of +# a parent object. i.e. +# +# "Object.virtual_widget.name" { +# type "out_drv" +# } +# ] +# + +Class.Component."virtual_widget" { +# + # Argument used to construct component: name + # + @args."name" { + type "string" + } + + DefineAttribute.pipeline_id {} + + DefineAttribute.no_pm {} + + DefineAttribute.widget_type { + type "string" + constraints { + values [ + "out_drv" + "input" + ] + } + } + + attributes { + mandatory [ + "no_pm" + "widget_type" + ] + } + + no_pm "true" +} diff --git a/tools/topology2/include/components/volume.conf b/tools/topology2/include/components/volume.conf new file mode 100644 index 000000000000..581e3c4c5337 --- /dev/null +++ b/tools/topology2/include/components/volume.conf @@ -0,0 +1,133 @@ +# +# Common pipeline volume +# +# A generic volume component. All attributes defined herein are namespaced +# by alsatplg to "pga.attribute_name" +# +# Usage: this component can be used by declaring in the "widgets" field of +# a parent object. i.e. +# +# widgets [ +# "pga.M.N" { +# period_source_count "2" +# period_sink_count "2" +# } +# ] +# +# Where M is pipeline ID and N is a unique integer in the parent object. + + + +Class.Component."pga" { + # + # Argument used to construct component: pipeline ID + # + @args."pipeline_id" { + type "integer" + } + + # + # Unique index per widget type in pipeline. + # + @args."index" { + type "integer" + } + + #include common component definition + + + DefineAttribute.uuid { + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + DefineAttribute.volume_ctl_name {} + DefineAttribute.volume_switch_name {} + + # + # Bespoke attributes for PGA + # + DefineAttribute.ramp_step_type { + # Token set reference name + token_ref "sof_tkn_volume.word" + constraints { + value_ref "sof_tkn_volume_ramp_type" + values [ + "linear" + "log" + "linear_zc" + "log_zc" + ] + } + } + + + DefineAttribute.ramp_step_ms { + # Token set reference name + token_ref "sof_tkn_volume.word" + } + + attributes { + mandatory [ + "no_pm" + "uuid" + "widget_type" + ] + immutable [ + "uuid" + "widget_type" + ] + deprecated [ + "preload_count" + ] + } + + mixer."$volume_ctl_name" { + #Channel register and shift for Front Left/Right + channel."fl" { + shift 0 + } + channel."fr" {} + + tlv."vtlv_m64s2" {} + } + + mixer."$volume_switch_name" { + channel."flw" { + reg 2 + shift 0 + } + channel."fl" { + reg 2 + shift 1 + } + channel."fr" { + reg 2 + shift 2 + } + channel."frw" { + reg 2 + shift 2 + } + + ops."ctl" { + info "volsw" + #259 binds the mixer control to switch get/put handlers + get "259" + put "259" + } + + #max 1 indicates switch type control + max "1" + invert "false" + } + + # Set default attribute values for PGA + widget_type "pga" + uuid "7e:67:7e:b7:f4:5f:88:41:af:14:fb:a8:bd:bf:86:82" + no_pm "true" + period_sink_count 2 + period_source_count 2 + format "$format" # format is based on pipeline format + core_id 0 +} diff --git a/tools/topology2/include/controls/bytes.conf b/tools/topology2/include/controls/bytes.conf new file mode 100644 index 000000000000..1db4e04c2720 --- /dev/null +++ b/tools/topology2/include/controls/bytes.conf @@ -0,0 +1,62 @@ + + +Class.Control."bytes" { + + @args."name" { + type "string" + } + + @args."pipeline_id" { + type "integer" + } + + @args."index" { + type "integer" + } + + DefineAttribute."max" {} + DefineAttribute."data_name" {} + DefineAttribute."base" {} + DefineAttribute."num_regs" {} + DefineAttribute."mask" {} + + DefineAttribute."access" { + constraints { + values [ + "read_write" + "tlv_read_write" + "read" + "write" + "volatile" + "tlv_read" + "tlv_write" + "tlv_command" + "inactive" + "lock" + "owner" + "tlv_callback" + ] + } + } + + attributes { + mandatory [ + "max" + "index" + ] + } + + # control uses bespoke driver get/put/info ID + ops."ctl" { + info "bytes" + } + + extops."extctl" { + #258 binds the control to byte control get/put handlers + get 258 + put 258 + } + + # Default attribute values for byte control + max 1024 +} diff --git a/tools/topology2/include/controls/common.conf b/tools/topology2/include/controls/common.conf new file mode 100644 index 000000000000..38d768078e60 --- /dev/null +++ b/tools/topology2/include/controls/common.conf @@ -0,0 +1,92 @@ +Class.Base."channel" { + @args."name" { + type "string" + } + + DefineAttribute."reg" {} + + DefineAttribute."shift" {} + + attributes { + mandatory [ + "reg" + "shift" + ] + } + + reg 1 + shift 1 +} + +Class.Base."ops" { + @args."name" { + type "string" + } + + DefineAttribute."info" {} + + DefineAttribute."get" {} + + DefineAttribute."put" {} + + attributes { + mandatory [ + "info" + ] + } +} + +Class.Base."extops" { + @args."name" { + type "string" + } + + DefineAttribute."info" {} + + DefineAttribute."get" {} + + DefineAttribute."put" {} + + attributes { + mandatory [ + "get" + "put" + ] + } +} + +Class.Base."scale" { + + @args."name" { + type "string" + } + + DefineAttribute."min" {} + + DefineAttribute."step" {} + + DefineAttribute."mute" {} + + attributes { + mandatory [ + "min" + "mute" + "step" + ] + } + + # Default scale attributes: "-64dB step 2dB" + min -6400 + step 200 + mute 1 +} + +Class.Base."tlv" { + @args."name" { + type "string" + } + + scale."0" { + mute 1 + } +} diff --git a/tools/topology2/include/controls/mixer.conf b/tools/topology2/include/controls/mixer.conf new file mode 100644 index 000000000000..9549d5f63162 --- /dev/null +++ b/tools/topology2/include/controls/mixer.conf @@ -0,0 +1,49 @@ + + +Class.Control."mixer" { + @args."name" { + type "string" + } + + DefineAttribute."max" {} + + DefineAttribute."invert" {} + + DefineAttribute."access" { + constraints { + values [ + "read_write" + "tlv_read_write" + "read" + "write" + "volatile" + "tlv_read" + "tlv_write" + "tlv_command" + "inactive" + "lock" + "owner" + "tlv_callback" + ] + } + } + + attributes { + mandatory [ + "max" + "invert" + ] + } + + # control uses bespoke driver get/put/info ID + ops."ctl" { + info "volsw" + #256 binds the mixer control to volume get/put handlers + get 256 + put 256 + } + + # Default attribute values for mixer control + max 32 + invert "false" +} diff --git a/tools/topology2/include/dais/alh.conf b/tools/topology2/include/dais/alh.conf new file mode 100644 index 000000000000..beaf3d26e34f --- /dev/null +++ b/tools/topology2/include/dais/alh.conf @@ -0,0 +1,96 @@ +# +# ALH DAI +# +# All attributes defined herein are namespaced by alsatplg to "alh.attribute_name" +# +# Usage: this component can be used by declaring in the "dais" field of +# a parent object. i.e. +# +# For Capture +#Object.ALH."M.capture" { +# format "s24le" +# dai_name "SDW0-Capture" +# id 2 +# hw_config."2" {} +# } +# } +# +# Where M is DAI index in the firmware + + +# DMIC port definition +Class.Dai."ALH" { + + # + # Argument used to construct DAI widget + # + # DAI Index + @args."index" { + token_ref "sof_dai_tokens.word" + type "integer" + } + + # capture_index is ignored for playback DAI + @args."capture_index" { + type "integer" + } + + @args."direction" { + type "string" + } + + DefineAttribute.playback_source_count {} + DefineAttribute.playback_sink_count {} + DefineAttribute.capture_source_count {} + DefineAttribute.capture_sink_count {} + + DefineAttribute.type { + token_ref "sof_dai_tokens.string" + } + + DefineAttribute.rate { + token_ref "sof_tkn_alh.word" + } + + DefineAttribute.ch { + token_ref "sof_tkn_alh.word" + } + + DefineAttribute.format { + constraints { + values [ + "s32le" + "s24le" + "s16le" + "float" + ] + } + } + + # Backend DAI Link ID matching with the machine driver + DefineAttribute.id {} + + DefineAttribute.default_hw_config {} + + DefineAttribute.dai_name {} + + attributes { + mandatory [ + "type" + "dai_name" + "default_hw_config" + "format" + "rate" + "ch" + ] + immutable [ + "type" + ] + } + + type "ALH" + playback_source_count 2 + playback_sink_count 0 + capture_sink_count 2 + capture_source_count 0 +} diff --git a/tools/topology2/include/dais/dmic.conf b/tools/topology2/include/dais/dmic.conf new file mode 100644 index 000000000000..587c6e9f9549 --- /dev/null +++ b/tools/topology2/include/dais/dmic.conf @@ -0,0 +1,132 @@ +# +# Intel DMIC DAI +# +# All attributes defined herein are namespaced by alsatplg to "dmic.attribute_name" +# +# Usage: this component can be used by declaring in the "dais" field of +# a parent object. i.e. +# +# For Capture +#Object.DMIC."M.capture" { +# format "s24le" +# dai_name "dmic16k" +# id 2 +# hw_config."2" {} +# } +# } +# +# Where M is DAI index in the firmware + + + +# DMIC port definition +Class.Dai."DMIC" { + + # + # Argument used to construct DAI widget + # + # DAI Index + @args."index" { + token_ref "sof_dai_tokens.word" + type "integer" + } + + # capture_index and index are the same for DMIC as it does not support playback. + # But we need this attribute to set the right index for the DAI widget + @args."capture_index" { + type "integer" + } + + + @args."direction" { + type "string" + } + + DefineAttribute.playback_source_count {} + DefineAttribute.playback_sink_count {} + DefineAttribute.capture_source_count {} + DefineAttribute.capture_sink_count {} + + DefineAttribute.type { + token_ref "sof_dai_tokens.string" + } + + DefineAttribute.format { + constraints { + values [ + "s32le" + "s24le" + "s16le" + "float" + ] + } + } + + # Backend DAI Link ID matching with the machine driver + DefineAttribute.id {} + + DefineAttribute.default_hw_config {} + + DefineAttribute.dai_name {} + + DefineAttribute.driver_version { + token_ref "sof_tkn_dmic.word" + } + + DefineAttribute.clk_min { + token_ref "sof_tkn_dmic.word" + } + + DefineAttribute.clk_max { + token_ref "sof_tkn_dmic.word" + } + + DefineAttribute.duty_min { + token_ref "sof_tkn_dmic.word" + } + + DefineAttribute.duty_max { + token_ref "sof_tkn_dmic.word" + } + + DefineAttribute.num_pdm_active { + token_ref "sof_tkn_dmic.word" + } + + DefineAttribute.sample_rate { + token_ref "sof_tkn_dmic.word" + } + + DefineAttribute.fifo_word_length { + token_ref "sof_tkn_dmic.word" + } + + DefineAttribute.unmute_ramp_time_ms { + token_ref "sof_tkn_dmic.word" + } + + attributes { + mandatory [ + "type" + "dai_name" + "format" + "driver_version" + "num_pdm_active" + "sample_rate" + "clk_min" + "clk_max" + "duty_min" + "duty_max" + "unmute_ramp_time_ms" + ] + immutable [ + "type" + ] + } + + type "DMIC" + playback_source_count 2 + playback_sink_count 0 + capture_sink_count 2 + capture_source_count 0 +} diff --git a/tools/topology2/include/dais/hda.conf b/tools/topology2/include/dais/hda.conf new file mode 100644 index 000000000000..a061dc3a4e98 --- /dev/null +++ b/tools/topology2/include/dais/hda.conf @@ -0,0 +1,106 @@ +# +# Intel HDA DAI +# +# All attributes defined herein are namespaced by alsatplg to "hda.attribute_name" +# +# Usage: this component can be used by declaring in the "dais" field of +# a parent object. i.e. +# +# For Playback +#Object.HDA."M.playback" { +# format "s24le" +# dai_name "iDisp1" +# id 2 +# index 3 +# hw_config."0" {} +# } +# For Capture +#Object.HDA."M.capture" { +# format "s32le" +# dai_name "Digital CPU DAI" +# id 2 +# index 3 +# hw_config."1" {} +# } +# +# duplex direction is not supported for HDA DAIs as the DAI index is different in the FW +# +# Where M is pipeline ID and N is a unique integer in the parent object. + + +# SSP port definition +Class.Dai."HDA" { + + # + # Argument used to construct DAI widget + # + # Playback DAI Index + @args."index" { + type "integer" + token_ref "sof_dai_tokens.word" + } + + # Capture DAI Index + @args."capture_index" { + type "integer" + } + + @args."direction" { + type "string" + } + + DefineAttribute.playback_source_count {} + DefineAttribute.playback_sink_count {} + DefineAttribute.capture_source_count {} + DefineAttribute.capture_sink_count {} + + DefineAttribute.type { + token_ref "sof_dai_tokens.string" + } + + DefineAttribute.format { + constraints { + values [ + "s32le" + "s24le" + "s16le" + "float" + ] + } + } + + # Backend DAI Link ID matching with the machine driver + DefineAttribute.id {} + + DefineAttribute.default_hw_config {} + + DefineAttribute.dai_name {} + + DefineAttribute.rate { + # Token reference and type + token_ref "sof_tkn_hda.word" + } + + DefineAttribute.ch { + # Token reference and type + token_ref "sof_tkn_hda.word" + } + + attributes { + mandatory [ + "type" + "dai_name" + "format" + "id" + ] + immutable [ + "type" + ] + } + + type "HDA" + playback_source_count 2 + playback_sink_count 0 + capture_sink_count 2 + capture_source_count 0 +} diff --git a/tools/topology2/include/dais/hw_config.conf b/tools/topology2/include/dais/hw_config.conf new file mode 100644 index 000000000000..05f53af0dfc2 --- /dev/null +++ b/tools/topology2/include/dais/hw_config.conf @@ -0,0 +1,45 @@ +Class.Base."hw_config" { + # + # Argument used to construct hw config (hw config ID) + # + @args."id" { + type "integer" + } + + # All attributes are only used for SSP. + + # SSP format ex: I2S, DSP_A, DSP_B etc + DefineAttribute.format {} + + DefineAttribute.mclk {} + + DefineAttribute.mclk_freq {} + + DefineAttribute.bclk {} + + DefineAttribute.bclk_freq {} + + DefineAttribute.fsync {} + + DefineAttribute.fsync_freq {} + + DefineAttribute.tdm_slots {} + + DefineAttribute.tdm_slot_width {} + + DefineAttribute.tx_slots {} + + DefineAttribute.rx_slots {} + + #TODO: Add link flags + + index "$index" + format "I2S" + mclk "codec_mclk_in" + bclk "codec_consumer" + fsync "codec_consumer" + fsync_freq 48000 + tdm_slots 2 + tx_slots 3 + rx_slots 3 +} diff --git a/tools/topology2/include/dais/pdm_config.conf b/tools/topology2/include/dais/pdm_config.conf new file mode 100644 index 000000000000..b663fe6156b3 --- /dev/null +++ b/tools/topology2/include/dais/pdm_config.conf @@ -0,0 +1,53 @@ +Class.Base."pdm_config" { + # + # Argument used to construct DMIC PDM config + # + @args."ctrl_id" { + type "integer" + token_ref "sof_tkn_dmic_pdm.short" + } + + DefineAttribute.mic_a_enable { + token_ref "sof_tkn_dmic_pdm.short" + } + + DefineAttribute.mic_b_enable { + token_ref "sof_tkn_dmic_pdm.word" + } + + DefineAttribute.polarity_a { + token_ref "sof_tkn_dmic_pdm.short" + } + + DefineAttribute.polarity_b { + token_ref "sof_tkn_dmic_pdm.short" + } + + DefineAttribute.clk_edge { + token_ref "sof_tkn_dmic_pdm.short" + } + + DefineAttribute.skew { + token_ref "sof_tkn_dmic_pdm.short" + } + + attributes { + mandatory [ + "ctrl_id" + "mic_a_enable" + "mic_b_enable" + "polarity_a" + "polarity_b" + "clk_edge" + "skew" + ] + } + + # default attribute values + mic_a_enable 1 + mic_b_enable 1 + polarity_a 0 + polarity_b 0 + clk_edge 0 + skew 0 +} diff --git a/tools/topology2/include/dais/pipe-copier-capture.conf b/tools/topology2/include/dais/pipe-copier-capture.conf new file mode 100644 index 000000000000..05f55892b9d1 --- /dev/null +++ b/tools/topology2/include/dais/pipe-copier-capture.conf @@ -0,0 +1,11 @@ +# Common file to add to the DAI object. +# The following copier objects will be created depending on direction. +copier."$type.$index.1" { + stream_name "$dai_name" + widget_type "dai_out" + direction "capture" +} + +endpoint."sink.$type.$index.0" { + widget "copier.$type.$index.1" +} diff --git a/tools/topology2/include/dais/pipe-copier-playback.conf b/tools/topology2/include/dais/pipe-copier-playback.conf new file mode 100644 index 000000000000..9bc73dcce8cb --- /dev/null +++ b/tools/topology2/include/dais/pipe-copier-playback.conf @@ -0,0 +1,10 @@ +# Common file to add to the DAI object. +copier."$type.$index.0" { + stream_name "$dai_name" + widget_type "dai_in" + direction "playback" +} + +endpoint."source.$type.$index.0" { + widget "copier.$type.$index.0" +} diff --git a/tools/topology2/include/dais/pipe-dai-capture.conf b/tools/topology2/include/dais/pipe-dai-capture.conf new file mode 100644 index 000000000000..0fb985113c48 --- /dev/null +++ b/tools/topology2/include/dais/pipe-dai-capture.conf @@ -0,0 +1,12 @@ +# Common file to add to the DAI object. +# The following DAI objects will be created depending on direction. +dai."$type.$capture_index.capture" { + period_sink_count "$capture_sink_count" + period_source_count "$capture_source_count" + stream_name "$dai_name" + widget_type "dai_out" +} + +endpoint."sink.$type.$capture_index.0" { + widget "dai.$type.$capture_index.capture" +} diff --git a/tools/topology2/include/dais/pipe-dai-playback.conf b/tools/topology2/include/dais/pipe-dai-playback.conf new file mode 100644 index 000000000000..b26a9110e7c3 --- /dev/null +++ b/tools/topology2/include/dais/pipe-dai-playback.conf @@ -0,0 +1,12 @@ +# Common file to add to the DAI object. +# The following DAI objects will be created depending on direction. +dai."$type.$index.playback" { + period_sink_count "$playback_sink_count" + period_source_count "$playback_source_count" + stream_name "$dai_name" + widget_type "dai_in" +} + +endpoint."source.$type.$index.0" { + widget "dai.$type.$index.playback" +} diff --git a/tools/topology2/include/dais/ssp.conf b/tools/topology2/include/dais/ssp.conf new file mode 100644 index 000000000000..26dd9d107b1b --- /dev/null +++ b/tools/topology2/include/dais/ssp.conf @@ -0,0 +1,136 @@ +# +# Intel SSP DAI +# +# All attributes defined herein are namespaced +# by alsatplg to "ssp.attribute_name" +# +# Usage: this component can be used by declaring in the "dais" field of +# a parent object. i.e. +# +# For Capture +#Object.SSP."M.capture" { +# dai_name "NoCodec-0" +# id 0 +# format "s24le" +# quirks "lbm_mode" +# sample_bits 24 +# hw_config."0" { +# mclk_freq 24000000 +# bclk_freq 4800000 +# tdm_slot_width 25 +# } +#} +# +# For Duplex +#Object.SSP."M.duplex" { +# dai_name "NoCodec-0" +# id 0 +# format "s24le" +# quirks "lbm_mode" +# sample_bits 24 +# hw_config."0" { +# mclk_freq 24000000 +# bclk_freq 4800000 +# tdm_slot_width 25 +# } +#} +# +# Where M is the DAI index in the firmware + + +# SSP port definition +Class.Dai."SSP" { + + # + # Argument used to construct DAI widget + # + # Playback DAI Index + @args."index" { + token_ref "sof_dai_tokens.word" + type "integer" + } + + # Capture DAI Index + @args."capture_index" { + type "integer" + } + + @args."direction" { + type "string" + } + + DefineAttribute.playback_source_count {} + DefineAttribute.playback_sink_count {} + DefineAttribute.capture_source_count {} + DefineAttribute.capture_sink_count {} + + DefineAttribute.type { + token_ref "sof_dai_tokens.string" + } + + DefineAttribute.default_hw_config {} + + DefineAttribute.dai_name {} + + DefineAttribute.format { + constraints { + values [ + "s32le" + "s24le" + "s16le" + "float" + ] + } + } + + # Backend DAI Link ID matching with the machine driver + DefineAttribute.id {} + + DefineAttribute.sample_bits { + # Token reference and type + token_ref "sof_ssp_tokens.word" + } + + DefineAttribute.bclk_delay { + # Token reference and type + token_ref "sof_ssp_tokens.word" + } + + DefineAttribute.quirks { + # Token reference and type + token_ref "sof_ssp_tokens.word" + constraints { + value_ref "sof_ssp_quirks" + values [ + "lbm_mode" + ] + } + } + + DefineAttribute.mclk_id { + # Token reference and type + token_ref "sof_ssp_tokens.short" + } + + attributes { + mandatory [ + "type" + "dai_name" + "format" + "id" + "sample_bits" + ] + immutable [ + "type" + ] + } + + type "SSP" + bclk_delay 0 + mclk_id 0 + default_hw_config 0 + playback_source_count 2 + playback_sink_count 0 + capture_sink_count 2 + capture_source_count 0 +} diff --git a/tools/topology2/include/pipelines/cavs/pipeline-passthrough-capture.conf b/tools/topology2/include/pipelines/cavs/pipeline-passthrough-capture.conf new file mode 100644 index 000000000000..5bc5f6edbe24 --- /dev/null +++ b/tools/topology2/include/pipelines/cavs/pipeline-passthrough-capture.conf @@ -0,0 +1,82 @@ +# +# Common pipeline +# +# A simple pipeline. All attributes defined herein are namespaced by alsatplg to +# "pipeline-passthrough-capture.attribute_name" +# +# Usage: this component can be used by declaring in the top-level topology conf file as follows: +# +# Object.pipeline-passthrough-capture."N.M" { +# pcm_name "Headset" +# format "s16le" +# period 1000 +# time_domain "timer" +# channels 2 +# rate 48000 +# } +# +# Where N and M are unique integers for pipeline ID and PCM ID in the parent object. +# + + + + + + +# +# Simple pipeline +# +# (sink) copier.N.0 <- (source endpoint) +# +Class.Pipeline."pipeline-passthrough-capture" { + + @args."pipeline_id" { + type "integer" + } + + @args."pcm_id" { + type "integer" + } + + + + attributes { + mandatory [ + "pcm_name" + "direction" + ] + immutable [ + "direction" + ] + } + + # Pipeline objects + copier."host.$pipeline_id.0" { + stream_name "$pcm_name.capture.$pcm_id" + widget_type "aif_out" + } + + pipeline."$pipeline_id" { + dynamic "$dynamic" + priority 0 + lp_mode 0 + } + + # PCM + pcm."$pcm_name.capture.$pcm_id" {} + + # PCM Capabilities + pcm_caps."$pcm_name.capture.$pcm_id" { + Srate_min "$rate" + rate_max "$rate" + channels_min "$channels" + channels_max "$channels" + } + + # Endpoint definitions + endpoint."source.pipeline.$pipeline_id.0" { + widget "copier.host.$pipeline_id.0" + } + + direction "capture" +} diff --git a/tools/topology2/include/pipelines/cavs/pipeline-passthrough-playback.conf b/tools/topology2/include/pipelines/cavs/pipeline-passthrough-playback.conf new file mode 100644 index 000000000000..659122343a7d --- /dev/null +++ b/tools/topology2/include/pipelines/cavs/pipeline-passthrough-playback.conf @@ -0,0 +1,82 @@ +# +# Common pipeline +# +# A simple pipeline. All attributes defined herein are namespaced by alsatplg to +# "pipeline-passthrough-playback.attribute_name" +# +# Usage: this component can be used by declaring in the top-level topology conf file as follows: +# +# Object.pipeline-passthrough-playback."N.M" { +# pcm_name "Headset" +# format "s16le" +# period 1000 +# time_domain "timer" +# channels 2 +# rate 48000 +# } +# +# Where N and M are unique integers for pipeline ID and PCM ID in the parent object. +# + + + + + + +# +# Simple pipeline +# +# (sink) copier.N.0 -> (sink endpoint) +# +Class.Pipeline."pipeline-passthrough-playback" { + + @args."pipeline_id" { + type "integer" + } + + @args."pcm_id" { + type "integer" + } + + + + attributes { + mandatory [ + "pcm_name" + "direction" + ] + immutable [ + "direction" + ] + } + + # Pipeline objects + copier."host.$pipeline_id.0" { + stream_name "$pcm_name.playback.$pcm_id" + widget_type "aif_in" + } + + pipeline."$pipeline_id" { + dynamic "$dynamic" + priority 0 + lp_mode 0 + } + + # PCM + pcm."$pcm_name.playback.$pcm_id" {} + + # PCM Capabilities + pcm_caps."$pcm_name.playback.$pcm_id" { + rate_min "$rate" + rate_max "$rate" + channels_min "$channels" + channels_max "$channels" + } + + # Endpoint definitions + endpoint."sink.pipeline.$pipeline_id.0" { + widget "copier.host.$pipeline_id.0" + } + + direction "playback" +} diff --git a/tools/topology2/include/pipelines/pipeline-common.conf b/tools/topology2/include/pipelines/pipeline-common.conf new file mode 100644 index 000000000000..080677c200cd --- /dev/null +++ b/tools/topology2/include/pipelines/pipeline-common.conf @@ -0,0 +1,78 @@ +# +# Common pipeline definitions. To be included in Class.Pipeline definitions +# + +# Number of channels +DefineAttribute.channels { + constraints { + min 2 + max 8 + } +} + +# Pipeline format +DefineAttribute.format { + constraints { + values [ + "s32le" + "s24le" + "s16le" + "float" + ] + } +} + +# Sampling rate +DefineAttribute.rate { + constraints { + min 48000 + max 196000 + } +} + +# Pipeline dicretion +DefineAttribute."direction" { + constraints { + values [ + "playback" + "capture" + ] + } +} + +# Scheduling period +DefineAttribute.period { + # Token reference and type + token_ref "sof_tkn_scheduler.word" + constraints { + min 333 + max 1000 + } +} + +# Scheduler time domain +DefineAttribute.time_domain { + # Token reference and type + token_ref "sof_tkn_scheduler.word" + constraints { + # Acceptable values for time_domain + value_ref "sof_tkn_scheduler_time_domain" + values [ + "timer" + "dma" + ] + } +} + +# Name of the PCM associated with the pipeline +DefineAttribute."pcm_name" {} + +# Boolean flag to indicate if the pipeline is dynamic. +DefineAttribute."dynamic" {} + +# Pipeline objects +pipeline."$pipeline_id" {} + +# by default all pipelines should be dynamic and should be explicitly set to false if needed when +# instantiating the pipeline object +dynamic "true" diff --git a/tools/topology2/include/pipelines/pipeline-detect.conf b/tools/topology2/include/pipelines/pipeline-detect.conf new file mode 100644 index 000000000000..d1358abf473f --- /dev/null +++ b/tools/topology2/include/pipelines/pipeline-detect.conf @@ -0,0 +1,182 @@ +# +# Pipeline with detect and channel selector +# +# All attributes defined herein are namespaced by alsatplg to +# "pipeline-detect.attribute_name" +# +# Usage: this component can be used by declaring in the top-level topology conf file as follows: +# +# Object.pipeline-detect."N" { +# format "s16le" +# period 1000 +# time_domain "timer" +# channels 2 +# rate 16000 +# } +# +# Where N is a unique integer for pipeline ID +# + + + + + +# +# (source) buffer.N.1 -> selector.N.0 -> buffer.N.0 -> detect.N.playback (sink) +# +Class.Pipeline."pipeline-detect" { + + @args."pipeline_id" { + type "integer" + } + + + + DefineAttribute."stream_name" {} + DefineAttribute."detect_sink_name" {} + + # Class type for the detect component. + DefineAttribute."detect_object_class" {} + DefineAttribute."detect_config" {} + DefineAttribute."detect_model" {} + + attributes { + mandatory [ + "channels" + "format" + "rate" + "period" + "direction" + "time_domain" + "stream_name" + ] + immutable [ + "direction" + ] + } + + pipeline."$pipeline_id" { + period "$period" + time_domain "$time_domain" + dynamic "$dynamic" + core 0 + frames 0 + priority 1 + mips 100000 + } + + virtual_widget."$detect_sink_name" { + widget_type "out_drv" + } + + + # Pipeline objects + $detect_object_class."$pipeline_id.0" { + stream_name "$stream_name" + detect_config "$detect_config" + detect_model "$detect_model" + + # trapping PRE/POST_PMU/PMD events + event_flags 15 + # 1 for DAPM event for detect component + event_type 1 + + # byte control for Detect config + bytes."detect_config.$pipeline_id.0" { + max 304 + data_name "$detect_config" + + access [ + tlv_write + tlv_read + tlv_callback + ] + + data."$data_name" {} + } + + # byte control for Detect model + bytes."detect_model.$pipeline_id.0" { + max 300000 + data_name "$detect_model" + + access [ + tlv_write + tlv_read + tlv_callback + ] + + data."$data_name" {} + } + } + + buffer."$pipeline_id.0" { + periods 2 + caps "comp" + channels "$channels" + } + + selector."$pipeline_id.0" { + format "$format" + + # byte control for selector + bytes."selector.$pipeline_id.0" { + max 304 + + access [ + tlv_write + tlv_read + tlv_callback + ] + + data."selector" { + bytes "0x53,0x4f,0x46,0x00,0x00,0x00,0x00,0x00, + 0x0c,0x00,0x00,0x00,0x00,0x10,0x00,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00" + } + } + } + + buffer."$pipeline_id.1" { + periods 2 + channels "$channels" + caps "comp" + } + + # Endpoint definitions + endpoint."source.pipeline.$pipeline_id.0" { + widget "buffer.$pipeline_id.1" + } + + # Endpoint definitions + endpoint."sink.pipeline.$pipeline_id.0" { + widget "$detect_sink_name" + } + + # Pipeline connections + connection."graph.$pipeline_id.0" { + sink "selector.$pipeline_id.0" + source "buffer.$pipeline_id.1" + } + + connection."graph.$pipeline_id.1" { + sink "buffer.$pipeline_id.0" + source "selector.$pipeline_id.0" + } + + connection."graph.$pipeline_id.2" { + sink "$detect_object_class.$pipeline_id.0" + source "buffer.$pipeline_id.0" + } + + connection."graph.$pipeline_id.3" { + source "$detect_object_class.$pipeline_id.0" + sink "$detect_sink_name" + } + + direction "capture" + time_domain "timer" +} diff --git a/tools/topology2/include/pipelines/pipeline-highpass-capture.conf b/tools/topology2/include/pipelines/pipeline-highpass-capture.conf new file mode 100644 index 000000000000..532451683901 --- /dev/null +++ b/tools/topology2/include/pipelines/pipeline-highpass-capture.conf @@ -0,0 +1,170 @@ +# +# Volume capture with Highpass EQ IIR pipeline +# +# Pipeline with a highpass IIR filter. All attributes defined herein are namespaced by alsatplg to +# "pipeline-highpass-capture.attribute_name" +# +# Usage: this component can be used by declaring in the top-level topology conf file as follows: +# +# Object.pipeline-highpass-capture."N.M" { +# pcm_name "Headset" +# format "s16le" +# period 1000 +# time_domain "timer" +# channels 2 +# rate 48000 +# } +# +# Where N and M are unique integers for pipeline ID and PCM ID in the parent object. +# + + + + + + + + + + + + +# +# +# (source) host.N.capture <- buffer.N.0 <- volume.N.0 <- buffer.N.1 <- eqiir.N.0 <- buffer.N.2 (sink endpoint) +# +Class.Pipeline."pipeline-highpass-capture" { + + @args."pipeline_id" { + type "integer" + } + + @args."pcm_id" { + type "integer" + } + + + DefineAttribute."volume_ctl_name" {} + DefineAttribute."eqiir_filter" {} + + attributes { + mandatory [ + "channels" + "format" + "rate" + "direction" + "period" + "time_domain" + "pcm_name" + "volume_ctl_name" + ] + immutable [ + "direction" + ] + } + + pipeline."$pipeline_id" { + period "$period" + time_domain "$time_domain" + dynamic "$dynamic" + core 0 + frames 0 + priority 0 + mips 5000 + } + + # Pipeline objects + host."$pipeline_id.capture" { + period_sink_count 0 + period_source_count 2 + widget_type "aif_out" + } + + buffer."$pipeline_id.0" { + periods 2 + channels "$channels" + caps "host" + } + + pga."$pipeline_id.0" { + format "$format" + volume_ctl_name "$volume_ctl_name" + } + + buffer."$pipeline_id.1" { + periods 2 + channels "$channels" + caps "host" + } + + eqiir."$pipeline_id.0" { + format "$format" + eqiir_filter "$eqiir_filter" + + # byte control for EQ IIR + bytes."eqiir.$pipeline_id.0" { + max 1024 + data_name "$eqiir_filter" + + data."$data_name" {} + + access [ + tlv_write + tlv_read + tlv_callback + ] + } + } + + buffer."$pipeline_id.2" { + periods 2 + channels "$channels" + caps "dai" + } + + # PCM + pcm."$pcm_name.capture.$pcm_id" {} + + # PCM Capabilities + pcm_caps."$pcm_name.capture.$pcm_id" { + rate_min "$rate" + rate_max "$rate" + channels_min "$channels" + channels_max "$channels" + } + + # Endpoint definitions + endpoint."source.pipeline.$pipeline_id.0" { + widget "buffer.$pipeline_id.2" + } + + # Pipeline connections + connection."graph.$pipeline_id.0" { + sink "host.$pipeline_id.capture" + source "buffer.$pipeline_id.0" + } + + connection."graph.$pipeline_id.1" { + sink "buffer.$pipeline_id.0" + source "pga.$pipeline_id.0" + } + + connection."graph.$pipeline_id.2" { + sink "pga.$pipeline_id.0" + source "buffer.$pipeline_id.1" + } + + connection."graph.$pipeline_id.3" { + sink "buffer.$pipeline_id.1" + source "eqiir.$pipeline_id.0" + } + + connection."graph.$pipeline_id.4" { + sink "eqiir.$pipeline_id.0" + source "buffer.$pipeline_id.2" + } + + direction "capture" + time_domain "timer" + period 1000 +} diff --git a/tools/topology2/include/pipelines/pipeline-kpb-vol-capture.conf b/tools/topology2/include/pipelines/pipeline-kpb-vol-capture.conf new file mode 100644 index 000000000000..3a8c56a01f9d --- /dev/null +++ b/tools/topology2/include/pipelines/pipeline-kpb-vol-capture.conf @@ -0,0 +1,193 @@ +# +# Capture pipeline with KPB and Volume +# +# A simple pipeline. All attributes defined herein are namespaced by alsatplg to +# "pipeline-volume-playback.attribute_name" +# +# Usage: this component can be used by declaring in the top-level topology conf file as follows: +# +# Object.pipeline-kpb-vol-capture."N.M" { +# pcm_name "DMIC0" +# format "s24le" +# period 1000 +# time_domain "timer" +# channels 2 +# rate 16000 +# } +# +# Where N and M are unique integers for pipeline ID and PCM ID in the parent object. +# + + + + + + + + +# +# Simple pipeline +# +# (sink) host.N.playback <- buffer.N.0 <- kpb.N.0 <- buffer.N.1 <- volume.N.0 <- buffer.N.2 (source endpoint) +# | +# ---> (KPB Sink endpoint) +# +Class.Pipeline."pipeline-kpb-vol-capture" { + + @args."pipeline_id" { + type "integer" + } + + @args."pcm_id" { + type "integer" + } + + + + DefineAttribute."volume_ctl_name" {} + + attributes { + mandatory [ + "channels" + "format" + "rate" + "direction" + "period" + "time_domain" + "pcm_name" + "volume_ctl_name" + ] + immutable [ + "direction" + ] + } + + pipeline."$pipeline_id" { + period "$period" + time_domain "$time_domain" + dynamic "$dynamic" + core 0 + frames 0 + priority 0 + mips 5000 + } + + # Pipeline objects + host."$pipeline_id.capture" { + period_sink_count 0 + period_source_count 2 + widget_type "aif_out" + } + + buffer."$pipeline_id.0" { + periods 2 + caps "host" + channels "$channels" + } + + kpb."$pipeline_id.0" { + format "$format" + + # byte control for KPB + bytes."kpb.$pipeline_id.0" { + max 304 + + access [ + tlv_write + tlv_read + tlv_callback + ] + + data."kpb" { + bytes "0x53,0x4f,0x46,0x00,0x00,0x00,0x00,0x00, + 0x18,0x00,0x00,0x00,0x00,0x10,0x00,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x80,0x3e,0x00,0x00,0x10,0x00,0x00,0x00" + } + } + } + + buffer."$pipeline_id.1" { + periods 2 + channels "$channels" + caps "host" + } + + + pga."$pipeline_id.0" { + ramp_step_type "linear" + ramp_step_ms 250 + volume_ctl_name "$volume_ctl_name" + period_source_count 3 + } + + buffer."$pipeline_id.2" { + periods 3 + channels "$channels" + caps "dai" + } + + # PCM + pcm."$pcm_name.capture.$pcm_id" { + capture_compatible_d0i3 "true" + } + + # PCM Capabilities + pcm_caps."$pcm_name.capture.$pcm_id" { + rate_min "$rate" + rate_max "$rate" + channels_min "$channels" + channels_max "$channels" + periods_mins 2 + periods_max 160 + period_size_max 256000 + buffer_size_min 256000 + buffer_size_max 1280000 + } + + # Endpoint definitions + endpoint."source.pipeline.$pipeline_id.0" { + widget "buffer.$pipeline_id.2" + } + + # host endpoint to connect the virtual_widget in detect pipeline + endpoint."source.pipeline.$pipeline_id.1" { + widget "host.$pipeline_id.capture" + } + + endpoint."sink.pipeline.$pipeline_id.0" { + widget "kpb.$pipeline_id.0" + } + + # Pipeline connections + connection."graph.$pipeline_id.0" { + sink "host.$pipeline_id.capture" + source "buffer.$pipeline_id.0" + } + + connection."graph.$pipeline_id.1" { + source "kpb.$pipeline_id.0" + sink "buffer.$pipeline_id.0" + } + + connection."graph.$pipeline_id.2" { + sink "kpb.$pipeline_id.0" + source "buffer.$pipeline_id.1" + } + + connection."graph.$pipeline_id.3" { + source "pga.$pipeline_id.0" + sink "buffer.$pipeline_id.1" + } + + connection."graph.$pipeline_id.4" { + sink "pga.$pipeline_id.0" + source "buffer.$pipeline_id.2" + } + + direction "capture" + time_domain "timer" +} diff --git a/tools/topology2/include/pipelines/pipeline-passthrough-capture.conf b/tools/topology2/include/pipelines/pipeline-passthrough-capture.conf new file mode 100644 index 000000000000..4a5e285ca6ed --- /dev/null +++ b/tools/topology2/include/pipelines/pipeline-passthrough-capture.conf @@ -0,0 +1,106 @@ +# +# Passthrough capture pipeline +# +# A simple pipeline. All attributes defined herein are namespaced by alsatplg to +# "pipeline-volume-playback.attribute_name" +# +# Usage: this component can be used by declaring in the top-level topology conf file as follows: +# +# Object.pipeline-passthrough-capture."N.M" { +# pcm_name "Headset" +# format "s16le" +# period 1000 +# time_domain "timer" +# channels 2 +# rate 48000 +# } +# +# Where N and M are unique integers for pipeline ID and PCM ID in the parent object. +# + + + + + + + +# +# +# (sink) host.N.playback <- buffer.N.0 (source endpoint) +# +Class.Pipeline."pipeline-passthrough-capture" { + + @args."pipeline_id" { + type "integer" + } + + @args."pcm_id" { + type "integer" + } + + + + attributes { + mandatory [ + "channels" + "format" + "rate" + "direction" + "period" + "time_domain" + "pcm_name" + ] + immutable [ + "direction" + ] + } + + pipeline."$pipeline_id" { + period "$period" + time_domain "$time_domain" + dynamic "$dynamic" + core 0 + frames 0 + priority 0 + mips 5000 + } + + # Pipeline objects + host."$pipeline_id.capture" { + period_sink_count 0 + period_source_count 2 + widget_type "aif_out" + } + + buffer."$pipeline_id.0" { + periods 2 + caps "host" + channels "$channels" + } + + # PCM + pcm."$pcm_name.capture.$pcm_id" {} + + # PCM Capabilities + pcm_caps."$pcm_name.capture.$pcm_id" { + rate_min "$rate" + rate_max "$rate" + channels_min "$channels" + channels_max "$channels" + } + + # Endpoint definitions + endpoint."source.pipeline.$pipeline_id.0" { + widget "buffer.$pipeline_id.0" + } + + # Pipeline connections + connection."graph.$pipeline_id.0" { + sink "host.$pipeline_id.capture" + source "buffer.$pipeline_id.0" + } + + direction "capture" + time_domain "timer" + period 1000 +} diff --git a/tools/topology2/include/pipelines/pipeline-smart-amp-playback.conf b/tools/topology2/include/pipelines/pipeline-smart-amp-playback.conf new file mode 100644 index 000000000000..23141b3ba61d --- /dev/null +++ b/tools/topology2/include/pipelines/pipeline-smart-amp-playback.conf @@ -0,0 +1,200 @@ +# +# Smart amp playback pipeline +# +# All attributes defined herein are namespaced by alsatplg to +# "pipeline-smart-amp-playback.attribute_name" +# +# Usage: this component can be used by declaring in the top-level topology conf file as follows: +# +# Object.pipeline-smart-amp-playback."N.M" { +# pcm_name "Speaker" +# format "s32le" +# period 1000 +# time_domain "timer" +# channels 2 +# rate 48000 +# } +# +# Where N and M are unique integers for pipeline ID and PCM ID in the parent object. +# +include/components/buffer.conf> + + + + + + + +# +# +# (sink) host.N.playback -> buffer.N.0 -> smart_amp.N.0 -> buffer.N.1 (sink endpoint) +# ^ +# | +# --- buffer.N.2 (Feedback source endpoint) +# +Class.Pipeline."pipeline-smart-amp-playback" { + + @args."pipeline_id" { + type "integer" + } + + @args."pcm_id" { + type "integer" + } + + + + DefineAttribute.core {} + DefineAttribute.smart_amp_class {} + DefineAttribute.smart_amp_config {} + DefineAttribute.smart_amp_model {} + DefineAttribute.smart_amp_model_get {} + + attributes { + mandatory [ + "channels" + "format" + "rate" + "direction" + "period" + "time_domain" + "pcm_name" + ] + immutable [ + "direction" + ] + } + + pipeline."$pipeline_id" { + period "$period" + time_domain "$time_domain" + dynamic "$dynamic" + core $core + frames 0 + priority 0 + mips 5000 + } + + # Pipeline objects + host."$pipeline_id.playback" { + period_sink_count 2 + period_source_count 0 + widget_type "aif_in" + } + + buffer."$pipeline_id.0" { + periods 2 + channels "$channels" + caps "host" + } + + $smart_amp_class."$pipeline_id.0" { + format "$format" + smart_amp_config "$smart_amp_config" + smart_amp_model "$smart_amp_model" + smart_amp_model_get "$smart_amp_model_get" + + # byte control for Smart amp config + bytes."config.$pipeline_id.0" { + max 304 + data_name "$smart_amp_config" + + access [ + tlv_write + tlv_read + tlv_callback + ] + + data."$data_name" {} + } + + # byte control for Smart amp model + bytes."model.$pipeline_id.0" { + max 300000 + data_name "$smart_amp_model" + + access [ + tlv_write + tlv_read + tlv_callback + ] + + data."$data_name" {} + } + + # Read-only byte control for getting the Smart amp model params + bytes."model_get_params.$pipeline_id.0" { + max 300000 + data_name "$smart_amp_model_get" + + access [ + volatile + tlv_read + tlv_callback + ] + + data."$data_name" {} + } + } + + buffer."$pipeline_id.1" { + periods 2 + channels 4 + caps "comp" + } + + + buffer."$pipeline_id.2" { + periods 2 + channels 4 + caps "host" + } + + + # PCM + pcm."$pcm_name.playback.$pcm_id" {} + + # PCM Capabilities + pcm_caps."$pcm_name.playback.$pcm_id" { + rate_min "$rate" + rate_max "$rate" + channels_min "$channels" + channels_max "$channels" + } + + # Endpoint definitions + endpoint."sink.pipeline.$pipeline_id.0" { + widget "buffer.$pipeline_id.1" + } + + endpoint."source.pipeline.$pipeline_id.0" { + widget "buffer.$pipeline_id.2" + } + + # Pipeline connections + connection."graph.$pipeline_id.0" { + source "host.$pipeline_id.playback" + sink "buffer.$pipeline_id.0" + } + + connection."graph.$pipeline_id.1" { + source "buffer.$pipeline_id.0" + sink "$smart_amp_class.$pipeline_id.0" + } + + connection."graph.$pipeline_id.2" { + source "$smart_amp_class.$pipeline_id.0" + sink "buffer.$pipeline_id.1" + } + + connection."graph.$pipeline_id.3" { + sink "$smart_amp_class.$pipeline_id.0" + source "buffer.$pipeline_id.2" + } + + direction "playback" + time_domain "timer" + dynamic_pipeline "false" + period 1000 + core 0 +} diff --git a/tools/topology2/include/pipelines/pipeline-smart-amp-ref-capture.conf b/tools/topology2/include/pipelines/pipeline-smart-amp-ref-capture.conf new file mode 100644 index 000000000000..b37e6c2bd1bd --- /dev/null +++ b/tools/topology2/include/pipelines/pipeline-smart-amp-ref-capture.conf @@ -0,0 +1,160 @@ +# +# Smart amp reference capture pipeline +# +# All attributes defined herein are namespaced by alsatplg to +# "pipeline-smart-amp-ref-capture.attribute_name" +# +# Usage: this component can be used by declaring in the top-level topology conf file as follows: +# +# Object.pipeline-smart-amp-ref-capture."N.M" { +# pcm_name "Speaker Feedback" +# format "s32le" +# period 1000 +# time_domain "timer" +# channels 2 +# rate 48000 +# } +# +# Where N and M are unique integers for pipeline ID and PCM ID in the parent object. +# +include/components/buffer.conf> + + + + + + + + +# +# +# (source) host.N.capture <- buffer.N.0 <- muxdemux.N.0 <- buffer.N.1 (source endpoint) +# | +# | +# --> (Feedback sink endpoint) +# +Class.Pipeline."pipeline-smart-amp-ref-capture" { + + @args."pipeline_id" { + type "integer" + } + + @args."pcm_id" { + type "integer" + } + + + + attributes { + mandatory [ + "channels" + "format" + "rate" + "direction" + "period" + "time_domain" + "pcm_name" + ] + immutable [ + "direction" + ] + } + + pipeline."$pipeline_id" { + period "$period" + time_domain "$time_domain" + core 0 + frames 0 + priority 0 + mips 5000 + dynamic "$dynamic" + } + + # Pipeline objects + host."$pipeline_id.capture" { + period_sink_count 0 + period_source_count 2 + widget_type "aif_out" + } + + buffer."$pipeline_id.0" { + periods 2 + channels "$channels" + caps "host" + } + + muxdemux."$pipeline_id.0" { + format "$format" + + # byte control for mux/demux + bytes."muxdemux.$pipeline_id.0" { + max 304 + + access [ + tlv_write + tlv_read + tlv_callback + ] + + data."muxdemux" { + bytes "0x53,0x4f,0x46,0x00,0x00,0x00,0x00,0x00, + 0x28,0x00,0x00,0x00,0x00,0x60,0x00,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x02,0x00,0x04,0x00,0x02,0x00,0x00,0x00, + 0x01,0x00,0x00,0x00,0x04,0x01,0x02,0x04, + 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x0b,0x00,0x00,0x00,0x02,0x01,0x04,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00" + } + } + } + + buffer."$pipeline_id.1" { + periods 2 + channels 4 + caps "comp" + } + + + # PCM + pcm."$pcm_name.capture.$pcm_id" {} + + # PCM Capabilities + pcm_caps."$pcm_name.capture.$pcm_id" { + rate_min "$rate" + rate_max "$rate" + channels_min "$channels" + channels_max "$channels" + } + + # Endpoint definitions + endpoint."source.pipeline.$pipeline_id.0" { + widget "buffer.$pipeline_id.1" + } + + endpoint."sink.pipeline.$pipeline_id.0" { + widget "muxdemux.$pipeline_id.0" + } + + # Pipeline connections + connection."graph.$pipeline_id.0" { + sink "host.$pipeline_id.capture" + source "buffer.$pipeline_id.0" + } + + connection."graph.$pipeline_id.1" { + sink "buffer.$pipeline_id.0" + source "muxdemux.$pipeline_id.0" + } + + connection."graph.$pipeline_id.2" { + sink "muxdemux.$pipeline_id.0" + source "buffer.$pipeline_id.1" + } + + direction "capture" + time_domain "timer" + period 1000 + dynamic_pipeline "false" +} diff --git a/tools/topology2/include/pipelines/pipeline-volume-capture.conf b/tools/topology2/include/pipelines/pipeline-volume-capture.conf new file mode 100644 index 000000000000..bfe1226f93b6 --- /dev/null +++ b/tools/topology2/include/pipelines/pipeline-volume-capture.conf @@ -0,0 +1,133 @@ +# +# Volume playback pipeline +# +# A simple pipeline. All attributes defined herein are namespaced by alsatplg to +# "pipeline-volume-playback.attribute_name" +# +# Usage: this component can be used by declaring in the top-level topology conf file as follows: +# +# Object.pipeline-volume-capture."N.M" { +# pcm_name "Headset" +# format "s16le" +# period 1000 +# time_domain "timer" +# channels 2 +# rate 48000 +# } +# +# Where N and M are unique integers for pipeline ID and PCM ID in the parent object. +# + + + + + + + +# +# +# (sink) host.N.playback <- buffer.N.0 <- volume.N.0 <- buffer.N.1 (source endpoint) +# +Class.Pipeline."pipeline-volume-capture" { + + @args."pipeline_id" { + type "integer" + } + + @args."pcm_id" { + type "integer" + } + + + + DefineAttribute."volume_ctl_name" {} + DefineAttribute."volume_switch_name" {} + + attributes { + mandatory [ + "channels" + "format" + "rate" + "direction" + "period" + "time_domain" + "pcm_name" + "volume_ctl_name" + ] + immutable [ + "direction" + ] + } + + pipeline."$pipeline_id" { + period "$period" + time_domain "$time_domain" + dynamic "$dynamic" + core 0 + frames 0 + priority 0 + mips 5000 + } + + # Pipeline objects + host."$pipeline_id.capture" { + period_sink_count 0 + period_source_count 2 + widget_type "aif_out" + } + + buffer."$pipeline_id.0" { + periods 2 + caps "host" + channels "$channels" + } + + pga."$pipeline_id.0" { + ramp_step_type "linear" + ramp_step_ms 250 + volume_ctl_name "$volume_ctl_name" + volume_switch_name "$volume_switch_name" + } + + buffer."$pipeline_id.1" { + periods 2 + channels "$channels" + caps "dai" + } + + # PCM + pcm."$pcm_name.capture.$pcm_id" {} + + # PCM Capabilities + pcm_caps."$pcm_name.capture.$pcm_id" { + rate_min "$rate" + rate_max "$rate" + channels_min "$channels" + channels_max "$channels" + } + + # Endpoint definitions + endpoint."source.pipeline.$pipeline_id.0" { + widget "buffer.$pipeline_id.1" + } + + # Pipeline connections + connection."graph.$pipeline_id.0" { + sink "host.$pipeline_id.capture" + source "buffer.$pipeline_id.0" + } + + connection."graph.$pipeline_id.1" { + sink "buffer.$pipeline_id.0" + source "pga.$pipeline_id.0" + } + + connection."graph.$pipeline_id.2" { + sink "pga.$pipeline_id.0" + source "buffer.$pipeline_id.1" + } + + direction "capture" + time_domain "timer" + period 1000 +} diff --git a/tools/topology2/include/pipelines/pipeline-volume-playback.conf b/tools/topology2/include/pipelines/pipeline-volume-playback.conf new file mode 100644 index 000000000000..ecf4dda6ae06 --- /dev/null +++ b/tools/topology2/include/pipelines/pipeline-volume-playback.conf @@ -0,0 +1,131 @@ +# +# Volume playback pipeline +# +# A simple pipeline. All attributes defined herein are namespaced by alsatplg to +# "pipeline-volume-playback.attribute_name" +# +# Usage: this component can be used by declaring in the top-level topology conf file as follows: +# +# Object.pipeline-volume-playback."N.M" { +# pcm_name "Headset" +# format "s16le" +# period 1000 +# time_domain "timer" +# channels 2 +# rate 48000 +# } +# +# Where N and M are unique integers for pipeline ID and PCM ID in the parent object. +# + + + + + + + +# +# +# (source) host.N.playback -> buffer.N.0 -> volume.N.0 -> buffer.N.1 (sink endpoint) +# +Class.Pipeline."pipeline-volume-playback" { + + @args."pipeline_id" { + type "integer" + } + + @args."pcm_id" { + type "integer" + } + + + + DefineAttribute."volume_ctl_name" {} + + attributes { + mandatory [ + "channels" + "format" + "rate" + "direction" + "period" + "time_domain" + "pcm_name" + "volume_ctl_name" + ] + immutable [ + "direction" + ] + } + + pipeline."$pipeline_id" { + period "$period" + time_domain "$time_domain" + dynamic "$dynamic" + core 0 + frames 0 + priority 0 + mips 5000 + } + + # Pipeline objects + host."$pipeline_id.playback" { + period_sink_count 2 + period_source_count 0 + widget_type "aif_in" + } + + buffer."$pipeline_id.0" { + periods 2 + caps "host" + channels "$channels" + } + + pga."$pipeline_id.0" { + ramp_step_type "linear" + ramp_step_ms 250 + volume_ctl_name "$volume_ctl_name" + } + + buffer."$pipeline_id.1" { + periods 2 + channels "$channels" + caps "dai" + } + + # PCM + pcm."$pcm_name.playback.$pcm_id" {} + + # PCM Capabilities + pcm_caps."$pcm_name.playback.$pcm_id" { + rate_min "$rate" + rate_max "$rate" + channels_min "$channels" + channels_max "$channels" + } + + # Endpoint definitions + endpoint."sink.pipeline.$pipeline_id.0" { + widget "buffer.$pipeline_id.1" + } + + # Pipeline connections + connection."graph.$pipeline_id.0" { + source "host.$pipeline_id.playback" + sink "buffer.$pipeline_id.0" + } + + connection."graph.$pipeline_id.1" { + source "buffer.$pipeline_id.0" + sink "pga.$pipeline_id.0" + } + + connection."graph.$pipeline_id.2" { + source "pga.$pipeline_id.0" + sink "buffer.$pipeline_id.1" + } + + direction "playback" + time_domain "timer" + period 1000 +} diff --git a/tools/topology2/include/platform/intel/bxt.conf b/tools/topology2/include/platform/intel/bxt.conf new file mode 100644 index 000000000000..af8c27f1bde1 --- /dev/null +++ b/tools/topology2/include/platform/intel/bxt.conf @@ -0,0 +1,21 @@ +# The memory caps definitions are based on the type of memory capability defined as below: +# These values must match SOF_MEM_CAPS_ values in ipc/topology.h +#SOF_MEM_CAPS_RAM "1" +#SOF_MEM_CAPS_ROM "2" +#SOF_MEM_CAPS_EXT "4" +#SOF_MEM_CAPS_LP "8" +#SOF_MEM_CAPS_HP "16" +#SOF_MEM_CAPS_DMA "32" +#SOF_MEM_CAPS_CACHE "64" + +#dai_mem_cap = SOF_MEM_CAPS_RAM | SOF_MEM_CAPS_DMA | SOF_MEM_CAPS_CACHE | SOF_MEM_CAPS_HP; +#host_mem_cap = SOF_MEM_CAPS_RAM | SOF_MEM_CAPS_DMA | SOF_MEM_CAPS_CACHE | SOF_MEM_CAPS_HP; +#pass_mem_cap = SOF_MEM_CAPS_RAM | SOF_MEM_CAPS_DMA | SOF_MEM_CAPS_CACHE | SOF_MEM_CAPS_HP; +#comp_mem_cap = SOF_MEM_CAPS_RAM | SOF_MEM_CAPS_CACHE; + +SectionVendorTokens."sof_tkn_mem" { + dai "113" + host "113" + pass "113" + comp "65" +} diff --git a/tools/topology2/sof-cnl-nocodec.conf b/tools/topology2/sof-cnl-nocodec.conf new file mode 100644 index 000000000000..f12a661a85a0 --- /dev/null +++ b/tools/topology2/sof-cnl-nocodec.conf @@ -0,0 +1,76 @@ + +# +# Simple Machine - High level topology - Maps to machine driver. +# +# +# PCM 0 <-> bufferN.0 <-> volumeN.0 <-> bufferN.1 -> SSP0 +# + + + + + + + + + + + +# +# Pipeline definitions +# + +# Pipeline ID:1 PCM ID: 0 +Object.pipeline-volume-playback."1.0" { + pcm_name "Port0" + format "s24le" + channels 2 + rate 48000 + volume_ctl_name "1 Master Playback Volume" +} + +# Pipeline ID:2 PCM ID: 0 +Object.pipeline-volume-capture."2.0" { + pcm_name "Port0" + format "s24le" + channels 2 + rate 48000 + volume_ctl_name "2 Master Capture Volume" +} + +# +# List of all DAIs +# +#SSP Index: 0, Direction: duplex +Object.SSP."0.0.duplex" { + dai_name "NoCodec-0" + id 0 + default_hw_config 0 + format "s24le" + quirks "lbm_mode" + sample_bits 24 + hw_config."0" { + mclk_freq 24000000 + bclk_freq 4800000 + tdm_slot_width 25 + } + + #include DAI components + + +} + +# +# List of all endpoint connections +# +# Connect: Pipeline 1 -> SSP 0 DAI_IN +Object.connection."endpoint.1.0" { + source "endpoint.sink.pipeline.1.0" + sink "endpoint.source.SSP.0.0" +} + +# Connect: SSP 0 DAI_OUT -> Pipeline 2 +Object.connection."endpoint.2.0" { + sink "endpoint.source.pipeline.2.0" + source "endpoint.sink.SSP.0.0" +} diff --git a/tools/topology2/sof-hda-generic-2ch.conf b/tools/topology2/sof-hda-generic-2ch.conf new file mode 100644 index 000000000000..b8a4df47b6e9 --- /dev/null +++ b/tools/topology2/sof-hda-generic-2ch.conf @@ -0,0 +1,344 @@ +# +# HDA topology 2ch +# +# +# PCM 0 -> buffer1.0 -> volume1.0 -> buffer1.1 -> HDA0.playback +# PCM 0 <- buffer2.0 <- volume2.0 <- buffer2.1 <- eqiir2.0 <- buffer2.1 <- HDA1.capture +# PCM 1 -> buffer3.0 -> volume3.0 -> buffer3.1 -> HDA2.playback +# PCM 1 <- buffer4.0 <- volume4.0 <- buffer4.1 <- eqiir4.0 <- buffer4.1 <- HDA3.capture +# PCM 3 -> buffer7.0 -> volume7.0 -> buffer7.1 -> HDA4.playback +# PCM 4 -> buffer8.0 -> volume8.0 -> buffer8.1 -> HDA5.playback +# PCM 5 -> buffer9.0 -> volume9.0 -> buffer9.1 -> HDA6.playback +# PCM 6 <- buffer10.0 <- volume10.0 <- buffer10.1 -> DMIC 0 +# PCM 7 <- buffer11.0 <- volume11.0 <- buffer11.1 -> DMIC 1 +# + + + + + + + + + + + + + +# +# Pipeline definitions +# + +# Pipeline ID:1 PCM ID: 0 +Object.pipeline-volume-playback."1.0" { + pcm_name "HDA Analog" + format "s24le" + channels 2 + rate 48000 + volume_ctl_name "1 Master Playback Volume" +} + +# Pipeline ID:2 PCM ID: 0 +Object.pipeline-highpass-capture."2.0" { + pcm_name "HDA Analog" + format "s24le" + channels 2 + rate 48000 + eqiir_filter "highpass_50Hz_0dB_48kHz" + volume_ctl_name "2 Master Capture Volume" +} + +# Pipeline ID:3 PCM ID: 1 +Object.pipeline-volume-playback."3.1" { + pcm_name "HDA Digital" + format "s24le" + channels 2 + rate 48000 + volume_ctl_name "3 Master Playback Volume" +} + +# Pipeline ID:4 PCM ID: 1 +Object.pipeline-highpass-capture."4.1" { + pcm_name "HDA Digital" + format "s24le" + channels 2 + rate 48000 + eqiir_filter "highpass_50Hz_0dB_48kHz" + volume_ctl_name "4 Master Capture Volume" +} + +# Pipeline ID:7 PCM ID: 3 +Object.pipeline-volume-playback."7.3" { + pcm_name "HDMI1" + format "s24le" + channels 2 + rate 48000 + volume_ctl_name "7 Master Playback Volume" +} + +# Pipeline ID:8 PCM ID: 4 +Object.pipeline-volume-playback."8.4" { + pcm_name "HDMI2" + format "s24le" + channels 2 + rate 48000 + volume_ctl_name "8 Master Playback Volume" +} + +# Pipeline ID:9 PCM ID: 5 +Object.pipeline-volume-playback."9.5" { + pcm_name "HDMI3" + format "s24le" + channels 2 + rate 48000 + volume_ctl_name "9 Master Playback Volume" +} + +# Pipeline ID:10 PCM ID: 6 +Object.pipeline-volume-capture."10.6" { + pcm_name "DMIC" + format "s32le" + channels 2 + rate 48000 + volume_ctl_name "DMIC0 Capture Volume" + volume_switch_name "DMIC0 Capture Switch" +} + +# Pipeline ID:11 PCM ID: 7 +Object.pipeline-volume-capture."11.7" { + pcm_name "DMIC16k" + format "s32le" + channels 2 + rate 16000 + volume_ctl_name "DMIC1 Capture Volume" +} + +# +# List of all DAIs +# +# HDA Playback DAI Index: 0, Capture DAI Index: 1, Direction: duplex +Object.HDA."0.1.duplex" { + dai_name "Analog Playback and Capture" + id 4 + format "s32le" + default_hw_config 4 + hw_config."4" {} + + #include DAI components + + +} + +# HDA Playback DAI Index: 2, Capture DAI Index: 3, Direction: duplex +Object.HDA."2.3.duplex" { + dai_name "Digital Playback and Capture" + id 5 + format "s32le" + default_hw_config 5 + hw_config."5" {} + + #include DAI components + + +} + +# HDA Playback DAI Index: 4, Direction: playback +# Capture DAI index is unused +Object.HDA."4.0.playback" { + dai_name "iDisp1" + id 1 + format "s32le" + default_hw_config 1 + hw_config."1" {} + + #include DAI components + +} + +# HDA Playback DAI Index: 5, Direction: playback +# Capture DAI index is unused +Object.HDA."5.0.playback" { + dai_name "iDisp2" + id 2 + format "s32le" + default_hw_config 2 + hw_config."2" {} + + #include DAI components + +} + +# HDA Playback DAI Index: 6, Direction: playback +# Capture DAI index is unused +Object.HDA."6.0.playback" { + dai_name "iDisp3" + id 3 + format "s32le" + default_hw_config 3 + hw_config."3" {} + + #include DAI components + +} + +# DMIC DAI Index: 0, Direction: capture +Object.DMIC."0.0.capture" { + dai_name "dmic01" + id 6 + format "s32le" + default_hw_config 6 + hw_config."6" {} + driver_version 1 + clk_min 500000 + clk_max 4800000 + duty_min 40 + duty_max 60 + sample_rate 48000 + fifo_word_length 32 + unmute_ramp_time_ms 200 + num_pdm_active 1 + + # PDM controller config + pdm_config."0" {} + + #include DAI components + +} + +# DMIC DAI Index: 1, Direction: capture +Object.DMIC."1.1.capture" { + dai_name "dmic16k" + id 7 + format "s32le" + default_hw_config 7 + hw_config."7" {} + driver_version 1 + clk_min 500000 + clk_max 4800000 + duty_min 40 + duty_max 60 + sample_rate 16000 + fifo_word_length 32 + unmute_ramp_time_ms 400 + num_pdm_active 1 + + # PDM controller config + pdm_config."0" {} + + #include DAI components + +} + +# +# List of all endpoint connections +# +# Connect: Pipeline 1 -> HDA 0 DAI_IN +Object.connection."endpoint.1.0" { + source "endpoint.sink.pipeline.1.0" + sink "endpoint.source.HDA.0.0" +} + +# Connect: HDA 1 DAI_OUT -> Pipeline 2 +Object.connection."endpoint.2.0" { + sink "endpoint.source.pipeline.2.0" + source "endpoint.sink.HDA.1.0" +} + +# Connect: Pipeline 3 -> HDA 2 DAI_IN +Object.connection."endpoint.3.0" { + source "endpoint.sink.pipeline.3.0" + sink "endpoint.source.HDA.2.0" +} + +# Connect: HDA 3 DAI_OUT -> Pipeline 4 +Object.connection."endpoint.4.0" { + sink "endpoint.source.pipeline.4.0" + source "endpoint.sink.HDA.3.0" +} + +# Connect: Pipeline 7 -> HDA 4 DAI_IN +Object.connection."endpoint.5.0" { + source "endpoint.sink.pipeline.7.0" + sink "endpoint.source.HDA.4.0" +} + +# Connect: Pipeline 8 -> HDA 5 DAI_IN +Object.connection."endpoint.6.0" { + source "endpoint.sink.pipeline.8.0" + sink "endpoint.source.HDA.5.0" +} + +# Connect: Pipeline 9 -> HDA 6 DAI_IN +Object.connection."endpoint.7.0" { + source "endpoint.sink.pipeline.9.0" + sink "endpoint.source.HDA.6.0" +} + +# Connect: DMIC 0 DAI_OUT -> Pipeline 10 +Object.connection."endpoint.8.0" { + sink "endpoint.source.pipeline.10.0" + source "endpoint.sink.DMIC.0.0" +} + +# Connect: DMIC 1 DAI_OUT -> Pipeline 11 +Object.connection."endpoint.9.0" { + sink "endpoint.source.pipeline.11.0" + source "endpoint.sink.DMIC.1.0" +} + +# Virtual widgets for legacy machine driver compatibility + +Object.virtual_widget."iDisp3 Tx" { + widget_type "out_drv" +} +Object.virtual_widget."iDisp2 Tx" { + widget_type "out_drv" +} +Object.virtual_widget."iDisp1 Tx" { + widget_type "out_drv" +} +Object.virtual_widget."Analog CPU Playback" { + widget_type "out_drv" +} +Object.virtual_widget."Digital CPU Playback" { + widget_type "out_drv" +} +Object.virtual_widget."Alt Analog CPU Playback" { + widget_type "out_drv" +} +Object.virtual_widget."Analog CPU Capture" { + widget_type "input" +} +Object.virtual_widget."Digital CPU Capture" { + widget_type "input" +} +Object.virtual_widget."Alt Analog CPU Capture" { + widget_type "input" +} +Object.virtual_widget."codec0_in" { + widget_type "input" +} +Object.virtual_widget."codec1_in" { + widget_type "input" +} +Object.virtual_widget."codec0_out" { + widget_type "input" +} +Object.virtual_widget."codec1_out" { + widget_type "input" +} +Object.virtual_widget."codec2_in" { + widget_type "input" +} +Object.virtual_widget."codec2_out" { + widget_type "input" +} +Object.virtual_widget."iDisp1_out" { + widget_type "input" +} +Object.virtual_widget."iDisp2_out" { + widget_type "input" +} +Object.virtual_widget."iDisp3_out" { + widget_type "input" +} diff --git a/tools/topology2/sof-hda-generic-4ch.conf b/tools/topology2/sof-hda-generic-4ch.conf new file mode 100644 index 000000000000..804666c41703 --- /dev/null +++ b/tools/topology2/sof-hda-generic-4ch.conf @@ -0,0 +1,346 @@ +# +# HDA topology 4ch +# +# +# PCM 0 -> buffer1.0 -> volume1.0 -> buffer1.1 -> HDA0.playback +# PCM 0 <- buffer2.0 <- volume2.0 <- buffer2.1 <- eqiir2.0 <- buffer2.1 <- HDA1.capture +# PCM 1 -> buffer3.0 -> volume3.0 -> buffer3.1 -> HDA2.playback +# PCM 1 <- buffer4.0 <- volume4.0 <- buffer4.1 <- eqiir4.0 <- buffer4.1 <- HDA3.capture +# PCM 3 -> buffer7.0 -> volume7.0 -> buffer7.1 -> HDA4.playback +# PCM 4 -> buffer8.0 -> volume8.0 -> buffer8.1 -> HDA5.playback +# PCM 5 -> buffer9.0 -> volume9.0 -> buffer9.1 -> HDA6.playback +# PCM 6 <- buffer10.0 <- volume10.0 <- buffer10.1 <- DMIC0 +# PCM 7 <- buffer11.0 <- volume11.0 <- buffer11.1 <- DMIC1 +# + + + + + + + + + + + + + +# +# Pipeline definitions +# + +# Pipeline ID:1 PCM ID: 0 +Object.pipeline-volume-playback."1.0" { + pcm_name "HDA Analog" + format "s24le" + channels 2 + rate 48000 + volume_ctl_name "1 Master Playback Volume" +} + +# Pipeline ID:2 PCM ID: 0 +Object.pipeline-highpass-capture."2.0" { + pcm_name "HDA Analog" + format "s24le" + channels 2 + rate 48000 + volume_ctl_name "2 Master Capture Volume" + eqiir_filter "highpass_50Hz_0dB_48kHz" +} + +# Pipeline ID:3 PCM ID: 1 +Object.pipeline-volume-playback."3.1" { + pcm_name "HDA Digital" + format "s24le" + channels 2 + rate 48000 + volume_ctl_name "3 Master Playback Volume" +} + +# Pipeline ID:4 PCM ID: 1 +Object.pipeline-highpass-capture."4.1" { + pcm_name "HDA Digital" + format "s24le" + channels 2 + rate 48000 + volume_ctl_name "4 Master Capture Volume" + eqiir_filter "highpass_50Hz_0dB_48kHz" +} + +# Pipeline ID:7 PCM ID: 3 +Object.pipeline-volume-playback."7.3" { + pcm_name "HDMI1" + format "s24le" + channels 2 + rate 48000 + volume_ctl_name "7 Master Playback Volume" +} + +# Pipeline ID:8 PCM ID: 4 +Object.pipeline-volume-playback."8.4" { + pcm_name "HDMI2" + format "s24le" + channels 2 + rate 48000 + volume_ctl_name "8 Master Playback Volume" +} + +# Pipeline ID:9 PCM ID: 5 +Object.pipeline-volume-playback."9.5" { + pcm_name "HDMI3" + format "s24le" + channels 2 + rate 48000 + volume_ctl_name "9 Master Playback Volume" +} + +# Pipeline ID:10 PCM ID: 6 +Object.pipeline-volume-capture."10.6" { + pcm_name "DMIC" + format "s32le" + channels 4 + rate 48000 + volume_ctl_name "DMIC0 Capture Volume" + volume_switch_name "DMIC0 Capture Switch" +} + +# Pipeline ID:11 PCM ID: 7 +Object.pipeline-volume-capture."11.7" { + pcm_name "DMIC16k" + format "s32le" + channels 4 + rate 16000 + volume_ctl_name "DMIC1 Capture Volume" +} + +# +# List of all DAIs +# +# HDA Playback DAI Index: 0, Capture DAI Index: 1, Direction: duplex +Object.HDA."0.1.duplex" { + dai_name "Analog Playback and Capture" + id 4 + format "s32le" + default_hw_config 4 + hw_config."4" {} + + #include DAI components + + +} + +# HDA Playback DAI Index: 2, Capture DAI Index: 3, Direction: duplex +Object.HDA."2.3.duplex" { + dai_name "Digital Playback and Capture" + id 5 + format "s32le" + default_hw_config 5 + hw_config."5" {} + + #include DAI components + + +} + +# HDA Playback DAI Index: 4, Direction: playback +# Capture DAI index is unused +Object.HDA."4.0.playback" { + dai_name "iDisp1" + id 1 + format "s32le" + default_hw_config 1 + hw_config."1" {} + + #include DAI components + +} + +# HDA Playback DAI Index: 5, Direction: playback +# Capture DAI index is unused +Object.HDA."5.0.playback" { + dai_name "iDisp2" + id 2 + format "s32le" + default_hw_config 2 + hw_config."2" {} + + #include DAI components + +} + +# HDA Playback DAI Index: 6, Direction: playback +# Capture DAI index is unused +Object.HDA."6.0.playback" { + dai_name "iDisp3" + id 3 + format "s32le" + default_hw_config 3 + hw_config."3" {} + + #include DAI components + +} + +# DMIC DAI Index: 0, Direction: capture +Object.DMIC."0.0.capture" { + dai_name "dmic01" + id 6 + format "s32le" + default_hw_config 6 + hw_config."6" {} + driver_version 1 + clk_min 500000 + clk_max 4800000 + duty_min 40 + duty_max 60 + sample_rate 48000 + fifo_word_length 32 + unmute_ramp_time_ms 200 + num_pdm_active 2 + + # PDM controller config + pdm_config."0" {} + pdm_config."1" {} + + #include DAI components + +} + +# DMIC DAI Index: 1, Direction: capture +Object.DMIC."1.1.capture" { + dai_name "dmic16k" + id 7 + format "s32le" + default_hw_config 7 + hw_config."7" {} + driver_version 1 + clk_min 500000 + clk_max 4800000 + duty_min 40 + duty_max 60 + sample_rate 16000 + fifo_word_length 32 + unmute_ramp_time_ms 400 + num_pdm_active 2 + + # PDM controller config + pdm_config."0" {} + pdm_config."1" {} + + #include DAI components + +} + +# +# List of all endpoint connections +# +# Connect: Pipeline 1 -> HDA 0 DAI_IN +Object.connection."endpoint.1.0" { + source "endpoint.sink.pipeline.1.0" + sink "endpoint.source.HDA.0.0" +} + +# Connect: HDA 1 DAI_OUT -> Pipeline 2 +Object.connection."endpoint.2.0" { + sink "endpoint.source.pipeline.2.0" + source "endpoint.sink.HDA.1.0" +} + +# Connect: Pipeline 3 -> HDA 2 DAI_IN +Object.connection."endpoint.3.0" { + source "endpoint.sink.pipeline.3.0" + sink "endpoint.source.HDA.2.0" +} + +# Connect: HDA 3 DAI_OUT -> Pipeline 4 +Object.connection."endpoint.4.0" { + sink "endpoint.source.pipeline.4.0" + source "endpoint.sink.HDA.3.0" +} + +# Connect: Pipeline 7 -> HDA 4 DAI_IN +Object.connection."endpoint.5.0" { + source "endpoint.sink.pipeline.7.0" + sink "endpoint.source.HDA.4.0" +} + +# Connect: Pipeline 8 -> HDA 5 DAI_IN +Object.connection."endpoint.6.0" { + source "endpoint.sink.pipeline.8.0" + sink "endpoint.source.HDA.5.0" +} + +# Connect: Pipeline 9 -> HDA 6 DAI_IN +Object.connection."endpoint.7.0" { + source "endpoint.sink.pipeline.9.0" + sink "endpoint.source.HDA.6.0" +} + +# Connect: DMIC 0 DAI_OUT -> Pipeline 10 +Object.connection."endpoint.8.0" { + sink "endpoint.source.pipeline.10.0" + source "endpoint.sink.DMIC.0.0" +} + +# Connect: DMIC 1 DAI_OUT -> Pipeline 11 +Object.connection."endpoint.9.0" { + sink "endpoint.source.pipeline.11.0" + source "endpoint.sink.DMIC.1.0" +} + +# Virtual widgets for legacy machine driver compatibility + +Object.virtual_widget."iDisp3 Tx" { + widget_type "out_drv" +} +Object.virtual_widget."iDisp2 Tx" { + widget_type "out_drv" +} +Object.virtual_widget."iDisp1 Tx" { + widget_type "out_drv" +} +Object.virtual_widget."Analog CPU Playback" { + widget_type "out_drv" +} +Object.virtual_widget."Digital CPU Playback" { + widget_type "out_drv" +} +Object.virtual_widget."Alt Analog CPU Playback" { + widget_type "out_drv" +} +Object.virtual_widget."Analog CPU Capture" { + widget_type "input" +} +Object.virtual_widget."Digital CPU Capture" { + widget_type "input" +} +Object.virtual_widget."Alt Analog CPU Capture" { + widget_type "input" +} +Object.virtual_widget."codec0_in" { + widget_type "input" +} +Object.virtual_widget."codec1_in" { + widget_type "input" +} +Object.virtual_widget."codec0_out" { + widget_type "input" +} +Object.virtual_widget."codec1_out" { + widget_type "input" +} +Object.virtual_widget."codec2_in" { + widget_type "input" +} +Object.virtual_widget."codec2_out" { + widget_type "input" +} +Object.virtual_widget."iDisp1_out" { + widget_type "input" +} +Object.virtual_widget."iDisp2_out" { + widget_type "input" +} +Object.virtual_widget."iDisp3_out" { + widget_type "input" +} diff --git a/tools/topology2/sof-tgl-max98373-rt5682.conf b/tools/topology2/sof-tgl-max98373-rt5682.conf new file mode 100644 index 000000000000..90bc331ef0d6 --- /dev/null +++ b/tools/topology2/sof-tgl-max98373-rt5682.conf @@ -0,0 +1,381 @@ +# +# SOF TGL MAX98373-RT5682 I2S +# +# +# PCM 0 -> buffer1.0 -> smart_amp1.0 -> buffer1.1 -> SSP1.playback +# ^ +# | +# buffer1.2 +# ^ +# | +# PCM 0 <- buffer11.0 <- muxdemux11.0 <- buffer11.1 <- SSP1.capture +# PCM 1 <-> buffer2.0/3.0 <-> volume2.0/3.0 <-> buffer2.1/3.1 <-> SSP0.duplex +# PCM 2 -> buffer5.0 -> volume5.0 -> buffer5.1 -> HDA4.playback +# PCM 3 -> buffer6.0 -> volume6.0 -> buffer6.1 -> HDA5.playback +# PCM 4 -> buffer7.0 -> volume7.0 -> buffer7.1 -> HDA6.playback +# PCM 5 -> buffer8.0 -> volume8.0 -> buffer8.1 -> HDA7.playback +# PCM 99 <- buffer4.0 <- volume4.0 <- buffer4.1 <- DMIC0 +# PCM 100 <- buffer.9.0 <- kpb.9.0 <- buffer.9.1 <- volume.9.0 <- buffer.9.2 <- DMIC1 +# | +# V +# buffer.10.1 -> selector.10.0 -> buffer.10.0 -> detect.10 + + + + + + + + + + + + + + + + + + + + + + +# +# Pipeline definitions +# + +# Pipeline ID:1 PCM ID: 0 +Object.pipeline-smart-amp-playback."1.0" { + pcm_name "smart373-spk" + format "s32le" + channels 2 + rate 48000 + smart_amp_class "smart_amp" + smart_amp_config "dummy_amp_config" + smart_amp_model "dummy_amp_model" + smart_amp_model_get "dummy_amp_model_get" +} + +# Pipeline ID:11 PCM ID: 0 +Object.pipeline-smart-amp-ref-capture."11.0" { + pcm_name "smart373-spk" + format "s32le" + channels 2 + rate 48000 +} + +# Pipeline ID:2 PCM ID: 1 +Object.pipeline-volume-playback."2.1" { + pcm_name "Headset" + format "s32le" + channels 2 + rate 48000 + volume_ctl_name "2 Master Playback Volume" +} + +# Pipeline ID:3 PCM ID: 1 +Object.pipeline-volume-capture."3.1" { + pcm_name "Headset" + format "s32le" + channels 2 + rate 48000 + volume_ctl_name "3 Master Capture Volume" +} + +# Pipeline ID:5 PCM ID: 2 +Object.pipeline-volume-playback."5.2" { + pcm_name "HDMI1" + format "s32le" + channels 2 + rate 48000 + volume_ctl_name "5 Master Playback Volume" +} + +# Pipeline ID:6 PCM ID: 3 +Object.pipeline-volume-playback."6.3" { + pcm_name "HDMI2" + format "s32le" + channels 2 + rate 48000 + volume_ctl_name "6 Master Playback Volume" +} + +# Pipeline ID:7 PCM ID: 4 +Object.pipeline-volume-playback."7.4" { + pcm_name "HDMI3" + format "s32le" + channels 2 + rate 48000 + volume_ctl_name "7 Master Playback Volume" +} + +# Pipeline ID:8 PCM ID: 5 +Object.pipeline-volume-playback."8.5" { + pcm_name "HDMI4" + format "s32le" + channels 2 + rate 48000 + volume_ctl_name "8 Master Playback Volume" +} + +# Pipeline ID:4 PCM ID: 99 +Object.pipeline-passthrough-capture."4.99" { + pcm_name "DMIC" + format "s32le" + channels 4 + rate 48000 +} + +# Pipeline ID:9 PCM ID: 100 +Object.pipeline-kpb-vol-capture."9.100" { + pcm_name "DMIC16k" + format "s32le" + channels 2 + rate 16000 + period 20000 + volume_ctl_name "9 KWD Capture Volume" +} + +# Pipeline ID:10 +Object.pipeline-detect."10" { + format "s24le" + channels 2 + rate 16000 + period 20000 + stream_name "DMIC16k.capture.100" + detect_sink_name "Detect Sink 10" + detect_object_class "detect" + detect_config "dummy_detect_config" + detect_model "dummy_detect_model" +} + +# +# List of all DAIs +# +#SSP Index: 0, Direction: duplex +Object.SSP."0.0.duplex" { + dai_name "SSP0-Codec" + id 0 + default_hw_config 0 + format "s24le" + sample_bits 24 + hw_config."0" { + mclk_freq 19200000 + bclk_freq 2400000 + tdm_slots 2 + tdm_slot_width 25 + tx_slots 3 + rx_slots 3 + } + + #include DAI components + + +} + +#SSP Index: 1, Direction: duplex +Object.SSP."1.1.duplex" { + dai_name "SSP1-Codec" + id 7 + default_hw_config 7 + format "s32le" + sample_bits 32 + hw_config."7" { + format "DSP_B" + mclk_freq 19200000 + bclk_freq 12288000 + tdm_slot_width 32 + tdm_slots 8 + tx_slots 15 + rx_slots 255 + } + + #include DAI components + + +} + +# HDA Playback DAI Index: 4, Direction: playback +# Capture DAI index is unused +Object.HDA."4.0.playback" { + dai_name "iDisp1" + id 3 + format "s32le" + default_hw_config 3 + hw_config."3" {} + + #include DAI components + +} + +# HDA Playback DAI Index: 5, Direction: playback +# Capture DAI index is unused +Object.HDA."5.0.playback" { + dai_name "iDisp2" + id 4 + format "s32le" + default_hw_config 4 + hw_config."4" {} + + #include DAI components + +} + +# HDA Playback DAI Index: 6, Direction: playback +# Capture DAI index is unused +Object.HDA."6.0.playback" { + dai_name "iDisp3" + id 5 + format "s32le" + default_hw_config 5 + hw_config."5" {} + + #include DAI components + +} + +# HDA Playback DAI Index: 6, Direction: playback +# Capture DAI index is unused +Object.HDA."7.0.playback" { + dai_name "iDisp4" + id 6 + format "s32le" + default_hw_config 6 + hw_config."6" {} + + #include DAI components + +} + +# DMIC DAI Index: 0, Direction: capture +Object.DMIC."0.0.capture" { + dai_name "dmic01" + id 1 + format "s32le" + default_hw_config 1 + hw_config."1" {} + driver_version 1 + clk_min 500000 + clk_max 4800000 + duty_min 40 + duty_max 60 + sample_rate 48000 + fifo_word_length 32 + unmute_ramp_time_ms 200 + num_pdm_active 2 + + # PDM controller config + pdm_config."0" {} + pdm_config."1" {} + + #include DAI components + +} + +# DMIC DAI Index: 1, Direction: capture +Object.DMIC."1.1.capture" { + dai_name "dmic16k" + id 2 + format "s32le" + default_hw_config 2 + hw_config."2" {} + driver_version 1 + clk_min 500000 + clk_max 4800000 + duty_min 40 + duty_max 60 + sample_rate 16000 + fifo_word_length 32 + unmute_ramp_time_ms 400 + num_pdm_active 1 + + # PDM controller config + pdm_config."0" {} + + capture_sink_count 3 + + #include DAI components + +} + +# +# List of all endpoint connections +# +# Connect: Pipeline 1 -> SSP 1 DAI_IN +Object.connection."endpoint.1.0" { + source "endpoint.sink.pipeline.1.0" + sink "endpoint.source.SSP.1.0" +} + +# Connect: SSP 1 DAI_OUT -> Pipeline 11 +Object.connection."endpoint.2.0" { + sink "endpoint.source.pipeline.11.0" + source "endpoint.sink.SSP.1.0" +} + +# Connect muxdemux11.0 -> buffer1.2 +Object.connection."endpoint.3.0" { + sink "endpoint.source.pipeline.1.0" + source "endpoint.sink.pipeline.11.0" +} + +# Connect: Pipeline 2 -> SSP 0 DAI_IN +Object.connection."endpoint.4.0" { + source "endpoint.sink.pipeline.2.0" + sink "endpoint.source.SSP.0.0" +} + +# Connect: SSP 0 DAI_OUT -> Pipeline 3 +Object.connection."endpoint.5.0" { + sink "endpoint.source.pipeline.3.0" + source "endpoint.sink.SSP.0.0" +} + +# Connect: Pipeline 5 -> HDA 4 DAI_IN +Object.connection."endpoint.6.0" { + source "endpoint.sink.pipeline.5.0" + sink "endpoint.source.HDA.4.0" +} + +# Connect: Pipeline 6 -> HDA 5 DAI_IN +Object.connection."endpoint.7.0" { + source "endpoint.sink.pipeline.6.0" + sink "endpoint.source.HDA.5.0" +} + +# Connect: Pipeline 7 -> HDA 6 DAI_IN +Object.connection."endpoint.8.0" { + source "endpoint.sink.pipeline.7.0" + sink "endpoint.source.HDA.6.0" +} + +# Connect: Pipeline 8 -> HDA 7 DAI_IN +Object.connection."endpoint.9.0" { + source "endpoint.sink.pipeline.8.0" + sink "endpoint.source.HDA.7.0" +} + +# Connect: DMIC 0 DAI_OUT -> Pipeline 4 +Object.connection."endpoint.10.0" { + sink "endpoint.source.pipeline.4.0" + source "endpoint.sink.DMIC.0.0" +} + +# Connect: DMIC 1 DAI_OUT -> Pipeline 9 +Object.connection."endpoint.11.0" { + sink "endpoint.source.pipeline.9.0" + source "endpoint.sink.DMIC.1.0" +} + +# Connect: kpb9.0 -> buffer10.0 +Object.connection."endpoint.12.0" { + sink "endpoint.source.pipeline.10.0" + source "endpoint.sink.pipeline.9.0" +} + +# Connect: detect_sink.10 -> Pipeline 9 host +Object.connection."endpoint.13.0" { + sink "endpoint.source.pipeline.9.1" + source "endpoint.sink.pipeline.10.0" +} diff --git a/tools/topology2/sof-tgl-sdw-max98373-rt5682-2ch.conf b/tools/topology2/sof-tgl-sdw-max98373-rt5682-2ch.conf new file mode 100644 index 000000000000..a84a8a3fa098 --- /dev/null +++ b/tools/topology2/sof-tgl-sdw-max98373-rt5682-2ch.conf @@ -0,0 +1,393 @@ +# +# SOF TGL MAX98373-RT5682 ALH +# +# +# PCM 0 -> buffer1.0 -> volume1.0 -> buffer1.1 -> ALH Pin2 +# PCM 1 <- buffer2.0 <- volume2.0 <- buffer2.1 <- ALH Pin3 +# PCM 2 -> buffer3.0 -> smart_amp3.0 -> buffer3.1 -> ALH Pin 0x102.playback +# ^ +# | +# buffer3.2 +# ^ +# | +# PCM 3 <- buffer4.0 <- muxdemux4.0 <- buffer4.1 <- ALH Pin 0x103.capture +# PCM 5 -> buffer6.0 -> volume6.0 -> buffer6.1 -> HDA4.playback +# PCM 6 -> buffer7.0 -> volume7.0 -> buffer7.1 -> HDA5.playback +# PCM 7 -> buffer8.0 -> volume8.0 -> buffer8.1 -> HDA6.playback +# PCM 8 -> buffer9.0 -> volume9.0 -> buffer9.1 -> HDA7.playback +# PCM 10 <- buffer11.0 <- volume11.0 <- buffer11.1 <- DMIC0 +# PCM 12 <- buffer.12.0 <- kpb.12.0 <- buffer.12.1 <- volume.12.0 <- buffer.12.2 <- DMIC1 +# | +# V +# buffer.13.1 -> selector.13.0 -> buffer.13.0 -> detect.13 + + + + + + + + + + + + + + + + + + + + + + +# +# Pipeline definitions +# +# Pipeline ID:1 PCM ID: 0 +Object.pipeline-volume-playback."1.0" { + pcm_name "Jack Out" + format "s32le" + channels 2 + rate 48000 + volume_ctl_name "1 Master Playback Volume" +} + +# Pipeline ID:2 PCM ID: 1 +Object.pipeline-volume-capture."2.1" { + pcm_name "Jack in" + format "s32le" + channels 2 + rate 48000 + volume_ctl_name "2 Master Capture Volume" +} + +# Pipeline ID:3 PCM ID: 2 +Object.pipeline-smart-amp-playback."3.2" { + pcm_name "Speaker" + format "s32le" + channels 2 + rate 48000 + smart_amp_class "smart_amp" + smart_amp_config "dummy_amp_config" + smart_amp_model "dummy_amp_model" + smart_amp_model_get "dummy_amp_model_get" +} + +# Pipeline ID:4 PCM ID: 3 +Object.pipeline-smart-amp-ref-capture."4.3" { + pcm_name "Amplifier Reference" + format "s32le" + channels 2 + rate 48000 +} + +# Pipeline ID:6 PCM ID: 5 +Object.pipeline-volume-playback."6.5" { + pcm_name "HDMI1" + format "s32le" + channels 2 + rate 48000 + volume_ctl_name "6 Master Playback Volume" +} + +# Pipeline ID:7 PCM ID: 6 +Object.pipeline-volume-playback."7.6" { + pcm_name "HDMI2" + format "s32le" + channels 2 + rate 48000 + volume_ctl_name "7 Master Playback Volume" +} + +# Pipeline ID:8 PCM ID: 7 +Object.pipeline-volume-playback."8.7" { + pcm_name "HDMI3" + format "s32le" + channels 2 + rate 48000 + volume_ctl_name "8 Master Playback Volume" +} + +# Pipeline ID:9 PCM ID: 8 +Object.pipeline-volume-playback."9.8" { + pcm_name "HDMI4" + format "s32le" + channels 2 + rate 48000 + volume_ctl_name "9 Master Playback Volume" +} + +# Pipeline ID:11 PCM ID: 10 +Object.pipeline-passthrough-capture."11.10" { + pcm_name "DMIC" + format "s32le" + channels 4 + rate 48000 +} + +# Pipeline ID:12 PCM ID: 12 +Object.pipeline-kpb-vol-capture."12.12" { + pcm_name "BufferedMic" + format "s32le" + channels 2 + rate 16000 + period 20000 + volume_ctl_name "9 KWD Capture Volume" +} + +# Pipeline ID:13 +Object.pipeline-detect."13" { + format "s24le" + channels 2 + rate 16000 + period 20000 + stream_name "BufferedMic.capture.12" + detect_sink_name "Detect Sink 13" + detect_object_class "detect" + detect_config "dummy_detect_config" + detect_model "dummy_detect_model" +} + +# +# List of all DAIs +# +#ALH Index: 2, Direction: playback +Object.ALH."2.2.playback" { + dai_name "SDW0-Playback" + id 0 + default_hw_config 0 + format "s24le" + rate 48000 + ch 2 + hw_config."0" {} + + #include DAI components + +} + +#ALH Index: 3, Direction: capture +Object.ALH."3.3.capture" { + dai_name "SDW0-Capture" + id 1 + default_hw_config 1 + format "s24le" + rate 48000 + ch 2 + hw_config."1" {} + + #include DAI components + +} + +#ALH Index: 0x102, Direction: playback +Object.ALH."0x102.0x102.playback" { + dai_name "SDW1-Playback" + id 2 + default_hw_config 2 + format "s24le" + rate 48000 + ch 2 + hw_config."2" {} + + #include DAI components + +} + +#ALH Index: 0x103, Direction: capture +Object.ALH."0x103.0x103.capture" { + dai_name "SDW1-Capture" + id 3 + default_hw_config 3 + format "s24le" + rate 48000 + ch 2 + hw_config."3" {} + + #include DAI components + +} + +# HDA Playback DAI Index: 4, Direction: playback +# Capture DAI index is unused +Object.HDA."4.0.playback" { + dai_name "iDisp1" + id 6 + format "s32le" + default_hw_config 6 + hw_config."6" {} + + #include DAI components + +} + +# HDA Playback DAI Index: 5, Direction: playback +# Capture DAI index is unused +Object.HDA."5.0.playback" { + dai_name "iDisp2" + id 7 + format "s32le" + default_hw_config 7 + hw_config."7" {} + + #include DAI components + +} + +# HDA Playback DAI Index: 6, Direction: playback +# Capture DAI index is unused +Object.HDA."6.0.playback" { + dai_name "iDisp3" + id 8 + format "s32le" + default_hw_config 8 + hw_config."8" {} + + #include DAI components + +} + +# HDA Playback DAI Index: 6, Direction: playback +# Capture DAI index is unused +Object.HDA."7.0.playback" { + dai_name "iDisp4" + id 9 + format "s32le" + default_hw_config 9 + hw_config."9" {} + + #include DAI components + +} + +# DMIC DAI Index: 0, Direction: capture +Object.DMIC."0.0.capture" { + dai_name "dmic01" + id 4 + format "s32le" + default_hw_config 4 + hw_config."4" {} + driver_version 1 + clk_min 500000 + clk_max 4800000 + duty_min 40 + duty_max 60 + sample_rate 48000 + fifo_word_length 32 + unmute_ramp_time_ms 200 + num_pdm_active 1 + + # PDM controller config + pdm_config."0" {} + + #include DAI components + +} + +# DMIC DAI Index: 1, Direction: capture +Object.DMIC."1.1.capture" { + dai_name "dmic16k" + id 5 + format "s32le" + default_hw_config 5 + hw_config."5" {} + driver_version 1 + clk_min 500000 + clk_max 4800000 + duty_min 40 + duty_max 60 + sample_rate 16000 + fifo_word_length 32 + unmute_ramp_time_ms 400 + num_pdm_active 1 + + # PDM controller config + pdm_config."0" {} + + capture_sink_count 3 + + #include DAI components + +} + +# +# List of all endpoint connections +# +# Connect: Pipeline 1 -> ALH 2 DAI_IN +Object.connection."endpoint.1.0" { + source "endpoint.sink.pipeline.1.0" + sink "endpoint.source.ALH.2.0" +} + +# Connect: ALH 3 DAI_OUT -> Pipeline 2 +Object.connection."endpoint.2.0" { + sink "endpoint.source.pipeline.2.0" + source "endpoint.sink.ALH.3.0" +} + +# Connect muxdemux4.0 -> buffer3.2 +Object.connection."endpoint.3.0" { + sink "endpoint.source.pipeline.3.0" + source "endpoint.sink.pipeline.4.0" +} + +# Connect: Pipeline 3 -> ALH 0x102 DAI_IN +Object.connection."endpoint.4.0" { + source "endpoint.sink.pipeline.3.0" + sink "endpoint.source.ALH.258.0" +} + +# Connect: ALH 0x103 DAI_OUT -> Pipeline 4 +Object.connection."endpoint.5.0" { + sink "endpoint.source.pipeline.4.0" + source "endpoint.sink.ALH.259.0" +} + +# Connect: Pipeline 6 -> HDA 4 DAI_IN +Object.connection."endpoint.6.0" { + source "endpoint.sink.pipeline.6.0" + sink "endpoint.source.HDA.4.0" +} + +# Connect: Pipeline 7 -> HDA 5 DAI_IN +Object.connection."endpoint.7.0" { + source "endpoint.sink.pipeline.7.0" + sink "endpoint.source.HDA.5.0" +} + +# Connect: Pipeline 8 -> HDA 6 DAI_IN +Object.connection."endpoint.8.0" { + source "endpoint.sink.pipeline.8.0" + sink "endpoint.source.HDA.6.0" +} + +# Connect: Pipeline 9 -> HDA 7 DAI_IN +Object.connection."endpoint.9.0" { + source "endpoint.sink.pipeline.9.0" + sink "endpoint.source.HDA.7.0" +} + +# Connect: DMIC 0 DAI_OUT -> Pipeline 11 +Object.connection."endpoint.10.0" { + sink "endpoint.source.pipeline.11.0" + source "endpoint.sink.DMIC.0.0" +} + +# Connect: DMIC 1 DAI_OUT -> Pipeline 12 +Object.connection."endpoint.11.0" { + sink "endpoint.source.pipeline.12.0" + source "endpoint.sink.DMIC.1.0" +} + +# Connect: kpb12.0 -> buffer13.0 +Object.connection."endpoint.12.0" { + sink "endpoint.source.pipeline.13.0" + source "endpoint.sink.pipeline.12.0" +} + +# Connect: detect_sink.13 -> Pipeline 12 host +Object.connection."endpoint.13.0" { + sink "endpoint.source.pipeline.12.1" + source "endpoint.sink.pipeline.13.0" +} diff --git a/tools/topology2/sof-tgl-sdw-max98373-rt5682-4ch.conf b/tools/topology2/sof-tgl-sdw-max98373-rt5682-4ch.conf new file mode 100644 index 000000000000..026c2100eea0 --- /dev/null +++ b/tools/topology2/sof-tgl-sdw-max98373-rt5682-4ch.conf @@ -0,0 +1,394 @@ +# +# SOF TGL MAX98373-RT5682 ALH +# +# +# PCM 0 -> buffer1.0 -> volume1.0 -> buffer1.1 -> ALH Pin2 +# PCM 1 <- buffer2.0 <- volume2.0 <- buffer2.1 <- ALH Pin3 +# PCM 2 -> buffer3.0 -> smart_amp3.0 -> buffer3.1 -> ALH Pin 0x102.playback +# ^ +# | +# buffer3.2 +# ^ +# | +# PCM 3 <- buffer4.0 <- muxdemux4.0 <- buffer4.1 <- ALH Pin 0x103.capture +# PCM 5 -> buffer6.0 -> volume6.0 -> buffer6.1 -> HDA4.playback +# PCM 6 -> buffer7.0 -> volume7.0 -> buffer7.1 -> HDA5.playback +# PCM 7 -> buffer8.0 -> volume8.0 -> buffer8.1 -> HDA6.playback +# PCM 8 -> buffer9.0 -> volume9.0 -> buffer9.1 -> HDA7.playback +# PCM 10 <- buffer11.0 <- volume11.0 <- buffer11.1 <- DMIC0 +# PCM 12 <- buffer.12.0 <- kpb.12.0 <- buffer.12.1 <- volume.12.0 <- buffer.12.2 <- DMIC1 +# | +# V +# buffer.13.1 -> selector.13.0 -> buffer.13.0 -> detect.13 + + + + + + + + + + + + + + + + + + + + + + +# +# Pipeline definitions +# +# Pipeline ID:1 PCM ID: 0 +Object.pipeline-volume-playback."1.0" { + pcm_name "Jack Out" + format "s32le" + channels 2 + rate 48000 + volume_ctl_name "1 Master Playback Volume" +} + +# Pipeline ID:2 PCM ID: 1 +Object.pipeline-volume-capture."2.1" { + pcm_name "Jack in" + format "s32le" + channels 2 + rate 48000 + volume_ctl_name "2 Master Capture Volume" +} + +# Pipeline ID:3 PCM ID: 2 +Object.pipeline-smart-amp-playback."3.2" { + pcm_name "Speaker" + format "s32le" + channels 2 + rate 48000 + smart_amp_class "smart_amp" + smart_amp_config "dummy_amp_config" + smart_amp_model "dummy_amp_model" + smart_amp_model_get "dummy_amp_model_get" +} + +# Pipeline ID:4 PCM ID: 3 +Object.pipeline-smart-amp-ref-capture."4.3" { + pcm_name "Amplifier Reference" + format "s32le" + channels 2 + rate 48000 +} + +# Pipeline ID:6 PCM ID: 5 +Object.pipeline-volume-playback."6.5" { + pcm_name "HDMI1" + format "s32le" + channels 2 + rate 48000 + volume_ctl_name "6 Master Playback Volume" +} + +# Pipeline ID:7 PCM ID: 6 +Object.pipeline-volume-playback."7.6" { + pcm_name "HDMI2" + format "s32le" + channels 2 + rate 48000 + volume_ctl_name "7 Master Playback Volume" +} + +# Pipeline ID:8 PCM ID: 7 +Object.pipeline-volume-playback."8.7" { + pcm_name "HDMI3" + format "s32le" + channels 2 + rate 48000 + volume_ctl_name "8 Master Playback Volume" +} + +# Pipeline ID:9 PCM ID: 8 +Object.pipeline-volume-playback."9.8" { + pcm_name "HDMI4" + format "s32le" + channels 2 + rate 48000 + volume_ctl_name "9 Master Playback Volume" +} + +# Pipeline ID:11 PCM ID: 10 +Object.pipeline-passthrough-capture."11.10" { + pcm_name "DMIC" + format "s32le" + channels 4 + rate 48000 +} + +# Pipeline ID:12 PCM ID: 12 +Object.pipeline-kpb-vol-capture."12.12" { + pcm_name "BufferedMic" + format "s32le" + channels 2 + rate 16000 + period 20000 + volume_ctl_name "9 KWD Capture Volume" +} + +# Pipeline ID:13 +Object.pipeline-detect."13" { + format "s24le" + channels 2 + rate 16000 + period 20000 + stream_name "BufferedMic.capture.12" + detect_sink_name "Detect Sink 13" + detect_object_class "detect" + detect_config "dummy_detect_config" + detect_model "dummy_detect_model" +} + +# +# List of all DAIs +# +#ALH Index: 2, Direction: playback +Object.ALH."2.2.playback" { + dai_name "SDW0-Playback" + id 0 + default_hw_config 0 + format "s24le" + rate 48000 + ch 2 + hw_config."0" {} + + #include DAI components + +} + +#ALH Index: 3, Direction: capture +Object.ALH."3.3.capture" { + dai_name "SDW0-Capture" + id 1 + default_hw_config 1 + format "s24le" + rate 48000 + ch 2 + hw_config."1" {} + + #include DAI components + +} + +#ALH Index: 0x102, Direction: playback +Object.ALH."0x102.0x102.playback" { + dai_name "SDW1-Playback" + id 2 + default_hw_config 2 + format "s24le" + rate 48000 + ch 2 + hw_config."2" {} + + #include DAI components + +} + +#ALH Index: 0x103, Direction: capture +Object.ALH."0x103.0x103.capture" { + dai_name "SDW1-Capture" + id 3 + default_hw_config 3 + format "s24le" + rate 48000 + ch 2 + hw_config."3" {} + + #include DAI components + +} + +# HDA Playback DAI Index: 4, Direction: playback +# Capture DAI index is unused +Object.HDA."4.0.playback" { + dai_name "iDisp1" + id 6 + format "s32le" + default_hw_config 6 + hw_config."6" {} + + #include DAI components + +} + +# HDA Playback DAI Index: 5, Direction: playback +# Capture DAI index is unused +Object.HDA."5.0.playback" { + dai_name "iDisp2" + id 7 + format "s32le" + default_hw_config 7 + hw_config."7" {} + + #include DAI components + +} + +# HDA Playback DAI Index: 6, Direction: playback +# Capture DAI index is unused +Object.HDA."6.0.playback" { + dai_name "iDisp3" + id 8 + format "s32le" + default_hw_config 8 + hw_config."8" {} + + #include DAI components + +} + +# HDA Playback DAI Index: 6, Direction: playback +# Capture DAI index is unused +Object.HDA."7.0.playback" { + dai_name "iDisp4" + id 9 + format "s32le" + default_hw_config 9 + hw_config."9" {} + + #include DAI components + +} + +# DMIC DAI Index: 0, Direction: capture +Object.DMIC."0.0.capture" { + dai_name "dmic01" + id 4 + format "s32le" + default_hw_config 4 + hw_config."4" {} + driver_version 1 + clk_min 500000 + clk_max 4800000 + duty_min 40 + duty_max 60 + sample_rate 48000 + fifo_word_length 32 + unmute_ramp_time_ms 200 + num_pdm_active 2 + + # PDM controller config + pdm_config."0" {} + pdm_config."1" {} + + #include DAI components + +} + +# DMIC DAI Index: 1, Direction: capture +Object.DMIC."1.1.capture" { + dai_name "dmic16k" + id 5 + format "s32le" + default_hw_config 5 + hw_config."5" {} + driver_version 1 + clk_min 500000 + clk_max 4800000 + duty_min 40 + duty_max 60 + sample_rate 16000 + fifo_word_length 32 + unmute_ramp_time_ms 400 + num_pdm_active 1 + + # PDM controller config + pdm_config."0" {} + + capture_sink_count 3 + + #include DAI components + +} + +# +# List of all endpoint connections +# +# Connect: Pipeline 1 -> ALH 2 DAI_IN +Object.connection."endpoint.1.0" { + source "endpoint.sink.pipeline.1.0" + sink "endpoint.source.ALH.2.0" +} + +# Connect: ALH 3 DAI_OUT -> Pipeline 2 +Object.connection."endpoint.2.0" { + sink "endpoint.source.pipeline.2.0" + source "endpoint.sink.ALH.3.0" +} + +# Connect muxdemux4.0 -> buffer3.2 +Object.connection."endpoint.3.0" { + sink "endpoint.source.pipeline.3.0" + source "endpoint.sink.pipeline.4.0" +} + +# Connect: Pipeline 3 -> ALH 0x102 DAI_IN +Object.connection."endpoint.4.0" { + source "endpoint.sink.pipeline.3.0" + sink "endpoint.source.ALH.258.0" +} + +# Connect: ALH 0x103 DAI_OUT -> Pipeline 4 +Object.connection."endpoint.5.0" { + sink "endpoint.source.pipeline.4.0" + source "endpoint.sink.ALH.259.0" +} + +# Connect: Pipeline 6 -> HDA 4 DAI_IN +Object.connection."endpoint.6.0" { + source "endpoint.sink.pipeline.6.0" + sink "endpoint.source.HDA.4.0" +} + +# Connect: Pipeline 7 -> HDA 5 DAI_IN +Object.connection."endpoint.7.0" { + source "endpoint.sink.pipeline.7.0" + sink "endpoint.source.HDA.5.0" +} + +# Connect: Pipeline 8 -> HDA 6 DAI_IN +Object.connection."endpoint.8.0" { + source "endpoint.sink.pipeline.8.0" + sink "endpoint.source.HDA.6.0" +} + +# Connect: Pipeline 9 -> HDA 7 DAI_IN +Object.connection."endpoint.9.0" { + source "endpoint.sink.pipeline.9.0" + sink "endpoint.source.HDA.7.0" +} + +# Connect: DMIC 0 DAI_OUT -> Pipeline 11 +Object.connection."endpoint.10.0" { + sink "endpoint.source.pipeline.11.0" + source "endpoint.sink.DMIC.0.0" +} + +# Connect: DMIC 1 DAI_OUT -> Pipeline 12 +Object.connection."endpoint.11.0" { + sink "endpoint.source.pipeline.12.0" + source "endpoint.sink.DMIC.1.0" +} + +# Connect: kpb12.0 -> buffer13.0 +Object.connection."endpoint.12.0" { + sink "endpoint.source.pipeline.13.0" + source "endpoint.sink.pipeline.12.0" +} + +# Connect: detect_sink.13 -> Pipeline 12 host +Object.connection."endpoint.13.0" { + sink "endpoint.source.pipeline.12.1" + source "endpoint.sink.pipeline.13.0" +}