loopback_latency: Start capture before record

Often the loopback test would miss the audio. Sometimes this was because
the playback thread preempted the main thread and didn't allow capture
to start in time. This happened much more often with buffer sizes < 5ms.

Starting Capture before playback means the real time capture thread will
be started before playback begins, so it always sees the beginning of
the audio burst.

Note that capture and playback callback run in real time, but the main
function is a normal CFS thread.

BUG=none
TEST=this is a test

Change-Id: Ic1b7c4ef3403553b69a7003ccabe8508142dc40c
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/952680
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Louis Collard <louiscollard@chromium.org>
1 file changed
tree: 11410577eefb5f1c360aca4644275058336516a2
  1. include/
  2. src/
  3. Android.mk
  4. common.mk
  5. CPPLINT.cfg
  6. LICENSE
  7. Makefile
  8. README.txt