diff --git a/tools/topology/topology2/development/cavs-nocodec-asrc.conf b/tools/topology/topology2/development/cavs-nocodec-asrc.conf new file mode 100644 index 000000000000..2ec44f03d808 --- /dev/null +++ b/tools/topology/topology2/development/cavs-nocodec-asrc.conf @@ -0,0 +1,433 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Define { + MCLK 24576000 + NUM_DMICS 0 + # override DMIC default definitions + DMIC0_HOST_PIPELINE_ID 1 + DMIC0_DAI_PIPELINE_ID 2 + DMIC0_HOST_PIPELINE_SINK 'gain.1.1' + DMIC0_DAI_PIPELINE_SRC 'module-copier.2.2' + DMIC0_DAI_COPIER 'dai-copier.DMIC.NoCodec-6.capture' + DMIC0_DAI_GAIN 'eqiir.2.1' + DMIC0_NAME 'NoCodec-6' + DMIC1_NAME 'NoCodec-7' + DMIC0_PCM_CAPS 'Gain Capture 1' + DMIC1_PCM_CAPS 'DMIC1 WOV Capture' + PLATFORM "none" + SSP0_PCM_NAME "Port0" + SSP0_PCM_ID 0 + SSP1_PCM_NAME "Port1" + SSP1_PCM_ID 1 +} + +# override defaults with platform-specific config +IncludeByKey.PLATFORM { + "tgl" "platform/intel/tgl.conf" + "adl" "platform/intel/tgl.conf" + "mtl" "platform/intel/mtl.conf" + "lnl" "platform/intel/mtl.conf" +} + +# include DMIC config if needed. +IncludeByKey.NUM_DMICS { + "[1-4]" "platform/intel/dmic-generic.conf" +} + +# Dmic-->ASRC-->host copier + +Object.Pipeline.asrc-capture [ + { + index 3 + Object.Widget.host-copier.1 { + stream_name "ASRC Capture 3" + pcm_id 3 + num_input_audio_formats 2 + num_output_audio_formats 2 + 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.audio_format.2 { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + 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.asrc."1" { + rate_in 48000 + rate_out 48000 + asynchronous_mode 1 + operation_mode 1 + num_input_audio_formats 2 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + 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 [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + } + Object.Widget.pipeline."1" { + core $DMIC_CORE_ID + } + } +] + +Object.Base.route [ + { + source $DMIC0_DAI_COPIER + sink "asrc.3.1" + } + + { + source "asrc.3.1" + sink "host-copier.3.capture" + } +] + +Object.PCM.pcm [ + { + + name "ASRC Capture 3" + id 3 + direction "capture" + Object.Base.fe_dai."ASRC Capture 3" {} + + Object.PCM.pcm_caps."capture" { + name "ASRC Capture 3" + # only 32-bit capture supported now + formats 'S32_LE' + channels_min $NUM_DMICS + channels_max $NUM_DMICS + } + } +] + +# SSP0 --> asrc --> PCM0 +Object.Dai.SSP [ + { + id 0 + dai_index 0 + direction "duplex" + name NoCodec-0 + default_hw_conf_id 0 + sample_bits 32 + quirks "lbm_mode" + io_clk $MCLK + + Object.Base.hw_config.1 { + name "SSP0" + id 0 + bclk_freq 3072000 + tdm_slot_width 32 + # TODO: remove this. Needs alsaptlg change. + Object.Base.link_config.1 { + clock_source 1 + } + } + } +] +Object.Pipeline.io-gateway-capture [ + { + index 4 + direction capture + + Object.Widget.dai-copier."1" { + dai_index 0 + dai_type "SSP" + type dai_out + copier_type "SSP" + stream_name "NoCodec-0" + node_type $I2S_LINK_INPUT_CLASS + Object.Base.audio_format.1 { + in_bit_depth 32 + in_valid_bit_depth 32 + out_bit_depth 32 + out_valid_bit_depth 32 + } + } + } +] + +Object.Pipeline.asrc-capture [ + { + index 5 + Object.Widget.host-copier.1 { + stream_name "SSP0 Capture" + pcm_id $SSP0_PCM_ID + } + Object.Widget.asrc."1" { + rate_in 48000 + rate_out 48000 + asynchronous_mode 1 + operation_mode 0 + + num_input_audio_formats 2 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + # 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 [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + # out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + } + Object.Widget.pipeline."1" { + core $DMIC_CORE_ID + } + } +] + +Object.Base.route [ + { + source "asrc.5.1" + sink "host-copier.$SSP0_PCM_ID.capture" + } + { + source "dai-copier.SSP.NoCodec-0.capture" + sink "asrc.5.1" + } +] + +Object.PCM.pcm [ + { + name "$SSP0_PCM_NAME" + id $SSP0_PCM_ID + direction "capture" + Object.Base.fe_dai.1 { + name "$SSP0_PCM_NAME" + } + + Object.PCM.pcm_caps.1 { + direction "capture" + name "SSP0 Capture" + formats 'S16_LE,S24_LE,S32_LE' + } + } +] + + +# PCM1--> gain --> ASRC--> SSP1 +Object.Dai.SSP [ + { + id 1 + dai_index 1 + direction "duplex" + name NoCodec-1 + default_hw_conf_id 0 + sample_bits 32 + quirks "lbm_mode" + io_clk $MCLK + + Object.Base.hw_config.1 { + name "SSP1" + id 0 + bclk_freq 3072000 + tdm_slot_width 32 + # TODO: remove this. Needs alsaptlg change. + Object.Base.link_config.1 { + clock_source 1 + } + } + } +] + +Object.Pipeline.io-gateway [ + { + index 7 + direction playback + + Object.Widget.dai-copier.1 { + dai_index 1 + dai_type "SSP" + copier_type "SSP" + stream_name "NoCodec-1" + node_type $I2S_LINK_OUTPUT_CLASS + num_input_pins 1 + num_input_audio_formats 3 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_bit_depth 32 + in_valid_bit_depth 24 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + num_output_audio_formats 3 + 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 + } + ] + } + } +] + +Object.Pipeline.host-copier-gain-asrc-playback [ + { + index 6 + + Object.Widget.host-copier.1 { + rate_in 48000 + stream_name 'SSP1 Playback' + pcm_id $SSP1_PCM_ID + } + + Object.Widget.gain.1 { + rate_in 48000 + Object.Control.mixer.1 { + name '$SSP1_PCM_NAME Playback Volume' + } + } + + Object.Widget.asrc."1" { + rate_in 48000 + rate_out 16000 + asynchronous_mode 1 + operation_mode 0 + } + Object.Widget.pipeline."1" { + core $DMIC_CORE_ID + } + } +] + + +Object.Base.route [ + { + source "host-copier.$SSP1_PCM_ID.playback" + sink "gain.6.1" + } + { + source "gain.6.1" + sink "asrc.6.1" + } + { + source "asrc.6.1" + sink "dai-copier.SSP.NoCodec-1.playback" + } +] + +Object.PCM.pcm [ + { + name "$SSP1_PCM_NAME" + id $SSP1_PCM_ID + direction "playback" + Object.Base.fe_dai.1 { + name "$SSP1_PCM_NAME" + } + + Object.PCM.pcm_caps.1 { + direction "playback" + name "SSP1 Playback" + formats 'S16_LE,S24_LE,S32_LE' + } + } +] \ No newline at end of file diff --git a/tools/topology/topology2/development/tplg-targets.cmake b/tools/topology/topology2/development/tplg-targets.cmake index a2245db252a3..290fade53463 100644 --- a/tools/topology/topology2/development/tplg-targets.cmake +++ b/tools/topology/topology2/development/tplg-targets.cmake @@ -107,4 +107,9 @@ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-nocodec-bt-mtl-lbm.bin" # Topology to test IPC4 Crossover "development/cavs-nocodec-crossover\;sof-tgl-nocodec-crossover-2way\;PLATFORM=tgl,\ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-tgl-nocodec-crossover.bin,EFX_CROSSOVER_PARAMS=2way" + +# Topology to test IPC4 ASRC +"development/cavs-nocodec-asrc\;sof-tgl-nocodec-asrc\;NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-tgl-nocodec-asrc.bin,DEEPBUFFER_FW_DMA_MS=100,\ +SSP0_MIXER_2LEVEL=1,PLATFORM=tgl" ) diff --git a/tools/topology/topology2/include/components/asrc.conf b/tools/topology/topology2/include/components/asrc.conf index 5737186ca67b..1adcb9b457de 100644 --- a/tools/topology/topology2/include/components/asrc.conf +++ b/tools/topology/topology2/include/components/asrc.conf @@ -66,10 +66,12 @@ Class.Widget."asrc" { ] !mandatory [ - "format" - "rate_out" "asynchronous_mode" "operation_mode" + "num_input_audio_formats" + "num_output_audio_formats" + "num_input_pins" + "num_output_pins" ] # @@ -94,6 +96,8 @@ Class.Widget."asrc" { # Default attributes for asrc # type "asrc" - uuid "f6:72:ec:c8:26:85:af:4f:9d:39:a2:3d:0b:54:1d:e2" + uuid "2d:40:b4:66:68:b4:f2:42:81:a7:b3:71:21:86:3d:d4" no_pm "true" + num_input_pins 1 + num_output_pins 1 } diff --git a/tools/topology/topology2/include/components/asrc_format_s32_convert_from_24k.conf b/tools/topology/topology2/include/components/asrc_format_s32_convert_from_24k.conf new file mode 100644 index 000000000000..5d134214e725 --- /dev/null +++ b/tools/topology/topology2/include/components/asrc_format_s32_convert_from_24k.conf @@ -0,0 +1,26 @@ +#asrc format array + num_output_audio_formats 2 + + Object.Base.output_audio_format [ + # 8khz output + { + out_rate 8000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 16khz output + { + out_rate 16000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + + num_input_audio_formats 1 + + Object.Base.input_audio_format [ + { + in_rate 24000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] diff --git a/tools/topology/topology2/include/components/asrc_format_s32_convert_from_48k.conf b/tools/topology/topology2/include/components/asrc_format_s32_convert_from_48k.conf new file mode 100644 index 000000000000..2d9f94fdb1cb --- /dev/null +++ b/tools/topology/topology2/include/components/asrc_format_s32_convert_from_48k.conf @@ -0,0 +1,103 @@ +#asrc format array + num_output_audio_formats 14 + + Object.Base.output_audio_format [ + # 8khz output + { + out_rate 8000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 11.025 khz output + { + out_rate 11025 + out_bit_depth 32 + out_valid_bit_depth 32 + obs "$[($out_channels * (($[($out_rate + 999)] / 1000) + 4)) * ($out_bit_depth / 8)]" + } + # 12khz output + { + out_rate 12000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 16khz output + { + out_rate 16000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 22.05khz output + { + out_rate 22050 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 24khz output + { + out_rate 24000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 32khz output + { + out_rate 32000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 44.1khz output + { + out_rate 44100 + out_bit_depth 32 + out_valid_bit_depth 32 + obs "$[($out_channels * (($[($out_rate + 999)] / 1000) + 4)) * ($out_bit_depth / 8)]" + } + # 48khz output + { + out_rate 48000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 64khz output + { + out_rate 64000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 88.2khz output + { + out_rate 88200 + out_bit_depth 32 + out_valid_bit_depth 32 + obs "$[($out_channels * (($[($out_rate + 999)] / 1000) + 4)) * ($out_bit_depth / 8)]" + } + # 96khz output + { + out_rate 96000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 176.4khz output + { + out_rate 176400 + out_bit_depth 32 + out_valid_bit_depth 32 + obs "$[($out_channels * (($[($out_rate + 999)] / 1000) + 4)) * ($out_bit_depth / 8)]" + } + # 192khz output + { + out_rate 192000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + + num_input_audio_formats 1 + + Object.Base.input_audio_format [ + { + in_rate 48000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] diff --git a/tools/topology/topology2/include/components/asrc_format_s32_to_sxx_convert.conf b/tools/topology/topology2/include/components/asrc_format_s32_to_sxx_convert.conf new file mode 100644 index 000000000000..a76ba74ab2de --- /dev/null +++ b/tools/topology/topology2/include/components/asrc_format_s32_to_sxx_convert.conf @@ -0,0 +1,346 @@ +#src format array + num_input_audio_formats 14 + + Object.Base.input_audio_format [ + # 8khz input + { + in_rate 8000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 11.025 khz input + { + in_rate 11025 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 12khz input + { + in_rate 12000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 16khz input + { + in_rate 16000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 22.05khz input + { + in_rate 22050 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 24khz input + { + in_rate 24000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 32khz input + { + in_rate 32000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 44.1khz input + { + in_rate 44100 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 48khz input + { + in_rate 48000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 64khz input + { + in_rate 64000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 88.2khz input + { + in_rate 88200 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 96khz input + { + in_rate 96000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 176.4khz input + { + in_rate 176400 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 192khz input + { + in_rate 192000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + + num_output_audio_formats 42 + + Object.Base.output_audio_format [ + # 8khz output + { + out_rate 8000 + out_bit_depth 16 + out_valid_bit_depth 16 + } + # 11.025 khz output + { + out_rate 11025 + out_bit_depth 16 + out_valid_bit_depth 16 + } + # 12khz output + { + out_rate 12000 + out_bit_depth 16 + out_valid_bit_depth 16 + } + # 16khz output + { + out_rate 16000 + out_bit_depth 16 + out_valid_bit_depth 16 + } + # 22.05khz output + { + out_rate 22050 + out_bit_depth 16 + out_valid_bit_depth 16 + } + # 24khz output + { + out_rate 24000 + out_bit_depth 16 + out_valid_bit_depth 16 + } + # 32khz output + { + out_rate 32000 + out_bit_depth 16 + out_valid_bit_depth 16 + } + # 44.1khz output + { + out_rate 44100 + out_bit_depth 16 + out_valid_bit_depth 16 + } + # 48khz output + { + out_rate 48000 + out_bit_depth 16 + out_valid_bit_depth 16 + } + # 64khz output + { + out_rate 64000 + out_bit_depth 16 + out_valid_bit_depth 16 + } + # 88.2khz output + { + out_rate 88200 + out_bit_depth 16 + out_valid_bit_depth 16 + } + # 96khz output + { + out_rate 96000 + out_bit_depth 16 + out_valid_bit_depth 16 + } + # 176.4khz output + { + out_rate 176400 + out_bit_depth 16 + out_valid_bit_depth 16 + } + # 192khz output + { + out_rate 192000 + out_bit_depth 16 + out_valid_bit_depth 16 + } + # 8khz output + { + out_rate 8000 + out_bit_depth 32 + out_valid_bit_depth 24 + } + # 11.025 khz output + { + out_rate 11025 + out_bit_depth 32 + out_valid_bit_depth 24 + } + # 12khz output + { + out_rate 12000 + out_bit_depth 32 + out_valid_bit_depth 24 + } + # 16khz output + { + out_rate 16000 + out_bit_depth 32 + out_valid_bit_depth 24 + } + # 22.05khz output + { + out_rate 22050 + out_bit_depth 32 + out_valid_bit_depth 24 + } + # 24khz output + { + out_rate 24000 + out_bit_depth 32 + out_valid_bit_depth 24 + } + # 32khz output + { + out_rate 32000 + out_bit_depth 32 + out_valid_bit_depth 24 + } + # 44.1khz output + { + out_rate 44100 + out_bit_depth 32 + out_valid_bit_depth 24 + } + # 48khz output + { + out_rate 48000 + out_bit_depth 32 + out_valid_bit_depth 24 + } + # 64khz output + { + out_rate 64000 + out_bit_depth 32 + out_valid_bit_depth 24 + } + # 88.2khz output + { + out_rate 88200 + out_bit_depth 32 + out_valid_bit_depth 24 + } + # 96khz output + { + out_rate 96000 + out_bit_depth 32 + out_valid_bit_depth 24 + } + # 176.4khz output + { + out_rate 176400 + out_bit_depth 32 + out_valid_bit_depth 24 + } + # 192khz output + { + out_rate 192000 + out_bit_depth 32 + out_valid_bit_depth 24 + } + # 8khz output + { + out_rate 8000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 11.025 khz output + { + out_rate 11025 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 12khz output + { + out_rate 12000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 16khz output + { + out_rate 16000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 22.05khz output + { + out_rate 22050 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 24khz output + { + out_rate 24000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 32khz output + { + out_rate 32000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 44.1khz output + { + out_rate 44100 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 48khz output + { + out_rate 48000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 64khz output + { + out_rate 64000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 88.2khz output + { + out_rate 88200 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 96khz output + { + out_rate 96000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 176.4khz output + { + out_rate 176400 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 192khz output + { + out_rate 192000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] diff --git a/tools/topology/topology2/include/components/asrc_format_sxx_to_s32_convert.conf b/tools/topology/topology2/include/components/asrc_format_sxx_to_s32_convert.conf new file mode 100644 index 000000000000..0518fb2d2a6f --- /dev/null +++ b/tools/topology/topology2/include/components/asrc_format_sxx_to_s32_convert.conf @@ -0,0 +1,346 @@ +#src format array + num_input_audio_formats 42 + + Object.Base.input_audio_format [ + # 8khz input + { + in_rate 8000 + in_bit_depth 16 + in_valid_bit_depth 16 + } + # 11.025 khz input + { + in_rate 11025 + in_bit_depth 16 + in_valid_bit_depth 16 + } + # 12khz input + { + in_rate 12000 + in_bit_depth 16 + in_valid_bit_depth 16 + } + # 16khz input + { + in_rate 16000 + in_bit_depth 16 + in_valid_bit_depth 16 + } + # 22.05khz input + { + in_rate 22050 + in_bit_depth 16 + in_valid_bit_depth 16 + } + # 24khz input + { + in_rate 24000 + in_bit_depth 16 + in_valid_bit_depth 16 + } + # 32khz input + { + in_rate 32000 + in_bit_depth 16 + in_valid_bit_depth 16 + } + # 44.1khz input + { + in_rate 44100 + in_bit_depth 16 + in_valid_bit_depth 16 + } + # 48khz input + { + in_rate 48000 + in_bit_depth 16 + in_valid_bit_depth 16 + } + # 64khz input + { + in_rate 64000 + in_bit_depth 16 + in_valid_bit_depth 16 + } + # 88.2khz input + { + in_rate 88200 + in_bit_depth 16 + in_valid_bit_depth 16 + } + # 96khz input + { + in_rate 96000 + in_bit_depth 16 + in_valid_bit_depth 16 + } + # 176.4khz input + { + in_rate 176400 + in_bit_depth 16 + in_valid_bit_depth 16 + } + # 192khz input + { + in_rate 192000 + in_bit_depth 16 + in_valid_bit_depth 16 + } + # 8khz input + { + in_rate 8000 + in_bit_depth 32 + in_valid_bit_depth 24 + } + # 11.025 khz input + { + in_rate 11025 + in_bit_depth 32 + in_valid_bit_depth 24 + } + # 12khz input + { + in_rate 12000 + in_bit_depth 32 + in_valid_bit_depth 24 + } + # 16khz input + { + in_rate 16000 + in_bit_depth 32 + in_valid_bit_depth 24 + } + # 22.05khz input + { + in_rate 22050 + in_bit_depth 32 + in_valid_bit_depth 24 + } + # 24khz input + { + in_rate 24000 + in_bit_depth 32 + in_valid_bit_depth 24 + } + # 32khz input + { + in_rate 32000 + in_bit_depth 32 + in_valid_bit_depth 24 + } + # 44.1khz input + { + in_rate 44100 + in_bit_depth 32 + in_valid_bit_depth 24 + } + # 48khz input + { + in_rate 48000 + in_bit_depth 32 + in_valid_bit_depth 24 + } + # 64khz input + { + in_rate 64000 + in_bit_depth 32 + in_valid_bit_depth 24 + } + # 88.2khz input + { + in_rate 88200 + in_bit_depth 32 + in_valid_bit_depth 24 + } + # 96khz input + { + in_rate 96000 + in_bit_depth 32 + in_valid_bit_depth 24 + } + # 176.4khz input + { + in_rate 176400 + in_bit_depth 32 + in_valid_bit_depth 24 + } + # 192khz input + { + in_rate 192000 + in_bit_depth 32 + in_valid_bit_depth 24 + } + # 8khz input + { + in_rate 8000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 11.025 khz input + { + in_rate 11025 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 12khz input + { + in_rate 12000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 16khz input + { + in_rate 16000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 22.05khz input + { + in_rate 22050 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 24khz input + { + in_rate 24000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 32khz input + { + in_rate 32000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 44.1khz input + { + in_rate 44100 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 48khz input + { + in_rate 48000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 64khz input + { + in_rate 64000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 88.2khz input + { + in_rate 88200 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 96khz input + { + in_rate 96000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 176.4khz input + { + in_rate 176400 + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 192khz input + { + in_rate 192000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + + num_output_audio_formats 14 + + Object.Base.output_audio_format [ + # 8khz output + { + out_rate 8000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 11.025 khz output + { + out_rate 11025 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 12khz output + { + out_rate 12000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 16khz output + { + out_rate 16000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 22.05khz output + { + out_rate 22050 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 24khz output + { + out_rate 24000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 32khz output + { + out_rate 32000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 44.1khz output + { + out_rate 44100 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 48khz output + { + out_rate 48000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 64khz output + { + out_rate 64000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 88.2khz output + { + out_rate 88200 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 96khz output + { + out_rate 96000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 176.4khz output + { + out_rate 176400 + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 192khz output + { + out_rate 192000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] diff --git a/tools/topology/topology2/include/components/src_format_s32_convert_from_48k.conf b/tools/topology/topology2/include/components/src_format_s32_convert_from_48k.conf index 2185581258dc..18560807348e 100644 --- a/tools/topology/topology2/include/components/src_format_s32_convert_from_48k.conf +++ b/tools/topology/topology2/include/components/src_format_s32_convert_from_48k.conf @@ -13,6 +13,7 @@ out_rate 11025 out_bit_depth 32 out_valid_bit_depth 32 + # keep the output buffer size as interger and big enough to store data obs "$[($out_channels * (($[($out_rate + 999)] / 1000) + 4)) * ($out_bit_depth / 8)]" } # 12khz output diff --git a/tools/topology/topology2/include/pipelines/cavs/asrc-capture.conf b/tools/topology/topology2/include/pipelines/cavs/asrc-capture.conf new file mode 100644 index 000000000000..a19b1bc21372 --- /dev/null +++ b/tools/topology/topology2/include/pipelines/cavs/asrc-capture.conf @@ -0,0 +1,72 @@ +# +# CAVS ASRC capture pipeline +# +# A simple asrc pipeline. All attributes defined herein are namespaced +# by alsatplg to "Object.Pipeline.asrc-capture.N.attribute_name". +# +# Usage: asrc-capture pipeline object can be instantiated as: +# +# Object.Pipeline.asrc-capture."N" { +# format "s16le" +# period 1000 +# time_domain "timer" +# channels 2 +# rate 48000 +# } +# +# Where N is the unique pipeline ID within the same alsaconf node. +# + + + + + + +Class.Pipeline."asrc-capture" { + + DefineAttribute."index" {} + + + + attributes { + !constructor [ + "index" + ] + + !immutable [ + "direction" + ] + + unique "instance" + } + + Object.Widget { + host-copier."1" { + type "aif_out" + num_input_pins 1 + + node_type $HDA_HOST_INPUT_CLASS + } + + asrc."1" { + asynchronous_mode 1 + operation_mode 1 + + } + + pipeline."1" { + priority 0 + lp_mode 0 + } + } + + direction "capture" + dynamic_pipeline 1 + time_domain "timer" + channels 2 + channels_min 2 + channels_max 4 + rate 48000 + rate_min 48000 + rate_max 48000 +} diff --git a/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-asrc-playback.conf b/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-asrc-playback.conf new file mode 100644 index 000000000000..55279d9dcfcd --- /dev/null +++ b/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-asrc-playback.conf @@ -0,0 +1,92 @@ +# +# FE playback pipeline: host-copier-gain-asrc-playback +# +# All attributes defined herein are namespaced +# by alsatplg to "Object.Pipeline.host-copier-gain-asrc-playback.N.attribute_name" +# +# Usage: host-copier-gain-asrc-playback pipeline object can be instantiated as: +# +# Object.Pipeline.host-copier-gain-asrc-playback."N" { +# period 1000 +# time_domain "timer" +# channels 2 +# rate 48000 +# } +# +# Where N is the unique pipeline ID within the same alsaconf node. +# + + + + +# +# + + +Class.Pipeline."host-copier-gain-asrc-playback" { + + DefineAttribute."index" {} + + + + attributes { + !constructor [ + "index" + ] + + !immutable [ + "direction" + ] + + # + # host-copier-gain-asrc-playback objects instantiated within the same alsaconf node must have + # unique pipeline_id attribute + # + unique "instance" + } + + Object.Widget { + host-copier."1" { + type "aif_in" + node_type $HDA_HOST_OUTPUT_CLASS + num_output_pins 1 + + + } + + gain."1" { + num_input_audio_formats 2 + 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 + } + } + + asrc."1" { + asynchronous_mode 1 + operation_mode 0 + + } + + pipeline."1" { + priority 0 + lp_mode 0 + } + } + + direction "playback" + dynamic_pipeline 1 + time_domain "timer" + channels 2 + channels_min 2 + channels_max 2 + rate 48000 + rate_min 48000 + rate_max 48000 +}