diff --git a/tools/topology/topology2/cavs-sdw.conf b/tools/topology/topology2/cavs-sdw.conf index 5070efe3c09a..51cf6b160c10 100644 --- a/tools/topology/topology2/cavs-sdw.conf +++ b/tools/topology/topology2/cavs-sdw.conf @@ -12,6 +12,7 @@ + @@ -70,6 +71,7 @@ + Define { @@ -241,6 +243,7 @@ IncludeByKey.SDW_JACK { "dax" "platform/intel/sdw-jack-dax.conf" "dts" "platform/intel/sdw-jack-dts.conf" "generic" "platform/intel/sdw-jack-generic.conf" + "resonance" "platform/intel/sdw-jack-resonance.conf" } } "false" { diff --git a/tools/topology/topology2/development/cavs-nocodec-resonance.conf b/tools/topology/topology2/development/cavs-nocodec-resonance.conf new file mode 100644 index 000000000000..93202f5272a8 --- /dev/null +++ b/tools/topology/topology2/development/cavs-nocodec-resonance.conf @@ -0,0 +1,200 @@ +# +# cAVS nocodec topology: Google Resonance Audio spatializer playback test +# +# Pipeline: +# PCM0 playback (2ch or 5.1 48kHz) -> resonance-audio -> SSP0 TX (2ch) +# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Define { + MCLK 24576000 + PLATFORM "none" + SSP0_PCM_ID 0 + SSP0_PCM_NAME "Port0" +} + +IncludeByKey.PLATFORM { + "tgl" "platform/intel/tgl.conf" + "adl" "platform/intel/tgl.conf" + "mtl" "platform/intel/mtl.conf" + "lnl" "platform/intel/lnl.conf" + "ptl" "platform/intel/ptl.conf" + "wcl" "platform/intel/ptl.conf" +} + +Object.Dai.SSP [ + { + id 0 + dai_index 0 + direction "playback" + name NoCodec-0 + default_hw_conf_id 0 + sample_bits 32 + io_clk $MCLK + + Object.Base.hw_config.1 { + name "SSP0" + id 0 + bclk_freq 3072000 + fsync_freq 48000 + tdm_slot_width 32 + Object.Base.link_config.1 { + clock_source 1 + } + } + } +] + +Object.Pipeline.host-gateway-playback [ + { + index 1 + Object.Widget.host-copier.1 { + stream_name 'Spatial Playback' + pcm_id 0 + num_input_audio_formats 2 + Object.Base.input_audio_format [ + { + in_rate 48000 + in_bit_depth 16 + in_valid_bit_depth 16 + in_channels 2 + in_ch_cfg $CHANNEL_CONFIG_STEREO + in_ch_map $CHANNEL_MAP_STEREO + } + { + in_rate 48000 + in_bit_depth 16 + in_valid_bit_depth 16 + in_channels 6 + in_ch_cfg $CHANNEL_CONFIG_5_POINT_1 + in_ch_map $CHANNEL_MAP_5_POINT_1 + } + ] + num_output_audio_formats 2 + Object.Base.output_audio_format [ + { + out_rate 48000 + out_bit_depth 16 + out_valid_bit_depth 16 + out_channels 2 + out_ch_cfg $CHANNEL_CONFIG_STEREO + out_ch_map $CHANNEL_MAP_STEREO + } + { + out_rate 48000 + out_bit_depth 16 + out_valid_bit_depth 16 + out_channels 6 + out_ch_cfg $CHANNEL_CONFIG_5_POINT_1 + out_ch_map $CHANNEL_MAP_5_POINT_1 + } + ] + } + } +] + +Object.Pipeline.resonance-playback [ + { + index 2 + } +] + +Object.Pipeline.io-gateway [ + { + index 3 + direction playback + Object.Widget.dai-copier.1 { + dai_index 0 + dai_type "SSP" + copier_type "SSP" + stream_name "NoCodec-0" + node_type $I2S_LINK_OUTPUT_CLASS + num_input_pins 1 + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_rate 48000 + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 2 + in_ch_cfg $CHANNEL_CONFIG_STEREO + in_ch_map $CHANNEL_MAP_STEREO + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_rate 48000 + out_bit_depth 32 + out_valid_bit_depth 32 + out_channels 2 + out_ch_cfg $CHANNEL_CONFIG_STEREO + out_ch_map $CHANNEL_MAP_STEREO + } + ] + } + } +] + +Object.PCM.pcm [ + { + name "$SSP0_PCM_NAME" + id $SSP0_PCM_ID + direction "playback" + Object.Base.fe_dai.1 { + name "$SSP0_PCM_NAME" + } + + Object.PCM.pcm_caps.1 { + direction "playback" + name "Spatial Playback" + formats 'S16_LE' + rates '48000' + channels_min 2 + channels_max 6 + } + } +] + +Object.Base.route [ + { + source "host-copier.0.playback" + sink "module-copier.2.1" + } + { + source "module-copier.2.2" + sink "dai-copier.SSP.NoCodec-0.playback" + } +] diff --git a/tools/topology/topology2/development/tplg-targets.cmake b/tools/topology/topology2/development/tplg-targets.cmake index 6baaa7906cd1..d076b517e262 100644 --- a/tools/topology/topology2/development/tplg-targets.cmake +++ b/tools/topology/topology2/development/tplg-targets.cmake @@ -362,6 +362,12 @@ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-dmic-ssp-lbm-webrtc-aec.bin" "development/cavs-nocodec-webrtc-ns2\;sof-tgl-nocodec-webrtc-ns2\;PLATFORM=tgl,\ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-tgl-nocodec-webrtc-ns2.bin" +# Google Resonance Audio spatializer (2ch/5.1 -> 2ch binaural) on PTL/WCL nocodec SSP +"development/cavs-nocodec-resonance\;sof-ptl-nocodec-resonance\;PLATFORM=ptl,\ +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-nocodec-resonance.bin" +"development/cavs-nocodec-resonance\;sof-wcl-nocodec-resonance\;PLATFORM=wcl,\ +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-wcl-nocodec-resonance.bin" + # Topology to test the USB audio offload on an HDA machine, load it with # snd_sof.tplg_filename=sof-hda-generic-uaol.tplg "development/sof-hda-generic-uaol\;sof-hda-generic-uaol\;HDA_CONFIG=mix,HDA_MIC_ENHANCED_CAPTURE=true,\ @@ -726,9 +732,21 @@ BT_PB_HOST_PIPELINE_ID=200,BT_PB_DAI_PIPELINE_ID=201,BT_CP_HOST_PIPELINE_ID=202, PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-ssp2-bt-id10-sb4.bin,\ BT_TRANSP_CODEC=sb4" +# RT722 with PCH-DMIC and Google Resonance Audio spatializer on Jack Out (hw:0,0) +"cavs-sdw\;sof-ptl-rt722-4ch-resonance\;PLATFORM=ptl,SDW_DMIC=1,NUM_SDW_AMP_LINKS=1,NUM_DMICS=4,\ +PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC0_ID=5,DMIC1_ID=6,HDMI1_ID=7,HDMI2_ID=8,HDMI3_ID=9,\ +SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\ +SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\ +SDW_JACK_PIPELINE_SRC=resonance,DEEPBUFFER_FW_DMA_MS=10,\ +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-rt722-4ch-resonance.bin,DMIC0_ENHANCED_CAPTURE=true,\ +EFX_DMIC0_TDFB_PARAMS=line4_pass,EFX_DMIC0_DRC_PARAMS=dmic_default,\ +BT_PCM_ID=20,BT_ID=10,BT_PCM_NAME=Bluetooth,ADD_BT=true,BT_DEEP_BUFFER=true,BT_SSP_DUPLEX=true,\ +BT_PB_HOST_PIPELINE_ID=200,BT_PB_DAI_PIPELINE_ID=201,BT_CP_HOST_PIPELINE_ID=202,BT_CP_DAI_PIPELINE_ID=203" + ) list(APPEND SYMLINKS +"sof-wcl-rt722-4ch-resonance\;sof-ptl-rt722-4ch-resonance" "sof-wcl-rt722-4ch-bt\;sof-ptl-rt722-4ch-bt" "sof-wcl-rt722-4ch-bt-lc3\;sof-ptl-rt722-4ch-bt-lc3" "sof-wcl-rt722-4ch-bt-msbc\;sof-ptl-rt722-4ch-bt-msbc" diff --git a/tools/topology/topology2/include/components/resonance-audio.conf b/tools/topology/topology2/include/components/resonance-audio.conf new file mode 100644 index 000000000000..32ac7de075c7 --- /dev/null +++ b/tools/topology/topology2/include/components/resonance-audio.conf @@ -0,0 +1,123 @@ +# +# Common widget resonance-audio +# +# Google Resonance Audio spatializer (1st-order HOA + virtual surround). +# Accepts Mono, Stereo, 4-ch FOA (AmbiX), 5.1, or 7.1 input and renders +# 2-channel binaural stereo output. +# +# UUID: 12f51e05-61d9-4a96-939eca72c615d89b + + + + +Class.Widget."resonance-audio" { + DefineAttribute."index" {} + DefineAttribute."instance" {} + + + + DefineAttribute."cpc" { + token_ref "comp.word" + } + + DefineAttribute."stack_bytes_requirement" { + token_ref "comp.word" + } + + DefineAttribute."heap_bytes_requirement" { + token_ref "comp.word" + } + + attributes { + !constructor [ + "index" + "instance" + ] + + !mandatory [ + "no_pm" + "uuid" + ] + + !immutable [ + "uuid" + "type" + "scheduler_domain" + ] + + !deprecated [ + "preload_count" + ] + + unique "instance" + } + + Object.Control { + mixer."1" { + Object.Base.channel.1 { + name "fc" + shift 0 + } + Object.Base.ops.1 { + name "ctl" + info "volsw" + get 259 + put 259 + } + max 1 + } + mixer."2" { + Object.Base.channel.1 { + name "fc" + shift 0 + } + Object.Base.ops.1 { + name "ctl" + info "volsw" + get 259 + put 259 + } + max 1 + } + mixer."3" { + Object.Base.channel.1 { + name "fc" + shift 0 + } + Object.Base.ops.1 { + name "ctl" + info "volsw" + get 259 + put 259 + } + max 1 + } + bytes."1" { + !access [ + tlv_read + tlv_write + tlv_callback + ] + Object.Base.extops.1 { + name "extctl" + get 258 + put 258 + } + max 256 + } + } + + # Format lists (Object.Base.input_audio_format / output_audio_format) are declared + # per-pipeline or per-instance because alsatplg appends Class.Widget arrays. + + # UUID: 12f51e05-61d9-4a96-939eca72c615d89b + uuid "05:1e:f5:12:d9:61:96:4a:93:9e:ca:72:c6:15:d8:9b" + type "effect" + no_pm "true" + cpc 4000 + scheduler_domain "DP" + stack_bytes_requirement 16384 + heap_bytes_requirement 131072 + num_input_pins 1 + num_output_pins 1 +} diff --git a/tools/topology/topology2/include/pipelines/cavs/host-copier-resonance-gain-mixin-playback.conf b/tools/topology/topology2/include/pipelines/cavs/host-copier-resonance-gain-mixin-playback.conf new file mode 100644 index 000000000000..651253d85734 --- /dev/null +++ b/tools/topology/topology2/include/pipelines/cavs/host-copier-resonance-gain-mixin-playback.conf @@ -0,0 +1,121 @@ +# +# FE playback pipeline: host-copier-resonance-gain-mixin-playback +# +# host-copier (1/2/4/6ch) -> resonance-audio (binaural 2ch) -> gain (2ch) -> mixin (2ch) +# + + + + + + + + + +Class.Pipeline."host-copier-resonance-gain-mixin-playback" { + + + + attributes { + !constructor [ + "index" + ] + + !immutable [ + "direction" + ] + + unique "instance" + } + + Object.Widget { + host-copier."1" { + type "aif_in" + node_type $HDA_HOST_OUTPUT_CLASS + num_input_audio_formats 3 + num_output_audio_formats 1 + num_output_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 + } + { + in_bit_depth 32 + in_valid_bit_depth 24 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + + resonance-audio."1" { + Object.Control { + mixer."1" { + name "Resonance Enable Switch $index" + } + mixer."2" { + name "Resonance Speaker Mode Switch $index" + } + mixer."3" { + name "Resonance Room Reverb Switch $index" + } + bytes."1" { + name "Resonance Spatial Pose $index" + } + } + } + + gain."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 + } + ] + } + + mixin."1" {} + + pipeline."1" { + priority 0 + lp_mode 0 + } + } + + Object.Base.route [ + { + source host-copier.$index.playback + sink resonance-audio.$index.1 + } + { + source resonance-audio.$index.1 + sink gain.$index.1 + } + { + source gain.$index.1 + sink mixin.$index.1 + } + ] + + direction "playback" + dynamic_pipeline 1 + time_domain "timer" +} diff --git a/tools/topology/topology2/include/pipelines/cavs/resonance-playback.conf b/tools/topology/topology2/include/pipelines/cavs/resonance-playback.conf new file mode 100644 index 000000000000..b568df6a1825 --- /dev/null +++ b/tools/topology/topology2/include/pipelines/cavs/resonance-playback.conf @@ -0,0 +1,176 @@ +# +# cAVS resonance-audio spatializer playback pipeline +# +# module-copier (in) -> resonance-audio (spatialize to 2ch binaural) -> module-copier (out) +# +# Usage: +# Object.Pipeline.resonance-playback."N" { +# period 1000 +# time_domain "timer" +# } +# + + + + + + + +Class.Pipeline."resonance-playback" { + + + + attributes { + !constructor [ + "index" + ] + + !immutable [ + "direction" + ] + + unique "instance" + } + + Object.Widget { + pipeline."1" { + priority 0 + lp_mode 0 + } + + module-copier."1" { + period_sink_count 1 + period_source_count 1 + num_input_audio_formats 2 + num_output_audio_formats 2 + Object.Base.input_audio_format [ + { + in_rate 48000 + in_bit_depth 16 + in_valid_bit_depth 16 + in_channels 2 + in_ch_cfg $CHANNEL_CONFIG_STEREO + in_ch_map $CHANNEL_MAP_STEREO + } + { + in_rate 48000 + in_bit_depth 16 + in_valid_bit_depth 16 + in_channels 6 + in_ch_cfg $CHANNEL_CONFIG_5_POINT_1 + in_ch_map $CHANNEL_MAP_5_POINT_1 + } + ] + Object.Base.output_audio_format [ + { + out_rate 48000 + out_bit_depth 16 + out_valid_bit_depth 16 + out_channels 2 + out_ch_cfg $CHANNEL_CONFIG_STEREO + out_ch_map $CHANNEL_MAP_STEREO + } + { + out_rate 48000 + out_bit_depth 16 + out_valid_bit_depth 16 + out_channels 6 + out_ch_cfg $CHANNEL_CONFIG_5_POINT_1 + out_ch_map $CHANNEL_MAP_5_POINT_1 + } + ] + } + + resonance-audio."1" { + num_input_audio_formats 2 + Object.Base.input_audio_format [ + { + in_rate 48000 + in_bit_depth 16 + in_valid_bit_depth 16 + in_channels 2 + in_ch_cfg $CHANNEL_CONFIG_STEREO + in_ch_map $CHANNEL_MAP_STEREO + ibs 384 + } + { + in_rate 48000 + in_bit_depth 16 + in_valid_bit_depth 16 + in_channels 6 + in_ch_cfg $CHANNEL_CONFIG_5_POINT_1 + in_ch_map $CHANNEL_MAP_5_POINT_1 + ibs 1152 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_rate 48000 + out_bit_depth 16 + out_valid_bit_depth 16 + out_channels 2 + out_ch_cfg $CHANNEL_CONFIG_STEREO + out_ch_map $CHANNEL_MAP_STEREO + obs 384 + } + ] + Object.Control { + mixer."1" { + name "Resonance Enable Switch $index" + } + mixer."2" { + name "Resonance Speaker Mode Switch $index" + } + mixer."3" { + name "Resonance Room Reverb Switch $index" + } + bytes."1" { + name "Resonance Spatial Pose $index" + } + } + } + + module-copier."2" { + period_sink_count 1 + period_source_count 1 + num_input_audio_formats 1 + num_output_audio_formats 1 + Object.Base.input_audio_format [ + { + in_rate 48000 + in_bit_depth 16 + in_valid_bit_depth 16 + in_channels 2 + in_ch_cfg $CHANNEL_CONFIG_STEREO + in_ch_map $CHANNEL_MAP_STEREO + } + ] + Object.Base.output_audio_format [ + { + out_rate 48000 + out_bit_depth 32 + out_valid_bit_depth 32 + out_channels 2 + out_ch_cfg $CHANNEL_CONFIG_STEREO + out_ch_map $CHANNEL_MAP_STEREO + } + ] + } + } + + Object.Base { + route.1 { + source module-copier.$index.1 + sink resonance-audio.$index.1 + } + route.2 { + source resonance-audio.$index.1 + sink module-copier.$index.2 + } + } + + direction "playback" + dynamic_pipeline 1 + time_domain "timer" +} diff --git a/tools/topology/topology2/platform/intel/sdw-jack-resonance.conf b/tools/topology/topology2/platform/intel/sdw-jack-resonance.conf new file mode 100644 index 000000000000..566ffb16e41b --- /dev/null +++ b/tools/topology/topology2/platform/intel/sdw-jack-resonance.conf @@ -0,0 +1,1051 @@ +# include deep buffer config if buffer size is in 1 - 1000 ms. +IncludeByKey.PASSTHROUGH { +"false" { + IncludeByKey.DEEPBUFFER_FW_DMA_MS { + "([1-9]|[1-9][0-9]|[1-9][0-9][0-9]|1000)" "platform/intel/deep-buffer.conf" + } +} +} + +Define { + JACK_PLAYBACK_PCM_NAME "Jack Out" + JACK_CAPTURE_PCM_NAME "Jack In" + JACK_RATE 48000 +} + +# +# List of all DAIs +# +Object.Dai.ALH [ + { + dai_index 0 + id $SDW_JACK_OUT_BE_ID + direction "playback" + name $SDW_JACK_OUT_STREAM + default_hw_conf_id 0 + rate $JACK_RATE + channels 2 + + Object.Base.hw_config.1 { + id 0 + name "ALH2" + } + } + { + dai_index 10 + id $SDW_JACK_IN_BE_ID + direction "capture" + name $SDW_JACK_IN_STREAM + default_hw_conf_id 0 + rate $JACK_RATE + channels $SDW_JACK_CAPTURE_CH + + + Object.Base.hw_config.1 { + id 0 + name "ALH3" + } + } +] + +# +# Pipeline definitions +# +IncludeByKey.PASSTHROUGH { +"false" { + Object.Pipeline { + host-copier-resonance-gain-mixin-playback [ + { + index 0 + + Object.Widget.host-copier.1 { + stream_name "volume playback 0" + pcm_id 0 + IncludeByKey.PCM_FORMAT_ALL { + "true" { + num_input_audio_formats 15 + Object.Base.input_audio_format [ + { + in_rate $JACK_RATE + in_bit_depth 16 + in_valid_bit_depth 16 + in_channels 2 + in_ch_cfg $CHANNEL_CONFIG_STEREO + in_ch_map $CHANNEL_MAP_STEREO + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 2 + in_ch_cfg $CHANNEL_CONFIG_STEREO + in_ch_map $CHANNEL_MAP_STEREO + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 24 + in_channels 2 + in_ch_cfg $CHANNEL_CONFIG_STEREO + in_ch_map $CHANNEL_MAP_STEREO + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + in_sample_type $SAMPLE_TYPE_FLOAT + in_channels 2 + in_ch_cfg $CHANNEL_CONFIG_STEREO + in_ch_map $CHANNEL_MAP_STEREO + } + { + in_rate $JACK_RATE + in_bit_depth 8 + in_valid_bit_depth 8 + in_sample_type $SAMPLE_TYPE_UNSIGNED_INTEGER + in_channels 2 + in_ch_cfg $CHANNEL_CONFIG_STEREO + in_ch_map $CHANNEL_MAP_STEREO + } + { + in_rate $JACK_RATE + in_bit_depth 16 + in_valid_bit_depth 16 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_QUATRO + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_QUATRO + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 24 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_QUATRO + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + in_sample_type $SAMPLE_TYPE_FLOAT + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_QUATRO + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + in_rate $JACK_RATE + in_bit_depth 8 + in_valid_bit_depth 8 + in_sample_type $SAMPLE_TYPE_UNSIGNED_INTEGER + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_QUATRO + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + in_rate $JACK_RATE + in_bit_depth 16 + in_valid_bit_depth 16 + in_channels 6 + in_ch_cfg $CHANNEL_CONFIG_5_POINT_1 + in_ch_map $CHANNEL_MAP_5_POINT_1 + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 6 + in_ch_cfg $CHANNEL_CONFIG_5_POINT_1 + in_ch_map $CHANNEL_MAP_5_POINT_1 + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 24 + in_channels 6 + in_ch_cfg $CHANNEL_CONFIG_5_POINT_1 + in_ch_map $CHANNEL_MAP_5_POINT_1 + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + in_sample_type $SAMPLE_TYPE_FLOAT + in_channels 6 + in_ch_cfg $CHANNEL_CONFIG_5_POINT_1 + in_ch_map $CHANNEL_MAP_5_POINT_1 + } + { + in_rate $JACK_RATE + in_bit_depth 8 + in_valid_bit_depth 8 + in_sample_type $SAMPLE_TYPE_UNSIGNED_INTEGER + in_channels 6 + in_ch_cfg $CHANNEL_CONFIG_5_POINT_1 + in_ch_map $CHANNEL_MAP_5_POINT_1 + } + ] + num_output_audio_formats 3 + Object.Base.output_audio_format [ + { + out_rate $JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + out_channels 2 + out_ch_cfg $CHANNEL_CONFIG_STEREO + out_ch_map $CHANNEL_MAP_STEREO + } + { + out_rate $JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_QUATRO + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + out_rate $JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + out_channels 6 + out_ch_cfg $CHANNEL_CONFIG_5_POINT_1 + out_ch_map $CHANNEL_MAP_5_POINT_1 + } + ] + } + "false" { + num_input_audio_formats 9 + Object.Base.input_audio_format [ + { + in_rate $JACK_RATE + in_bit_depth 16 + in_valid_bit_depth 16 + in_channels 2 + in_ch_cfg $CHANNEL_CONFIG_STEREO + in_ch_map $CHANNEL_MAP_STEREO + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 2 + in_ch_cfg $CHANNEL_CONFIG_STEREO + in_ch_map $CHANNEL_MAP_STEREO + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 24 + in_channels 2 + in_ch_cfg $CHANNEL_CONFIG_STEREO + in_ch_map $CHANNEL_MAP_STEREO + } + { + in_rate $JACK_RATE + in_bit_depth 16 + in_valid_bit_depth 16 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_QUATRO + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_QUATRO + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 24 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_QUATRO + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + in_rate $JACK_RATE + in_bit_depth 16 + in_valid_bit_depth 16 + in_channels 6 + in_ch_cfg $CHANNEL_CONFIG_5_POINT_1 + in_ch_map $CHANNEL_MAP_5_POINT_1 + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 6 + in_ch_cfg $CHANNEL_CONFIG_5_POINT_1 + in_ch_map $CHANNEL_MAP_5_POINT_1 + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 24 + in_channels 6 + in_ch_cfg $CHANNEL_CONFIG_5_POINT_1 + in_ch_map $CHANNEL_MAP_5_POINT_1 + } + ] + num_output_audio_formats 3 + Object.Base.output_audio_format [ + { + out_rate $JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + out_channels 2 + out_ch_cfg $CHANNEL_CONFIG_STEREO + out_ch_map $CHANNEL_MAP_STEREO + } + { + out_rate $JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_QUATRO + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + out_rate $JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + out_channels 6 + out_ch_cfg $CHANNEL_CONFIG_5_POINT_1 + out_ch_map $CHANNEL_MAP_5_POINT_1 + } + ] + } + } + } + Object.Widget.resonance-audio.1 { + heap_bytes_requirement 393216 + num_input_pins 2 + Object.Base.input_pin_binding.1 { + input_pin_binding_name "host-copier.0.playback" + } + Object.Base.input_pin_binding.2 { + input_pin_binding_name "host-copier.55.playback" + } + num_input_audio_formats 5 + Object.Base.input_audio_format [ + { + input_pin_index 0 + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 2 + in_ch_cfg $CHANNEL_CONFIG_STEREO + in_ch_map $CHANNEL_MAP_STEREO + } + { + input_pin_index 0 + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_QUATRO + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + input_pin_index 0 + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 6 + in_ch_cfg $CHANNEL_CONFIG_5_POINT_1 + in_ch_map $CHANNEL_MAP_5_POINT_1 + } + { + input_pin_index 0 + in_rate $JACK_RATE + in_bit_depth 16 + in_valid_bit_depth 16 + in_channels 2 + in_ch_cfg $CHANNEL_CONFIG_STEREO + in_ch_map $CHANNEL_MAP_STEREO + } + { + input_pin_index 1 + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 2 + in_ch_cfg $CHANNEL_CONFIG_STEREO + in_ch_map $CHANNEL_MAP_STEREO + ibs 384 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_rate $JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + out_channels 2 + out_ch_cfg $CHANNEL_CONFIG_STEREO + out_ch_map $CHANNEL_MAP_STEREO + } + ] + } + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Pre Mixer $JACK_PLAYBACK_PCM_NAME Playback Volume' + } + Object.Base.input_audio_format [ + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_rate $JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + Object.Widget.mixin.1 { + Object.Base.input_audio_format [ + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_rate $JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + } + ] + + mixout-gain-alh-dai-copier-playback [ + { + index 1 + + Object.Widget.mixout.1 { + Object.Base.input_audio_format [ + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_rate $JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + Object.Widget.alh-copier.1 { + stream_name $SDW_JACK_OUT_STREAM + node_type $ALH_LINK_OUTPUT_CLASS + num_input_audio_formats 3 + Object.Base.input_audio_format [ + { + in_rate $JACK_RATE + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 24 + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_rate $JACK_RATE + out_bit_depth 32 + out_valid_bit_depth $SDW_LINK_VALID_BITS + out_sample_type $SAMPLE_TYPE_MSB_INTEGER + out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256)) | ($out_sample_type * 65536)]" + } + ] + } + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Post Mixer $JACK_PLAYBACK_PCM_NAME Playback Volume' + } + Object.Base.input_audio_format [ + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_rate $JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + } + ] + + host-gateway-playback [ + { + index 55 + Object.Widget.host-copier.1 { + stream_name "Spatial Metadata" + pcm_id 55 + num_input_audio_formats 1 + num_output_audio_formats 1 + Object.Base.input_audio_format [ + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 2 + in_ch_cfg $CHANNEL_CONFIG_STEREO + in_ch_map $CHANNEL_MAP_STEREO + } + ] + Object.Base.output_audio_format [ + { + out_rate $JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + out_channels 2 + out_ch_cfg $CHANNEL_CONFIG_STEREO + out_ch_map $CHANNEL_MAP_STEREO + } + ] + } + } + ] + } +} +"true" { + Object.Pipeline.host-gateway-playback [ + { + index 0 + Object.Widget.host-copier.1 { + stream_name "volume playback 0" + pcm_id 0 + num_input_audio_formats 3 + Object.Base.input_audio_format [ + { + in_rate $JACK_RATE + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 24 + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + num_output_audio_formats 3 + Object.Base.output_audio_format [ + { + out_rate $JACK_RATE + out_bit_depth 16 + out_valid_bit_depth 16 + } + { + out_rate $JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 24 + } + { + out_rate $JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + } + ] + + Object.Widget { + alh-copier [ + { + stream_name $SDW_JACK_OUT_STREAM + node_type $ALH_LINK_OUTPUT_CLASS + index 1 + type dai_in + direction playback + num_input_pins 1 + num_input_audio_formats 3 + Object.Base.input_audio_format [ + { + in_rate $JACK_RATE + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 24 + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_rate $JACK_RATE + out_bit_depth 32 + out_valid_bit_depth $SDW_LINK_VALID_BITS + out_sample_type $SAMPLE_TYPE_MSB_INTEGER + out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]" + } + ] + } + ] + pipeline [ + { + index 1 + priority 0 + lp_mode 0 + dynamic_pipeline 1 + } + ] + } + } +} + +Object.Pipeline.host-gateway-capture [ + { + index 10 + + Object.Widget.host-copier.1 { + stream_name "Passthrough Capture 0" + pcm_id 1 + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_rate $JACK_RATE + in_channels $SDW_JACK_CAPTURE_CH + in_bit_depth 32 + in_valid_bit_depth 32 + IncludeByKey.SDW_JACK_CAPTURE_CH { + "1" { + in_ch_map $CHANNEL_MAP_MONO + in_ch_cfg $CHANNEL_CONFIG_MONO + } + } + } + ] + IncludeByKey.PCM_FORMAT_ALL { + "true" { + num_output_audio_formats 5 + Object.Base.output_audio_format [ + { + out_rate $JACK_RATE + out_channels $SDW_JACK_CAPTURE_CH + out_bit_depth 16 + out_valid_bit_depth 16 + IncludeByKey.SDW_JACK_CAPTURE_CH { + "1" { + out_ch_map $CHANNEL_MAP_MONO + out_ch_cfg $CHANNEL_CONFIG_MONO + } + } + } + { + out_rate $JACK_RATE + out_channels $SDW_JACK_CAPTURE_CH + out_bit_depth 32 + out_valid_bit_depth 24 + IncludeByKey.SDW_JACK_CAPTURE_CH { + "1" { + out_ch_map $CHANNEL_MAP_MONO + out_ch_cfg $CHANNEL_CONFIG_MONO + } + } + } + { + out_rate $JACK_RATE + out_channels $SDW_JACK_CAPTURE_CH + out_bit_depth 32 + out_valid_bit_depth 32 + IncludeByKey.SDW_JACK_CAPTURE_CH { + "1" { + out_ch_map $CHANNEL_MAP_MONO + out_ch_cfg $CHANNEL_CONFIG_MONO + } + } + } + { + out_rate $JACK_RATE + out_channels $SDW_JACK_CAPTURE_CH + out_bit_depth 32 + out_valid_bit_depth 32 + out_sample_type $SAMPLE_TYPE_FLOAT + IncludeByKey.SDW_JACK_CAPTURE_CH { + "1" { + out_ch_map $CHANNEL_MAP_MONO + out_ch_cfg $CHANNEL_CONFIG_MONO + } + } + } + { + out_rate $JACK_RATE + out_channels $SDW_JACK_CAPTURE_CH + out_bit_depth 8 + out_valid_bit_depth 8 + out_sample_type $SAMPLE_TYPE_UNSIGNED_INTEGER + IncludeByKey.SDW_JACK_CAPTURE_CH { + "1" { + out_ch_map $CHANNEL_MAP_MONO + out_ch_cfg $CHANNEL_CONFIG_MONO + } + } + } + ] + } + "false" { + num_output_audio_formats 3 + Object.Base.output_audio_format [ + { + out_rate $JACK_RATE + out_channels $SDW_JACK_CAPTURE_CH + out_bit_depth 16 + out_valid_bit_depth 16 + IncludeByKey.SDW_JACK_CAPTURE_CH { + "1" { + out_ch_map $CHANNEL_MAP_MONO + out_ch_cfg $CHANNEL_CONFIG_MONO + } + } + } + { + out_rate $JACK_RATE + out_channels $SDW_JACK_CAPTURE_CH + out_bit_depth 32 + out_valid_bit_depth 24 + IncludeByKey.SDW_JACK_CAPTURE_CH { + "1" { + out_ch_map $CHANNEL_MAP_MONO + out_ch_cfg $CHANNEL_CONFIG_MONO + } + } + } + { + out_rate $JACK_RATE + out_channels $SDW_JACK_CAPTURE_CH + out_bit_depth 32 + out_valid_bit_depth 32 + IncludeByKey.SDW_JACK_CAPTURE_CH { + "1" { + out_ch_map $CHANNEL_MAP_MONO + out_ch_cfg $CHANNEL_CONFIG_MONO + } + } + } + ] + } + } + } + } +] + +# Jack capture pipeline widgets +Object.Widget { + module-copier."12" { + index 1 + num_input_pins 1 + num_output_pins 2 + num_input_audio_formats 1 + num_output_audio_formats 1 + Object.Base.input_audio_format [ + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_rate $JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + + alh-copier [ + { + stream_name $SDW_JACK_IN_STREAM + direction "capture" + type "dai_out" + index 11 + node_type $ALH_LINK_INPUT_CLASS + num_input_audio_formats 1 + num_output_audio_formats 1 + num_output_pins 1 + + Object.Base.input_audio_format [ + { + in_rate $JACK_RATE + in_channels $SDW_JACK_CAPTURE_CH + in_bit_depth 32 + in_valid_bit_depth $SDW_LINK_VALID_BITS + in_sample_type $SAMPLE_TYPE_MSB_INTEGER + in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256))]" + IncludeByKey.SDW_JACK_CAPTURE_CH { + "1" { + in_ch_map $CHANNEL_MAP_MONO + in_ch_cfg $CHANNEL_CONFIG_MONO + } + } + } + ] + Object.Base.output_audio_format [ + { + out_rate $JACK_RATE + out_channels $SDW_JACK_CAPTURE_CH + out_bit_depth 32 + out_valid_bit_depth 32 + IncludeByKey.SDW_JACK_CAPTURE_CH { + "1" { + out_ch_map $CHANNEL_MAP_MONO + out_ch_cfg $CHANNEL_CONFIG_MONO + } + } + } + ] + } + ] + + pipeline [ + { + index 11 + priority 0 + lp_mode 0 + dynamic_pipeline 1 + + IncludeByKey.PASSTHROUGH { + "false" { + Object.Widget.eqiir [ + { + num_input_audio_formats 1 + num_output_audio_formats 1 + # index 11 is inherited from the pipeline definition + # the instance number is automatically generated as '0' + Object.Base.input_audio_format [ + { + in_rate $JACK_RATE + in_channels $SDW_JACK_CAPTURE_CH + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_rate $JACK_RATE + out_channels $SDW_JACK_CAPTURE_CH + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + + Object.Control.bytes."1" { + + name '$JACK_CAPTURE_PCM_NAME Capture IIR Eq' + } + } + ] + Object.Widget.module-copier [ + { + num_input_audio_formats 1 + num_output_audio_formats 1 + # index 11 is inherited from the pipeline definition + # the instance number is automatically generated as '0' + Object.Base.input_audio_format [ + { + in_rate $JACK_RATE + in_channels $SDW_JACK_CAPTURE_CH + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_rate $JACK_RATE + out_channels $SDW_JACK_CAPTURE_CH + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + ] + } + } + } + ] +} + +Object.PCM.pcm [ + { + name "$JACK_PLAYBACK_PCM_NAME" + id 0 + direction "playback" + Object.Base.fe_dai.1 { + name "$JACK_PLAYBACK_PCM_NAME" + } + + Object.PCM.pcm_caps.1 { + name "volume playback 0" + IncludeByKey.PCM_FORMAT_ALL { + "true" { + formats 'S16_LE,S24_LE,S32_LE,U8,FLOAT_LE' + } + "false" { + formats 'S16_LE,S24_LE,S32_LE' + } + } + IncludeByKey.JACK_RATE { + "48000" { + rates '48000' + } + "96000" { + rates '96000' + } + "192000" { + rates '192000' + } + } + channels_min 2 + channels_max 6 + } + } + { + name "$JACK_CAPTURE_PCM_NAME" + id 1 + direction "capture" + Object.Base.fe_dai.1 { + name "$JACK_CAPTURE_PCM_NAME" + } + + Object.PCM.pcm_caps.1 { + name "Passthrough Capture 0" + IncludeByKey.PCM_FORMAT_ALL { + "true" { + formats 'S16_LE,S24_LE,S32_LE,U8,FLOAT_LE' + } + "false" { + formats 'S16_LE,S24_LE,S32_LE' + } + } + IncludeByKey.JACK_RATE { + "48000" { + rates '48000' + } + "96000" { + rates '96000' + } + "192000" { + rates '192000' + } + } + channels_min $SDW_JACK_CAPTURE_CH + channels_max $SDW_JACK_CAPTURE_CH + } + } +] + +IncludeByKey.PASSTHROUGH { +"false" { + Object.PCM.pcm [ + { + name "Spatial Metadata" + id 55 + direction "playback" + compress "true" + + Object.Base.fe_dai.1 { + name "Spatial Metadata" + } + + Object.PCM.pcm_caps.1 { + name "Spatial Metadata" + formats 'S32_LE' + rates '48000' + rate_min 48000 + rate_max 48000 + channels_min 2 + channels_max 2 + } + } + ] + + Object.Base.route [ + { + source "host-copier.55.playback" + sink "resonance-audio.0.1" + } + { + source "gain.1.1" + sink "module-copier.1.12" + } + { + source "module-copier.1.12" + sink "alh-copier.$SDW_JACK_OUT_STREAM.0" + } + { + source "mixin.0.1" + sink "mixout.1.1" + } + { + source "alh-copier.$SDW_JACK_IN_STREAM.0" + sink "eqiir.11.0" + } + { + source "eqiir.11.0" + sink "module-copier.11.0" + } + { + source "module-copier.11.0" + sink "host-copier.1.capture" + } + ] + } +"true" { + Object.Base.route [ + { + source "alh-copier.$SDW_JACK_IN_STREAM.0" + sink "host-copier.1.capture" + } + { + source "host-copier.0.playback" + sink "alh-copier.$SDW_JACK_OUT_STREAM.0" + } + ] + } +}