From a18fc3d050ea74a109c18119426ba3530442a084 Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Mon, 25 Nov 2024 19:50:38 +0800 Subject: [PATCH] Topology2: add more rates support for deep buffer jack Deep buffer should use the same rate as the original device. Signed-off-by: Bard Liao --- .../topology2/platform/intel/deep-buffer.conf | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/tools/topology/topology2/platform/intel/deep-buffer.conf b/tools/topology/topology2/platform/intel/deep-buffer.conf index 18a4629c7f0c..13885f402c82 100644 --- a/tools/topology/topology2/platform/intel/deep-buffer.conf +++ b/tools/topology/topology2/platform/intel/deep-buffer.conf @@ -1,5 +1,6 @@ Define { DEEP_BUF_SPK false + DEEP_BUF_JACK_RATE 48000 } Object.Pipeline.deepbuffer-playback [ @@ -9,12 +10,66 @@ Object.Pipeline.deepbuffer-playback [ Object.Widget.host-copier.1 { stream_name $DEEP_BUFFER_PCM_NAME pcm_id $DEEP_BUFFER_PCM_ID + Object.Base.input_audio_format [ + { + in_rate $DEEP_BUF_JACK_RATE + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_rate $DEEP_BUF_JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 24 + } + { + in_rate $DEEP_BUF_JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_rate $DEEP_BUF_JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } Object.Widget.gain.1 { Object.Control.mixer.1 { name 'Pre Mixer $DEEP_BUFFER_PCM_NAME Volume' } + Object.Base.input_audio_format [ + { + in_rate $DEEP_BUF_JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_rate $DEEP_BUF_JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + Object.Widget.mixin.1 { + Object.Base.input_audio_format [ + { + in_rate $DEEP_BUF_JACK_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_rate $DEEP_BUF_JACK_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } } ] @@ -41,6 +96,17 @@ Object.PCM.pcm [ # Note: The lower limit for the buffer size is rate # dependent buffer_size_min "$[(((2 * $channels_min) * 48) * $DEEPBUFFER_FW_DMA_MS) * 2]" + IncludeByKey.DEEP_BUF_JACK_RATE { + "48000" { + rates '48000' + } + "96000" { + rates '96000' + } + "192000" { + rates '192000' + } + } } } ]