CRAS: iodev_list - Ramp up/down for unmute/mute only in normal run

When device is not in normal run state, there is no need to start
ramping. This avoid the unwanted ramping down where device is
in no_stream state, and user changes mute state.

The scenario is:
1. Start playback
2. Stop playback
3. Device in no_stream state.
4. Press mute. Device starts ramping down.
5. Ramping does not proceed because there is no valid sample being
   played.
6. Start playback. Valid sample is being played. Ramping proceeds.
   cras_iodev_put_output_buffer does not mute samples because ramping is
   in progress, therefore, we have unexpected audio.

This CL avoids the unwanted ramping down request at 5 to avoid
unexpected audio.

BUG=chromium:669662
TEST=make check
TEST=Follow above scenario and check there is no unexpected audio.

Change-Id: Ia7c20d41f2e1def93ba0e966d8d482b6f703b038
Reviewed-on: https://chromium-review.googlesource.com/428731
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Chinyue Chen <chinyue@chromium.org>
2 files changed