chromiumos/third_party/adhd.git
12 months agoCRAS a2dp: Add err log for a2dp failures 26/66326/3 master
Hsin-Yu Chao [Tue, 20 Aug 2013 07:37:33 +0000 (15:37 +0800)]
CRAS a2dp: Add err log for a2dp failures

Add error log for transport release and acquire failure.
This will help debug on future report for a2dp device unexpected
disconnection.  Also fixed license header.

BUG=chromium:246433
TEST=None

Change-Id: Ibce9ebbca4f6846796ccd283bee6c4db56d0a69d
Reviewed-on: https://gerrit.chromium.org/gerrit/66326
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>

12 months agoMario UCM: Disable auto-mute and add AutoUnplugInputNode flag 84/66184/2
Hsin-Yu Chao [Mon, 19 Aug 2013 06:02:19 +0000 (14:02 +0800)]
Mario UCM: Disable auto-mute and add AutoUnplugInputNode flag

Remove 'PCM Playback Volume' control which does not exist.
Disable auto-mute to let Chrome will select the output device.
Also turn on AutoUnplugInputNode flag to display only the
active input device on UI.

BUG=chromium:267355
TEST=Manual test on x86-mario, gmerge adhd; select
output device in Chrome UI

Change-Id: I36d96fde5a3cfa285a2224743cff3817d80a59fa
Reviewed-on: https://gerrit.chromium.org/gerrit/66184
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>

12 months agoCRAS: Add dsp config for Falco. 02/66902/2
Dylan Reid [Sat, 24 Aug 2013 01:58:12 +0000 (18:58 -0700)]
CRAS: Add dsp config for Falco.

Provided by the vendor.

BUG=chrome-os-partner:21943
TEST=manual, listen to youtube.

Change-Id: Ib21540354cfce3ec11539d9fccddcd5043cc0107
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/66902
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
Commit-Queue: Chih-Chung Chang <chihchung@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
13 months agoCRAS BT: Remove HFP_AG profile 98/66798/2
Hsin-Yu Chao [Fri, 23 Aug 2013 05:29:33 +0000 (13:29 +0800)]
CRAS BT: Remove HFP_AG profile

Don't register HFP profile for now.
Will add it back when we're ready for it.

BUG=chromium:232315
TEST=Unittest

Change-Id: If66b4fe16da58e2cd2c5dab15cc3c1f0ba3b1fc5
Reviewed-on: https://gerrit.chromium.org/gerrit/66798
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
13 months agoCRAS: dbus - remove unused header. 55/66155/2
Dylan Reid [Sat, 17 Aug 2013 02:23:37 +0000 (19:23 -0700)]
CRAS: dbus - remove unused header.

cras_dbus doesn't use timerfd anymore.

Change-Id: I0d0d30905f1d26ad72cad047262d409fadf62b59
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/66155
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
13 months agoCRAS: alsa_jack - remove unused header. 52/66152/2
Dylan Reid [Sat, 17 Aug 2013 02:15:37 +0000 (19:15 -0700)]
CRAS: alsa_jack - remove unused header.

libudev isn't used in this file.

Change-Id: I8bd50cba5cf3e1dd05001dfd30e9e05568dde950
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/66152
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
13 months agoCRAS: bt_profile - remove flaky test. 71/66671/2
Dylan Reid [Thu, 22 Aug 2013 17:07:54 +0000 (10:07 -0700)]
CRAS: bt_profile - remove flaky test.

Remove this test because it causes timeouts and is testing code that
doesn't run yet.  Bug to fix the test is 277645.

BUG=chromium:277645
TEST=run adhd unit tests.

Change-Id: I79e673a1bb038b50fb83b5fc14e12e9fc98bf1f9
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/66671
Reviewed-by: Ronald G. Minnich <rminnich@chromium.org>
Commit-Queue: Ronald G. Minnich <rminnich@chromium.org>
Tested-by: Ronald G. Minnich <rminnich@chromium.org>
13 months agoCRAS: Add per-node volume/gain in cras_test_client output. 22/66322/2
Chih-Chung Chang [Tue, 20 Aug 2013 07:18:04 +0000 (15:18 +0800)]
CRAS: Add per-node volume/gain in cras_test_client output.

BUG=chromium:273872
TEST=run "cras_test_client --dump_s" on stout

Change-Id: Ic9a65abcc579512b7d0df27ec9ddfe29c16b7167
Reviewed-on: https://gerrit.chromium.org/gerrit/66322
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Chih-Chung Chang <chihchung@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
13 months agoCRAS HFP: Add cras_hfp_info 18/59418/14
Hsin-Yu Chao [Thu, 27 Jun 2013 02:04:44 +0000 (10:04 +0800)]
CRAS HFP: Add cras_hfp_info

Create the sekeleton of hfp_info and unittest.
A hfp_info will have at most one output device and
one input device attach to it, the add & rm iodev
calls will be used for HFP device open and close.

BUG=chromium:232315
TEST=Unittest

Change-Id: Ic26069d80fbe90a0fc0f101263e4fa9af040ee8a
Reviewed-on: https://gerrit.chromium.org/gerrit/59418
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>

13 months agoCRAS BT: Add HFP AG profile 06/59206/13
Hsin-Yu Chao [Thu, 16 May 2013 12:00:03 +0000 (20:00 +0800)]
CRAS BT: Add HFP AG profile

Creates the profile instance for HFP AG (Headset gateway).
This change registers callbacks to bluez for bluetooth
devices supporrts HFP_AG_UUID.  More implementation will
be add later.

BUG=chromium:232315
TEST="emerge-link adhd". Add syslog to each profile callback,
connect and disconnect bluetooth headset to link to verify
each call is triggered.

Change-Id: Ie7528d55a1de32fcfa4092fcf2a201cfd9dc1724
Reviewed-on: https://gerrit.chromium.org/gerrit/59206
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>

13 months agoCRAS BT: use cras_bt_transport in bt_profile 11/62811/7
Hsin-Yu Chao [Fri, 19 Jul 2013 08:05:08 +0000 (16:05 +0800)]
CRAS BT: use cras_bt_transport in bt_profile

Use cras_bt_transport to carry the necessary information
for cras_iodev creation in bt profile connection/disconnection.

BUG=chromium:232315
TEST=Unittest

Change-Id: Ic8ce2d41824dda5e36d17cf75724faa601256eaa
Reviewed-on: https://gerrit.chromium.org/gerrit/62811
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>

13 months agoCRAS BT: Hook profile register/remove to bt manager 11/59211/13
Hsin-Yu Chao [Wed, 5 Jun 2013 04:54:16 +0000 (12:54 +0800)]
CRAS BT: Hook profile register/remove to bt manager

Hook profile register/remove calls to cras_bt_mangager.

BUG=chromium:232315
TEST=emerge-link adhd

Change-Id: If5028cd17fb0088f2f5ecdf4bfdb3cf3c0124d06
Reviewed-on: https://gerrit.chromium.org/gerrit/59211
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>

13 months agoCRAS BT: Add cras_bt_profile 04/59204/12
Hsin-Yu Chao [Wed, 15 May 2013 13:49:32 +0000 (21:49 +0800)]
CRAS BT: Add cras_bt_profile

A cras_bt_profile structure represents an external profile
of bluez in CRAS. It registers the callbacks to bluez for
events like device connection, disconnection by matching
supported UUID. Will be used for HFP support.

BUG=chromium:232315
TEST="emerge-link adhd" and unittest.

Change-Id: I8920fe8c6db5e7f5db266776c2ea133a61cf8b4b
Reviewed-on: https://gerrit.chromium.org/gerrit/59204
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>

13 months agoUnittest: Fix uninitialized variable warning 99/66199/2
Hsin-Yu Chao [Mon, 19 Aug 2013 15:16:48 +0000 (23:16 +0800)]
Unittest: Fix uninitialized variable warning

