Add Swanky dsp.ini and volume curve

BUG=chrome-os-partner:27101
TEST=listen to music with the configuration in the system

Change-Id: I51170e0dc4f2ce4edebc2908ce6f7c9e95497eec
Reviewed-on: https://chromium-review.googlesource.com/210414
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Yung Leem <yungleem@chromium.org>
Tested-by: Yung Leem <yungleem@chromium.org>
CRAS: audio_thread - Remove extra output check.

Now that unified streams are removed the extra check for output after
checking stream_uses_output is redundant, get rid of it.

BUG=none
TEST=make check

Change-Id: I97d8e0c1b92ac992a1ae9bd5fb05b16be16b0f70
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/210406
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
CRAS: audio_thread - Only set timestamp when fetching audio.

The timestamp is only used in the audio callback, only set it when the
callback will be invoked.

BUG=none
TEST=make check

Change-Id: I276100fc66812168766ad9cd820f130c0f8c9de8
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/210451
Reviewed-by: Chinyue Chen <chinyue@chromium.org>
CRAS: audio_thread - Fix out-of-date comment.

There has only been one audio thread for a long time.

Change-Id: I99c2c7160f3ece8547c868d51373e15dc4601a7e
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/210452
Reviewed-by: Chinyue Chen <chinyue@chromium.org>
Winky: headphone volume up due to hardware change

Because of adding HP damping resistor(0ohm -> 5.11ohm) at PV2 board,
HP output max level is decreased. (32ohm Load, 360mV)
Our spec is 400 ~ 450mV.
So we need to modify HP volume table.

BUG=chrome-os-partner:30873
TEST=`emerge-winky adhd`
      check headphone volume table.
      check headphone output level.
      dume register and check 0x27, 02c and 0x2d while mp3 file
      is playing.
      i2cdump -f -y 1 0x0010

Change-Id: Iccfff29f51cf245f95a1b910a7fd7f31e8c98a68
Reviewed-on: https://chromium-review.googlesource.com/209992
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.com>
Reviewed-by: Jongpil Jung <jongpil19.jung@samsung.com>
Commit-Queue: Jongpil Jung <jongpil19.jung@samsung.com>
Revert "Revert "CRAS: type - Add node type keyboard mic""

This reverts commit 22896d1fe968133df82539cf5c711e61c72bdb9c.

Chrome 38.0.2109.0 is now able to filter out keyboard mic
device from audio UI. Re-upload the previous commit to add
node type keyboard mic.

BUG=chromium:393908
TEST=cras_test_client --dump_s on Pixel. Manual test on TOT
Chrome, plug in USB devices check there's no keyboard mic
displayed on UI tray.

Change-Id: I9999c7007cbc768cca60d709c017a35650cbcfa9
Reviewed-on: https://chromium-review.googlesource.com/210895
Reviewed-by: Chinyue Chen <chinyue@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
CRAS: audio_thread - move first_dev helpers.

They are needed earlier in the file by a later commit

BUG=none
TEST=unittests

Change-Id: I37196bddc22c9fcf63cd6e01f61183b51697cc5a
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: audio_thread - pre-fill the odev when opening it.

Filling the odev with one cb_threshold of data will prevent the client
from seeing two quick requests when adding the first stream.

BUG=none
TEST=unittest and play audio on Yoshi.

Change-Id: Id98aaaf18164e684ba07185f9ae11e9264a219c0
CRAS: util - Add helper to add timespecs.

BUG=none
TEST=none =(

Change-Id: Idf70a1cc038395dca20de385401525b755d9f79f
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CARS: audio_thread - Keep next callback time per 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 a
callback to a stream.

Change-Id: I210329b320bdd0b9b885ad1d3ce0d50b166083f0
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: audio_thread - set stream draining on error.

If there is an error communicating with a stream, mark is as draining
so it is removed as soon as the audio is used up.

BUG=none
TEST=play audio on Blaze

Change-Id: Ie6d41a7fcdaa74746d9ecd5ee144a2f287b928df
Signed-off-by: Dylan Reid <dgreid@chromium.org>
wip

Change-Id: I90023bfa78e9517a590b60654cd683a0e170a5ef
wip: remove stream waiting, wake when streams write back results.