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 <jaska.uimonen@intel.com>
This commit is contained in:
Jaska Uimonen 2021-03-03 16:03:20 +02:00 committed by Liam Girdwood
parent 288e228c67
commit 7712d96a18
1 changed files with 1 additions and 1 deletions

View File

@ -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) {