mirror of https://github.com/thesofproject/sof.git
audio: host: reload DMA buffer on non-zero partial_size
This patch ensures that the DMA buffer is reloaded when partial_size is non-zero, even if copy_bytes is zero. This condition typically occurs at the end of a stream, where the last data chunk does not meet the condition for reload DMA buffer, leaving a non-zero partial_size. Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
This commit is contained in:
parent
7b5475b0af
commit
16b53b423c
|
@ -449,8 +449,20 @@ static int host_copy_normal(struct host_data *hd, struct comp_dev *dev, copy_cal
|
||||||
comp_dbg(dev, "host_copy_normal()");
|
comp_dbg(dev, "host_copy_normal()");
|
||||||
|
|
||||||
copy_bytes = host_get_copy_bytes_normal(hd, dev);
|
copy_bytes = host_get_copy_bytes_normal(hd, dev);
|
||||||
if (!copy_bytes)
|
if (!copy_bytes) {
|
||||||
|
if (hd->partial_size != 0) {
|
||||||
|
if (stream_sync(hd, dev)) {
|
||||||
|
ret = dma_reload(hd->chan->dma->z_dev, hd->chan->index, 0, 0,
|
||||||
|
hd->partial_size);
|
||||||
|
if (ret < 0)
|
||||||
|
comp_err(dev, "dma_reload() failed, ret = %u", ret);
|
||||||
|
|
||||||
|
hd->partial_size = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
cb(dev, copy_bytes);
|
cb(dev, copy_bytes);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue