From 671e63507737d52ce11e0a1b032e295a36e71005 Mon Sep 17 00:00:00 2001 From: Rander Wang Date: Tue, 30 Nov 2021 13:48:13 +0800 Subject: [PATCH] ipc4: refine buffer size Audio driver only create single buffer but SOF requires double buffer. Since obs should be equal to ibs, buffer size will be set to obs * 2. Signed-off-by: Rander Wang --- src/ipc/ipc4/helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ipc/ipc4/helper.c b/src/ipc/ipc4/helper.c index 2d86c49f1..9dd957756 100644 --- a/src/ipc/ipc4/helper.c +++ b/src/ipc/ipc4/helper.c @@ -201,7 +201,8 @@ static struct comp_buffer *ipc4_create_buffer(struct comp_dev *src, struct comp_ src_cfg = (struct ipc4_base_module_cfg *)comp_get_drvdata(src); sink_cfg = (struct ipc4_base_module_cfg *)comp_get_drvdata(sink); - buf_size = MAX(src_cfg->obs, sink_cfg->ibs); + /* double it since obs is single buffer size */ + buf_size = src_cfg->obs * 2; memset(&ipc_buf, 0, sizeof(ipc_buf)); ipc_buf.size = buf_size; ipc_buf.comp.id = IPC4_COMP_ID(src_queue, dst_queue);