From 645b27acf7726b83f7865ade3a3f650681f5bafe Mon Sep 17 00:00:00 2001 From: Eddy Hsu Date: Wed, 14 Aug 2024 20:36:23 +0000 Subject: [PATCH] [TEST] Use SubTreeCopy --- .../mixout-gain-ctc-dai-copier-playback.conf | 128 +++++------------- 1 file changed, 37 insertions(+), 91 deletions(-) diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-ctc-dai-copier-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-ctc-dai-copier-playback.conf index b181b82b0b8b..b95cde91f450 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-ctc-dai-copier-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-ctc-dai-copier-playback.conf @@ -1,5 +1,6 @@ # # BE playback pipeline: mixout-gain-ctc-dai-copier. +# This pipeline is an extension of the mixout-gain-dai-copier-playback pipeline class. # # All attributes defined herein are namespaced # by alsatplg to "Object.Pipeline.mixout-gain-ctc-dai-copier-playback.N.attribute_name" @@ -21,105 +22,50 @@ + + Class.Pipeline."mixout-gain-ctc-dai-copier-playback" { + SubTreeCopy.baseclass { + # this class extends the mixout-gain-dai-copier-playback class definition + source "Class.Pipeline.mixout-gain-dai-copier-playback" - DefineAttribute."index" {} + # target node is not defined which means that the new subtree will be copied to + # the parent node containing the SubTreeCopy node i.e in this case the + # Class.Pipeline.mixout-gain-ctc-dai-copier-playback {} node. - + # default copy type is to extend the base class ie the widgets and routes + # will be added to the existing list of widgets/routes in the base class - attributes { - !constructor [ - "index" - ] + tree { + Object.Widget { + ctc."1" { + num_input_audio_formats 1 + num_output_audio_formats 1 - !immutable [ - "direction" - ] - - # - # mixout-gain-ctc-dai-copier-playback objects instantiated within the same alsaconf node must have - # unique instance attribute - # - unique "instance" - } - - Object.Widget { - mixout."1" {} - dai-copier."1" { - type dai_in - num_input_audio_formats 1 - num_output_audio_formats 1 - num_input_pins 1 - - # copier only supports one format based on mixin/mixout requirements: 32-bit 48KHz 2ch - 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.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 + } + ] } - ] - } - gain."1" { - num_input_audio_formats 1 - num_output_audio_formats 1 + } - # 32-bit 48KHz 2ch - 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 - } - ] - } - ctc."1" { - num_input_audio_formats 1 - num_output_audio_formats 1 - - 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" { - priority 0 - lp_mode 0 + Object.Base { + ! route [ + { + source gain.$index.1 + sink ctc.$index.1 + } + ] + } } } - - Object.Base { - route.1 { - source mixout.$index.1 - sink gain.$index.1 - } - route.2 { - source gain.$index.1 - sink ctc.$index.1 - } - } - - direction "playback" - dynamic_pipeline 1 - time_domain "timer" }