From edd489aa19b9c87607f801d18442ecbfcc2f6a04 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Mon, 18 Mar 2024 11:04:01 +0100 Subject: [PATCH] dp: do not block ppl because of sink/source limits Module adapter DP copy checks shouldn't block pipeline, similarly to LL-only scenario Add sink free size check to calculate copy size Signed-off-by: Adrian Bonislawski --- src/audio/module_adapter/module_adapter.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/audio/module_adapter/module_adapter.c b/src/audio/module_adapter/module_adapter.c index 5f09d23db24e..621045f43b44 100644 --- a/src/audio/module_adapter/module_adapter.c +++ b/src/audio/module_adapter/module_adapter.c @@ -1079,8 +1079,9 @@ static int module_adapter_copy_dp_queues(struct comp_dev *dev) struct sof_source *following_mod_data_source = audio_stream_get_source(&buffer->stream); struct sof_source *data_src = dp_queue_get_source(dp_queue); - uint32_t to_copy = MIN(source_get_min_available(following_mod_data_source), - source_get_data_available(data_src)); + uint32_t to_copy = MIN(MIN(source_get_min_available(following_mod_data_source), + source_get_data_available(data_src)), + sink_get_free_size(data_sink)); err = source_to_sink_copy(data_src, data_sink, true, to_copy); if (err) {