From 6771f3641b3ace977e7837821d16b069cdec26f0 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 | 87 ++++++++++++++++++- 1 file changed, 85 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..299b6f341cd1 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,49 @@ 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.output_audio_format [ + { + out_rate $JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 32 } + ] + Object.Base.output_audio_format [ + { + out_rate $JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } } ] @@ -78,14 +117,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 } @@ -93,6 +135,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 @@ -119,14 +162,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 +180,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 +211,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 +229,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 +260,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 +268,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 +302,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 +311,7 @@ Object.Widget { ] Object.Base.output_audio_format [ { + out_rate $JACK_RATE out_bit_depth 32 out_valid_bit_depth 32 } @@ -277,12 +336,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 +373,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 +397,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 }