auron_paine: update audio volume curve

TEST=`emerge-auron_paine adhd` verify file is modified.
BUG=none
Signed-off-by: Pan Sheng-Liang <Sheng-Liang.Pan@quantatw.com>

Change-Id: I5b7c473449f4971d7dde539af6a95be3e00d668a
Reviewed-on: https://chromium-review.googlesource.com/233062
Reviewed-by: Yung Leem <yungleem@chromium.org>
Tested-by: Pan Sheng-Liang <Sheng-Liang.Pan@quantatw.com>
Commit-Queue: Pan Sheng-Liang <Sheng-Liang.Pan@quantatw.com>
CRAS: audio_thread - Don't remove device if it's not in list

This fixes a crash when adding a stream to new adev failed,
and CRAS tried to delete the not yet added dev from active
dev list.

BUG=None
TEST=Apply A2DP HFP switching patch series, verify no crash
when switch happens.

Change-Id: Ia6fa0bc2783f0231a10a48ec7916fd75004d0ca2
Reviewed-on: https://chromium-review.googlesource.com/232895
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
CRAS: bt_profile - Rename some variables

Adjust naming to better reflect what each path string
is representing.

BUG=None
TEST=None

Change-Id: I6949da5818e4d9efcf9aff31f3d6ecfd7bb39503
Reviewed-on: https://chromium-review.googlesource.com/231860
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
CRAS: bt_device - Name bluetooth constants by profile and role

In order to differentiate HSP and HFP devices, name profile and
uuid variables by profile name and role defined in specification.
HFP: handsfree, audio gateway
HSP: headset, audio gateway

BUG=None
TEST=None

Change-Id: I0947a7bd46143c85b91c15238a569ce15b3ac552
Reviewed-on: https://chromium-review.googlesource.com/231861
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
CRAS: hfp_iodev - Fill device readable name

BUG=None
TEST=Enable HFP, connect to a headset. cras_test_client --dump_s

Change-Id: I2608642550a10feba94c28d1f6a39852fb4bb2cd
Reviewed-on: https://chromium-review.googlesource.com/231862
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
CRAS: hfp_slc - Close rfcomm_fd in SLC destructor

This will allow us to not pass in a transport object
to hfp_iodev and slc.

BUG=chromium:432434
TEST=Manual enable HFP, test playback and capture.

Change-Id: I64a3ec419d1962c85061201fedbdb3ff70a523a3
Reviewed-on: https://chromium-review.googlesource.com/231863
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
CRAS: bt_profile - Use bt device to replace transport

The transport object carries information and is used in Bluez's
media API. We borrowed it for the cras_bt_profile module and
it turns out redundant in cases when we want to associate a profile
or HFP related objects with cras_bt_device.
This change refactors the code to better align with Bluez profile
API and will allow the device disconnected event be notified to bt
profiles in a clean way.

BUG=chromium:432434
TEST=Test A2DP playback. Manual enable HFP, test playback & capture.

Change-Id: I2fab0b32965227512ad841bd7df785cd1af4a2ab
Reviewed-on: https://chromium-review.googlesource.com/231864
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
CRAS: hfp_ag_profile - refactor to support multi HFP devs

Refactors hfp_ag profile to support the case that multiple
bluetooth headsets are connected.

BUG=chromium:432434
TEST=Manual enable HFP, connect two bluetooth headsets,
see both headsets appear in the audio devices UI.

Change-Id: I5459db72310a8e65eab2206fe4dabc0e46bc5351
Reviewed-on: https://chromium-review.googlesource.com/231865
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
CRAS: bt_device - Notify profiles when device disconnects

There's case when powering off a bluetooth headset where it doesn't
send RequestDisconnection method so CRAS could think an HFP device
is still connected. Solve this problem by monitoring the device
'connected' attribute change and notifying registerred profiles.

BUG=chromium:432434
TEST=Manual enable HFP, connect to BT headset and then powers off
the headset, see it disappear from audio devices UI.

Change-Id: I5d9cd4c05a08e78fd95746a2c199834264003f6c
Reviewed-on: https://chromium-review.googlesource.com/231866
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
CRAS: Remove unused stream reattach related code.

BUG=None
TEST=make && make test && test on peppy

Change-Id: Ib4d77e2ae2f1356fdb48ac7c73c9ea95ffa3d058
Reviewed-on: https://chromium-review.googlesource.com/233122
Reviewed-by: Chinyue Chen <chinyue@chromium.org>
Commit-Queue: Chinyue Chen <chinyue@chromium.org>
Tested-by: Chinyue Chen <chinyue@chromium.org>
CRAS: client - remove hotword stubs

These were never used. It will now go in a different direction.

Change-Id: Ic371185c75a1306730ecb541c912eb19e009c867
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: client - copy flags to the stream

Any flags passed were being dropped before the stream is created.
This wasn't noticed because no flags were used until now.

Change-Id: I0921d7511e357c521054cebc68a23a60b8f42f96
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: rstream - save flags.

The flags will be used now, save them when creating an rstream.

Change-Id: I2d0b2dc59c1800340c49bd990f9f4d6e7a238de0
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: byte_buffer - add reset funciton.

The test iodev will need this when it returns to the start of a file.

Change-Id: Ied6bf99cb6be1092ac0852b79422b02fb86e0217
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: rstream - rename get_buffer_size to get_buffer_frames

Make the name say what it means.  Do this before adding a user for
this function.

Change-Id: Iaba6fb61373f388d42a01815d1822e9d295b6b87
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: dev_stream - Filter callback time if draining

This removes another rstream dependency from audio_thread and will
allow for other conditions to be used in the future to filter out the
next_cb_ts.

Change-Id: Ie1d19c0398514596c22b79e52ab9ae3d46cd2bce
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: Add test iodev.

To start the test iodev will be used to test hotwording while we wait
for hardware.

Change-Id: I965ff7512ed2e8df8d81f3c7f02ec7f21a08abb7
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: Add interface to add a test_iodev

Plumb a message and argument from the test client to add a test iodev
to the server.  This will be used to add a hotword test device and
fake wake up buffers.

Change-Id: I9fb244297a52faf55e4f1dda853e378e3c401860
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: add flag for hotword stream

Add two flags, one to allow more than a callback threshold of data to
be sent over shm.  The other is to allow a stream's timing to be
driven by an input device.  This will allow for a stream to be
notified when samples are ready even if the input isn't clocked
traditionally, such as hotword devices.

Change-Id: I5938d0e08eb480d80142422d91869e7c7b32c234
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: add test hotword commands

This creates the ability to send a command to a test iodev.  This will
be used to feed hotword data to the hotword test iodev.

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