Warning occurs in unittest stage of build bot.
Initialize variable to NULL to silence the warning.

BUG=None
TEST=None

Change-Id: I23208f77c1f4a262dbe95488aba51d7d391a6ffb
Reviewed-on: https://gerrit.chromium.org/gerrit/66199
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>

13 months agoCRAS: audio_thread - fix compiler warning. 51/66151/2
Dylan Reid [Sat, 17 Aug 2013 01:28:43 +0000 (18:28 -0700)]
CRAS: audio_thread - fix compiler warning.

Function doesn't return, make it void.

Change-Id: Id2e5f69872e04ccd5ffae34cc5ce0ca9b671e81c
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/66151
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
13 months agoCRAS BT: modify dbus_test framework 10/62810/6
Hsin-Yu Chao [Mon, 22 Jul 2013 03:43:43 +0000 (11:43 +0800)]
CRAS BT: modify dbus_test framework

Add CreateMessageCall and WithUnixFd support to dbus_test.

BUG=chromium:232315
TEST=None

Change-Id: I0d6e01229741ab9316c7a0fe3f84b1a51c6de4e6
Reviewed-on: https://gerrit.chromium.org/gerrit/62810
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
13 months agoAlex: Disable auto-mute and add AutoUnplugInputNode flag 94/66094/2
Hsin-Yu Chao [Fri, 16 Aug 2013 17:02:08 +0000 (01:02 +0800)]
Alex: Disable auto-mute and add AutoUnplugInputNode flag

Chrome will select the output device now. Also turn on
AutoUnplugInputNode flag to display only the active input
device on UI.

BUG=chromium:267355
TEST=Manual test on x86-alex, gmerge adhd; select
output device in Chrome UI

Change-Id: I6d4b1aa4aa059c6d9e2ec5ce10fca43388b2b03b
Reviewed-on: https://gerrit.chromium.org/gerrit/66094
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
13 months agoZGB: Disable auto-mute and add AutoUnplugInputNode flag 71/65571/8
Hsin-Yu Chao [Mon, 12 Aug 2013 06:36:13 +0000 (14:36 +0800)]
ZGB: Disable auto-mute and add AutoUnplugInputNode flag

Chrome will select the output device now. Also turn on
AutoUnplugInputNode flag to display only the active input
device on UI.

BUG=chromium:267355
TEST=gmerge adhd; select output device in Chrome UI.

Change-Id: Ic60070a44bd50ce1cc01b2f5622b9b397964f21d
Reviewed-on: https://gerrit.chromium.org/gerrit/65571
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>

13 months agoCRAS flags: Add AutoUnplugInputNode flag 69/65569/8
Hsin-Yu Chao [Wed, 7 Aug 2013 11:45:02 +0000 (19:45 +0800)]
CRAS flags: Add AutoUnplugInputNode flag

When AutoUnplugInputNode flag is set in UCM, at the time a mic
jack is plugged/unplgged, internal mic will be set to
unplgged/plugged.

This is a work around for the audio device selection UI
to have reasonable behavior on platforms that we cannot
suppress auto-mic.

What user will observe is that the input device is auto-selected
and only the active one is displayed on UI.

BUG=chromium:267355
TEST=Manual set 'AutoUnplugInputNode' flag to true on ZGB,
plug and unplug mic jack.

Change-Id: Ia2402ce26e5a2673511cc651b2444bd9dcff4c32
Reviewed-on: https://gerrit.chromium.org/gerrit/65569
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>

13 months agoCRAS UCM: Enable flag be added in UCM config 83/65583/5
Hsin-Yu Chao [Mon, 12 Aug 2013 12:22:41 +0000 (20:22 +0800)]
CRAS UCM: Enable flag be added in UCM config

Parse flag name specified in verb section of UCM config.
This will enable turning on/off a feature per platform.

BUG=chromium:267355
TEST=Unittest

Change-Id: Id04bfe5c4f94e62a11b88131d51c44d230ea4601
Reviewed-on: https://gerrit.chromium.org/gerrit/65583
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>

13 months agoCRAS: If we know there is no internal mic, don't add an output node for it. 88/65688/3
Chih-Chung Chang [Tue, 13 Aug 2013 06:13:42 +0000 (14:13 +0800)]
CRAS: If we know there is no internal mic, don't add an output node for it.

On newer kernels we can know if there is an internal mic by checking if
the jack named "Internal Mic Phantom Jack" exists.

BUG=chromium:270292
TEST=make check. run on stumpy and there is no output node for internal mic,
but on lumpy there is.

Change-Id: I62fb7b7e0c4bc10fba8b1221d957b4bb6312206a
Reviewed-on: https://gerrit.chromium.org/gerrit/65688
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Chih-Chung Chang <chihchung@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
13 months agoCRAS: audio_thread - Get delay from possibly_*_audio. 24/65724/2
Dylan Reid [Tue, 6 Aug 2013 03:26:40 +0000 (20:26 -0700)]
CRAS: audio_thread - Get delay from possibly_*_audio.

Getting the delay from within the read/fill function will allow for
the delay to be different for different devices.

BUG=chromium:272327
TEST=manual, hangout on pixel, check for echo.

Change-Id: I2d3ae752903815d341de4b0ea967dc38ade7946a
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/65724
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
13 months agoadhd: fix a heap-use-after-free problem in testing. 31/65731/2
Yunlian Jiang [Tue, 13 Aug 2013 20:04:45 +0000 (13:04 -0700)]
adhd: fix a heap-use-after-free problem in testing.

BUG=chromium:272407
TEST=test passes with asan.

Change-Id: Ibf0c3eef677d0a0d55c3f74d7fe99a69eb54e62b
Reviewed-on: https://gerrit.chromium.org/gerrit/65731
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Yunlian Jiang <yunlian@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
13 months agoCRAS: Move mute/softvol to after loopback. 01/65001/5
Dylan Reid [Wed, 7 Aug 2013 21:00:21 +0000 (14:00 -0700)]
CRAS: Move mute/softvol to after loopback.

Moving the zeroing of the mix buffer and the application of the
system/node software volume to after the streams are mixed
accomplishes two things:  It allows the loopback stream to play even
if the system is muted, and ensures that the dsp sees full scale
samples for processing.

BUG=chromium:266547
TEST=capture loopback while the system is muted and make sure there is
audio. Use software volume to adjust HDMI output.

Change-Id: I9aa52bfae52b43bc64524947b47b278cacf06b1d
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/65001

13 months agoCRAS: alsa_io - When bounding buffer level account for extra. 33/65233/2
Dylan Reid [Thu, 8 Aug 2013 20:59:58 +0000 (13:59 -0700)]
CRAS: alsa_io - When bounding buffer level account for extra.

If a device has a min_buffer_level set, this number of frames are
added to the used_size.  The new check for avail_frames omitted this,
causing USB devices to always think they were out of data.

BUG=chromium:270210
TEST=play youtube, attach USB headset, still works.

Change-Id: I0b7f5dee4f228f6a6468565280a90eb213ad78a7
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/65233
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
13 months agopit enabe dc blocking and set adc volume. 35/65235/2
Dylan Reid [Thu, 8 Aug 2013 21:30:06 +0000 (14:30 -0700)]
pit enabe dc blocking and set adc volume.

This change was provided by the vendor.

BUG=chrome-os-partner:21572
TEST=play/record audio on pit

Change-Id: Ib34855865e99b90adfab523a8d863681184bd01c
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/65235
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
13 months agoCRAS: Remove old references to outdated functions. 56/65256/2
Adrian Li [Thu, 8 Aug 2013 23:14:32 +0000 (16:14 -0700)]
CRAS: Remove old references to outdated functions.

Remove some old functions which are no longer referenced anywhere.

BUG=None
TEST=All CRAS unit tests pass.

