diff --git a/tools/topology/topology2/include/pipelines/cavs/host-gateway-tdfb-drc-capture.conf b/tools/topology/topology2/include/pipelines/cavs/host-gateway-tdfb-drc-capture.conf index c0912037a424..1c9bd5174f65 100644 --- a/tools/topology/topology2/include/pipelines/cavs/host-gateway-tdfb-drc-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/host-gateway-tdfb-drc-capture.conf @@ -19,6 +19,12 @@ +Define { + DMIC_PCM_CHANNELS 2 + DMIC_CHANNEL_CFG $CHANNEL_CONFIG_STEREO + DMIC_CHANNEL_MAP $CHANNEL_MAP_STEREO +} + Class.Pipeline."host-gateway-tdfb-drc-capture" { SubTreeCopy.baseclass { @@ -57,12 +63,18 @@ Class.Pipeline."host-gateway-tdfb-drc-capture" { { in_bit_depth 32 in_valid_bit_depth 32 + in_channels $DMIC_PCM_CHANNELS + in_ch_cfg $DMIC_CHANNEL_CFG + in_ch_map $DMIC_CHANNEL_MAP } ] Object.Base.output_audio_format [ { out_bit_depth 32 out_valid_bit_depth 32 + out_channels $DMIC_PCM_CHANNELS + out_ch_cfg $DMIC_CHANNEL_CFG + out_ch_map $DMIC_CHANNEL_MAP } ] } @@ -82,12 +94,18 @@ Class.Pipeline."host-gateway-tdfb-drc-capture" { { in_bit_depth 32 in_valid_bit_depth 32 + in_channels $DMIC_PCM_CHANNELS + in_ch_cfg $DMIC_CHANNEL_CFG + in_ch_map $DMIC_CHANNEL_MAP } ] Object.Base.output_audio_format [ { out_bit_depth 32 out_valid_bit_depth 32 + out_channels $DMIC_PCM_CHANNELS + out_ch_cfg $DMIC_CHANNEL_CFG + out_ch_map $DMIC_CHANNEL_MAP } ] } diff --git a/tools/topology/topology2/platform/intel/sdw-dmic-generic.conf b/tools/topology/topology2/platform/intel/sdw-dmic-generic.conf index f8fc51303966..243721ab18ef 100644 --- a/tools/topology/topology2/platform/intel/sdw-dmic-generic.conf +++ b/tools/topology/topology2/platform/intel/sdw-dmic-generic.conf @@ -5,7 +5,37 @@ Define { SDW_DMIC_STREAM 'SDW3-Capture' SDW_DMIC_BE_ID 4 SDW_DMIC_PASSTHROUGH "false" - SDW_DMIC_HOST_PIPELINE_ID 40 + SDW_DMIC_HOST_PIPELINE_ID 40 + SDW_DMIC_PCM_CHANNELS 2 + SDW_DMIC_CHANNEL_CFG $CHANNEL_CONFIG_STEREO + SDW_DMIC_CHANNEL_MAP $CHANNEL_MAP_STEREO +} + +IncludeByKey.SDW_DMIC_PCM_CHANNELS { + "1" { + Define { + SDW_DMIC_CHANNEL_CFG $CHANNEL_CONFIG_MONO + SDW_DMIC_CHANNEL_MAP $CHANNEL_MAP_MONO + } + } + "2" { + Define { + SDW_DMIC_CHANNEL_CFG $CHANNEL_CONFIG_STEREO + SDW_DMIC_CHANNEL_MAP $CHANNEL_MAP_STEREO + } + } + "4" { + Define { + SDW_DMIC_CHANNEL_CFG $CHANNEL_CONFIG_3_POINT_1 + SDW_DMIC_CHANNEL_MAP $CHANNEL_MAP_3_POINT_1 + } + } + "8" { + Define { + SDW_DMIC_CHANNEL_CFG $CHANNEL_CONFIG_7_POINT_1 + SDW_DMIC_CHANNEL_MAP $CHANNEL_MAP_7_POINT_1 + } + } } Object.Dai.ALH [ @@ -16,7 +46,7 @@ Object.Dai.ALH [ name $SDW_DMIC_STREAM default_hw_conf_id 0 rate 48000 - channels 2 + channels $SDW_DMIC_PCM_CHANNELS Object.Base.hw_config.1 { id 0 @@ -28,6 +58,9 @@ Object.Dai.ALH [ IncludeByKey.SDW_DMIC_ENHANCED_CAPTURE { "true" { + DMIC_PCM_CHANNELS = $SDW_DMIC_PCM_CHANNELS + DMIC_CHANNEL_CFG = $SDW_DMIC_CHANNEL_CFG + DMIC_CHANNEL_MAP = $SDW_DMIC_CHANNEL_MAP Object.Pipeline { host-gateway-tdfb-drc-capture [ { @@ -41,26 +74,41 @@ IncludeByKey.SDW_DMIC_ENHANCED_CAPTURE { num_output_audio_formats 5 Object.Base.output_audio_format [ { + out_channels $SDW_DMIC_PCM_CHANNELS out_bit_depth 16 out_valid_bit_depth 16 + out_ch_cfg $SDW_DMIC_CHANNEL_CFG + out_ch_map $SDW_DMIC_CHANNEL_MAP } { + out_channels $SDW_DMIC_PCM_CHANNELS out_bit_depth 32 out_valid_bit_depth 32 + out_ch_cfg $SDW_DMIC_CHANNEL_CFG + out_ch_map $SDW_DMIC_CHANNEL_MAP } { + out_channels $SDW_DMIC_PCM_CHANNELS out_bit_depth 32 out_valid_bit_depth 24 + out_ch_cfg $SDW_DMIC_CHANNEL_CFG + out_ch_map $SDW_DMIC_CHANNEL_MAP } { + out_channels $SDW_DMIC_PCM_CHANNELS out_bit_depth 32 out_valid_bit_depth 32 out_sample_type $SAMPLE_TYPE_FLOAT + out_ch_cfg $SDW_DMIC_CHANNEL_CFG + out_ch_map $SDW_DMIC_CHANNEL_MAP } { + out_channels $SDW_DMIC_PCM_CHANNELS out_bit_depth 8 out_valid_bit_depth 8 out_sample_type $SAMPLE_TYPE_UNSIGNED_INTEGER + out_ch_cfg $SDW_DMIC_CHANNEL_CFG + out_ch_map $SDW_DMIC_CHANNEL_MAP } ] } @@ -68,16 +116,25 @@ IncludeByKey.SDW_DMIC_ENHANCED_CAPTURE { num_output_audio_formats 3 Object.Base.output_audio_format [ { + out_channels $SDW_DMIC_PCM_CHANNELS out_bit_depth 16 out_valid_bit_depth 16 + out_ch_cfg $SDW_DMIC_CHANNEL_CFG + out_ch_map $SDW_DMIC_CHANNEL_MAP } { + out_channels $SDW_DMIC_PCM_CHANNELS out_bit_depth 32 out_valid_bit_depth 24 + out_ch_cfg $SDW_DMIC_CHANNEL_CFG + out_ch_map $SDW_DMIC_CHANNEL_MAP } { + out_channels $SDW_DMIC_PCM_CHANNELS out_bit_depth 32 out_valid_bit_depth 32 + out_ch_cfg $SDW_DMIC_CHANNEL_CFG + out_ch_map $SDW_DMIC_CHANNEL_MAP } ] } @@ -121,6 +178,76 @@ IncludeByKey.SDW_DMIC_ENHANCED_CAPTURE { Object.Widget.host-copier.1 { stream_name "sdw dmic" pcm_id 4 + IncludeByKey.PCM_FORMAT_ALL { + "true" { + num_output_audio_formats 5 + Object.Base.output_audio_format [ + { + out_channels $SDW_DMIC_PCM_CHANNELS + out_bit_depth 16 + out_valid_bit_depth 16 + out_ch_cfg $SDW_DMIC_CHANNEL_CFG + out_ch_map $SDW_DMIC_CHANNEL_MAP + } + { + out_channels $SDW_DMIC_PCM_CHANNELS + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $SDW_DMIC_CHANNEL_CFG + out_ch_map $SDW_DMIC_CHANNEL_MAP + } + { + out_channels $SDW_DMIC_PCM_CHANNELS + out_bit_depth 32 + out_valid_bit_depth 24 + out_ch_cfg $SDW_DMIC_CHANNEL_CFG + out_ch_map $SDW_DMIC_CHANNEL_MAP + } + { + out_channels $SDW_DMIC_PCM_CHANNELS + out_bit_depth 32 + out_valid_bit_depth 32 + out_sample_type $SAMPLE_TYPE_FLOAT + out_ch_cfg $SDW_DMIC_CHANNEL_CFG + out_ch_map $SDW_DMIC_CHANNEL_MAP + } + { + out_channels $SDW_DMIC_PCM_CHANNELS + out_bit_depth 8 + out_valid_bit_depth 8 + out_sample_type $SAMPLE_TYPE_UNSIGNED_INTEGER + out_ch_cfg $SDW_DMIC_CHANNEL_CFG + out_ch_map $SDW_DMIC_CHANNEL_MAP + } + ] + } + "false" { + num_output_audio_formats 3 + Object.Base.output_audio_format [ + { + out_channels $SDW_DMIC_PCM_CHANNELS + out_bit_depth 16 + out_valid_bit_depth 16 + out_ch_cfg $SDW_DMIC_CHANNEL_CFG + out_ch_map $SDW_DMIC_CHANNEL_MAP + } + { + out_channels $SDW_DMIC_PCM_CHANNELS + out_bit_depth 32 + out_valid_bit_depth 24 + out_ch_cfg $SDW_DMIC_CHANNEL_CFG + out_ch_map $SDW_DMIC_CHANNEL_MAP + } + { + out_channels $SDW_DMIC_PCM_CHANNELS + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $SDW_DMIC_CHANNEL_CFG + out_ch_map $SDW_DMIC_CHANNEL_MAP + } + ] + } + } } } ] @@ -141,19 +268,25 @@ Object.Widget { num_output_audio_formats 1 num_output_pins 1 - # 32-bit 48KHz 2ch + # 32-bit 48KHz capture, channel count derived from NUM_DMICS. Object.Base.input_audio_format [ { + in_channels $SDW_DMIC_PCM_CHANNELS in_bit_depth 32 in_valid_bit_depth $SDW_LINK_VALID_BITS in_sample_type $SAMPLE_TYPE_MSB_INTEGER + in_ch_cfg $SDW_DMIC_CHANNEL_CFG + in_ch_map $SDW_DMIC_CHANNEL_MAP in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256))]" } ] Object.Base.output_audio_format [ { + out_channels $SDW_DMIC_PCM_CHANNELS out_bit_depth 32 out_valid_bit_depth 32 + out_ch_cfg $SDW_DMIC_CHANNEL_CFG + out_ch_map $SDW_DMIC_CHANNEL_MAP } ] } @@ -174,14 +307,20 @@ Object.Widget { # index 41 is in herited from the pipeline definition Object.Base.input_audio_format [ { + in_channels $SDW_DMIC_PCM_CHANNELS in_bit_depth 32 in_valid_bit_depth 32 + in_ch_cfg $SDW_DMIC_CHANNEL_CFG + in_ch_map $SDW_DMIC_CHANNEL_MAP } ] Object.Base.output_audio_format [ { + out_channels $SDW_DMIC_PCM_CHANNELS out_bit_depth 32 out_valid_bit_depth 32 + out_ch_cfg $SDW_DMIC_CHANNEL_CFG + out_ch_map $SDW_DMIC_CHANNEL_MAP } ] @@ -197,14 +336,20 @@ Object.Widget { num_output_audio_formats 1 Object.Base.input_audio_format [ { + in_channels $SDW_DMIC_PCM_CHANNELS in_bit_depth 32 in_valid_bit_depth 32 + in_ch_cfg $SDW_DMIC_CHANNEL_CFG + in_ch_map $SDW_DMIC_CHANNEL_MAP } ] Object.Base.output_audio_format [ { + out_channels $SDW_DMIC_PCM_CHANNELS out_bit_depth 32 out_valid_bit_depth 32 + out_ch_cfg $SDW_DMIC_CHANNEL_CFG + out_ch_map $SDW_DMIC_CHANNEL_MAP } ] } @@ -226,6 +371,8 @@ Object.PCM.pcm [ Object.PCM.pcm_caps.1 { name "sdw dmic" + channels_min $SDW_DMIC_PCM_CHANNELS + channels_max $SDW_DMIC_PCM_CHANNELS IncludeByKey.PCM_FORMAT_ALL { "true" { formats 'S16_LE,S24_LE,S32_LE,U8,FLOAT_LE' diff --git a/tools/topology/topology2/production/tplg-targets-sdca-generic.cmake b/tools/topology/topology2/production/tplg-targets-sdca-generic.cmake index c7d5b5d8af1b..3f5d7acd5620 100644 --- a/tools/topology/topology2/production/tplg-targets-sdca-generic.cmake +++ b/tools/topology/topology2/production/tplg-targets-sdca-generic.cmake @@ -27,9 +27,19 @@ DEEP_BUF_SPK=true" SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,NUM_HDMIS=0,\ DEEP_BUF_SPK=true" +#default NUM_DMICS=2 "cavs-sdw\;sof-sdca-mic-id4\;SDW_JACK=false,SDW_DMIC=1,NUM_HDMIS=0,\ SDW_DMIC_STREAM=Capture-SmartMic" +"cavs-sdw\;sof-sdca-mic-1ch-id4\;SDW_JACK=false,SDW_DMIC=1,NUM_HDMIS=0,\ +SDW_DMIC_STREAM=Capture-SmartMic,SDW_DMIC_PCM_CHANNELS=1" + +"cavs-sdw\;sof-sdca-mic-4ch-id4\;SDW_JACK=false,SDW_DMIC=1,NUM_HDMIS=0,\ +SDW_DMIC_STREAM=Capture-SmartMic,SDW_DMIC_PCM_CHANNELS=4" + +"cavs-sdw\;sof-sdca-mic-8ch-id4\;SDW_JACK=false,SDW_DMIC=1,NUM_HDMIS=0,\ +SDW_DMIC_STREAM=Capture-SmartMic,SDW_DMIC_PCM_CHANNELS=8" + "cavs-sdw\;sof-hdmi-pcm5-id2\;SDW_JACK=false,HDMI1_ID=2,HDMI2_ID=3,HDMI3_ID=4" "cavs-sdw\;sof-hdmi-pcm5-id3\;SDW_JACK=false,HDMI1_ID=3,HDMI2_ID=4,HDMI3_ID=5" "cavs-sdw\;sof-hdmi-pcm5-id4\;SDW_JACK=false,HDMI1_ID=4,HDMI2_ID=5,HDMI3_ID=6"