Skip to content

Commit

Permalink
audio: module: Fix passthrough module
Browse files Browse the repository at this point in the history
After commit 5f6f22d ("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: 5f6f22d ("audio: module_adapter: Prepare to convert
copier to use module interface")
Signed-off-by: Daniel Baluta <[email protected]>
  • Loading branch information
dbaluta authored and lgirdwood committed Oct 29, 2024
1 parent 7d7c3e7 commit 5fe899d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/audio/module_adapter/module/passthrough.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 5fe899d

Please sign in to comment.