diff --git a/tools/topology/topology2/platform/intel/deep-buffer-spk.conf b/tools/topology/topology2/platform/intel/deep-buffer-spk.conf new file mode 100644 index 000000000000..b5743653f84f --- /dev/null +++ b/tools/topology/topology2/platform/intel/deep-buffer-spk.conf @@ -0,0 +1,59 @@ +Define { + SPEAKER_PCM_CORE_ID 0 +} + +Object.Pipeline.deepbuffer-playback [ + { + index $DEEP_BUFFER_PIPELINE_ID_2 + core_id $SPEAKER_PCM_CORE_ID + + Object.Widget.host-copier.1 { + stream_name $DEEP_BUFFER_PCM_NAME_2 + pcm_id $DEEP_BUFFER_PCM_ID_2 + } + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Pre Mixer $DEEP_BUFFER_PCM_NAME_2 Volume' + } + } + Object.Widget.pipeline.1 { + core $SPEAKER_PCM_CORE_ID + } + } +] + +Object.PCM.pcm [ + { + name $DEEP_BUFFER_PCM_NAME_2 + id $DEEP_BUFFER_PCM_ID_2 + direction playback + playback_compatible_d0i3 $DEEPBUFFER_D0I3_COMPATIBLE + + Object.Base.fe_dai.1 { + name "$DEEP_BUFFER_PCM_NAME_2" + } + Object.PCM.pcm_caps.1 { + name $DEEP_BUFFER_PCM_NAME_2 + formats 'S16_LE,S24_LE,S32_LE' + # To avoid DMA spinning on a buffer we need bigger + # buffer than the host buffer size, let's say twice as + # big + # (S16_LE, Stereo, 48KHz, DEEPBUFFER_FW_DMA_MS) * 2 + # + # Note: The lower limit for the buffer size is rate + # dependent + buffer_size_min "$[(((2 * $channels_min) * 48) * $DEEPBUFFER_FW_DMA_MS) * 2]" + } + } +] + +Object.Base.route [ + { + source $DEEP_BUFFER_PIPELINE_SRC_2 + sink $DEEP_BUFFER_PIPELINE_SINK_2 + } + { + source host-copier.$DEEP_BUFFER_PCM_ID_2.playback + sink gain.$DEEP_BUFFER_PIPELINE_ID_2.1 + } +] diff --git a/tools/topology/topology2/platform/intel/deep-buffer.conf b/tools/topology/topology2/platform/intel/deep-buffer.conf index 78d6baec8e21..5b86088feddf 100644 --- a/tools/topology/topology2/platform/intel/deep-buffer.conf +++ b/tools/topology/topology2/platform/intel/deep-buffer.conf @@ -164,65 +164,5 @@ Object.Base.route [ # Spawn another instance IncludeByKey.DEEP_BUF_SPK { -"true" { - Define { - SPEAKER_PCM_CORE_ID 0 - } - - Object.Pipeline.deepbuffer-playback [ - { - index $DEEP_BUFFER_PIPELINE_ID_2 - core_id $SPEAKER_PCM_CORE_ID - - Object.Widget.host-copier.1 { - stream_name $DEEP_BUFFER_PCM_NAME_2 - pcm_id $DEEP_BUFFER_PCM_ID_2 - } - Object.Widget.gain.1 { - Object.Control.mixer.1 { - name 'Pre Mixer $DEEP_BUFFER_PCM_NAME_2 Volume' - } - } - Object.Widget.pipeline.1 { - core $SPEAKER_PCM_CORE_ID - } - } - ] - - Object.PCM.pcm [ - { - name $DEEP_BUFFER_PCM_NAME_2 - id $DEEP_BUFFER_PCM_ID_2 - direction playback - playback_compatible_d0i3 $DEEPBUFFER_D0I3_COMPATIBLE - - Object.Base.fe_dai.1 { - name "$DEEP_BUFFER_PCM_NAME_2" - } - Object.PCM.pcm_caps.1 { - name $DEEP_BUFFER_PCM_NAME_2 - formats 'S16_LE,S24_LE,S32_LE' - # To avoid DMA spinning on a buffer we need bigger - # buffer than the host buffer size, let's say twice as - # big - # (S16_LE, Stereo, 48KHz, DEEPBUFFER_FW_DMA_MS) * 2 - # - # Note: The lower limit for the buffer size is rate - # dependent - buffer_size_min "$[(((2 * $channels_min) * 48) * $DEEPBUFFER_FW_DMA_MS) * 2]" - } - } - ] - - Object.Base.route [ - { - source $DEEP_BUFFER_PIPELINE_SRC_2 - sink $DEEP_BUFFER_PIPELINE_SINK_2 - } - { - source host-copier.$DEEP_BUFFER_PCM_ID_2.playback - sink gain.$DEEP_BUFFER_PIPELINE_ID_2.1 - } - ] - } +"true" "platform/intel/deep-buffer-spk.conf" } diff --git a/tools/topology/topology2/platform/intel/sdw-amp-generic.conf b/tools/topology/topology2/platform/intel/sdw-amp-generic.conf index 3bc52d5d3482..e2fb32916b52 100644 --- a/tools/topology/topology2/platform/intel/sdw-amp-generic.conf +++ b/tools/topology/topology2/platform/intel/sdw-amp-generic.conf @@ -16,6 +16,27 @@ Define { SDW_SPK_ECHO_REF_PCM_ID 12 } +# include deep buffer config if buffer size is in 1 - 1000 ms. +IncludeByKey.PASSTHROUGH { +"false" { + IncludeByKey.DEEPBUFFER_FW_DMA_MS { + "([1-9]|[1-9][0-9]|[1-9][0-9][0-9]|1000)" { + IncludeByKey.DEEP_BUF_SPK { + "true" { + #deep-buffer-spk.conf is included in deep-buffer.conf + #and deep-buffer.conf is included if SDW_JACK is true. + #Therefore, only include deep-buffer-spk.conf when + #SDW_JACK is false to avoid duplicated. + IncludeByKey.SDW_JACK { + "false" "platform/intel/deep-buffer-spk.conf" + } + } + } + } + } +} +} + Object.Dai.ALH [ { dai_index 20 diff --git a/tools/topology/topology2/production/tplg-targets-sdca-generic.cmake b/tools/topology/topology2/production/tplg-targets-sdca-generic.cmake index 5f45c85d46fd..fe393b3d2769 100644 --- a/tools/topology/topology2/production/tplg-targets-sdca-generic.cmake +++ b/tools/topology/topology2/production/tplg-targets-sdca-generic.cmake @@ -12,16 +12,20 @@ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack" SDW_JACK_IN_STREAM=Capture-SimpleJack,NUM_HDMIS=0" "cavs-sdw\;sof-sdca-1amp-id2\;NUM_SDW_AMP_LINKS=1,SDW_JACK=false,\ -SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,NUM_HDMIS=0" +SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,NUM_HDMIS=0,\ +DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true" "cavs-sdw\;sof-sdca-2amp-id2\;NUM_SDW_AMP_LINKS=2,SDW_JACK=false,\ -SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,NUM_HDMIS=0" +SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,NUM_HDMIS=0,\ +DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true" "cavs-sdw\;sof-sdca-3amp-id2\;NUM_SDW_AMP_LINKS=3,SDW_JACK=false,\ -SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,NUM_HDMIS=0" +SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,NUM_HDMIS=0,\ +DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true" "cavs-sdw\;sof-sdca-4amp-id2\;NUM_SDW_AMP_LINKS=4,SDW_JACK=false,\ -SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,NUM_HDMIS=0" +SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,NUM_HDMIS=0,\ +DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true" "cavs-sdw\;sof-sdca-mic-id4\;SDW_JACK=false,SDW_DMIC=1,NUM_HDMIS=0,\ SDW_DMIC_STREAM=Capture-SmartMic"