dai: call dma_copy even if there is no data

Changes flow of dai_copy to call dma_copy even if there is no data
available. This way we make sure that all DMA needed procedures are
executed, since buffers pointers won't be changed anyway.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This commit is contained in:
Tomasz Lauda 2019-10-21 15:17:25 +02:00 committed by Tomasz Lauda
parent d6f86e57ee
commit 87a4bed002
1 changed files with 3 additions and 7 deletions

View File

@ -604,14 +604,10 @@ static int dai_check_for_xrun(struct comp_dev *dev, uint32_t copy_bytes)
struct dai_data *dd = comp_get_drvdata(dev); struct dai_data *dd = comp_get_drvdata(dev);
struct comp_buffer *local_buffer; struct comp_buffer *local_buffer;
/* data available for copy */ /* data available for copy or just starting */
if (copy_bytes) if (copy_bytes || dd->start_position == dev->position)
return 0; return 0;
/* no data yet, we're just starting */
if (dd->start_position == dev->position)
return PPL_STATUS_PATH_STOP;
/* xrun occurred */ /* xrun occurred */
if (dev->params.direction == SOF_IPC_STREAM_PLAYBACK) { if (dev->params.direction == SOF_IPC_STREAM_PLAYBACK) {
trace_dai_error_with_ids(dev, "dai_check_for_xrun() " trace_dai_error_with_ids(dev, "dai_check_for_xrun() "
@ -664,7 +660,7 @@ static int dai_copy(struct comp_dev *dev)
/* check for underrun or overrun */ /* check for underrun or overrun */
ret = dai_check_for_xrun(dev, copy_bytes); ret = dai_check_for_xrun(dev, copy_bytes);
if (ret < 0 || ret == PPL_STATUS_PATH_STOP) if (ret < 0)
return ret; return ret;
ret = dma_copy(dd->chan, copy_bytes, 0); ret = dma_copy(dd->chan, copy_bytes, 0);