diff --git a/tools/topology/topology2/cavs-mixin-mixout-dax-ssp.conf b/tools/topology/topology2/cavs-mixin-mixout-dax-ssp.conf index e105f1d40a35..bac41013d48f 100644 --- a/tools/topology/topology2/cavs-mixin-mixout-dax-ssp.conf +++ b/tools/topology/topology2/cavs-mixin-mixout-dax-ssp.conf @@ -8,6 +8,7 @@ Define { DOLBY_DAX_CORE_ID 0 + DAX_HEADSET "false" } # Pipeline ID:1 PCM ID: 0 @@ -46,7 +47,9 @@ Object.Pipeline { } ] - mixout-gain-dax-dai-copier-playback [ + IncludeByKey.DAX_HEADSET { + "true" { + mixout-gain-dax-dai-copier-playback [ { index $HEADSET_DAI_PIPELINE_ID @@ -112,17 +115,20 @@ Object.Pipeline { } } } + ] + } + "false" { + mixout-gain-dai-copier-playback [ { - index $SPEAKER_DAI_PIPELINE_ID - core_id $SPEAKER_PCM_CORE_ID + index $HEADSET_DAI_PIPELINE_ID Object.Widget.dai-copier.1 { - dai_index $SPEAKER_SSP_DAI_INDEX + dai_index $HEADSET_SSP_DAI_INDEX dai_type "SSP" copier_type "SSP" - stream_name "$SPEAKER_CODEC_NAME" + stream_name "$HEADSET_CODEC_NAME" node_type $I2S_LINK_OUTPUT_CLASS - IncludeByKey.SSP_SPK_FMT_24 { + IncludeByKey.SSP_HS_FMT_24 { "true" { Object.Base.output_audio_format [ { @@ -146,50 +152,107 @@ Object.Pipeline { Object.Widget.gain.1 { Object.Control.mixer.1 { - name 'Post Mixer $SPEAKER_PCM_NAME Playback Volume' + name 'Post Mixer $HEADSET_PCM_NAME Playback Volume' } } + } + ] + } + } + mixout-gain-dax-dai-copier-playback [ + { + index $SPEAKER_DAI_PIPELINE_ID + core_id $SPEAKER_PCM_CORE_ID - Object.Widget.dolby-dax.1 { - core_id $DOLBY_DAX_CORE_ID - Object.Control { - mixer."1" { - name 'DAX Speaker Switch' - } - mixer."2" { - name 'DAX Speaker Switch CP' - } - mixer."3" { - name 'DAX Speaker Switch CTC' - } - mixer."4" { - name 'DAX Speaker Volume' - } - enum."1" { - name 'DAX Speaker Profile' + Object.Widget.dai-copier.1 { + dai_index $SPEAKER_SSP_DAI_INDEX + dai_type "SSP" + copier_type "SSP" + stream_name "$SPEAKER_CODEC_NAME" + node_type $I2S_LINK_OUTPUT_CLASS + IncludeByKey.SSP_SPK_FMT_24 { + "true" { + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 24 + out_sample_type $SAMPLE_TYPE_LSB_INTEGER + out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]" } - enum."2" { - name 'DAX Speaker Device' - } - bytes."1" { - name 'DAX Speaker Tuning' - max 8192 + ] + } + "false" { + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 } + ] } } + } - Object.Widget.pipeline.1 { - core $SPEAKER_PCM_CORE_ID + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Post Mixer $SPEAKER_PCM_NAME Playback Volume' + } + } + + Object.Widget.dolby-dax.1 { + core_id $DOLBY_DAX_CORE_ID + Object.Control { + mixer."1" { + name 'DAX Speaker Switch' + } + mixer."2" { + name 'DAX Speaker Switch CP' + } + mixer."3" { + name 'DAX Speaker Switch CTC' + } + mixer."4" { + name 'DAX Speaker Volume' + } + enum."1" { + name 'DAX Speaker Profile' + } + enum."2" { + name 'DAX Speaker Device' + } + bytes."1" { + name 'DAX Speaker Tuning' + max 8192 + } } } + + Object.Widget.pipeline.1 { + core $SPEAKER_PCM_CORE_ID + } + } ] } -Object.Base.route [ +IncludeByKey.DAX_HEADSET { + "true" { + Object.Base.route [ { source "dolby-dax.$HEADSET_DAI_PIPELINE_ID.1" sink "dai-copier.SSP.$HEADSET_CODEC_NAME.playback" } + ] + } + "false" { + Object.Base.route [ + { + source "gain.$HEADSET_DAI_PIPELINE_ID.1" + sink "dai-copier.SSP.$HEADSET_CODEC_NAME.playback" + } + ] + } +} + +Object.Base.route [ { source "mixin.$HEADSET_HOST_PIPELINE_ID.1" sink "mixout.$HEADSET_DAI_PIPELINE_ID.1" diff --git a/tools/topology/topology2/cavs-sdw.conf b/tools/topology/topology2/cavs-sdw.conf index 4d655378ab36..da97bedb4dc1 100644 --- a/tools/topology/topology2/cavs-sdw.conf +++ b/tools/topology/topology2/cavs-sdw.conf @@ -120,6 +120,7 @@ Define { SDW_AMP_XOVER_EQFIR_PARAMS default DOLBY_DAX_CORE_ID 0 USE_DAX "false" + DAX_HEADSET "false" SDW_ECHO_REF_DAI "false" } diff --git a/tools/topology/topology2/platform/intel/sdw-jack-generic.conf b/tools/topology/topology2/platform/intel/sdw-jack-generic.conf index 583a91e86f87..de9adc38f01a 100644 --- a/tools/topology/topology2/platform/intel/sdw-jack-generic.conf +++ b/tools/topology/topology2/platform/intel/sdw-jack-generic.conf @@ -161,106 +161,185 @@ IncludeByKey.PASSTHROUGH { ] IncludeByKey.USE_DAX { "true" { - mixout-gain-dax-alh-dai-copier-playback [ - { - index 1 + IncludeByKey.DAX_HEADSET { + "true" { + mixout-gain-dax-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 + 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 + } + ] } - { - in_rate $JACK_RATE - in_bit_depth 32 - in_valid_bit_depth 24 + 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)]" + } + ] } - { - in_rate $JACK_RATE - in_bit_depth 32 - in_valid_bit_depth 32 + 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 + } + ] } - ] - 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.dolby-dax.1 { + core_id $DOLBY_DAX_CORE_ID + Object.Control { + mixer."1" { + name 'DAX Headphone Switch' + } + mixer."2" { + name 'DAX Headphone Switch CP' + } + mixer."3" { + name 'DAX Headphone Switch CTC' + } + mixer."4" { + name 'DAX Headphone Volume' + } + enum."1" { + name 'DAX Headphone Profile' + } + enum."2" { + name 'DAX Headphone Device' + } + bytes."1" { + name 'DAX Headphone Tuning' + max 8192 + } + } } - ] - } - 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 - } - ] - } - Object.Widget.dolby-dax.1 { - core_id $DOLBY_DAX_CORE_ID - Object.Control { - mixer."1" { - name 'DAX Headphone Switch' - } - mixer."2" { - name 'DAX Headphone Switch CP' - } - mixer."3" { - name 'DAX Headphone Switch CTC' - } - mixer."4" { - name 'DAX Headphone Volume' - } - enum."1" { - name 'DAX Headphone Profile' - } - enum."2" { - name 'DAX Headphone Device' - } - bytes."1" { - name 'DAX Headphone Tuning' - max 8192 - } + ] + } + "false" { + 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 + } + ] } } + ] + } } - ] } "false" { mixout-gain-alh-dai-copier-playback [ @@ -678,16 +757,32 @@ IncludeByKey.PASSTHROUGH { "false" { IncludeByKey.USE_DAX { "true" { - Object.Base.route [ - { - source "dolby-dax.1.1" - sink "module-copier.1.12" + IncludeByKey.DAX_HEADSET { + "true" { + Object.Base.route [ + { + source "dolby-dax.1.1" + sink "module-copier.1.12" + } + { + source "module-copier.1.12" + sink "alh-copier.$SDW_JACK_OUT_STREAM.0" + } + ] } - { - source "module-copier.1.12" - sink "alh-copier.$SDW_JACK_OUT_STREAM.0" + "false" { + Object.Base.route [ + { + source "gain.1.1" + sink "module-copier.1.12" + } + { + source "module-copier.1.12" + sink "alh-copier.$SDW_JACK_OUT_STREAM.0" + } + ] } - ] + } } "false" { Object.Base.route [