From ea0e4b51f2146c64d49d03890a308a950323d457 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Wed, 24 Jul 2024 16:55:20 +0200 Subject: [PATCH] topology2: remove audio_format We need to use input_audio_format and output_audio_format. Signed-off-by: Pierre-Louis Bossart --- .../include/common/audio_format.conf | 237 ------------------ .../include/pipelines/cavs/dai-kpb-be.conf | 3 +- .../cavs/google-rtc-aec-capture.conf | 3 +- .../mixout-gain-alh-dai-copier-playback.conf | 1 - ...ut-gain-eqiir-dts-dai-copier-playback.conf | 51 ++-- .../cavs/mixout-gain-host-copier-capture.conf | 3 +- .../cavs/src-gain-mixin-playback.conf | 1 - .../include/pipelines/gain-capture.conf | 3 +- 8 files changed, 44 insertions(+), 258 deletions(-) delete mode 100644 tools/topology/topology2/include/common/audio_format.conf diff --git a/tools/topology/topology2/include/common/audio_format.conf b/tools/topology/topology2/include/common/audio_format.conf deleted file mode 100644 index d572f3c00..000000000 --- a/tools/topology/topology2/include/common/audio_format.conf +++ /dev/null @@ -1,237 +0,0 @@ -## \struct audio_format -## \brief Class definition for audio format object -## -## audio_format objects can be instantiated as: -## -## Object.Base.audio_format."0" { -## in_rate 48000 -## in_sample_container_size 16 -## in_valid_bit_depth 16 -## in_interleaving_style "interleaved" -## out_rate 48000 -## out_sample_container_size 16 -## out_valid_bit_depth 16 -## out_interleaving_style "interleaved" -## } -## - -Class.Base."audio_format" { - - DefineAttribute."instance" { - } - - ## input sampling rate - DefineAttribute."in_rate" { - # Token set reference name - token_ref "cavs_audio_format.word" - } - - # #input bit depth - DefineAttribute."in_bit_depth" { - # Token set reference name - token_ref "cavs_audio_format.word" - } - - ## input valid bit depth - DefineAttribute."in_valid_bit_depth" { - # Token set reference name - token_ref "cavs_audio_format.word" - } - - ## input channel count - DefineAttribute."in_channels" { - # Token set reference name - token_ref "cavs_audio_format.word" - constraints { - min 1 - max 8 - } - } - - ## input channel map - DefineAttribute."in_ch_map" { - # Token set reference name - token_ref "cavs_audio_format.word" - } - - ## input channel config - DefineAttribute."in_ch_cfg" { - # Token set reference name - token_ref "cavs_audio_format.word" - } - - ## input interleaving style - DefineAttribute."in_interleaving_style" { - type "string" - # Token set reference name - token_ref "cavs_audio_format.word" - constraints { - !valid_values [ - "interleaved" - "non-interleaved" - ] - !tuple_values [ - 0 - 1 - ] - } - } - - ## input format config - DefineAttribute."in_fmt_cfg" { - # Token set reference name - token_ref "cavs_audio_format.word" - } - - ## output sampling rate - DefineAttribute."out_rate" { - # Token set reference name - token_ref "cavs_audio_format.word" - } - - ## Input sample_type. - ## Valid values for sample type are defined in common_definitions.conf. - DefineAttribute."in_sample_type" { - type string - # Token set reference name - token_ref "cavs_audio_format.word" - constraints { - !valid_values [ - $SAMPLE_TYPE_MSB_INTEGER - $SAMPLE_TYPE_LSB_INTEGER - $SAMPLE_TYPE_SIGNED_INTEGER - $SAMPLE_TYPE_UNSIGNED_INTEGER - $SAMPLE_TYPE_FLOAT - ] - } - } - - ## output bit depth - DefineAttribute."out_bit_depth" { - # Token set reference name - token_ref "cavs_audio_format.word" - } - - ## output valid bit depth - DefineAttribute."out_valid_bit_depth" { - # Token set reference name - token_ref "cavs_audio_format.word" - } - - ## output channel count - DefineAttribute."out_channels" { - # Token set reference name - token_ref "cavs_audio_format.word" - constraints { - min 1 - max 8 - } - } - - ## output channel map - DefineAttribute."out_ch_map" { - # Token set reference name - token_ref "cavs_audio_format.word" - } - - ## output channel config - DefineAttribute."out_ch_cfg" { - # Token set reference name - token_ref "cavs_audio_format.word" - } - - ## output interleaving style - DefineAttribute."out_interleaving_style" { - type "string" - # Token set reference name - token_ref "cavs_audio_format.word" - constraints { - !valid_values [ - "interleaved" - "non-interleaved" - ] - !tuple_values [ - 0 - 1 - ] - } - } - - ## output format config - DefineAttribute."out_fmt_cfg" { - # Token set reference name - token_ref "cavs_audio_format.word" - } - - # - ## input buffer size - # - DefineAttribute."ibs" { - # Token set reference name and type - token_ref "cavs_audio_format.word" - } - - # - ## output buffer size - # - DefineAttribute."obs" { - # Token set reference name and type - token_ref "cavs_audio_format.word" - } - - ## Output sample_type. - ## Valid values for sample type are defined in common_definitions.conf. - DefineAttribute."out_sample_type" { - type string - # Token set reference name - token_ref "cavs_audio_format.word" - constraints { - !valid_values [ - $SAMPLE_TYPE_MSB_INTEGER - $SAMPLE_TYPE_LSB_INTEGER - $SAMPLE_TYPE_SIGNED_INTEGER - $SAMPLE_TYPE_UNSIGNED_INTEGER - $SAMPLE_TYPE_FLOAT - ] - } - } - - - attributes { - !constructor [ - "instance" - ] - - # - # audio_format objects instantiated within the same alsaconf node must have unique - # instance attribute values - # - unique "instance" - } - - in_rate 48000 - in_bit_depth 16 - in_valid_bit_depth 16 - in_channels 2 - in_interleaving_style "interleaved" - in_sample_type $SAMPLE_TYPE_LSB_INTEGER - out_rate 48000 - out_bit_depth 16 - out_valid_bit_depth 16 - out_channels 2 - out_interleaving_style "interleaved" - out_sample_type $SAMPLE_TYPE_LSB_INTEGER - in_ch_cfg $CHANNEL_CONFIG_STEREO - in_ch_map $CHANNEL_MAP_STEREO - out_ch_cfg $CHANNEL_CONFIG_STEREO - out_ch_map $CHANNEL_MAP_STEREO - - # math expression for computing input/output fmt_cfg - in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256)) | ($in_sample_type * 65536)]" - out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256)) | ($out_sample_type * 65536)]" - - # math expression for computing input/put buffer sizes - # for 11.025 22.05, 44.1, 88.2 and 176.4khz, we need to round it to ceiling value - ibs "$[($in_channels * ($[($in_rate + 999)] / 1000)) * ($in_bit_depth / 8)]" - obs "$[($out_channels * ($[($out_rate + 999)] / 1000)) * ($out_bit_depth / 8)]" -} diff --git a/tools/topology/topology2/include/pipelines/cavs/dai-kpb-be.conf b/tools/topology/topology2/include/pipelines/cavs/dai-kpb-be.conf index 0c3a5823a..91ca50a62 100644 --- a/tools/topology/topology2/include/pipelines/cavs/dai-kpb-be.conf +++ b/tools/topology/topology2/include/pipelines/cavs/dai-kpb-be.conf @@ -15,7 +15,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # - + + diff --git a/tools/topology/topology2/include/pipelines/cavs/google-rtc-aec-capture.conf b/tools/topology/topology2/include/pipelines/cavs/google-rtc-aec-capture.conf index cf83b5215..936d45c28 100644 --- a/tools/topology/topology2/include/pipelines/cavs/google-rtc-aec-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/google-rtc-aec-capture.conf @@ -17,7 +17,8 @@ - + + diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-alh-dai-copier-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-alh-dai-copier-playback.conf index b06ad1d06..9483629c4 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-alh-dai-copier-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-alh-dai-copier-playback.conf @@ -13,7 +13,6 @@ # Where N is the unique pipeline ID within the same alsaconf node. # - diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-eqiir-dts-dai-copier-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-eqiir-dts-dai-copier-playback.conf index 078b65799..87b9002f8 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-eqiir-dts-dai-copier-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-eqiir-dts-dai-copier-playback.conf @@ -14,7 +14,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # - + + @@ -54,10 +55,14 @@ Class.Pipeline."mixout-gain-eqiir-dts-dai-copier-playback" { num_input_pins 1 # copier only supports one format based on mixin/mixout requirements: 32-bit 48KHz 2ch - Object.Base.audio_format [ + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 32 } @@ -68,10 +73,14 @@ Class.Pipeline."mixout-gain-eqiir-dts-dai-copier-playback" { num_output_audio_formats 1 # 32-bit 48KHz 2ch - Object.Base.audio_format [ + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 32 } @@ -81,12 +90,18 @@ Class.Pipeline."mixout-gain-eqiir-dts-dai-copier-playback" { num_input_audio_formats 1 num_output_audio_formats 1 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] Object.Control.bytes."1" { @@ -96,12 +111,18 @@ Class.Pipeline."mixout-gain-eqiir-dts-dai-copier-playback" { num_input_audio_formats 1 num_output_audio_formats 1 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } pipeline."1" { diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-host-copier-capture.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-host-copier-capture.conf index 3a34a3110..ab18e5b48 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-host-copier-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-host-copier-capture.conf @@ -14,7 +14,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # - + + diff --git a/tools/topology/topology2/include/pipelines/cavs/src-gain-mixin-playback.conf b/tools/topology/topology2/include/pipelines/cavs/src-gain-mixin-playback.conf index 5d1fc1a45..45f9e3d13 100644 --- a/tools/topology/topology2/include/pipelines/cavs/src-gain-mixin-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/src-gain-mixin-playback.conf @@ -15,7 +15,6 @@ # - diff --git a/tools/topology/topology2/include/pipelines/gain-capture.conf b/tools/topology/topology2/include/pipelines/gain-capture.conf index 66e2d7df6..1255e0202 100644 --- a/tools/topology/topology2/include/pipelines/gain-capture.conf +++ b/tools/topology/topology2/include/pipelines/gain-capture.conf @@ -15,7 +15,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # - + +