From b6b10af036162336fe46d81fb0d8836645305c95 Mon Sep 17 00:00:00 2001 From: Serhiy Katsyuba Date: Wed, 21 Sep 2022 13:05:54 +0200 Subject: [PATCH] ipc4: block mixin pipeline if no active sink In case mixin pipeline is running but mixout pipeline is not -- do not discard source data but block source pipeline until at least one sink (mixout) started. A typical topology is to have mixin and mixout in separate pipelines. Often, mixout pipeline is started a few milliseconds later after mixin pipeline. In such case mixin pipeline should be blocked until mixout pipeline started to do not loose any audio periods. Signed-off-by: Serhiy Katsyuba --- src/audio/mixin_mixout.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/audio/mixin_mixout.c b/src/audio/mixin_mixout.c index 4a0a36433..0e886d994 100644 --- a/src/audio/mixin_mixout.c +++ b/src/audio/mixin_mixout.c @@ -742,10 +742,7 @@ static int mixin_copy(struct comp_dev *dev) bytes_to_consume_from_source_buf = 0; if (source_avail_frames > 0) { if (active_mixout_cnt == 0) { - /* discard source data */ - comp_update_buffer_consume(source_c, - audio_stream_period_bytes(&source_c->stream, - source_avail_frames)); + /* block mixin pipeline until at least one mixout pipeline started */ buffer_release(source_c); return 0; }