Yuna: Add ucm config files for Yuna

This is a clone of the Auron configuration

BUG=chrome-os-partner:33445
TEST=listen for audio

Change-Id: Ic264e5e681717b918af602c2f9a1dff583793ff7
Reviewed-on: https://chromium-review.googlesource.com/227370
Tested-by: Allen Hung <allen.hung@intel.com>
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Allen Hung <allen.hung@intel.com>
CRAS: audio_thread - Don't rm fallback dev from active list

This fixes a bug that if fallback device already been moved to the
active device list and error occurs when append a new stream, the
fallback device could get destroyed and treat as active dev again.

BUG=chromium:428535
TEST=Play an 8-channel audio file several times, verify CRAS
doesn't crash.

Change-Id: Ia7a967332a1a0c24a88714d6b91f0fd573008ce5
Reviewed-on: https://chromium-review.googlesource.com/228978
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
CRAS: audio_thread - Return err if append stream to fallback dev fails

If append stream fails fallback device could stay uninitialized.
Return the error right away to prevent crash later when determining
buffer level.

BUG=chromium:432035
TEST=None

Change-Id: Id13a35a04363629c53d324f850029cf9e9398852
Reviewed-on: https://chromium-review.googlesource.com/228974
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
CRAS: audio_thread - Removed unused err code

The error codes haven't been used since the audio thread refactoring.

[dgreid - remove 'ERROR_OTHER' as well and add commit message]

BUG=chromium:432425
TEST=None

Change-Id: I51f5862339f09fd681ca045ac645a8c957381bfb
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/229261
CRAS: audio_thread - Disconnect stream when append error

When append a stream to active device fails, the cause could
be at unsupported stream format or device init error. Handle
them differently by remove the stream or the active device.

[dgreid - remove error codes and move check for fallback_dev to
withing rm_active_adev]

BUG=chromium:432425
TEST=Open the url contains 8-channel audio and Youtube, verify
that audio from Youtube can still be heard

Change-Id: I52daaa918fa83bfb288b96b9f2214007a8171656
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/229241
CRAS: fmt_conv - Add a default channel copy function

Adds a default channel conversion that copies a little of each
channel to all of the output channels.  It divides the input signal by
the number of channels and adds each input channel.  All output
channels play the same thing.  This is slow, and attenuates the signal
heavily, but it is better than dropping it.  It will only be used when
no better converter is found.

BUG=chromium:432425
TEST=play 8 channel test file from iis.fraunhofer.de

Change-Id: I6ada1281ae8b957f3a7d66d4c827d4eae9542e99
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/229730
CRAS: audio_thread - log delay in fetch

This will help debug issues with A/V sync.

BUG=none
TEST=cras_test_client --dump_a | grep 'FETCH_STREAM:'

Change-Id: I84e29fed677968638e456af3d0b4d3cdab443b77
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/227283
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
UCM config: Samus: add auto channel swap on headphone plug/unplug

The speaker amps expect left channel data on rising edges of the
PDM clock, but the codec outputs left channel data on the falling
edges by default. To workaround the issue, this patch keeps the
channels flipped when there is no headphone, and swaps the channels
back to normal when headphone is plugged in.

BUG=chrome-os-partner:32809
TEST=left and right channel testing on headphones and speakers

Change-Id: I5fc6d6876563afb78712a8795f75cc0fa0f505fd
Signed-off-by: Ben Zhang <benzh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/231077
Reviewed-by: Anatol Pomazau <anatol@google.com>