summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarter Hsu <carterhsu@google.com>2019-05-14 14:26:24 +0800
committerCarter Hsu <carterhsu@google.com>2019-05-29 11:42:45 +0800
commitaaa9496b9860c1f508342f875867897ce42a1a78 (patch)
treebdb71fdd3ba0ab8cb5c75cda4a76e49f7a7eefaf
parentde49eecf02f552df911bccc2f553e08e0bf4d212 (diff)
downloadandroid_hardware_qcom_audio-aaa9496b9860c1f508342f875867897ce42a1a78.tar.gz
android_hardware_qcom_audio-aaa9496b9860c1f508342f875867897ce42a1a78.tar.bz2
android_hardware_qcom_audio-aaa9496b9860c1f508342f875867897ce42a1a78.zip
audio: fix control flow
1. Audio HAL should notified STHAL before sending audio calibration of audio usecase to kernel. 2. Fix the condition logic of pcm_capture, the stream.out and stream.in are union, so we can't check if it's NULL. Bug: 129111371 Test: manual Change-Id: I39676410555f7f528c0705059c312a1250d489f0 Signed-off-by: Carter Hsu <carterhsu@google.com>
-rw-r--r--hal/audio_hw.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index b15bde77..417d7cdb 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -650,6 +650,8 @@ int enable_audio_route(struct audio_device *adev,
ALOGV("%s: enter: usecase(%d)", __func__, usecase->id);
+ audio_extn_sound_trigger_update_stream_status(usecase, ST_EVENT_STREAM_BUSY);
+
if (usecase->type == PCM_CAPTURE)
snd_device = usecase->in_snd_device;
else
@@ -664,7 +666,6 @@ int enable_audio_route(struct audio_device *adev,
// this also appends to mixer_path
platform_add_backend_name(adev->platform, mixer_path, snd_device);
- audio_extn_sound_trigger_update_stream_status(usecase, ST_EVENT_STREAM_BUSY);
ALOGD("%s: usecase(%d) apply and update mixer path: %s", __func__, usecase->id, mixer_path);
audio_route_apply_and_update_path(adev->audio_route, mixer_path);
@@ -1442,8 +1443,7 @@ struct audio_usecase *get_usecase_from_list(struct audio_device *adev,
static bool force_device_switch(struct audio_usecase *usecase)
{
- if (usecase->stream.out == NULL) {
- ALOGE("%s: stream.out is NULL", __func__);
+ if (usecase->type == PCM_CAPTURE || usecase->stream.out == NULL) {
return false;
}