Merge "st-hal: check barge in support flag before update ec"
diff --git a/sound_trigger_hw.c b/sound_trigger_hw.c
index 6f9b6f1..f677147 100644
--- a/sound_trigger_hw.c
+++ b/sound_trigger_hw.c
@@ -824,8 +824,10 @@
} else {
ALOGV("%s: Ignore capture events as sva has dedicated path", __func__);
}
- pthread_mutex_unlock(&stdev->lock);
- return;
+ if (!conc_allowed) {
+ pthread_mutex_unlock(&stdev->lock);
+ return;
+ }
}
} else {
/*
@@ -842,8 +844,6 @@
p_ses = node_to_item(p_ses_node, st_session_t, list_node);
st_session_pause(p_ses);
}
- pthread_mutex_unlock(&stdev->lock);
- return;
} else {
if (event_type == AUDIO_EVENT_CAPTURE_DEVICE_INACTIVE) {
list_for_each(p_ses_node, &stdev->sound_model_list) {
@@ -863,6 +863,10 @@
}
}
stdev->session_allowed = conc_allowed;
+ if (!conc_allowed) {
+ pthread_mutex_unlock(&stdev->lock);
+ return;
+ }
}
/*
@@ -905,8 +909,6 @@
}
}
- platform_stdev_reset_backend_cfg(stdev->platform);
-
list_for_each(p_ses_node, &stdev->sound_model_list) {
p_ses = node_to_item(p_ses_node, st_session_t, list_node);
if (p_ses && p_ses->exec_mode == ST_EXEC_MODE_ADSP) {
@@ -1113,6 +1115,7 @@
* state so device switch will set up the next session with the
* new device to be started later
*/
+ stdev->reset_backend = true;
switch_device();
pthread_mutex_unlock(&stdev->lock);
@@ -1139,7 +1142,7 @@
st_hw_check_and_update_lpi(stdev, p_ses);
if (stdev->lpi_enable != platform_get_lpi_mode(stdev->platform) &&
- !is_any_session_buffering()) {
+ !is_any_session_buffering() && stdev->session_allowed) {
list_for_each(p_ses_node, &stdev->sound_model_list) {
p_ses = node_to_item(p_ses_node, st_session_t, list_node);
if (p_ses && p_ses->exec_mode == ST_EXEC_MODE_ADSP) {
@@ -1149,8 +1152,6 @@
}
}
- platform_stdev_reset_backend_cfg(stdev->platform);
-
list_for_each(p_ses_node, &stdev->sound_model_list) {
p_ses = node_to_item(p_ses_node, st_session_t, list_node);
if (p_ses && p_ses->exec_mode == ST_EXEC_MODE_ADSP) {
@@ -1192,7 +1193,7 @@
stdev->vad_enable = st_hw_check_vad_support(stdev, p_ses,
stdev->lpi_enable);
if (stdev->lpi_enable != platform_get_lpi_mode(stdev->platform) &&
- !is_any_session_buffering() &&
+ !is_any_session_buffering() && stdev->session_allowed &&
stdev->transit_to_non_lpi_on_battery_charging) {
list_for_each(p_ses_node, &stdev->sound_model_list) {
p_ses = node_to_item(p_ses_node, st_session_t, list_node);
@@ -1203,8 +1204,6 @@
}
}
- platform_stdev_reset_backend_cfg(stdev->platform);
-
list_for_each(p_ses_node, &stdev->sound_model_list) {
p_ses = node_to_item(p_ses_node, st_session_t, list_node);
if (p_ses && p_ses->exec_mode == ST_EXEC_MODE_ADSP) {
diff --git a/st_hw_session_lsm.c b/st_hw_session_lsm.c
index 0ab4ddc..929f51b 100644
--- a/st_hw_session_lsm.c
+++ b/st_hw_session_lsm.c
@@ -580,7 +580,7 @@
{
st_profile_type_t profile_type;
- profile_type = (p_ses->vendor_uuid_info && !p_ses->stdev->lpi_enable) ?
+ profile_type = (p_ses->vendor_uuid_info && !p_ses->lpi_enable) ?
p_ses->vendor_uuid_info->profile_type : ST_PROFILE_TYPE_NONE;
return profile_type;
}
diff --git a/st_session.c b/st_session.c
index 732125f..9bb1c09 100644
--- a/st_session.c
+++ b/st_session.c
@@ -4,7 +4,7 @@
* user session. This state machine implements logic for handling all user
* interactions, detectinos, SSR and Audio Concurencies.
*
- * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -2512,6 +2512,7 @@
hw_ses->lpi_enable = hw_ses->stdev->lpi_enable;
hw_ses->barge_in_mode = hw_ses->stdev->barge_in_mode;
do_unload = true;
+ platform_stdev_reset_backend_cfg(hw_ses->stdev->platform);
}
/*
@@ -3298,13 +3299,6 @@
}
}
} else {
- local_event = calloc(1, sizeof(*local_event) + payload_size);
- if (!local_event) {
- ALOGE("%s: event allocation failed, size %zd", __func__,
- payload_size);
- status = -ENOMEM;
- goto exit;
- }
memcpy(local_event->phrase_extras,
stc_ses->rc_config->phrases, stc_ses->rc_config->num_phrases *
sizeof(struct sound_trigger_phrase_recognition_extra));