From b58887d0f7e1c605e81c1a6fa155db1f6356fd1f Mon Sep 17 00:00:00 2001 From: Shiv Maliyappanahalli Date: Wed, 4 Nov 2015 18:10:20 -0800 Subject: hal: Fix device selection at start of the voice call Voice call setup latency value is exceeding 500 msec. It is due to primary output selecting handset instead of voice handset causing the extra delay. Fix this by starting voice usecase first before changing device for primary output. Change-Id: I39ac8186b62d86b2047bf73860e7027d15df7fd2 --- hal/audio_hw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hal/audio_hw.c b/hal/audio_hw.c index a23eb7a8..cc5fd5ad 100644 --- a/hal/audio_hw.c +++ b/hal/audio_hw.c @@ -1779,9 +1779,6 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) if (val != 0) { out->devices = val; - if (!out->standby) - select_devices(adev, out->usecase); - if ((adev->mode == AUDIO_MODE_IN_CALL) && output_drives_call(adev, out)) { adev->current_call_output = out; @@ -1790,6 +1787,9 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) else voice_update_devices_for_all_voice_usecases(adev); } + + if (!out->standby) + select_devices(adev, out->usecase); } if ((adev->mode == AUDIO_MODE_NORMAL) && -- cgit v1.2.3