mirror of https://github.com/thesofproject/sof.git
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:
parent
288e228c67
commit
7712d96a18
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue