HAL: Restrict calls to ADM for low-latency usecase
Stream must be registered for AUDIO_OUTPUT_FLAG_FAST and AUDIO_INPUT_FLAG_FAST.
The others are not intended to take this path. If all streams are registered,
they wait for focus which leads to underruns.
Change-Id: I7304a09ee9a6f60b10394a2ed206e365e3b8090e
Signed-off-by: Narsinga Rao Chella <nrchella@codeaurora.org>
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index b9ac139..1e1127c 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -3589,7 +3589,8 @@
in->pcm = NULL;
goto error_open;
}
- register_in_stream(in);
+ if (in->flags == AUDIO_INPUT_FLAG_FAST)
+ register_in_stream(in);
if (in->realtime) {
ATRACE_BEGIN("pcm_in_start");
ret = pcm_start(in->pcm);
@@ -4445,7 +4446,8 @@
}
if (ret == 0) {
- register_out_stream(out);
+ if (out->flags == AUDIO_OUTPUT_FLAG_FAST)
+ register_out_stream(out);
if (out->realtime) {
if (out->pcm == NULL || !pcm_is_ready(out->pcm)) {
ALOGE("%s: pcm stream not ready", __func__);