CRAS: dev_io - Fix setting delay for input stream

The delay of an input stream is set in capture_to_streams when the number
of samples in the shm is 0. The delay value is related to number of
samples in the device.

It should not be set again in set_input_dev_wake_ts.
At that time, the sample left in the device will be changed, and it
does corresponds to the delay that stream wants.

Separate get_stream_limit_set_delay into two functions so
get_stream_limit part can be reused at two places.

BUG=b:69839355
TEST=run loopback_latency -c and pass it more than 20 times.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Change-Id: I52befd0ebdbe32d4c53f05e6208774e244b8a9d6
Reviewed-on: https://chromium-review.googlesource.com/818372
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
1 file changed