CRAS alsa helper: Treat zero frames as error only for output
CRAS alsa helper: Treat zero frames as error only for output

snd_pcm_mmap_begin sets the available frames in return. Originally
we treat it as error when seeing zero frames.  This should happen
only for output devices.

For input devices, after suspend then resume, pcm handle could have
just resumed(in dev_running callback) before calling mmap_begin.
In this case, available frames just turned to zero, which is a
reasonable value.

BUG=chromium:284777
TEST=Run audio visualizer demo, suspend and resume system several
times, verify audio recording and playback work good everytime.

Change-Id: Ia27f017cf978fc78244ff48dd38ee766bd3508e5
Reviewed-on: https://chromium-review.googlesource.com/168744
Reviewed-by: Dylan Reid <c791bfe44996c1eed9c7149a0c5f12a86d58eb85@chromium.org>
Commit-Queue: Hsinyu Chao <8b91762bdbe27d3121b311091d7ca5125e9a8df6@chromium.org>
Tested-by: Hsinyu Chao <8b91762bdbe27d3121b311091d7ca5125e9a8df6@chromium.org>

drinkcat/adhd,drinkcat/adhd,drinkcat/adhd,drinkcat/adhd,drinkcat/adhd,drinkcat/adhd