Skip to content

Commit

Permalink
topology2: intel: deep-buffer: Adjust the buffer_size_min only
Browse files Browse the repository at this point in the history
There is no benefit on changing the period/buffer size_max as it is set
by default to a reasonably large value already.
What matters is the buffer_size_min: it needs to be larger than the
amount of data that one DMA burst will transfer, which is equal to the
DeepBuffer size. For safety reasons the minimum buffer size has to be
larger than this.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
  • Loading branch information
ujfalusi authored and kv2019i committed Apr 24, 2024
1 parent bba6a4c commit aa60e65
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions tools/topology/topology2/platform/intel/deep-buffer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@ Object.PCM.pcm [
Object.PCM.pcm_caps.1 {
name $DEEP_BUFFER_PCM_NAME
formats 'S16_LE,S24_LE,S32_LE'
# align with $DEEPBUFFER_FW_DMA_MS
period_size_max 65535
buffer_size_max 262144
# 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]"
}
}
]
Expand Down Expand Up @@ -83,9 +88,14 @@ IncludeByKey.DEEP_BUF_SPK {
Object.PCM.pcm_caps.1 {
name $DEEP_BUFFER_PCM_NAME_2
formats 'S16_LE,S24_LE,S32_LE'
# align with $DEEPBUFFER_FW_DMA_MS
period_size_max 65535
buffer_size_max 262144
# 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]"
}
}
]
Expand Down

0 comments on commit aa60e65

Please sign in to comment.