Change-Id: I1ec69134e9757e746fad28b4817c20349f0983b4
Reviewed-on: https://gerrit.chromium.org/gerrit/65256
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Adrian Li <alhli@chromium.org>
Reviewed-by: Adrian Li <alhli@chromium.org>
Tested-by: Adrian Li <alhli@chromium.org>
13 months agoauto mute/mic for falco. 68/65068/3
Dylan Reid [Thu, 8 Aug 2013 00:30:20 +0000 (17:30 -0700)]
auto mute/mic for falco.

Similar to Peppy, with one name change and no DSP yet.

BUG=chrome-os-partner:21692
TEST=Use UI to toggle mic and headphones.

Change-Id: I3be0ef92d15fe7f59ddf97aaff103bbf509218bb
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/65068

13 months agoCRAS: cras_rclient - Init vol/cap gain by node instead of directly. 29/65029/3
Adrian Li [Wed, 7 Aug 2013 21:08:24 +0000 (14:08 -0700)]
CRAS: cras_rclient - Init vol/cap gain by node instead of directly.

The volume/capture gain needs to be initialized explicitly when a
stream is first added to the audio thread. Previously this was done by
a direct call to iodev->set_volume/set_capture_gain. Here we instead
set the volume/capture gain of the active node, which in addition to
calling iodev->set_volume/set_capture_gain, also runs the
volume/capture gain notifications and callbacks (which in particular
also now sets the software volume).

BUG=chromium:264890
TEST=Ran gmerge adhd, verified that speaker/headphones still
initialize volume correctly. Ran unit tests, all pass.

Change-Id: Ibb40962c29222ce9c3ca8e9a7fb2805b55954464
Reviewed-on: https://gerrit.chromium.org/gerrit/65029
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Adrian Li <alhli@chromium.org>
Reviewed-by: Adrian Li <alhli@chromium.org>
Tested-by: Adrian Li <alhli@chromium.org>
13 months agoCRAS: Separate software volume scaling from controls. 21/64821/3
Adrian Li [Wed, 31 Jul 2013 22:27:59 +0000 (15:27 -0700)]
CRAS: Separate software volume scaling from controls.

This makes software volume scaling independent of the control
thread. A single float value is stored by the audio thread which (if
required) is used to scale audio samples in write_streams.

The three situations in which the software volume needs to be set
include:
  1. System volume changes
  2. Node volume changes
  3. Stream opens for the first time

BUG=chromium:264890
TEST=Ran unit tests, all tests pass.

Change-Id: I975665e701c751eaf55820747938178e42245d15
Reviewed-on: https://gerrit.chromium.org/gerrit/64821
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Adrian Li <alhli@chromium.org>
Reviewed-by: Adrian Li <alhli@chromium.org>
Tested-by: Adrian Li <alhli@chromium.org>
13 months agoCRAS: cras_test_client - Wake up file IO loop when stream terminates. 54/64854/4
Adrian Li [Wed, 7 Aug 2013 00:23:22 +0000 (17:23 -0700)]
CRAS: cras_test_client - Wake up file IO loop when stream terminates.

When running a stream (playback/capture/loopback), cras_test_client
loops every second in order to print latency and RMS values. Currently
the thread only wakes when a key command is sent to stdout, but not
when the stream terminates. This means that if no key commands are
sent, streams can only have a duration in multiples of the sleep time.

For measuring the RMS in a loopback stream, we wish to observe the
stream for a much shorter duration (say ~10 ms). The thread must
therefore be woken up at the correct time in order to terminate it.

BUG=chromium:257154, chromium:215328
TEST=Ran cras_test_client for playback, capture and loopback
streams. Durations have much finer resolution as expected. Key
commands still work.

Change-Id: I9368fc6ea9d8d64f1ea859fb03f616c85d64f9cf
Reviewed-on: https://gerrit.chromium.org/gerrit/64854
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Adrian Li <alhli@chromium.org>
Reviewed-by: Adrian Li <alhli@chromium.org>
Tested-by: Adrian Li <alhli@chromium.org>
13 months agoPeppy auto mute/mic change. 76/64876/2
Dylan Reid [Tue, 6 Aug 2013 04:28:59 +0000 (21:28 -0700)]
Peppy auto mute/mic change.

Turn off auto mic/mute and allow the UI to control.

Also set Internal Mic Boost to 0 as other values seem to mute (needs
to be investigated).

BUG=chrome-os-partner:21568
TEST=Switch Peppy audio to/from headset and HDMI

Change-Id: I3f7fdf899ac7e6e609fc4a627812989dcc026c82
Reviewed-on: https://gerrit.chromium.org/gerrit/64876
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Dylan Reid <dgreid@chromium.org>

13 months agoCRAS: loopback - Allow zeros to be added. 56/64856/4
Dylan Reid [Wed, 7 Aug 2013 00:28:09 +0000 (17:28 -0700)]
CRAS: loopback - Allow zeros to be added.

Instead of poling into the shm area of the stream from two different
places (one was broken), allow add_audio to be told to zero the buffer
instead of copying from the passed pointer.  This fixes the issue of
the loopback clicking after all output streams are closed.

BUG=chromium:266136
TEST=Play to ChromeCast, stop stream listen to silence.

Change-Id: Ieef49c5393cf24f2850af200362920da1b055d32
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/64856

13 months agoCRAS: audio_thread - Reattach streams when loopback format is set. 55/64855/3
Dylan Reid [Wed, 7 Aug 2013 00:12:40 +0000 (17:12 -0700)]
CRAS: audio_thread - Reattach streams when loopback format is set.

When the format of the loopback device is changed, tell loopback
clients to re-attach so that the format converter will be configured
properly.

BUG=chromium:266136
TEST=Cast to TV, listen to audio. Change formats, listen again.

Change-Id: Ia3a3961f94b00a58c15fb7ac0db65a615ff8bdd7
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/64855
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
13 months agoCRAS: audio_thread - Remove volume/capture gain init from open_dev. 75/64675/4
Adrian Li [Mon, 5 Aug 2013 17:43:46 +0000 (10:43 -0700)]
CRAS: audio_thread - Remove volume/capture gain init from open_dev.

The ALSA open_dev calls init_device_settings which either sets volume
and volume limits (for output devices), or capture gain and capture
gain limits (for input devices).

Because the volume and capture gain are controls specific to each
device node, we wish to separate them from any audio processing that
occurs on the audio thread (including open_dev). This is necessary if
we wish to later on decouple the audio thread from the device
list/server.

First we remove init_device_settings from open_dev. This will mean
that the volume/capture gain is not reset correctly if a stream is
opened on a previously closed device (this is when open_dev is
normally called).

However, by moving the volume/capture gain calls to cras_rclient
whenever the client connects to a new stream, the volume/capture gain
will still be reset correctly in the above scenario.

Therefore in practice, the user experience should be consistent with
before.

The ALSA unit test has been updated to reflect this change. The
rclient unit test has been updated because of segmentation faults
(bogus calls to set_volume and set_capture_gain).

BUG=chromium:264890
TEST=Ran gmerge adhd and tested opening streams, plugging in
headphones and changing volume. Top-level behaviour is still
consistent.

Change-Id: I9f22b1f55c8fb59bfa516af3d6b8bfb6fa4b8177
Reviewed-on: https://gerrit.chromium.org/gerrit/64675
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Adrian Li <alhli@chromium.org>
Reviewed-by: Adrian Li <alhli@chromium.org>
Tested-by: Adrian Li <alhli@chromium.org>
13 months agoCRAS: alsa_io_unit_test - Set curve pointer to NULL after freeing. 85/64785/2 stabilize-4512.B
Adrian Li [Tue, 6 Aug 2013 17:11:04 +0000 (10:11 -0700)]
CRAS: alsa_io_unit_test - Set curve pointer to NULL after freeing.

The fake_curve pointer needs to be set to NULL after freeing it;
otherwise the null checks in set_alsa_volume can still pass, and a
segmentation fault can occur when calling fake_curve->get_dBFS.

BUG=chromium:264890
TEST=Ran unit tests, all tests still pass.

