CRAS: Move rstream request to dev_stream.

Move requesting playback samples to a function in dev_stream.  This
removes one more dependency on rstream from audio_thread and will make
a good place to update stream-specific timers in a future change.

Change-Id: I3ccf49b17135ab44050be7cecc132021d2ead2c5
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: Keep next callback time per dev_stream.

For each stream, save the time it should next be serviced.  This time
is start + n * callback_number.  Add one callback threshold of sleep
time after every callback.

This time will later be used to better calculate when to make
callbacks to a stream.

Change-Id: I210329b320bdd0b9b885ad1d3ce0d50b166083f0
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: audio_thread - Prefill with more zeros for min_buffer_level > 0

If a device has min_buffer_level set, start with cb_threshold +
min_buffer_level samples.  Without this the device will need to make
more than one consecutive callbacks to get filled to the appropriate
level.

BUG=none
TEST=play audio to BT and USB

Change-Id: Idc5ca851433bbd217a46ca40d5acc3e465f6690d
Signed-off-by: Dylan Reid <dgreid@chromium.org>
wip wake up based on a timer not on frames. unit tests break here

Change-Id: Ibb94ec43cc709d6f2a97a7dd16e21accf63b2608
add logging for new wake ups

Change-Id: I7fef15e31cba6af795414b7a5381a5b063138701
add dev_sleep but don't use it yet

Change-Id: Idbdd1e63af6153c5305840b7a25a8ebcae3385cb
CRAS: audio_thread - pre-fill shm for output streams.

Instead of dumping zeros into the output device, mark a buffer as
ready in the shared memory region.  This was it works for streams that
aren't the first ones added to a device.

Change-Id: I103858a54f588e62cff1116087df09fcfa74e7ac
Signed-off-by: Dylan Reid <dgreid@chromium.org>
wip: don't wait for streams

Change-Id: I646f453cd9ec0efb9e06271c1294f2c3afb7feb7
wake up for draining streams

Change-Id: Ibb63657de0587f465b67ef5fa95304d9fac3baaa