From 193dec2c9fbe89357e025681bfb3c4d234226c5a Mon Sep 17 00:00:00 2001 From: Andrula Song Date: Wed, 17 Jan 2024 10:06:09 +0800 Subject: [PATCH] Topology: Topology2: Add sof-hda-benchmark-asrc32/24/16- This patch adds build of hda-generic development topologies to test ASRC component with s32/24/16 format. Signed-off-by: Andrula Song --- .../topology2/cavs-benchmark-hda.conf | 26 ++++++++++++++++--- .../development/tplg-targets-bench.cmake | 2 ++ .../include/bench/asrc_hda_route.conf | 19 ++++++++++++++ .../topology2/include/bench/asrc_s16.conf | 17 ++++++++++++ .../topology2/include/bench/asrc_s24.conf | 17 ++++++++++++ .../topology2/include/bench/asrc_s32.conf | 17 ++++++++++++ .../topology2/include/components/asrc.conf | 8 ++++-- 7 files changed, 101 insertions(+), 5 deletions(-) create mode 100644 tools/topology/topology2/include/bench/asrc_hda_route.conf create mode 100644 tools/topology/topology2/include/bench/asrc_s16.conf create mode 100644 tools/topology/topology2/include/bench/asrc_s24.conf create mode 100644 tools/topology/topology2/include/bench/asrc_s32.conf diff --git a/tools/topology/topology2/cavs-benchmark-hda.conf b/tools/topology/topology2/cavs-benchmark-hda.conf index fc28a2b8e105..fa818f8fe802 100644 --- a/tools/topology/topology2/cavs-benchmark-hda.conf +++ b/tools/topology/topology2/cavs-benchmark-hda.conf @@ -2,6 +2,7 @@ + Define { ANALOG_PLAYBACK_PCM 'Analog Playback' @@ -195,6 +196,25 @@ IncludeByKey.BENCH_CONFIG { } + # + # ASRC component + # + + # '^' indicates the start of the string and '$' means the end of string + # manually adding '^' and '$' for whole string precise matching + + "^asrc16$" { + + } + + "^asrc24$" { + + } + + "^asrc32$" { + + } + # # DCblock component # @@ -328,15 +348,15 @@ IncludeByKey.BENCH_CONFIG { # SRC component # - "src16" { + "^src16$" { } - "src24" { + "^src24$" { } - "src32" { + "^src32$" { } diff --git a/tools/topology/topology2/development/tplg-targets-bench.cmake b/tools/topology/topology2/development/tplg-targets-bench.cmake index 50b263801fda..74d600f1a28b 100644 --- a/tools/topology/topology2/development/tplg-targets-bench.cmake +++ b/tools/topology/topology2/development/tplg-targets-bench.cmake @@ -9,6 +9,7 @@ set(platforms "TGL" "MTL") set(sampleformats "16" "24" "32") set(components + "asrc" "dcblock" "drc" "drc_multiband" @@ -22,6 +23,7 @@ set(components ) set(component_parameters + "BENCH_ASRC_PARAMS=default" "BENCH_DCBLOCK_PARAMS=default" "BENCH_DRC_PARAMS=enabled" "BENCH_DRC_MULTIBAND_PARAMS=default" diff --git a/tools/topology/topology2/include/bench/asrc_hda_route.conf b/tools/topology/topology2/include/bench/asrc_hda_route.conf new file mode 100644 index 000000000000..853085a164b1 --- /dev/null +++ b/tools/topology/topology2/include/bench/asrc_hda_route.conf @@ -0,0 +1,19 @@ + # Created with script "./bench_comp_generate.sh asrc" + Object.Base.route [ + { + sink 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.playback' + source 'asrc.1.1' + } + { + sink 'asrc.1.1' + source 'host-copier.0.playback' + } + { + source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture' + sink 'asrc.3.2' + } + { + source 'asrc.3.2' + sink 'host-copier.0.capture' + } + ] diff --git a/tools/topology/topology2/include/bench/asrc_s16.conf b/tools/topology/topology2/include/bench/asrc_s16.conf new file mode 100644 index 000000000000..82647eea960f --- /dev/null +++ b/tools/topology/topology2/include/bench/asrc_s16.conf @@ -0,0 +1,17 @@ + # Created with script "./bench_comp_generate.sh asrc" + Object.Widget.asrc.1 { + index 1 + asynchronous_mode 0 + operation_mode 0 + rate_out 48000 + + } + Object.Widget.asrc.2 { + index 3 + rate_in 48000 + asynchronous_mode 0 + operation_mode 1 + + } + + diff --git a/tools/topology/topology2/include/bench/asrc_s24.conf b/tools/topology/topology2/include/bench/asrc_s24.conf new file mode 100644 index 000000000000..4121e4aa7447 --- /dev/null +++ b/tools/topology/topology2/include/bench/asrc_s24.conf @@ -0,0 +1,17 @@ + # Created with script "./bench_comp_generate.sh asrc" + Object.Widget.asrc.1 { + index 1 + asynchronous_mode 0 + operation_mode 0 + rate_out 48000 + + } + Object.Widget.asrc.2 { + index 3 + asynchronous_mode 0 + operation_mode 1 + rate_in 48000 + + } + + diff --git a/tools/topology/topology2/include/bench/asrc_s32.conf b/tools/topology/topology2/include/bench/asrc_s32.conf new file mode 100644 index 000000000000..2de2edaa08b5 --- /dev/null +++ b/tools/topology/topology2/include/bench/asrc_s32.conf @@ -0,0 +1,17 @@ + # Created with script "./bench_comp_generate.sh asrc" + Object.Widget.asrc.1 { + index 1 + asynchronous_mode 0 + operation_mode 0 + rate_out 48000 + + } + Object.Widget.asrc.2 { + index 3 + asynchronous_mode 0 + operation_mode 1 + rate_in 48000 + + } + + diff --git a/tools/topology/topology2/include/components/asrc.conf b/tools/topology/topology2/include/components/asrc.conf index 31f592571bb4..1adcb9b457de 100644 --- a/tools/topology/topology2/include/components/asrc.conf +++ b/tools/topology/topology2/include/components/asrc.conf @@ -66,10 +66,12 @@ Class.Widget."asrc" { ] !mandatory [ - "format" - "rate_out" "asynchronous_mode" "operation_mode" + "num_input_audio_formats" + "num_output_audio_formats" + "num_input_pins" + "num_output_pins" ] # @@ -96,4 +98,6 @@ Class.Widget."asrc" { type "asrc" uuid "2d:40:b4:66:68:b4:f2:42:81:a7:b3:71:21:86:3d:d4" no_pm "true" + num_input_pins 1 + num_output_pins 1 }