Change-Id: Ib2bc141854b4ddf3f13166c993146107cfffc70c
Reviewed-on: https://gerrit.chromium.org/gerrit/64785
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Adrian Li <alhli@chromium.org>
Commit-Queue: Adrian Li <alhli@chromium.org>
Reviewed-by: Adrian Li <alhli@chromium.org>
13 months agoButterfly: Disable auto-mute and auto-mic 13/64313/3
Hsin-Yu Chao [Fri, 2 Aug 2013 06:05:05 +0000 (14:05 +0800)]
Butterfly: Disable auto-mute and auto-mic

Let Chrome does the switch.
Also removed two *Mic Capture Volume controls, since they
don't exist and non-exist mixer control causes a NULL
ucm be created thus breaks plug/unplug event.

BUG=chromium:266098
TEST=Manual select input/output device on Chrome UI.

Change-Id: I2180f09f731ab768ed54c5a92fd4f501598d4011
Reviewed-on: https://gerrit.chromium.org/gerrit/64313
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
13 months agoCRAS: Add UCM and DSP config for Peppy. 47/64747/4
Chih-Chung Chang [Tue, 6 Aug 2013 03:05:04 +0000 (11:05 +0800)]
CRAS: Add UCM and DSP config for Peppy.

BUG=chrome-os-partner:19752
TEST=run on peppy, remove and add dsp.ini and check the audio output difference
Change-Id: I484f8fbaef26b8894867cceab5ffef89eba4ec5b
Reviewed-on: https://gerrit.chromium.org/gerrit/64747
Commit-Queue: Chih-Chung Chang <chihchung@chromium.org>
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
13 months agoCRAS: Increase max number of ports to 128. 48/64748/3
Chih-Chung Chang [Tue, 6 Aug 2013 04:26:39 +0000 (12:26 +0800)]
CRAS: Increase max number of ports to 128.

When 8 eq are used for both channels, we need 4+8*2*4=68 ports.

BUG=none
TEST=make check

Change-Id: I0f8f615b0f30626932775b54507c32726e0cd761
Reviewed-on: https://gerrit.chromium.org/gerrit/64748
Commit-Queue: Chih-Chung Chang <chihchung@chromium.org>
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
13 months agoUCM: spring - Use Headphone and Speaker switches. 47/64347/2
Dylan Reid [Fri, 2 Aug 2013 18:13:28 +0000 (11:13 -0700)]
UCM: spring - Use Headphone and Speaker switches.

Instead of poking in the mixer (and not turning off the other device),
use the provided switches for HP/Speaker.

Change-Id: I1790164544b2c6a0fe2ed5578070851bbb661ee4
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/64347
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
13 months agoUCM: spring - Don't enable the EQ. 46/64346/2
Dylan Reid [Fri, 2 Aug 2013 18:10:58 +0000 (11:10 -0700)]
UCM: spring - Don't enable the EQ.

The software EQ has been running successfully on Spring, no need to
enable the Codec EQ.

BUG=none
TEST=plug/unplug headphones on spring.

Change-Id: I3e521e3c2028f245d92d741855fdf69fe4ce07a4
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/64346
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
13 months agospring: Fix bottom of volume curve. 39/64339/3
Dylan Reid [Fri, 2 Aug 2013 17:24:25 +0000 (10:24 -0700)]
spring: Fix bottom of volume curve.

The bottom of the curve was off by 1, the 4dB steps start at 43, not
at 46.

BUG=chromium-os:39914
TEST=adjust volume with headphones on Spring.

Change-Id: I5e991ce99821d28183fa04f513e77ce219e659aa
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/64339
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
13 months agoStout: disable auto-mute and auto-mic 58/64158/2
Hsin-Yu Chao [Wed, 31 Jul 2013 07:16:40 +0000 (15:16 +0800)]
Stout: disable auto-mute and auto-mic

Let Chrome does the switch.

BUG=chromium:266098
TEST=Manual select intput & output device in Chrome UI.

Change-Id: I77e970cb52d939694e57bf2f7aa11577d9e7f777
Reviewed-on: https://gerrit.chromium.org/gerrit/64158
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
13 months agoCRAS: audio_thread - Correct capture timestamp if buffer split. 73/63873/2
Dylan Reid [Wed, 31 Jul 2013 03:47:56 +0000 (20:47 -0700)]
CRAS: audio_thread - Correct capture timestamp if buffer split.

The capture timestamp should be for the first sample in the shared
memory buffer.  Avoid resetting it if the buffer is filled across two
wake ups by checking if there are already samples queued.

BUG=chromium:265873
TEST=hangout on pixel and check remote end for echo.

Change-Id: I8a800defbe2503c24bcc53e68b2ae381ef090681
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63873
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
13 months agoCRAS: Modify dev_running callback 01/63601/3
Hsin-Yu Chao [Mon, 29 Jul 2013 11:57:16 +0000 (19:57 +0800)]
CRAS: Modify dev_running callback

Modify the logic of dev_running() to:
Return 1 when device is still running (playback or
capture), return 0 if not.
Also modify audio_thread who calls dev_running and
interprets the return code.

BUG=None
TEST=None

Change-Id: I642e5e51d90e0b394c6fb25f77d92ed031e296ff
Reviewed-on: https://gerrit.chromium.org/gerrit/63601
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
13 months agoCRAS iodev_list: Better remove device from list 68/63468/5
Hsin-Yu Chao [Fri, 26 Jul 2013 10:20:50 +0000 (18:20 +0800)]
CRAS iodev_list: Better remove device from list

When remove device from a list while it's still opened,
this device will stay in list.  A2dp device hits this
problem that the socket is still valid for streaming at the
time when user disconnects it.

Address this problem by changing call order to:
1. cras_iodev_set_active: detaches streams from the active
    device so it will be closed.
2. rm_dev_from_list: actually removes device from list.

BUG=chromium:264336
TEST=Connect bluetooth device, open youtube keep audio playing.
Disconnect device in chrome://settings/bluetooth, see the bluetooth
device name no longer existing in the audio device list.

Change-Id: Ifb1c7c07229bf020431e7acc2420f842789f8036
Reviewed-on: https://gerrit.chromium.org/gerrit/63468
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
13 months agoCRAS A2DP: Properly handle a2dp_write error 67/63467/4
Hsin-Yu Chao [Fri, 26 Jul 2013 10:21:27 +0000 (18:21 +0800)]
CRAS A2DP: Properly handle a2dp_write error

When the a2dp connection is closed, should propagate the error so
that a2dp iodev will be closed.

Before this change, there is a potential bug that the a2dp iodev
can keep running even the connection is closed for whatever reason.
However this bug never get noticed because the iodev itself
always get closed immediately when bluez sends 'ClearConfiguration'
message.

BUG=chromium:264336
TEST=Manually add sleep(20); to the cras_a2dp_suspend() callback.
Connect a2dp device, open youtube to make audio playing, disconnect
a2dp device from UI in chrome://settings/bluetooth.
Before this change, a2dp device can run without problem(but no audio
actually heard) for 20 seconds; after this change applied, a2dp device
will be closed right after device disconnected.

Change-Id: Ifd7c6f22964774277968125e4d53330779efa212
Reviewed-on: https://gerrit.chromium.org/gerrit/63467
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
13 months agoCRAS: test_client - add missing newlines. 41/63741/2 firmware-pit-4482.B
Dylan Reid [Tue, 30 Jul 2013 17:24:41 +0000 (10:24 -0700)]
CRAS: test_client - add missing newlines.

Help output was missing newlines, add them.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Change-Id: Ibbd8a8dee144c59a3a31a10655380f8c0d4634ba
Reviewed-on: https://gerrit.chromium.org/gerrit/63741

13 months agoCRAS: audio_thread - Sleep until input or output needs data. 91/63391/5
Dylan Reid [Thu, 25 Jul 2013 21:05:13 +0000 (14:05 -0700)]
CRAS: audio_thread - Sleep until input or output needs data.

