From d2e93f44ad998d6ad0a299ab9e6221b6e91260d5 Mon Sep 17 00:00:00 2001 From: Rander Wang Date: Thu, 12 Oct 2023 13:18:08 +0800 Subject: [PATCH] topology2: clean up audio format Separate the input & output audio format. Signed-off-by: Rander Wang --- tools/topology/topology2/cavs-nocodec.conf | 143 ++++++++++++++------- 1 file changed, 97 insertions(+), 46 deletions(-) diff --git a/tools/topology/topology2/cavs-nocodec.conf b/tools/topology/topology2/cavs-nocodec.conf index 36987d6484ac..300fe10c0933 100644 --- a/tools/topology/topology2/cavs-nocodec.conf +++ b/tools/topology/topology2/cavs-nocodec.conf @@ -307,45 +307,54 @@ IncludeByKey.PASSTHROUGH { } Object.Widget.module-copier.1 { stream_name 'Gain Capture 19' + num_input_audio_formats 2 - num_output_audio_formats 2 - Object.Base.audio_format.1 { + Object.Base.input_audio_format.1 { in_bit_depth 32 in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 } - Object.Base.audio_format.2 { + Object.Base.input_audio_format.2 { in_channels 4 in_bit_depth 32 in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + num_output_audio_formats 2 + Object.Base.output_audio_format.1 { + out_bit_depth 32 + out_valid_bit_depth 32 + } + Object.Base.output_audio_format.2 { out_channels 4 out_bit_depth 32 out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 out_ch_map $CHANNEL_MAP_3_POINT_1 } } Object.Widget.gain.1 { num_input_audio_formats 2 - num_output_audio_formats 2 - Object.Base.audio_format.1 { + Object.Base.input_audio_format.1 { in_bit_depth 32 in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 } - Object.Base.audio_format.2 { + Object.Base.input_audio_format.2 { in_channels 4 in_bit_depth 32 in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + num_output_audio_formats 2 + Object.Base.output_audio_format.1 { + out_bit_depth 32 + out_valid_bit_depth 32 + } + Object.Base.output_audio_format.2 { out_channels 4 out_bit_depth 32 out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 out_ch_map $CHANNEL_MAP_3_POINT_1 } @@ -368,9 +377,14 @@ IncludeByKey.PASSTHROUGH { copier_type "SSP" stream_name "NoCodec-0" node_type $I2S_LINK_INPUT_CLASS - Object.Base.audio_format.1 { + + num_input_audio_formats 1 + Object.Base.input_audio_format.1 { in_bit_depth 32 in_valid_bit_depth 32 + } + num_output_audio_formats 1 + Object.Base.output_audio_format.1 { out_bit_depth 32 out_valid_bit_depth 32 } @@ -387,9 +401,14 @@ IncludeByKey.PASSTHROUGH { Object.Widget.module-copier."2" { stream_name "NoCodec-0" - Object.Base.audio_format.1 { + + num_input_audio_formats 1 + Object.Base.input_audio_format.1 { in_bit_depth 32 in_valid_bit_depth 32 + } + num_output_audio_formats 1 + Object.Base.output_audio_format.1 { out_bit_depth 32 out_valid_bit_depth 32 } @@ -634,9 +653,14 @@ Object.Pipeline.io-gateway-capture [ copier_type "SSP" stream_name "NoCodec-2" node_type $I2S_LINK_INPUT_CLASS - Object.Base.audio_format.1 { + + num_input_audio_formats 1 + Object.Base.input_audio_format.1 { in_bit_depth 32 in_valid_bit_depth 32 + } + num_output_audio_formats 1 + Object.Base.output_audio_format.1 { out_bit_depth 32 out_valid_bit_depth 32 } @@ -679,47 +703,58 @@ IncludeByKey.PASSTHROUGH { stream_name "Gain Capture 18" pcm_id 27 num_input_audio_formats 2 - num_output_audio_formats 2 - Object.Base.audio_format.1 { + Object.Base.input_audio_format.1 { in_bit_depth 32 in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 } - Object.Base.audio_format.2 { + Object.Base.input_audio_format.2 { in_channels 4 in_bit_depth 32 in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + + num_output_audio_formats 2 + Object.Base.output_audio_format.1 { + out_bit_depth 32 + out_valid_bit_depth 32 + } + Object.Base.output_audio_format.2 { out_channels 4 out_bit_depth 32 out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 out_ch_map $CHANNEL_MAP_3_POINT_1 } } Object.Widget.gain.1 { num_input_audio_formats 2 - num_output_audio_formats 2 - Object.Base.audio_format.1 { + Object.Base.input_audio_format.1 { in_bit_depth 32 in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 } - Object.Base.audio_format.2 { + Object.Base.input_audio_format.2 { in_channels 4 in_bit_depth 32 in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + + num_output_audio_formats 2 + Object.Base.output_audio_format.1 { + out_bit_depth 32 + out_valid_bit_depth 32 + } + Object.Base.output_audio_format.2 { out_channels 4 out_bit_depth 32 out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 out_ch_map $CHANNEL_MAP_3_POINT_1 } + Object.Control.mixer.1 { name 'Post Demux $DMIC0_PCM_0_NAME Capture Volume' } @@ -735,47 +770,58 @@ IncludeByKey.PASSTHROUGH { stream_name "Gain Capture 20" pcm_id 28 num_input_audio_formats 2 - num_output_audio_formats 2 - Object.Base.audio_format.1 { + Object.Base.input_audio_format.1 { in_bit_depth 32 in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 } - Object.Base.audio_format.2 { + Object.Base.input_audio_format.2 { in_channels 4 in_bit_depth 32 in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + + num_output_audio_formats 2 + Object.Base.output_audio_format.1 { + out_bit_depth 32 + out_valid_bit_depth 32 + } + Object.Base.output_audio_format.2 { out_channels 4 out_bit_depth 32 out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 out_ch_map $CHANNEL_MAP_3_POINT_1 } } Object.Widget.gain.1 { num_input_audio_formats 2 - num_output_audio_formats 2 - Object.Base.audio_format.1 { + Object.Base.input_audio_format.1 { in_bit_depth 32 in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 } - Object.Base.audio_format.2 { + Object.Base.input_audio_format.2 { in_channels 4 in_bit_depth 32 in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + + num_output_audio_formats 2 + Object.Base.output_audio_format.1 { + out_bit_depth 32 + out_valid_bit_depth 32 + } + Object.Base.output_audio_format.2 { out_channels 4 out_bit_depth 32 out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 out_ch_map $CHANNEL_MAP_3_POINT_1 } + Object.Control.mixer.1 { name 'Post Demux $DMIC0_PCM_1_NAME Capture Volume' } @@ -1070,9 +1116,14 @@ IncludeByKey.SSP1_ENABLED { copier_type "SSP" stream_name "NoCodec-1" node_type $I2S_LINK_INPUT_CLASS - Object.Base.audio_format.1 { + + num_input_audio_formats 1 + Object.Base.input_audio_format.1 { in_bit_depth 32 in_valid_bit_depth 32 + } + num_output_audio_formats 1 + Object.Base.output_audio_format.1 { out_bit_depth 32 out_valid_bit_depth 32 }