Merge "hal: allow VOIP standby to enable correct device for subsequent usecases" into audio-userspace.lnx.2.1-dev
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 24a2be8..272d64b 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2340,13 +2340,6 @@
ALOGD("%s: enter: stream (%p) usecase(%d: %s)", __func__,
stream, out->usecase, use_case_table[out->usecase]);
- if (out->usecase == USECASE_COMPRESS_VOIP_CALL) {
- /* Ignore standby in case of voip call because the voip output
- * stream is closed in adev_close_output_stream()
- */
- ALOGD("%s: Ignore Standby in VOIP call", __func__);
- return 0;
- }
lock_output_stream(out);
if (!out->standby) {
@@ -2358,7 +2351,13 @@
pthread_mutex_lock(&adev->lock);
out->standby = true;
- if (!is_offload_usecase(out->usecase)) {
+ if (out->usecase == USECASE_COMPRESS_VOIP_CALL) {
+ voice_extn_compress_voip_close_output_stream(stream);
+ pthread_mutex_unlock(&adev->lock);
+ pthread_mutex_unlock(&out->lock);
+ ALOGD("VOIP output entered standby");
+ return 0;
+ } else if (!is_offload_usecase(out->usecase)) {
if (out->pcm) {
pcm_close(out->pcm);
out->pcm = NULL;
@@ -3230,14 +3229,6 @@
ALOGD("%s: enter: stream (%p) usecase(%d: %s)", __func__,
stream, in->usecase, use_case_table[in->usecase]);
- if (in->usecase == USECASE_COMPRESS_VOIP_CALL) {
- /* Ignore standby in case of voip call because the voip input
- * stream is closed in adev_close_input_stream()
- */
- ALOGV("%s: Ignore Standby in VOIP call", __func__);
- return status;
- }
-
lock_input_stream(in);
if (!in->standby && in->is_st_session) {
ALOGD("%s: sound trigger pcm stop lab", __func__);
@@ -3251,11 +3242,16 @@
pthread_mutex_lock(&adev->lock);
in->standby = true;
- if (in->pcm) {
- pcm_close(in->pcm);
- in->pcm = NULL;
+ if (in->usecase == USECASE_COMPRESS_VOIP_CALL) {
+ voice_extn_compress_voip_close_input_stream(stream);
+ ALOGD("VOIP input entered standby");
+ } else {
+ if (in->pcm) {
+ pcm_close(in->pcm);
+ in->pcm = NULL;
+ }
+ status = stop_input_stream(in);
}
- status = stop_input_stream(in);
pthread_mutex_unlock(&adev->lock);
}
pthread_mutex_unlock(&in->lock);