Instead of relying on the input device to drive wake ups, wake up when
the input or output needs data next.  With one audio thread, the two
device may be unrelated and output shouldn't be able to be starved by
input.

chromium:263585
TEST=hangout with USB webcam while playing 44.1 youtube video.

Change-Id: I15fe6c9c942a9002d8bdb54f912ac3fdcd9d5826
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63391

13 months agoCRAS: audio_thread - only pad output buffer for unified streams. 90/63390/5
Dylan Reid [Thu, 25 Jul 2013 21:00:34 +0000 (14:00 -0700)]
CRAS: audio_thread - only pad output buffer for unified streams.

Just because an input device is open doesn't mean that there is a need
to pad the output buffer.  That is only needed for unified streams.
Now that there is only one audio thread in the system and unrelated
input and output devices can be attached to it, padding will cause
unneeded glitches.

BUG=chromium:263585
TEST=manual, play/record/unified on Falco and Link.

Change-Id: I414c18f104ee34c25034b7de341031639ca92cc2
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63390

13 months agoCRAS: alsa_io - limit used frames for output streams. 89/63389/4
Dylan Reid [Thu, 25 Jul 2013 20:55:45 +0000 (13:55 -0700)]
CRAS: alsa_io - limit used frames for output streams.

Limit the number of frames reported as used to the used size.  The
driver was returning an incorrectly large number the first time after
an input device was opened on the same card.

BUG=chromium:263585
TEST=play/record audio on Falco.

Change-Id: Ia82e4e2bc0384c79f5bfef4fa9bfb24be8898f4e
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63389

13 months agoCRAS: audio_thread - request the right number of frames for output. 88/63388/4
Dylan Reid [Thu, 25 Jul 2013 20:43:06 +0000 (13:43 -0700)]
CRAS: audio_thread - request the right number of frames for output.

Unified streams don't request audio from possibly_fill_audio (that
happens with the read).  No need to limit how much is requested of
other streams here anymore.

BUG=chromium:263585
TEST=play/record audio on Falco both normal an unified.

Change-Id: Ia55de296bad8ca6e10987027b3dac00f0b40a6e3
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63388

13 months agoCRAS: audio_thread - track in and out correction frames. 87/63387/3
Dylan Reid [Thu, 25 Jul 2013 20:31:10 +0000 (13:31 -0700)]
CRAS: audio_thread - track in and out correction frames.

In the case that different clocks are used for input and output (USB
mic with headphone output), the sleep correction should be tracked
separately.

BUG=chromium:263585
TEST=hangout with external webcam while playing youtube.

Change-Id: Ia09222174f7c00b5022caedc8992c023dae91be3
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63387

13 months agoCRAS: audio_thread - Check each stream's cb_threshold. 86/63386/3
Dylan Reid [Wed, 24 Jul 2013 00:01:43 +0000 (17:01 -0700)]
CRAS: audio_thread - Check each stream's cb_threshold.

Instead of using the output device's threshold for all attached
streams, check each streams individually.

BUG=chromium:263585
TEST=play multiple audio streams.

Change-Id: I8eb19f41359da4d0bb5811d051d96635e20f1690
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63386

13 months agoEnable DC blocking filter on Spring. 68/63668/2
Dylan Reid [Mon, 29 Jul 2013 23:55:23 +0000 (16:55 -0700)]
Enable DC blocking filter on Spring.

Like Daisy before it, enable the DC blocking filter.  This sets bit 4
in register 0x18.

BUG=chrome-os-partner:21400
TEST=boot spring record wav and check for DC offset with audio editor

Change-Id: Ie0dbe8d4c5e1afb2362d83b254a234780b29759b
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63668
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
13 months agoCRAS A2DP: Use a2dp device's human readable name 51/63451/3
Hsin-Yu Chao [Fri, 26 Jul 2013 04:18:24 +0000 (12:18 +0800)]
CRAS A2DP: Use a2dp device's human readable name

Whenever it's available use device readable name
instead of address as cras iodev's name.
Fixed a bug when update transport property, that
the 'Device' field should be parsed as object path.

BUG=chromium:264336
TEST=Connect bluetooth device. Chrome UI should display
readable name in device list now.

Change-Id: Ic885d5f8b57543b3a602fc871ae6b261f75368a6
Reviewed-on: https://gerrit.chromium.org/gerrit/63451
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
13 months agoCRAS: Make sure dsp handles empty or small-sized input data. 22/63322/2 factory-pit-4471.B
Chih-Chung Chang [Thu, 25 Jul 2013 05:00:00 +0000 (13:00 +0800)]
CRAS: Make sure dsp handles empty or small-sized input data.

The original code crashes because the size of input data is smaller than
one chunk.

BUG=chromium:263919
TEST=add unittest and make check

Change-Id: I6b720a04ef28bd319177f113d99a9f2297ddf9fa
Reviewed-on: https://gerrit.chromium.org/gerrit/63322
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Chih-Chung Chang <chihchung@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
13 months agoParrot disable auto-mute and auto-mic 34/63334/3
Hsin-Yu Chao [Thu, 25 Jul 2013 09:39:16 +0000 (17:39 +0800)]
Parrot disable auto-mute and auto-mic

Let Chrome does the switch. Also needs to remove the
'Auto-Mute' line from ucm file, or the set _verb will
fail since 'Auto-Mute' control doesn't exist anymore.

BUG=chromium:263621
TEST=plug and unplug headphone, select audio device from
chrome UI to verify playback & capture path is correct.

Change-Id: I7ac0328be9761f24a442f1eafeea2d3851294362
Reviewed-on: https://gerrit.chromium.org/gerrit/63334
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
14 months agoCRAS: Set volume/capture gain only for supported iodev 87/63187/3
Hsin-Yu Chao [Wed, 24 Jul 2013 11:10:19 +0000 (19:10 +0800)]
CRAS: Set volume/capture gain only for supported iodev

Bluetooth iodev relies on software volume hence doesn't
implement the set_volume and set_capture_gain callback.
NULL check the callbacks before atually calls it.

BUG=chromium:262227
TEST=emerge-link adhd, connect bluetooth headset successfully.

Change-Id: Ifd3796cb78cc429fe076cdc43da21857feaa8ef1
Reviewed-on: https://gerrit.chromium.org/gerrit/63187
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
14 months agoCRAS: rstream - Stop logging over/under runs. 33/62933/3
Dylan Reid [Tue, 23 Jul 2013 00:16:19 +0000 (17:16 -0700)]
CRAS: rstream - Stop logging over/under runs.

This is not a good way to track this since it is below the default log
level, no one tracks this, and it is almost always zero because Chrome
will zero fill if it fails to decode in time.  It was also causing
asserts from syslog on occasion.

BUG=none
TEST=play streams on Falco.

Change-Id: Iee589d363c20d5b67281a28fdc44039f25307ce8
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62933
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoStumpy disable auto-mute and auto-mic. 12/62312/3 stabilize-4443.B
Dylan Reid [Wed, 17 Jul 2013 01:37:32 +0000 (18:37 -0700)]
Stumpy disable auto-mute and auto-mic.

Only switch from built in to external when told to do so by Chrome.

BUG=chromium:236844
TEST=plug unplug headset while playing/recording audio on Stumpy.

Change-Id: I62d3161bfa1257ec62b32b647b111235b794de9d
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62312
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoCorrect Mic Boost control name for stumpy. 11/62311/2
Dylan Reid [Wed, 17 Jul 2013 01:35:33 +0000 (18:35 -0700)]
Correct Mic Boost control name for stumpy.

A recent backport of 3.10 kernel changes to chromeos-3.8 changed the
name of the boot capture control.  This makes it common with other
non-cirrus codecs, update the ucm config to match.

BUG=none
TEST=check capture volume after booting stumpy.

