summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMingming Yin <mingming@codeaurora.org>2016-01-22 12:48:44 -0800
committerSteve Kondik <steve@cyngn.com>2016-04-20 09:25:29 -0700
commit2a77bee753fa7b56186c0c4e848d12215b454b53 (patch)
tree4017a17d801c64c67c37d8132f34f354233604b9
parentfa2825bec8612d75e25871bea8c0f01243228179 (diff)
downloadandroid_hardware_qcom_audio-2a77bee753fa7b56186c0c4e848d12215b454b53.tar.gz
android_hardware_qcom_audio-2a77bee753fa7b56186c0c4e848d12215b454b53.tar.bz2
android_hardware_qcom_audio-2a77bee753fa7b56186c0c4e848d12215b454b53.zip
hal: stop sound trigger buffering during close
If the framework doesn't call read before standby and closes the record session, sound trigger buffering will not be stopped and sound trigger hal continue buffering internally. Fix this by stopping buffering during record session close. Change-Id: I83941610b3152f26e5ae9c449dbb8f9846b266a2 CRs-fixed: 966060
-rw-r--r--hal/audio_extn/soundtrigger.c4
-rw-r--r--hal/audio_hw.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/hal/audio_extn/soundtrigger.c b/hal/audio_extn/soundtrigger.c
index b5475a17..c502f66a 100644
--- a/hal/audio_extn/soundtrigger.c
+++ b/hal/audio_extn/soundtrigger.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
+ * Copyright (c) 2013-2014, 2016 The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -161,7 +162,7 @@ void audio_extn_sound_trigger_stop_lab(struct stream_in *in)
struct sound_trigger_info *st_ses_info = NULL;
audio_event_info_t event;
- if (!st_dev || !in)
+ if (!st_dev || !in || !in->is_st_session_active)
return;
pthread_mutex_lock(&st_dev->lock);
@@ -171,6 +172,7 @@ void audio_extn_sound_trigger_stop_lab(struct stream_in *in)
event.u.ses_info = st_ses_info->st_ses;
ALOGV("%s: AUDIO_EVENT_STOP_LAB pcm %p", __func__, st_ses_info->st_ses.pcm);
st_dev->st_callback(AUDIO_EVENT_STOP_LAB, &event);
+ in->is_st_session_active = false;
}
}
void audio_extn_sound_trigger_check_and_get_session(struct stream_in *in)
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index cd5dbcba..06bd2b7b 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright (C) 2013 The Android Open Source Project