CRAS: dev_stream - Log waking up too early for capture

Log when a capture stream doesn't have enough samples, but it's timer
has expired.

Change-Id: I050bf5680c1d240e32992f023e653885903a9658
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/232233
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
CRAS: audio_thread - Fix counting draining streams as wait streams

Don't increment the count of streams to wait for if the stream is
draining.  This is a lie as the sleep time was never set anyways.

Change-Id: I515350a80e6fb88f1a6d80b805fcdd2ca41f6fda
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/232153
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
CRAS: alsa - Check for 4 or 10 channel support

Checks if four or ten channels are supported by ALSA devices.  Some
USB capture devices we've seen only support these channel counts.

Change-Id: I6d329c7ad79170bb6401d75a8d6afe753ee2c467
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/232420
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
CRAS: audio_thread - Keep active streams on fallback device.

Have fallback device also keep active streams. This simplifies logic
when adding/removing devices and looking-up streams.

BUG=None
TEST=Remove/Add active device while playing Youtube videos on peppy.

Change-Id: I573057c646e96f9983c7ee1805ca0ae38eea3f57
Reviewed-on: https://chromium-review.googlesource.com/231644
Commit-Queue: Chinyue Chen <chinyue@chromium.org>
Tested-by: Chinyue Chen <chinyue@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
ryu: ucm: Use DAC1 as a main volume control

Ryu does not have standard 'Master' volume control so we have to use
extra volume control that is called DAC1 on rt5677.

BUG=chrome-os-partner:34205
TEST=headphone playback on P1 board

Change-Id: Id7081dd49d1004b4d9314abac6ad2d8f3c234416
Reviewed-on: https://chromium-review.googlesource.com/232975
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Anatol Pomazau <anatol@google.com>
Tested-by: Anatol Pomazau <anatol@google.com>
CRAS: audio_thread - set coarse rate adj to capture path

Set the coarse rate adjust field for input device, this will
guard the buffer level so it won't go too far from the min/max
stream callback threshold.

BUG=chromium:436251
TEST=cras_test_client --capture_file /tmp/1 --show_latency
or open AudioVisualizer app and use cras_test_client --dump_a
to monitor the input buffer level. Verify that after a few
hours recording the buffer level and latency value don't
increase to unacceptable range.

Change-Id: I9d01f3b90460669312702c45177417de77ca69c3
Reviewed-on: https://chromium-review.googlesource.com/232902
Reviewed-by: Chinyue Chen <chinyue@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Candy: Add volume curve config.

BUG=chrome-os-partner:31814
TEST=`emerge-candy adhd` verify the file is exist.

Change-Id: Ie918e5a50690b8d70b0acf856c4f1dde18de622e
Reviewed-on: https://chromium-review.googlesource.com/232839
Commit-Queue: Huki Huang <huki.huang@intel.com>
Tested-by: Huki Huang <huki.huang@intel.com>
Reviewed-by: Yung Leem <yungleem@chromium.org>