Change-Id: I35ab9cc5c3ea4d56f2f0fba57c77e0b9d94d1184
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62311
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoLumpy disable auto-mute and auto-mic. 10/62310/2
Dylan Reid [Wed, 17 Jul 2013 00:38:27 +0000 (17:38 -0700)]
Lumpy disable auto-mute and auto-mic.

Only switch from built in to external when told to do so by Chrome.

BUG=chromium:236844
TEST=plug unplug headset while playing/recording audio on Lumpy.

Change-Id: Id2f6eda7f3f2cf3103954c544a2cbd8f0c7706cc
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62310
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoAdd UCM config for Falco. 55/62355/2
Dylan Reid [Wed, 17 Jul 2013 17:05:23 +0000 (10:05 -0700)]
Add UCM config for Falco.

Set non-default mic levels and disable kernel auto muting.

BUG=chromium:236844
TEST=Enable audio UI, toggle between HP/Speakers.  Record with
youtube.com/my_webcam and check that recording levels are audible.

Change-Id: I055f6e94c58afc15f551b6cadffdee5e51eab79e
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62355
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoCRAS: alsa_io - Avoid naming HDMI as internal speaker. 49/62349/2
Dylan Reid [Wed, 17 Jul 2013 16:30:10 +0000 (09:30 -0700)]
CRAS: alsa_io - Avoid naming HDMI as internal speaker.

On falco, the HDMI output is the only device on a separate ALSA card.
When creating a default node for that card, avoid naming it as a
built-in speaker and instead make it an HDMI output.  This gives it
the correct priority and prevents it from being the default output if
it wins the race at startup.

BUG=chrome-os-partner:20980
TEST=list outputs on falco, check there isn't two "internal speaker"
outputs.

Change-Id: If1e7cd4cc95e4c17667f3459a8ed27d00e3de166
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62349
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoCorrect Mic Boost control name for lumpy. 09/62309/2
Dylan Reid [Wed, 17 Jul 2013 00:10:26 +0000 (17:10 -0700)]
Correct Mic Boost control name for lumpy.

A recent backport of 3.10 kernel changes to chromeos-3.8 changed the
name of the boot capture control.  This makes it common with other
non-cirrus codecs, update the ucm config to match.

BUG=none
TEST=check capture volume after booting lumpy.

Change-Id: Ib9959ad88535677aad9bdba2677da7cb9d08f9d9
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62309
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoInstall alsa patch file if it exists. 08/62308/2
Dylan Reid [Wed, 17 Jul 2013 01:26:21 +0000 (18:26 -0700)]
Install alsa patch file if it exists.

If there is an alsa patch file for a board, copy it to /lib/firmware.

BUG=chromium:260974
TEST=gmerge and check that the patch file makes it to /lib/firmware.

Change-Id: I8bfeff801349c315431bdc2e81057d32b53d7bb8
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62308
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoCRAS: Speed up max and abs value calculation of input in DRC. 21/62621/4
Chih-Chung Chang [Fri, 19 Jul 2013 06:11:07 +0000 (14:11 +0800)]
CRAS: Speed up max and abs value calculation of input in DRC.

Apply NEON and SSE. This reduces drc_test run time by 7% on spring and 2% on falco.

BUG=none
TEST=verify there is no difference in drc_test output before and after
change.

Change-Id: I9317316b21a47a340ddeca44000f6deddaa1b0cb
Reviewed-on: https://gerrit.chromium.org/gerrit/62621
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Chih-Chung Chang <chihchung@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoCRAS: Factor out some common calculation in DRC. 20/62620/3
Chih-Chung Chang [Fri, 19 Jul 2013 09:13:04 +0000 (17:13 +0800)]
CRAS: Factor out some common calculation in DRC.

In updating detector_average, if we know the volume gain is capped at 2dB,
the release rate can be pre-calculated.

This reduces drc_test run time by 28% on spring and 24% on falco.

BUG=none
TEST=verify there is no difference in drc_test output before and after
change.

Change-Id: I4cfa392c2df0de38f66fd28885badc42d9a97b65
Reviewed-on: https://gerrit.chromium.org/gerrit/62620
Commit-Queue: Chih-Chung Chang <chihchung@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
14 months agoCRAS: Add more reporting in the cmpraw test tool 49/62449/2
Chih-Chung Chang [Thu, 18 Jul 2013 04:27:57 +0000 (12:27 +0800)]
CRAS: Add more reporting in the cmpraw test tool

Now it also reports the percentage of samples changed.
Also fix a bug that only first half of the samples are compared.

BUG=none
TEST=print out the difference and verify it matches the reported result.

Change-Id: If4ee5fbb85ba59d2150967b4c24644401f76bf44
Reviewed-on: https://gerrit.chromium.org/gerrit/62449
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
Commit-Queue: Chih-Chung Chang <chihchung@chromium.org>

14 months agoCRAS: Replace powf with faster approximation. 34/62334/2
Chih-Chung Chang [Wed, 17 Jul 2013 08:29:59 +0000 (16:29 +0800)]
CRAS: Replace powf with faster approximation.

This reduces run time of drc_test by 10% on spring, 15% on link.

BUG=none
TEST=compare the output of drc_test before and after the change, verify
the difference is small.

Change-Id: I12a280d558313d8cb8744f3f5aa653347f433cfb
Reviewed-on: https://gerrit.chromium.org/gerrit/62334
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
Commit-Queue: Chih-Chung Chang <chihchung@chromium.org>

14 months agoCRAS: Make knee_expf and decibels_to_linear share the same code. 86/62086/3
Chih-Chung Chang [Tue, 16 Jul 2013 05:45:10 +0000 (13:45 +0800)]
CRAS: Make knee_expf and decibels_to_linear share the same code.

Remove similar code and make it slightly more accurate.

BUG=none
TEST=Run drc_test before and after change. Compare with the accurate
result when SLOW_KNEE_EXP is defined.

Change-Id: I041a9ed886b1da346125f0f3c101653cb2734169
Reviewed-on: https://gerrit.chromium.org/gerrit/62086
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
Commit-Queue: Chih-Chung Chang <chihchung@chromium.org>

14 months agoCRAS: Optimize summing DRC processed channels. 85/62085/3
Chih-Chung Chang [Tue, 16 Jul 2013 08:50:38 +0000 (16:50 +0800)]
CRAS: Optimize summing DRC processed channels.

Apply SSE and NEON to make it faster.

BUG=none
TEST=compare the output of drc_test before and after change.
Change-Id: I74d5d43dccd15c73f365013570542ec894b50ce8
Reviewed-on: https://gerrit.chromium.org/gerrit/62085
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
Commit-Queue: Chih-Chung Chang <chihchung@chromium.org>

14 months agoReplace asound.state with UCM init for link. 60/61760/2
Dylan Reid [Wed, 10 Jul 2013 03:02:54 +0000 (20:02 -0700)]
Replace asound.state with UCM init for link.

This replaces the asound.state file with a set of configuration
commands sent by UCM.  This method is less fragile.  The asound.state
file fails whenever a control index changes.  The UCM method will only
fail if a control that is being set is removed.

BUG=258646
TEST=boot link and check controls values.  Repeatedly load this config
with the print for DSP queue overflow enabled and make sure that no
overflow happens.

Change-Id: I9614ff4d6c72f1c0ede048e7c1d7b41336349a6a
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61760
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoReplace asound.state with UCM init for spring. 59/61759/2
Dylan Reid [Fri, 12 Jul 2013 00:40:12 +0000 (17:40 -0700)]
Replace asound.state with UCM init for spring.

This replaces the asound.state file with a set of configuration
commands sent by UCM.  This method is less fragile.  The asound.state
file fails whenever a control index changes.  The UCM method will only
fail if a control that is being set is removed.

Also disable DAC2 in the mixers it isn't used.

BUG=258646
TEST=boot spring and check controls values.

