Add partner microphone test website

BUG=chrome-os-partner:29863
TEST=manually test

Change-Id: I95f6d724d20c11c97735d424759101b8fdf09097
Reviewed-on: https://chromium-review.googlesource.com/205210
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Heng-ruey Hsu <henryhsu@google.com>
Tested-by: Heng-ruey Hsu <henryhsu@google.com>
blaze: Added volume curve

BUG=chrome-os-partner:29707
TEST=none

Change-Id: Ib9cf7ec37f519ff20e8a82813ae05e6c03473e58
Signed-off-by: Benjamin Lu <benjaminl@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/205900
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
CRAS: test_client - Add parsing of output log.

Printing the parsed log directly will make it more useful than a bunch
of numbers that you need to find a decoder ring for.

BUG=none
TEST=cras_test_client --dump_a

Change-Id: I78ae9f81fc3ce2298569b9a0ac5e800125fcfc43
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: audio_thread - Increase audio thread log size to 32k.

This allows more wake cycles to be dumped for debugging.

Change-Id: I75afd1c62e63c162ec5f07760fe276c2f3471393
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: audio_thread - Log stream add/remove.

Log when streams are added or removed to the audio thread.  This will
make it easier to debug timing issues that occur when a stream is
attached.

Change-Id: I30ad6d2b1551b51e4cba2219255cf20e794fae7b
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: audio_thread - Move logging to its own header file.

Move the logging functions to a separate header file so that logging
can be done from outside of audio_thread.c.

BUG=none
TEST=cras_test_client --dump_s

Change-Id: I47dd00bbeb6879ec58ab92c07a2513a9a5e115c2
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: audio_thread - Remove unused args from iodev callback.

The 'ts' and 'polled' arguments aren't needed.  hfp is the only user,
it totally ignores ts and used polled to check if it should run.  Only
call the callbacks when the fd is ready.

BUG=none
TEST=unittests pass.

Change-Id: Ic9413865fca58a2a635d23bda26826662496e733
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: audio_thread - Allow disabling callbacks and write fds

Enable audio_thread callbacks to poll an fd for being ready for a
write.  This will allow the a2dp iodev to check when the bluetooth
socket is ready for more data.

BUG=chromium:244615
TEST=unittest only

Change-Id: I6e01aa8ca8dabf2ed0a5801b90b2dd4dbdd400e6
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: a2dp_info - always set frame_count to one.

frame_count is only useful if packets are being broken up, always set
it to one.  This indicates that this is the last fragment of the
packet, which is true because there is only one fragment.

BUG=chromium:244615
TEST=play audio through jambox.

Change-Id: I04b2e4d18a33b90425a8dcaa2599f647d393ef20
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: sbc - Return on error.

If there is an error from the sbc codec, propagate it.  If it doesn't
totally fill the buffer, keep going and mark what it wrote as written
instead of bailing out.

Change-Id: I1a14d4d6c674da03accb1c2c011dfb31b5cafa92
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: a2dp_iodev - Don't send empty packets.

Don't send a packet just because nothing was processed this time.  If
there isn't data in the buffer there isn't anything to send.

Change-Id: If93a1e2255ef896ed21087331ce99e6d9c7fb1d8
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: a2dpio - Use a more "normal" pcm buffer.

The pcm buffer will work as a circular buffer, there isn't a helper
for this pattern even though it is used everywhere, that can be fixed
later, just open-code another one for now.

This change will make separating the timing of bt socket and the
stream's client easier in a later change.

Change-Id: Ibdae989b6f3cb10c8803e423bf31618ca1eef2f0
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: a2dpio - Write as much of the buffer as possible.

Loop in flush_data to write as much of the pcm buffer as possible.
This will make de-coupling the pcm and a2dp buffer levels easier.

Change-Id: I3a546a343d390e5defa1988e0b2cff55d94be575
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: a2dp_info - make avdtp_write static.

It isn't used outside the c file.

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

Change-Id: I2600be31f037337e844f572a4f6319d38d6fbcaf
TODO - fix uts CRAS: a2dp - Split encode and write operations.

Splitting the two operations will make it possible to drive the writes
based on the state of the output socket instead of the level of the
client stream in a future commit.

Change-Id: I6204a45c8c021356b71f9e3699de1cd3c6b16349
Signed-off-by: Dylan Reid <dgreid@chromium.org>
CRAS: audio_thread - log delay when filling output

Add the delay to the audio thread log.

BUG=none
TEST=cras_test_client --udmp_a

Signed-off-by: Dylan Reid <dgreid@chromium.org>
wip: drive a2dp output from socket writable

Change-Id: I69fdd26b5359df1437a05d88914dfed086ab9b21
only send data near mtu sized chunks

Change-Id: Ia16b559d07d504fb34821aacdf0356f41c09c6d0
sqme

Change-Id: Id4cb0a1856d2be40a019e3cd53198edfd825d1ce