From 5f0eec3a8d6a4b561e90b7f6a8452fcefaba0f2e Mon Sep 17 00:00:00 2001 From: Rander Wang Date: Mon, 25 Sep 2023 13:29:46 +0800 Subject: [PATCH 1/2] topology2: use input|output audio format The old style is not used now. Signed-off-by: Rander Wang --- .../include/pipelines/cavs/gain-capture.conf | 111 +++++++++++------- 1 file changed, 71 insertions(+), 40 deletions(-) diff --git a/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf b/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf index 57e65070b6db..8b5457310b94 100644 --- a/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf @@ -47,58 +47,89 @@ Class.Pipeline."gain-capture" { Object.Widget { host-copier."1" { type "aif_out" - num_input_audio_formats 3 - num_output_audio_formats 3 + num_input_audio_formats 1 num_input_pins 1 - # 16-bit 48KHz 2ch - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 24-bit 48KHz 2ch - Object.Base.audio_format.2 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 24 - } - # 32-bit 48KHz 2ch - Object.Base.audio_format.3 { - 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 + } + ] + + num_output_audio_formats 3 + num_output_pins 1 + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + { + out_bit_depth 32 + out_valid_bit_depth 24 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + node_type $HDA_HOST_INPUT_CLASS } gain."1" { num_input_audio_formats 2 - num_output_audio_formats 2 + num_input_pins 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] - #16-bit 48KHz 2ch - Object.Base.audio_format.1 {} - # 32-bit 48KHz 2ch - Object.Base.audio_format.2 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + num_output_audio_formats 2 + num_output_pins 1 + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } module-copier."2" { num_input_audio_formats 2 + num_input_pins 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + num_output_audio_formats 2 - #16-bit 48KHz 2ch - Object.Base.audio_format.1 {} - # 32-bit 48KHz 2ch - Object.Base.audio_format.2 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + num_output_pins 1 + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } pipeline."1" { From ec3240f98d5fd61908831e789f378ab90de1285f Mon Sep 17 00:00:00 2001 From: Rander Wang Date: Mon, 25 Sep 2023 14:10:52 +0800 Subject: [PATCH 2/2] topology2: Add 4ch audio formats for gain-capture pipeline Add support in gain-capture pipeline to support 4ch DMIC stream. Signed-off-by: Rander Wang --- .../include/pipelines/cavs/gain-capture.conf | 96 +++++++++++++++++-- 1 file changed, 90 insertions(+), 6 deletions(-) diff --git a/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf b/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf index 8b5457310b94..7919e2032b79 100644 --- a/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf @@ -47,16 +47,23 @@ Class.Pipeline."gain-capture" { Object.Widget { host-copier."1" { type "aif_out" - num_input_audio_formats 1 + num_input_audio_formats 2 num_input_pins 1 Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 } + { + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } ] - num_output_audio_formats 3 + num_output_audio_formats 6 num_output_pins 1 Object.Base.output_audio_format [ { @@ -71,13 +78,34 @@ Class.Pipeline."gain-capture" { out_bit_depth 32 out_valid_bit_depth 32 } + { + out_bit_depth 16 + out_valid_bit_depth 16 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + out_bit_depth 32 + out_valid_bit_depth 24 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } ] node_type $HDA_HOST_INPUT_CLASS } gain."1" { - num_input_audio_formats 2 + num_input_audio_formats 4 num_input_pins 1 Object.Base.input_audio_format [ { @@ -88,9 +116,23 @@ Class.Pipeline."gain-capture" { in_bit_depth 32 in_valid_bit_depth 32 } + { + in_bit_depth 16 + in_valid_bit_depth 16 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } ] - num_output_audio_formats 2 + num_output_audio_formats 4 num_output_pins 1 Object.Base.output_audio_format [ { @@ -101,11 +143,25 @@ Class.Pipeline."gain-capture" { out_bit_depth 32 out_valid_bit_depth 32 } + { + out_bit_depth 16 + out_valid_bit_depth 16 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } ] } module-copier."2" { - num_input_audio_formats 2 + num_input_audio_formats 4 num_input_pins 1 Object.Base.input_audio_format [ { @@ -116,9 +172,23 @@ Class.Pipeline."gain-capture" { in_bit_depth 32 in_valid_bit_depth 32 } + { + in_bit_depth 16 + in_valid_bit_depth 16 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } ] - num_output_audio_formats 2 + num_output_audio_formats 4 num_output_pins 1 Object.Base.output_audio_format [ { @@ -129,6 +199,20 @@ Class.Pipeline."gain-capture" { out_bit_depth 32 out_valid_bit_depth 32 } + { + out_bit_depth 16 + out_valid_bit_depth 16 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } ] }