Change-Id: I7bdab0b858b33d29c2e880bd31cfa2c6b3d454c4
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61759
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoReplace asound.state with UCM init for daisy. 58/61758/2
Dylan Reid [Fri, 12 Jul 2013 00:21:40 +0000 (17:21 -0700)]
Replace asound.state with UCM init for daisy.

This replaces the asound.state file with a set of configuration
commands sent by UCM.  This method is less fragile.  The asound.state
file fails whenever a control index changes.  The UCM method will only
fail if a control that is being set is removed.

BUG=258646
TEST=boot daisy and check controls values.

Change-Id: I80ac79d806fea8e3ce782a6a85bb1d1a655ba4a4
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61758
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoReplace asound.state with UCM init for mario. 57/61757/2
Dylan Reid [Thu, 11 Jul 2013 21:38:34 +0000 (14:38 -0700)]
Replace asound.state with UCM init for mario.

This replaces the asound.state file with a set of configuration
commands sent by UCM.  This method is less fragile.  The asound.state
file fails whenever a control index changes.  The UCM method will only
fail if a control that is being set is removed.  This removes setting
some controls that no longer exist.

BUG=258646
TEST=boot mario and check controls values.

Change-Id: I5a4da02e9f94c3ea19a3a863ad887ee9f23dec22
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61757
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoReplace asound.state with UCM init for stout. 56/61756/2
Dylan Reid [Thu, 11 Jul 2013 20:06:47 +0000 (13:06 -0700)]
Replace asound.state with UCM init for stout.

This replaces the asound.state file with a set of configuration
commands sent by UCM.  This method is less fragile.  The asound.state
file fails whenever a control index changes.  The UCM method will only
fail if a control that is being set is removed.

BUG=258646
TEST=boot stout and check controls values.

Change-Id: Iedba97088fdb5725cddcc995c5029a26e9da92b5
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61756
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoReplace asound.state with UCM init for butterfly. 55/61755/2
Dylan Reid [Thu, 11 Jul 2013 00:03:38 +0000 (17:03 -0700)]
Replace asound.state with UCM init for butterfly.

This replaces the asound.state file with a set of configuration
commands sent by UCM.  This method is less fragile.  The asound.state
file fails whenever a control index changes.  The UCM method will only
fail if a control that is being set is removed.  Don't set 'Mic Jack
Mode', it doesn't exist anymore.

BUG=258646
TEST=boot butterfly and check controls values.

Change-Id: Id4901441b6e97af829e3bc9f0d9d1ac1bdbb1ad9
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61755
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoReplace asound.state with UCM init for zgb. 54/61754/2
Dylan Reid [Wed, 10 Jul 2013 23:41:48 +0000 (16:41 -0700)]
Replace asound.state with UCM init for zgb.

This replaces the asound.state file with a set of configuration
commands sent by UCM.  This method is less fragile.  The asound.state
file fails whenever a control index changes.  The UCM method will only
fail if a control that is being set is removed.

BUG=258646
TEST=boot zgb and check controls values.

Change-Id: I3c442692e8acdfc0c8415cefac13bfd0285987d4
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61754
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoReplace asound.state with UCM init for alex. 53/61753/2
Dylan Reid [Wed, 10 Jul 2013 23:23:22 +0000 (16:23 -0700)]
Replace asound.state with UCM init for alex.

This replaces the asound.state file with a set of configuration
commands sent by UCM.  This method is less fragile.  The asound.state
file fails whenever a control index changes.  The UCM method will only
fail if a control that is being set is removed.

BUG=258646
TEST=boot alex and check controls values.

Change-Id: Iaf52dc2b1613d5fbc4f35f6d37af22aae0eca570
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61753
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoReplace asound.state with UCM init for parrot. 52/61752/2
Dylan Reid [Wed, 10 Jul 2013 18:57:32 +0000 (11:57 -0700)]
Replace asound.state with UCM init for parrot.

This replaces the asound.state file with a set of configuration
commands sent by UCM.  This method is less fragile.  The asound.state
file fails whenever a control index changes.  The UCM method will only
fail if a control that is being set is removed.

BUG=258646
TEST=boot parrot and check controls values.

Change-Id: I1f6a1806af89fa0ce3765546b9de600911bf097c
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61752
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoReplace asound.state with UCM init for stumpy. 51/61751/2
Dylan Reid [Wed, 10 Jul 2013 00:08:48 +0000 (17:08 -0700)]
Replace asound.state with UCM init for stumpy.

This replaces the asound.state file with a set of configuration
commands sent by UCM.  This method is less fragile.  The asound.state
file fails whenever a control index changes.  The UCM method will only
fail if a control that is being set is removed.

BUG=258646
TEST=boot stumpy and check controls values.

Change-Id: I19212aec0d11dac8c26e83369f28c64202efb385
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61751
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoReplace asound.state with UCM init for lumpy. 50/61750/2
Dylan Reid [Tue, 9 Jul 2013 22:25:34 +0000 (15:25 -0700)]
Replace asound.state with UCM init for lumpy.

This replaces the asound.state file with a set of configuration
commands sent by UCM.  This method is less fragile.  The asound.state
file fails whenever a control index changes.  The UCM method will only
fail if a control that is being set is removed.

BUG=258646
TEST=boot lumpy and check controls values.

Change-Id: Ia5f2dfd9e985166e8630c0dcb77acfa0dbd9f12f
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61750
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoRemove audio config for old, dead boards. 49/61749/2
Dylan Reid [Thu, 11 Jul 2013 20:30:44 +0000 (13:30 -0700)]
Remove audio config for old, dead boards.

BUG=none
TEST=none

Change-Id: I5868762161d06b0aee6f8d8f11bb26e5505f4b22
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61749
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoRemove mario64 config. 48/61748/2
Dylan Reid [Wed, 10 Jul 2013 20:31:40 +0000 (13:31 -0700)]
Remove mario64 config.

The board doesn't exist.

Change-Id: Ic7a012bc78f45fefd6987a42ef71d48e76632d84
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61748
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoCRAS: Update dsp config file for spring. 54/61854/4
Chih-Chung Chang [Mon, 15 Jul 2013 05:35:50 +0000 (13:35 +0800)]
CRAS: Update dsp config file for spring.

This adds more DRC and some slight adjustment to the EQ.

BUG=chrome-os-partner:20960
TEST=gmerge adhd, check output of cras_test_client --dump_dsp

Change-Id: I81f420657334d353fbbc93c14684184b2719cd59
Reviewed-on: https://gerrit.chromium.org/gerrit/61854
Commit-Queue: Chih-Chung Chang <chihchung@chromium.org>
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoCRAS: Add NEON and SSE version of dk_compress_output in drc. 57/61657/4
Chih-Chung Chang [Fri, 12 Jul 2013 07:58:23 +0000 (15:58 +0800)]
CRAS: Add NEON and SSE version of dk_compress_output in drc.

This reduces run time of drc_test by 5~6% on spring and link.

BUG=none
TEST=compare drc_test output before and after change.
Change-Id: Ic187fb8495174694f0726a5b21922383db303142
Reviewed-on: https://gerrit.chromium.org/gerrit/61657
Commit-Queue: Chih-Chung Chang <chihchung@chromium.org>
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoCRAS: Tweak the dk_compress_output algorithm. 56/61656/4
Chih-Chung Chang [Fri, 12 Jul 2013 07:57:47 +0000 (15:57 +0800)]
CRAS: Tweak the dk_compress_output algorithm.

So it's easier to apply SIMD later.

BUG=none
TEST=compare the output of drc_test and verify the difference is small.
Change-Id: I1b6df5e46074d35d9b5a8c1a65a605a12b3c30a0
Reviewed-on: https://gerrit.chromium.org/gerrit/61656
Commit-Queue: Chih-Chung Chang <chihchung@chromium.org>
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoCRAS: Optimize dk_process_delay_only using memcpy 55/61655/2
Chih-Chung Chang [Fri, 12 Jul 2013 08:15:54 +0000 (16:15 +0800)]
CRAS: Optimize dk_process_delay_only using memcpy

