Use the new XRUN API to report XRUNs to host and trace.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- src/audio/volume.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/audio/volume.c b/src/audio/volume.c index c81fd33..925a274 100644 --- a/src/audio/volume.c +++ b/src/audio/volume.c @@ -467,9 +467,12 @@ static int volume_copy(struct comp_dev *dev) copy_bytes = comp_buffer_get_copy_bytes(dev, source, sink);
/* Run volume if buffers have enough room */ - if (copy_bytes < cd->source_period_bytes || - copy_bytes < cd->sink_period_bytes) { - trace_volume_error("xru"); + if (copy_bytes < cd->source_period_bytes) { + comp_underrun(dev, source, cd->source_period_bytes); + return 0; + } + if (copy_bytes < cd->sink_period_bytes) { + comp_overrun(dev, source, cd->sink_period_bytes); return 0; }