From 5452607df84f0a2d6e921be4e646ff077396bb7b Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Mon, 2 Jan 2023 14:27:30 +0200 Subject: [PATCH] mixin-mixout: handle congestion corner case without assert If one mixout (A) is not able to process data, the 'sinks_free_frames' will be truncated compared other mixout buffers. When the mixin process is producing data to another mixout buffer (B), the number of already mixed frames may be larger than 'sinks_free_frames'. Further it is possible this mixout (B) has pending frames, leading to a larger 'start_frame' value. This is a valid and possible scenario, but will trigger assert(sinks_free_frames >= start_frame) in current code. As 'frames_to_copy' is already correctly calculated as limited to available free frames across all mixouts, no extra logic is needed when this condition happens. Mixin is not able to proceed until the congested mixout (A) has room again for further samples. Link: https://github.com/thesofproject/sof/issues/6896 Signed-off-by: Kai Vehmanen --- src/audio/mixin_mixout/mixin_mixout.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/audio/mixin_mixout/mixin_mixout.c b/src/audio/mixin_mixout/mixin_mixout.c index c56724f2e9a0..3ce52cc9156c 100644 --- a/src/audio/mixin_mixout/mixin_mixout.c +++ b/src/audio/mixin_mixout/mixin_mixout.c @@ -423,7 +423,6 @@ static int mixin_process(struct processing_module *mod, * performance problems with processing data on time in mixout. */ start_frame = mixout_data->pending_frames[source_index]; - assert(sinks_free_frames >= start_frame); sink_c = buffer_acquire(sink);