From 7712d96a180776d1d758e80b9c5e52d510e94d4b Mon Sep 17 00:00:00 2001 From: Jaska Uimonen Date: Wed, 3 Mar 2021 16:03:20 +0200 Subject: [PATCH] host: fix buffer size alignment In buffer_size calculation period_bytes should be aligned with dma before multiplying with period_count. This is an issue for example when period_bytes could be smaller than the dma alignment size like with 8khz 16 bit mono stream. Signed-off-by: Jaska Uimonen --- src/audio/host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/host.c b/src/audio/host.c index 5c5ca53d8..f42b2cd43 100644 --- a/src/audio/host.c +++ b/src/audio/host.c @@ -721,7 +721,7 @@ static int host_params(struct comp_dev *dev, } /* calculate DMA buffer size */ - buffer_size = ALIGN_UP(period_count * period_bytes, align); + buffer_size = ALIGN_UP(period_bytes, align) * period_count; /* alloc DMA buffer or change its size if exists */ if (hd->dma_buffer) {