Instead of copying samples one by one, we use memcpy.

BUG=none
TEST=run drc_test with some channel disabled and compare the outputs.

Change-Id: I008c9cc03ce25c8fe2249401e8df5a541d43c57c
Reviewed-on: https://gerrit.chromium.org/gerrit/61655
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
Commit-Queue: Chih-Chung Chang <chihchung@chromium.org>

14 months agoCRAS: Refactor drc_kernel. 86/61086/8
Chih-Chung Chang [Fri, 5 Jul 2013 08:34:00 +0000 (16:34 +0800)]
CRAS: Refactor drc_kernel.

Split the processing steps into smaller functions, so it is easier to
understand and optimize further.

Also make the size of delay buffer multiples of 32 frames, so we can
process 32 frames at once without worrying about split buffers.

BUG=none
TEST=compare the output of drc_test before and after change.
Change-Id: I93908fa3ec5faff2632e5d6c737a99be149e64e9
Reviewed-on: https://gerrit.chromium.org/gerrit/61086
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
Commit-Queue: Chih-Chung Chang <chihchung@chromium.org>

14 months agoCRAS: Make the size of delay buffer multiples of 32 frames. 54/61654/2
Chih-Chung Chang [Fri, 12 Jul 2013 08:10:16 +0000 (16:10 +0800)]
CRAS: Make the size of delay buffer multiples of 32 frames.

So later we can process 32 frames at once without worrying about split
buffers.

BUG=none
TEST=make check

Change-Id: Ibcdda02d7f40aae160aedab9aff8deb5f78fe0e3
Reviewed-on: https://gerrit.chromium.org/gerrit/61654
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Chih-Chung Chang <chihchung@chromium.org>
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoCRAS: inline rintf function in drc_math. 09/61409/6
Chih-Chung Chang [Wed, 10 Jul 2013 10:31:25 +0000 (18:31 +0800)]
CRAS: inline rintf function in drc_math.

This reduces drc_test run time by 11% on spring.

BUG=none
TEST=compare the output of drc_test before and after change.

Change-Id: I1608bb5ee263d08647d0ff49f04d2315bd20fce9
Reviewed-on: https://gerrit.chromium.org/gerrit/61409
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Chih-Chung Chang <chihchung@chromium.org>
Tested-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoadhd: use EXPECT_STREQ to compare the content of string. 24/61624/2 factory-pit-4390.B firmware-falco_peppy-4389.B firmware-leon-4389.26.B firmware-wolf-4389.24.B
Yunlian Jiang [Thu, 11 Jul 2013 23:56:23 +0000 (16:56 -0700)]
adhd: use EXPECT_STREQ to compare the content of string.

USE EXPECT_STREQ to compare the content of string.
EXPECT_EQ compares the address of two strings.

BUG=None
TEST=FEATURES=test emerge-lumpy adhd passes.

Change-Id: I31a9a949dc066973408f4ca67668edb00abf7b1d
Reviewed-on: https://gerrit.chromium.org/gerrit/61624
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Yunlian Jiang <yunlian@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
14 months agoCRAS: add ucm config for peach pit. 13/61313/6
Dylan Reid [Tue, 9 Jul 2013 01:59:03 +0000 (18:59 -0700)]
CRAS: add ucm config for peach pit.

Basic setup for pit's UCM config.  This gets HP/Speaker and
Internal/Headset mic switching to work.

BUG=chrome-os-partner:20763
TEST=plug/unplug headset while playing and recording audio.

Change-Id: Ibb07ed787f7af8495eec6ec6817559d91a7125dc
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61313
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agopeach_pit: Add volume curve. 94/61094/4
Dylan Reid [Mon, 8 Jul 2013 16:54:22 +0000 (09:54 -0700)]
peach_pit: Add volume curve.

This was curve provided by the vendor, I have not tested it.

BUG=chrome-os-partner:20705
TEST=tested manually by the vendor.

Change-Id: I7d73ec927b33b9e3fb6e04c465ef7dcbffe1c711
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61094
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoCRAS: iodev_list - remove streams before setting active device. 80/61380/2
Dylan Reid [Wed, 10 Jul 2013 02:01:49 +0000 (19:01 -0700)]
CRAS: iodev_list - remove streams before setting active device.

Remove all the streams from the thread before setting the new device.
If the device is set first, then it will be closed instead of the
previous one.

BUG=none
TEST=use test client to switch active output device, make sure correct
device is closed.

Change-Id: Ibd31a5169d7eeb133f9003523ad70dbea7d19961
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61380
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
14 months agoCRAS: test_client - display RMS value (power) in cras_test_client. 26/60926/5
Adrian Li [Tue, 2 Jul 2013 17:28:32 +0000 (10:28 -0700)]
CRAS: test_client - display RMS value (power) in cras_test_client.

Adds two options "--show_rms" and "--show_total_rms" to display the
instantaneous and total RMS (root mean square) values of the
post-mix/pre-DSP audio signal as received by the loopback stream; this
option can also be used on a capture stream. The RMS value is
representative of the signal's power.

The duration of the window over which the total RMS value is
calculated can be specified with the "--duration_seconds" option.

Currently only signed 16-bit integer samples are supported for this
calculation.

Usage:
    --show_rms          Display RMS value of loopback stream.
    --show_total_rms    Display total RMS value of loopback stream at
                        the end.

BUG=chromium:257154, chromium:215328
TEST=Played audio from a file and tested the RMS output of the
loopback stream. Verified that RMS values are consistent after
multiple runs. Other features in cras_test_client (capture_file and
playback_file) are still working.

Change-Id: Ieaaae42f69efc31aa9a720505bca6db273621022
Reviewed-on: https://gerrit.chromium.org/gerrit/60926
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Adrian Li <alhli@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>

14 months agoCRAS: test_client - allow float argument in duration_seconds. 89/61189/2
Adrian Li [Mon, 8 Jul 2013 21:10:19 +0000 (14:10 -0700)]
CRAS: test_client - allow float argument in duration_seconds.

Modifies the --duration_seconds argument to allow a floating point
number as input. Duration of streams can now be in milliseconds rather
than just whole numbers of seconds (useful for measuring loopback RMS
values over shorter periods).

BUG=none
TEST=Tested --duration_seconds argument with both integer and floating
point arguments with --playback_file and --capture_file.

Change-Id: I1b773e3dd279803c3f8b467d7f36946b84f32c57
Reviewed-on: https://gerrit.chromium.org/gerrit/61189
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Adrian Li <alhli@chromium.org>
Commit-Queue: Adrian Li <alhli@chromium.org>

14 months agoCRAS: Revert CRAS_STREAM_DIRECTION enum to fix loopback stream. 06/61106/2
Adrian Li [Mon, 8 Jul 2013 17:34:08 +0000 (10:34 -0700)]
CRAS: Revert CRAS_STREAM_DIRECTION enum to fix loopback stream.

This reverts two commmits:
- CRAS: Fix unit test broken by hack.
  Commit 166817c9704c97706f5bd247a640427e5fbec27c.
- CRAS: hack, don't add to enum until Chrome can be updated.
  Commit 4258f10c689972b0b854a4fbdf01a7bd387fc1ef.

These commits separated CRAS_STREAM_POST_MIX_PRE_DSP from the
CRAS_STREAM_DIRECTION enum because it was previously unhandled by a
switch statement.

Adding CRAS_STREAM_POST_MIX_PRE_DSP back to the enum fixes the
loopback stream.

BUG=chromium:247160
TEST=CRAS builds and loopback stream works.

Change-Id: I91ccb847d13f965d6d38c43aa9652ffe864e958e
Reviewed-on: https://gerrit.chromium.org/gerrit/61106
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Adrian Li <alhli@chromium.org>
Commit-Queue: Adrian Li <alhli@chromium.org>