* [PATCH v3] ASoC: SOF: ipc4-topology: Enable deep buffer capture
@ 2026-05-22 7:56 Peter Ujfalusi
2026-05-22 11:07 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Peter Ujfalusi @ 2026-05-22 7:56 UTC (permalink / raw)
To: lgirdwood, broonie
Cc: linux-sound, kai.vehmanen, yung-chuan.liao, pierre-louis.bossart,
seppo.ingalsuo
From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch lets a capture PCM to operate with deep buffer
by taking dsp_max_burst_size_in_ms from topology if it is
defined. Earlier the value from topology was omitted for
capture.
If not defined, the maximum burst size for capture is set
similarly as before to one millisecond.
The dma_buffer_size is set similarly as for playback from
largest of deep_buffer_dma_ms or SOF_IPC4_MIN_DMA_BUFFER_SIZE
times OBS.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
---
Changes since v2:
- fixed my SoB tag from SB...
Changes since v1:
- added my SoB tag, sorry
Peter
sound/soc/sof/ipc4-topology.c | 39 +++++++++++++++++++++--------------
1 file changed, 24 insertions(+), 15 deletions(-)
diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c
index 76812d8fb567..65756fe3a64f 100644
--- a/sound/soc/sof/ipc4-topology.c
+++ b/sound/soc/sof/ipc4-topology.c
@@ -624,6 +624,7 @@ static int sof_ipc4_widget_setup_pcm(struct snd_sof_widget *swidget)
struct sof_ipc4_available_audio_format *available_fmt;
struct snd_soc_component *scomp = swidget->scomp;
struct sof_ipc4_copier *ipc4_copier;
+ struct snd_sof_pcm_stream *sps;
struct snd_sof_pcm *spcm;
int node_type = 0;
int ret, dir;
@@ -668,24 +669,23 @@ static int sof_ipc4_widget_setup_pcm(struct snd_sof_widget *swidget)
if (ret)
goto free_available_fmt;
- if (dir == SNDRV_PCM_STREAM_PLAYBACK) {
- struct snd_sof_pcm_stream *sps = &spcm->stream[dir];
+ sps = &spcm->stream[dir];
+ sof_update_ipc_object(scomp, &sps->dsp_max_burst_size_in_ms,
+ SOF_COPIER_DEEP_BUFFER_TOKENS,
+ swidget->tuples,
+ swidget->num_tuples, sizeof(u32), 1);
- sof_update_ipc_object(scomp, &sps->dsp_max_burst_size_in_ms,
- SOF_COPIER_DEEP_BUFFER_TOKENS,
- swidget->tuples,
- swidget->num_tuples, sizeof(u32), 1);
- /* Set default DMA buffer size if it is not specified in topology */
- if (!sps->dsp_max_burst_size_in_ms) {
- struct snd_sof_widget *pipe_widget = swidget->spipe->pipe_widget;
- struct sof_ipc4_pipeline *pipeline = pipe_widget->private;
+ /* Set default DMA buffer size if it is not specified in topology */
+ if (!sps->dsp_max_burst_size_in_ms) {
+ struct snd_sof_widget *pipe_widget = swidget->spipe->pipe_widget;
+ struct sof_ipc4_pipeline *pipeline = pipe_widget->private;
+ if (dir == SNDRV_PCM_STREAM_PLAYBACK)
sps->dsp_max_burst_size_in_ms = pipeline->use_chain_dma ?
SOF_IPC4_CHAIN_DMA_BUFFER_SIZE : SOF_IPC4_MIN_DMA_BUFFER_SIZE;
- }
- } else {
- /* Capture data is copied from DSP to host in 1ms bursts */
- spcm->stream[dir].dsp_max_burst_size_in_ms = 1;
+ else
+ /* Capture data is copied from DSP to host in 1ms bursts */
+ sps->dsp_max_burst_size_in_ms = 1;
}
skip_gtw_cfg:
@@ -2430,10 +2430,19 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget,
copier_data->gtw_cfg.dma_buffer_size);
break;
case snd_soc_dapm_dai_out:
- case snd_soc_dapm_aif_out:
copier_data->gtw_cfg.dma_buffer_size =
SOF_IPC4_MIN_DMA_BUFFER_SIZE * copier_data->base_config.obs;
break;
+ case snd_soc_dapm_aif_out:
+ copier_data->gtw_cfg.dma_buffer_size =
+ max((u32)SOF_IPC4_MIN_DMA_BUFFER_SIZE, deep_buffer_dma_ms) *
+ copier_data->base_config.obs;
+ dev_dbg(sdev->dev, "copier %s, dma buffer%s: %u ms (%u bytes)",
+ swidget->widget->name,
+ deep_buffer_dma_ms ? " (using Deep Buffer)" : "",
+ max((u32)SOF_IPC4_MIN_DMA_BUFFER_SIZE, deep_buffer_dma_ms),
+ copier_data->gtw_cfg.dma_buffer_size);
+ break;
default:
break;
}
--
2.54.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v3] ASoC: SOF: ipc4-topology: Enable deep buffer capture
2026-05-22 7:56 [PATCH v3] ASoC: SOF: ipc4-topology: Enable deep buffer capture Peter Ujfalusi
@ 2026-05-22 11:07 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-05-22 11:07 UTC (permalink / raw)
To: lgirdwood, Peter Ujfalusi
Cc: linux-sound, kai.vehmanen, yung-chuan.liao, pierre-louis.bossart,
seppo.ingalsuo
On Fri, 22 May 2026 10:56:59 +0300, Peter Ujfalusi wrote:
> ASoC: SOF: ipc4-topology: Enable deep buffer capture
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.2
Thanks!
[1/1] ASoC: SOF: ipc4-topology: Enable deep buffer capture
https://git.kernel.org/broonie/sound/c/8fbcb4ab2670
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-22 17:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-22 7:56 [PATCH v3] ASoC: SOF: ipc4-topology: Enable deep buffer capture Peter Ujfalusi
2026-05-22 11:07 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox