From 441a0fe45cbf86bfd39ea5b8615eddf843353e77 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Thu, 20 Feb 2025 17:16:13 +0200 Subject: [PATCH] Tools: Topology2: ASRC: Remove non-used tokens with IPC4 This patch fixes the configuration tokens for ASRC with IPC4, the tokens asynchronous_mode and rate_in from IPC3 are not valid. In IPC4 all the control is packed to bit-fiels in operation mode. Token rate_out is in use as before. Signed-off-by: Seppo Ingalsuo --- .../topology2/include/bench/asrc_s16.conf | 18 ++++++++++-------- .../topology2/include/bench/asrc_s24.conf | 18 ++++++++++-------- .../topology2/include/bench/asrc_s32.conf | 18 ++++++++++-------- .../topology2/include/common/tokens.conf | 4 +--- .../topology2/include/components/asrc.conf | 14 -------------- 5 files changed, 31 insertions(+), 41 deletions(-) diff --git a/tools/topology/topology2/include/bench/asrc_s16.conf b/tools/topology/topology2/include/bench/asrc_s16.conf index 82647eea960f..3ba56b0c0622 100644 --- a/tools/topology/topology2/include/bench/asrc_s16.conf +++ b/tools/topology/topology2/include/bench/asrc_s16.conf @@ -1,16 +1,18 @@ # Created with script "./bench_comp_generate.sh asrc" + # Edited/added: + # - operation mode 1 for push for playback, 2 for pull for playback + # - rate_out 48000 for the fixed playback sink rate + # - rate_out 0 for the capture PCM defined sink rate Object.Widget.asrc.1 { - index 1 - asynchronous_mode 0 - operation_mode 0 - rate_out 48000 + index 1 + operation_mode 1 + rate_out 48000 } Object.Widget.asrc.2 { - index 3 - rate_in 48000 - asynchronous_mode 0 - operation_mode 1 + index 3 + operation_mode 2 + rate_out 0 } diff --git a/tools/topology/topology2/include/bench/asrc_s24.conf b/tools/topology/topology2/include/bench/asrc_s24.conf index 4121e4aa7447..1c7288cd01a3 100644 --- a/tools/topology/topology2/include/bench/asrc_s24.conf +++ b/tools/topology/topology2/include/bench/asrc_s24.conf @@ -1,16 +1,18 @@ # Created with script "./bench_comp_generate.sh asrc" + # Edited/added: + # - operation mode 1 for push for playback, 2 for pull for playback + # - rate_out 48000 for the fixed playback sink rate + # - rate_out 0 for the capture PCM defined sink rate Object.Widget.asrc.1 { - index 1 - asynchronous_mode 0 - operation_mode 0 - rate_out 48000 + index 1 + operation_mode 1 + rate_out 48000 } Object.Widget.asrc.2 { - index 3 - asynchronous_mode 0 - operation_mode 1 - rate_in 48000 + index 3 + operation_mode 2 + rate_out 0 } diff --git a/tools/topology/topology2/include/bench/asrc_s32.conf b/tools/topology/topology2/include/bench/asrc_s32.conf index 2de2edaa08b5..2a0e3387f84e 100644 --- a/tools/topology/topology2/include/bench/asrc_s32.conf +++ b/tools/topology/topology2/include/bench/asrc_s32.conf @@ -1,16 +1,18 @@ # Created with script "./bench_comp_generate.sh asrc" + # Edited/added: + # - operation mode 1 for push for playback, 2 for pull for playback + # - rate_out 48000 for the fixed playback sink rate + # - rate_out 0 for the capture PCM defined sink rate Object.Widget.asrc.1 { - index 1 - asynchronous_mode 0 - operation_mode 0 - rate_out 48000 + index 1 + operation_mode 1 + rate_out 48000 } Object.Widget.asrc.2 { - index 3 - asynchronous_mode 0 - operation_mode 1 - rate_in 48000 + index 3 + operation_mode 2 + rate_out 0 } diff --git a/tools/topology/topology2/include/common/tokens.conf b/tools/topology/topology2/include/common/tokens.conf index dadfc162483c..46b172bb08e2 100644 --- a/tools/topology/topology2/include/common/tokens.conf +++ b/tools/topology/topology2/include/common/tokens.conf @@ -63,9 +63,7 @@ Object.Base.VendorToken { "7" { name "asrc" - rate_in 320 - rate_out 321 - asynchronous_mode 322 + rate_out 321 operation_mode 323 } diff --git a/tools/topology/topology2/include/components/asrc.conf b/tools/topology/topology2/include/components/asrc.conf index 1adcb9b457de..5ea82b0e7882 100644 --- a/tools/topology/topology2/include/components/asrc.conf +++ b/tools/topology/topology2/include/components/asrc.conf @@ -8,7 +8,6 @@ # Object.Widget.asrc."N" { # format "s24le" # rate_out 48000 -# asynchronous_mode 1 # operation_mode 0 # } # @@ -32,24 +31,12 @@ Class.Widget."asrc" { # Bespoke attributes for ASRC # - # Source sample rate - DefineAttribute."rate_in" { - # Token set reference name and type - token_ref "asrc.word" - - } - # Target sample rate DefineAttribute."rate_out" { # Token set reference name and type token_ref "asrc.word" } - DefineAttribute."asynchronous_mode" { - # Token set reference name and type - token_ref "asrc.word" - } - DefineAttribute."operation_mode" { # Token set reference name and type token_ref "asrc.word" @@ -66,7 +53,6 @@ Class.Widget."asrc" { ] !mandatory [ - "asynchronous_mode" "operation_mode" "num_input_audio_formats" "num_output_audio_formats"