comp: volume: use XRUN handler to report XRUNs

Use the new XRUN API to report XRUNs to host and trace.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This commit is contained in:
Liam Girdwood 2017-08-22 22:33:52 +01:00
parent bc83a0e147
commit 9ec831b137
1 changed files with 6 additions and 3 deletions

View File

@ -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;
}