CRAS: Simpler scheduling of initial capture stream fetches

When we add the new stream, we will decide its next_cb_ts by its
cb_threshold and hw_level of input device. Hence, if there are enough
samples in the device, the next_cb_ts will be set to right now.
However, the device fills samples only if there is enough space on
all streams. So if there is an old stream without any space, the
samples will not be filled and posted. It causes the new stream to
be blocked and miss its next_cb_ts until the old stream is posted.
(That time should be the next_cb_ts of the old stream.)

Actually, we don't need to set the next_cb_ts on the new stream. If we
set the first next_cb_ts to zero, the stream will wake up when it gets
enough samples to post (this logic is written in get_input_wake_time
function). After its first post, we can initialize next_cb_ts without
recording missed callback event.

BUG=chromium:918462
TEST=Input streams ignore this missed callback event on peppy.

Change-Id: I7d37a95427637cb1d99ace05764c608b6708dcf7
Reviewed-on: https://chromium-review.googlesource.com/1535298
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Yu-Hsuan Hsu <yuhsuan@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
3 files changed