CRAS: cras_empty_iodev - Fix inaccurate rate on empty device
In current version, we compute consumed frames by floor(rate *
time_since_last) and update time_since_last when we write / read
frames from device. But it is inaccurate because the decimal part
of frames is ignored. We can use time_since_start instead of
time_since_last to fix this problem.
Make 'put_buffer' return -EPIPE to match other alsa-based devices.
BUG=b:118595791
TEST=The empty device can run normally on eve.
Change-Id: If3d29c45a36255eab476cc6e67353b634639a4ca
Reviewed-on: https://chromium-review.googlesource.com/1309571
Commit-Ready: Yu-Hsuan Hsu <yuhsuan@chromium.org>
Tested-by: Yu-Hsuan Hsu <yuhsuan@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
1 file changed