From 7b8ec70c6d00f2b7b7620eb1b65017b6301a51af Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Tue, 29 Oct 2024 11:31:39 +0200 Subject: [PATCH] audio: module: Fix passthrough module After commit 5f6f22d25e3a ("audio: module_adapter: Prepare to convert copier to use module interface") period_bytes are no longer computed in module generic prepare. This break the passthrough module as it was using period_bytes computed by upper layers. Fix this by computing period_bytes inside passthrough module prepare function. Fixes: 5f6f22d25e3a ("audio: module_adapter: Prepare to convert copier to use module interface") Signed-off-by: Daniel Baluta --- src/audio/module_adapter/module/passthrough.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/audio/module_adapter/module/passthrough.c b/src/audio/module_adapter/module/passthrough.c index 2cd5846e7393..1955e3bc487a 100644 --- a/src/audio/module_adapter/module/passthrough.c +++ b/src/audio/module_adapter/module/passthrough.c @@ -26,9 +26,12 @@ static int passthrough_codec_prepare(struct processing_module *mod, { struct comp_dev *dev = mod->dev; struct module_data *codec = &mod->priv; + struct comp_buffer *source = comp_dev_get_first_data_producer(dev); comp_info(dev, "passthrough_codec_prepare()"); + mod->period_bytes = audio_stream_period_bytes(&source->stream, dev->frames); + codec->mpd.in_buff = rballoc(0, SOF_MEM_CAPS_RAM, mod->period_bytes); if (!codec->mpd.in_buff) { comp_err(dev, "passthrough_codec_prepare(): Failed to alloc in_buff");