From c6a1494d0a668807c4915e252006bee8d8650d8f Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Wed, 6 Nov 2024 17:15:25 +0800 Subject: [PATCH] Topology2: add more rates support for SDW jack Add 96KHz/192KHz rates support for SoundWire jack device. Signed-off-by: Bard Liao --- .../platform/intel/sdw-jack-generic.conf | 133 +++++++++++++++++- 1 file changed, 131 insertions(+), 2 deletions(-) diff --git a/tools/topology/topology2/platform/intel/sdw-jack-generic.conf b/tools/topology/topology2/platform/intel/sdw-jack-generic.conf index 756e327a5412..99d15eb0aba8 100644 --- a/tools/topology/topology2/platform/intel/sdw-jack-generic.conf +++ b/tools/topology/topology2/platform/intel/sdw-jack-generic.conf @@ -10,6 +10,7 @@ IncludeByKey.PASSTHROUGH { Define { JACK_PLAYBACK_PCM_NAME "Jack Out" JACK_CAPTURE_PCM_NAME "Jack In" + JACK_RATE 48000 } # @@ -22,7 +23,7 @@ Object.Dai.ALH [ direction "playback" name $SDW_JACK_OUT_STREAM default_hw_conf_id 0 - rate 48000 + rate $JACK_RATE channels 2 Object.Base.hw_config.1 { @@ -36,7 +37,7 @@ Object.Dai.ALH [ direction "capture" name $SDW_JACK_IN_STREAM default_hw_conf_id 0 - rate 48000 + rate $JACK_RATE channels 2 Object.Base.hw_config.1 { @@ -59,11 +60,65 @@ IncludeByKey.PASSTHROUGH { Object.Widget.host-copier.1 { stream_name "volume playback 0" pcm_id 0 + 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 32 + } + { + in_rate $JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 24 + } + ] + Object.Base.output_audio_format [ + { + out_rate $JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } 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 } + ] } } ] @@ -72,20 +127,39 @@ IncludeByKey.PASSTHROUGH { { 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 } @@ -93,6 +167,7 @@ IncludeByKey.PASSTHROUGH { 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 @@ -104,6 +179,20 @@ IncludeByKey.PASSTHROUGH { 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 + } + ] } } ] @@ -119,14 +208,17 @@ IncludeByKey.PASSTHROUGH { 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 } @@ -134,14 +226,17 @@ IncludeByKey.PASSTHROUGH { 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 } @@ -162,14 +257,17 @@ IncludeByKey.PASSTHROUGH { 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 } @@ -177,6 +275,7 @@ IncludeByKey.PASSTHROUGH { 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 @@ -207,6 +306,7 @@ Object.Pipeline.host-gateway-capture [ num_input_audio_formats 1 Object.Base.input_audio_format [ { + in_rate $JACK_RATE in_bit_depth 32 in_valid_bit_depth 32 } @@ -214,14 +314,17 @@ Object.Pipeline.host-gateway-capture [ 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 } @@ -245,6 +348,7 @@ Object.Widget { Object.Base.input_audio_format [ { + in_rate $JACK_RATE in_bit_depth 32 in_valid_bit_depth $SDW_LINK_VALID_BITS in_sample_type $SAMPLE_TYPE_MSB_INTEGER @@ -253,6 +357,7 @@ Object.Widget { ] Object.Base.output_audio_format [ { + out_rate $JACK_RATE out_bit_depth 32 out_valid_bit_depth 32 } @@ -277,12 +382,14 @@ Object.Widget { # the instance number is automatically generated as '0' 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 } @@ -312,6 +419,17 @@ Object.PCM.pcm [ Object.PCM.pcm_caps.1 { name "volume playback 0" formats 'S16_LE,S24_LE,S32_LE' + IncludeByKey.JACK_RATE { + "48000" { + rates '48000' + } + "96000" { + rates '96000' + } + "192000" { + rates '192000' + } + } } } { @@ -325,6 +443,17 @@ Object.PCM.pcm [ Object.PCM.pcm_caps.1 { name "Passthrough Capture 0" 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 }