Skip to content

Commit 7526ff1

Browse files
committed
ASoC: SOF: ipc4-topology: Enable deep buffer capture
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. Signed-off-by: Seppo Ingalsuo <[email protected]>
1 parent cdadd72 commit 7526ff1

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

sound/soc/sof/ipc4-topology.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,7 @@ static int sof_ipc4_widget_setup_pcm(struct snd_sof_widget *swidget)
619619
struct sof_ipc4_available_audio_format *available_fmt;
620620
struct snd_soc_component *scomp = swidget->scomp;
621621
struct sof_ipc4_copier *ipc4_copier;
622+
struct snd_sof_pcm_stream *sps;
622623
struct snd_sof_pcm *spcm;
623624
int node_type = 0;
624625
int ret, dir;
@@ -663,24 +664,23 @@ static int sof_ipc4_widget_setup_pcm(struct snd_sof_widget *swidget)
663664
if (ret)
664665
goto free_available_fmt;
665666

666-
if (dir == SNDRV_PCM_STREAM_PLAYBACK) {
667-
struct snd_sof_pcm_stream *sps = &spcm->stream[dir];
667+
sps = &spcm->stream[dir];
668+
sof_update_ipc_object(scomp, &sps->dsp_max_burst_size_in_ms,
669+
SOF_COPIER_DEEP_BUFFER_TOKENS,
670+
swidget->tuples,
671+
swidget->num_tuples, sizeof(u32), 1);
668672

669-
sof_update_ipc_object(scomp, &sps->dsp_max_burst_size_in_ms,
670-
SOF_COPIER_DEEP_BUFFER_TOKENS,
671-
swidget->tuples,
672-
swidget->num_tuples, sizeof(u32), 1);
673-
/* Set default DMA buffer size if it is not specified in topology */
674-
if (!sps->dsp_max_burst_size_in_ms) {
675-
struct snd_sof_widget *pipe_widget = swidget->spipe->pipe_widget;
676-
struct sof_ipc4_pipeline *pipeline = pipe_widget->private;
673+
/* Set default DMA buffer size if it is not specified in topology */
674+
if (!sps->dsp_max_burst_size_in_ms) {
675+
struct snd_sof_widget *pipe_widget = swidget->spipe->pipe_widget;
676+
struct sof_ipc4_pipeline *pipeline = pipe_widget->private;
677677

678+
if (dir == SNDRV_PCM_STREAM_PLAYBACK)
678679
sps->dsp_max_burst_size_in_ms = pipeline->use_chain_dma ?
679680
SOF_IPC4_CHAIN_DMA_BUFFER_SIZE : SOF_IPC4_MIN_DMA_BUFFER_SIZE;
680-
}
681-
} else {
682-
/* Capture data is copied from DSP to host in 1ms bursts */
683-
spcm->stream[dir].dsp_max_burst_size_in_ms = 1;
681+
else
682+
/* Capture data is copied from DSP to host in 1ms bursts */
683+
sps->dsp_max_burst_size_in_ms = 1;
684684
}
685685

686686
skip_gtw_cfg:

0 commit comments

Comments
 (0)