From ee25e99146221ab0bf7ef738065f1953f921cd19 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Fri, 3 Jan 2020 15:48:00 +0900 Subject: [PATCH 01/16] Prevent already-running assistant from being prelaunched Change-Id: Ib891fd476a68d5b7ea2bb07f9d6d78a76022a688 --- src/multi_assistant_service.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/multi_assistant_service.c b/src/multi_assistant_service.c index 2e955bb..5043b09 100644 --- a/src/multi_assistant_service.c +++ b/src/multi_assistant_service.c @@ -1043,6 +1043,13 @@ int mas_launch_client_by_appid(const char *appid, CLIENT_LAUNCH_MODE launch_mode return -1; } + if (CLIENT_LAUNCH_MODE_PRELAUNCH == launch_mode) { + if (1 == aul_app_is_running(appid)) { + MAS_LOGE("appid %s is already running, no need for a prelaunch", appid); + return -1; + } + } + bundle *b = NULL; b = bundle_create(); if (NULL == b) { -- 2.7.4 From 0268faeff6546bf32877e686509e41c516d8d43f Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Fri, 3 Jan 2020 15:48:29 +0900 Subject: [PATCH 02/16] Bump version to 0.2.19 Change-Id: Iec9a4ecd932caf016b6f908a4e536ccfd5bbd200 --- org.tizen.multi-assistant-service.xml | 2 +- packaging/org.tizen.multi-assistant-service.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.tizen.multi-assistant-service.xml b/org.tizen.multi-assistant-service.xml index 29f8e6b..63492cc 100644 --- a/org.tizen.multi-assistant-service.xml +++ b/org.tizen.multi-assistant-service.xml @@ -1,5 +1,5 @@ - + Won Nam Jang Sooyeon Kim diff --git a/packaging/org.tizen.multi-assistant-service.spec b/packaging/org.tizen.multi-assistant-service.spec index 72e171c..cb4c6b7 100644 --- a/packaging/org.tizen.multi-assistant-service.spec +++ b/packaging/org.tizen.multi-assistant-service.spec @@ -1,6 +1,6 @@ Name: org.tizen.multi-assistant-service Summary: Multi assistant service -Version: 0.2.18 +Version: 0.2.19 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From dfd0dee91e54a0c80e288035552af727f9e89ac5 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Fri, 3 Jan 2020 19:00:50 +0900 Subject: [PATCH 03/16] Set background option to FALSE if not in PRELAUNCH mode Change-Id: Ibe2a5fbaeefde1a24d67ea3a17c44f59706d0971 --- src/multi_assistant_service.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/multi_assistant_service.c b/src/multi_assistant_service.c index 5043b09..d07cf18 100644 --- a/src/multi_assistant_service.c +++ b/src/multi_assistant_service.c @@ -1057,7 +1057,8 @@ int mas_launch_client_by_appid(const char *appid, CLIENT_LAUNCH_MODE launch_mode return -1; } - int result = aul_svc_set_background_launch(b, TRUE); + int result = aul_svc_set_background_launch(b, + (CLIENT_LAUNCH_MODE_PRELAUNCH == launch_mode ? TRUE : FALSE)); if (result < AUL_R_OK) { MAS_LOGE("ERROR : aul_svc_set_background_launch failed. app_id [%s] bundle[%p] result[%d : %s]", appid, b, result, get_error_message(result)); -- 2.7.4 From 80ad51539202b3493ace3250aa1740fbc379398d Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Fri, 3 Jan 2020 19:02:23 +0900 Subject: [PATCH 04/16] Bump version to 0.2.20 Change-Id: I1b4f5d2c6876c7fa6a09bb3356bb2a71b7575ff7 --- org.tizen.multi-assistant-service.xml | 2 +- packaging/org.tizen.multi-assistant-service.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.tizen.multi-assistant-service.xml b/org.tizen.multi-assistant-service.xml index 63492cc..8642e5a 100644 --- a/org.tizen.multi-assistant-service.xml +++ b/org.tizen.multi-assistant-service.xml @@ -1,5 +1,5 @@ - + Won Nam Jang Sooyeon Kim diff --git a/packaging/org.tizen.multi-assistant-service.spec b/packaging/org.tizen.multi-assistant-service.spec index cb4c6b7..32ad561 100644 --- a/packaging/org.tizen.multi-assistant-service.spec +++ b/packaging/org.tizen.multi-assistant-service.spec @@ -1,6 +1,6 @@ Name: org.tizen.multi-assistant-service Summary: Multi assistant service -Version: 0.2.19 +Version: 0.2.20 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From b1853d058f31645eedb6d3f3f3bd132334d29ddb Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Fri, 3 Jan 2020 19:48:35 +0900 Subject: [PATCH 05/16] Refine log levels and messages for better analysis Change-Id: I2bd416bc73b029792ed726ca59ece7f6e2b530bf --- plugins/wakeup-manager/inc/wakeup_manager_main.h | 2 +- .../wakeup-manager/src/wakeup_audio_manager.cpp | 13 ++++---- .../wakeup-manager/src/wakeup_engine_manager.cpp | 14 ++++---- plugins/wakeup-manager/src/wakeup_manager.cpp | 3 +- src/multi_assistant_dbus.c | 16 ++++----- src/multi_assistant_dbus_server.c | 38 +++++++++++----------- 6 files changed, 44 insertions(+), 42 deletions(-) diff --git a/plugins/wakeup-manager/inc/wakeup_manager_main.h b/plugins/wakeup-manager/inc/wakeup_manager_main.h index 80ce706..0a654c8 100644 --- a/plugins/wakeup-manager/inc/wakeup_manager_main.h +++ b/plugins/wakeup-manager/inc/wakeup_manager_main.h @@ -12,7 +12,7 @@ extern "C" { #ifdef LOG_TAG #undef LOG_TAG #endif -#define LOG_TAG "wakeup-manager" +#define LOG_TAG "multi-assistant" #ifdef __MODULE__ #undef __MODULE__ diff --git a/plugins/wakeup-manager/src/wakeup_audio_manager.cpp b/plugins/wakeup-manager/src/wakeup_audio_manager.cpp index 6a76a4f..efefeae 100644 --- a/plugins/wakeup-manager/src/wakeup_audio_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_audio_manager.cpp @@ -166,7 +166,7 @@ void CAudioManager::set_recording_session(recording_session session) /* Need to consider adapting conventional producer-consumer model */ void CAudioManager::streaming_previous_audio_data_thread_func() { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); unique_lock lock(mMutex, defer_lock); @@ -200,12 +200,12 @@ void CAudioManager::streaming_previous_audio_data_thread_func() } lock.unlock(); - MWR_LOGD("[EXIT]"); + MWR_LOGI("[EXIT]"); } void CAudioManager::streaming_audio_data_thread_func(long start_time) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); unique_lock lock(mMutex, defer_lock); bool finish_event_sent = false; @@ -247,7 +247,7 @@ void CAudioManager::streaming_audio_data_thread_func(long start_time) advance(lead, 1); } if (lead != end) { - MWR_LOGI("[INFO] Resume thread"); + MWR_LOGD("[INFO] Resume thread"); break; } if (g_speech_pcm_wait_count < cnt) { @@ -265,12 +265,11 @@ void CAudioManager::streaming_audio_data_thread_func(long start_time) } } } - MWR_LOGD("[EXIT]"); return; } cnt++; } - MWR_LOGI("[INFO] Finish to wait for new feedback data come"); + MWR_LOGD("[INFO] Finish to wait for new feedback data come"); /* resume feedback thread */ continue; @@ -310,7 +309,7 @@ void CAudioManager::streaming_audio_data_thread_func(long start_time) } } } - MWR_LOGD("[EXIT]"); + MWR_LOGI("[EXIT]"); } void CAudioManager::add_audio_data(mas_speech_data& data, long time) diff --git a/plugins/wakeup-manager/src/wakeup_engine_manager.cpp b/plugins/wakeup-manager/src/wakeup_engine_manager.cpp index f374d58..01372c7 100644 --- a/plugins/wakeup-manager/src/wakeup_engine_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_engine_manager.cpp @@ -185,7 +185,7 @@ bool CWakeupEngineManager::set_assistant_language(string appid, string language) if (info.assistant_list.end() != iter) { try { int ret = info.interface.set_language(language.c_str()); - MWR_LOGD("set_language returned %d : %s %s %s", + MWR_LOGI("set_language returned %d : %s %s %s", ret, appid.c_str(), info.engine_name.c_str(), language.c_str()); } catch (const std::exception& e) { MWR_LOGE("[ERROR] wakeup engine %s threw exception : %s", @@ -198,7 +198,7 @@ bool CWakeupEngineManager::set_assistant_language(string appid, string language) void CWakeupEngineManager::set_assistant_activated(string appid, bool activated) { - MWR_LOGD("[ENTER] : %s %d", appid.c_str(), activated); + MWR_LOGI("[ENTER] : %s %d", appid.c_str(), activated); for (auto& info : mEngineInfo) { const auto& iter = find_if(info.assistant_list.begin(), info.assistant_list.end(), [appid](const string& assistant) { @@ -255,7 +255,7 @@ void CWakeupEngineManager::set_wake_word_audio_require_flag(bool require) void CWakeupEngineManager::streaming_speech_data_thread_func() { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (nullptr == mSelectedEngine) return; @@ -325,7 +325,7 @@ void CWakeupEngineManager::streaming_speech_data_thread_func() while (!(mStopStreamingThread.load())) { this_thread::sleep_for(chrono::milliseconds(10)); if (index < interface->get_utterance_data_count()) { - MWR_LOGI("[INFO] Resume thread"); + MWR_LOGD("[INFO] Resume thread"); break; } if (g_speech_pcm_wait_count < cnt) { @@ -347,7 +347,7 @@ void CWakeupEngineManager::streaming_speech_data_thread_func() } cnt++; } - MWR_LOGI("[INFO] Finish to wait for new feedback data come"); + MWR_LOGD("[INFO] Finish to wait for new feedback data come"); /* resume feedback thread */ continue; @@ -383,6 +383,8 @@ void CWakeupEngineManager::streaming_speech_data_thread_func() } } } + + MWR_LOGI("[EXIT]"); } void CWakeupEngineManager::start_streaming_current_utterance_data() @@ -587,7 +589,7 @@ bool CWakeupEngineManager::on_error(string engine_name, int error_code, string e bool CWakeupEngineManager::on_audio_data_require_status(string engine_name, bool require) { - MWR_LOGD("[ENTER] %s, %d", engine_name.c_str(), require); + MWR_LOGI("[ENTER] %s, %d", engine_name.c_str(), require); bool found = false; // LOCK REQUIRED diff --git a/plugins/wakeup-manager/src/wakeup_manager.cpp b/plugins/wakeup-manager/src/wakeup_manager.cpp index c4e42cf..b2c427d 100644 --- a/plugins/wakeup-manager/src/wakeup_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_manager.cpp @@ -392,6 +392,7 @@ bool CWakeupManager::set_streaming_mode(STREAMING_MODE mode) bool CWakeupManager::change_manager_state(wakeup_manager_state_e state) { + MWR_LOGI("[ENTER] : %d", state); mWakeupManagerState = state; mWakeupEngineManager.update_manager_state(state); for (const auto& observer : mWakeupObservers) { @@ -573,7 +574,7 @@ vector CWakeupManager::get_setting_observers() static Eina_Bool streaming_duration_expired(void *data) { - MWR_LOGD("[ENTER]"); + MWR_LOGW("[ENTER]"); CWakeupManager *wakeup_manager = static_cast(data); if (nullptr == wakeup_manager) return ECORE_CALLBACK_CANCEL; diff --git a/src/multi_assistant_dbus.c b/src/multi_assistant_dbus.c index eab7619..34de016 100644 --- a/src/multi_assistant_dbus.c +++ b/src/multi_assistant_dbus.c @@ -162,7 +162,7 @@ int masc_dbus_send_error_message(int reason, const char* err_msg) if (!dbus_connection_send(g_conn_sender, msg, NULL)) { MAS_LOGE("[Dbus ERROR] <<<< error message : Out Of Memory !"); } else { - MAS_LOGD("<<<< Send error message : reason(%d), err_msg(%s)", reason, temp_err_msg); + MAS_LOGI("<<<< Send error message : reason(%d), err_msg(%s)", reason, temp_err_msg); dbus_connection_flush(g_conn_sender); } @@ -219,7 +219,7 @@ int masc_dbus_send_streaming_audio_data(int pid, int event, unsigned char* data, } else { static int last_event = -1; if (event != last_event) { - MAS_LOGI("[Dbus DEBUG] Success to Send utterance stream : event (%d)", event); + MAS_LOGI("[Dbus DEBUG] Success to Send utterance stream : %d event (%d)", pid, event); } last_event = event; dbus_connection_flush(g_conn_sender); @@ -272,7 +272,7 @@ int masc_dbus_active_state_change(int pid, int state) MAS_LOGE("[Dbus ERROR] Fail to Send"); return -1; // MAS_ERROR_OPERATION_FAILED; } else { - MAS_LOGD("[Dbus DEBUG] Success to Send activate message : %d", state); + MAS_LOGI("[Dbus DEBUG] Success to Send activate message : %d %d", pid, state); dbus_connection_flush(g_conn_sender); } @@ -333,7 +333,7 @@ int masc_dbus_send_preprocessing_information(int pid, const char* app_id) free(temp_app_id); return -1; // MAS_ERROR_OPERATION_FAILED; } else { - MAS_LOGD("[Dbus DEBUG] Success to Send preprocessing assistant information : %s", app_id); + MAS_LOGI("[Dbus DEBUG] Success to Send preprocessing assistant information : %d %s", pid, app_id); dbus_connection_flush(g_conn_sender); } @@ -388,7 +388,7 @@ int masc_dbus_send_streaming_section_changed(int pid, int section) MAS_LOGE("[Dbus ERROR] Fail to Send"); return -1; // MAS_ERROR_OPERATION_FAILED; } else { - MAS_LOGD("[Dbus DEBUG] Success to Send streaming section changed information : %d", section); + MAS_LOGI("[Dbus DEBUG] Success to Send streaming section changed information : %d %d", pid, section); dbus_connection_flush(g_conn_sender); } @@ -442,7 +442,7 @@ int masc_dbus_send_preprocessing_result(int pid, bool result) MAS_LOGE("[Dbus ERROR] Fail to Send"); return -1; // MAS_ERROR_OPERATION_FAILED; } else { - MAS_LOGD("[Dbus DEBUG] Success to Send preprocessing result : %d", temp_result); + MAS_LOGI("[Dbus DEBUG] Success to Send preprocessing result : %d %d", pid, temp_result); dbus_connection_flush(g_conn_sender); } @@ -504,7 +504,7 @@ int masc_dbus_send_wakeup_engine_command(int pid, const char* command) free(temp_command); return -1; // MAS_ERROR_OPERATION_FAILED; } else { - MAS_LOGD("[Dbus DEBUG] Success to Send wakeup_engine_command : %s", command); + MAS_LOGI("[Dbus DEBUG] Success to Send wakeup_engine_command : %d %s", pid, command); dbus_connection_flush(g_conn_sender); } @@ -559,7 +559,7 @@ int masc_dbus_service_state_change(int pid, int state) MAS_LOGE("[Dbus ERROR] Fail to Send"); return -1; // MAS_ERROR_OPERATION_FAILED; } else { - MAS_LOGD("[Dbus DEBUG] Success to Send activate message : %d", state); + MAS_LOGI("[Dbus DEBUG] Success to Send activate message : %d %d", pid, state); dbus_connection_flush(g_conn_sender); } diff --git a/src/multi_assistant_dbus_server.c b/src/multi_assistant_dbus_server.c index c229817..136606b 100644 --- a/src/multi_assistant_dbus_server.c +++ b/src/multi_assistant_dbus_server.c @@ -69,7 +69,7 @@ int ma_service_dbus_initialize(DBusConnection* conn, DBusMessage* msg) DBusMessage* reply; reply = dbus_message_new_method_return(msg); - MAS_LOGD("[OUT] mas initialize : result(%d)", ret); + MAS_LOGI("[OUT] mas initialize : result(%d)", ret); if (NULL != reply) { dbus_message_append_args(reply, DBUS_TYPE_INT32, &ret, @@ -120,7 +120,7 @@ int ma_service_dbus_deinitialize(DBusConnection* conn, DBusMessage* msg) DBusMessage* reply; reply = dbus_message_new_method_return(msg); - MAS_LOGD("[OUT] mas deinitialize : result(%d)", ret); + MAS_LOGI("[OUT] mas deinitialize : result(%d)", ret); if (NULL != reply) { dbus_message_append_args(reply, DBUS_TYPE_INT32, &ret, @@ -165,7 +165,7 @@ int ma_service_dbus_get_audio_format(DBusConnection* conn, DBusMessage* msg) dbus_error_free(&err); ret = -1; //MAS_ERROR_OPERATION_FAILED; } else { - MAS_LOGD("[IN] mas get default voice"); + MAS_LOGD("[IN] mas get audio format"); ret = mas_client_get_audio_format(pid, &rate, &channel, &audio_type); } @@ -181,7 +181,7 @@ int ma_service_dbus_get_audio_format(DBusConnection* conn, DBusMessage* msg) DBUS_TYPE_INT32, &audio_type, DBUS_TYPE_INVALID); if (0 == ret) { - MAS_LOGD("[OUT] mas get audio format : rate(%d), channel(%d), audio_type(%d)", rate, channel, audio_type); + MAS_LOGI("[OUT] mas get audio format : rate(%d), channel(%d), audio_type(%d)", rate, channel, audio_type); } else { MAS_LOGE("[OUT ERROR] mas get audio format : result(%d)", ret); } @@ -219,7 +219,7 @@ int ma_service_dbus_get_audio_source_type(DBusConnection* conn, DBusMessage* msg dbus_error_free(&err); ret = -1; //MAS_ERROR_OPERATION_FAILED; } else { - MAS_LOGD("[IN] mas get default voice"); + MAS_LOGD("[IN] mas get audio source type"); ret = mas_client_get_audio_source_type(pid, &type); } @@ -240,7 +240,7 @@ int ma_service_dbus_get_audio_source_type(DBusConnection* conn, DBusMessage* msg DBUS_TYPE_STRING, &temp_type, DBUS_TYPE_INVALID); if (0 == ret) { - MAS_LOGD("[OUT] mas get audio source type : type(%s)", temp_type); + MAS_LOGI("[OUT] mas get audio source type : type(%s)", temp_type); } else { MAS_LOGE("[OUT ERROR] mas get audio source type : result(%d)", ret); } @@ -283,7 +283,7 @@ int ma_service_dbus_send_asr_result(DBusConnection* conn, DBusMessage* msg) dbus_error_free(&err); ret = -1; //MAS_ERROR_OPERATION_FAILED; } else { - MAS_LOGD("[IN] mas send asr result : pid(%d), event(%d), asr_result(%s)", pid, event, asr_result); + MAS_LOGI("[IN] mas send asr result : pid(%d), event(%d), asr_result(%s)", pid, event, asr_result); ret = mas_client_send_asr_result(pid, event, asr_result); } @@ -342,7 +342,7 @@ int ma_service_dbus_send_result(DBusConnection* conn, DBusMessage* msg) dbus_error_free(&err); ret = -1; //MAS_ERROR_OPERATION_FAILED; } else { - MAS_LOGD("[IN] mas send result : pid(%d), display_text(%s), utterance_text(%s), result_json(%s)", pid, display_text, utterance_text, result_json); + MAS_LOGI("[IN] mas send result : pid(%d), display_text(%s), utterance_text(%s), result_json(%s)", pid, display_text, utterance_text, result_json); ret = mas_client_send_result(pid, display_text, utterance_text, result_json); } @@ -393,11 +393,11 @@ int ma_service_dbus_send_recognition_result(DBusConnection* conn, DBusMessage* m MAS_LOGD("[DEBUG] MAS SEND RECOGNITION RESULT"); if (dbus_error_is_set(&err)) { - MAS_LOGE("[IN ERROR] mas send error : Get arguments error (%s)", err.message); + MAS_LOGE("[IN ERROR] mas send recognition result : Get arguments error (%s)", err.message); dbus_error_free(&err); ret = -1; //MAS_ERROR_OPERATION_FAILED; } else { - MAS_LOGD("[IN] mas send error : pid(%d), result(%d)", pid, result); + MAS_LOGI("[IN] mas send recognition result : pid(%d), result(%d)", pid, result); ret = mas_client_send_recognition_result(pid, result); } @@ -428,7 +428,7 @@ int ma_service_dbus_start_streaming_audio_data(DBusConnection* conn, DBusMessage dbus_error_free(&err); ret = -1; //MAS_ERROR_OPERATION_FAILED; } else { - MAS_LOGD("[IN] mas send start streaming : pid(%d), type(%d)", pid, type); + MAS_LOGI("[IN] mas send start streaming : pid(%d), type(%d)", pid, type); ret = mas_client_start_streaming_audio_data(pid, type); } @@ -459,7 +459,7 @@ int ma_service_dbus_stop_streaming_audio_data(DBusConnection* conn, DBusMessage* dbus_error_free(&err); ret = -1; //MAS_ERROR_OPERATION_FAILED; } else { - MAS_LOGD("[IN] mas stop streaming : pid(%d), type(%d)", pid, type); + MAS_LOGI("[IN] mas stop streaming : pid(%d), type(%d)", pid, type); ret = mas_client_stop_streaming_audio_data(pid, type); } @@ -490,7 +490,7 @@ int ma_service_dbus_update_voice_feedback_state(DBusConnection* conn, DBusMessag dbus_error_free(&err); ret = -1; //MAS_ERROR_OPERATION_FAILED; } else { - MAS_LOGD("[IN] mas update voice feedback : pid(%d), state(%d)", pid, state); + MAS_LOGI("[IN] mas update voice feedback : pid(%d), state(%d)", pid, state); ret = mas_client_update_voice_feedback_state(pid, state); } @@ -521,7 +521,7 @@ int ma_service_dbus_send_assistant_specific_command(DBusConnection* conn, DBusMe dbus_error_free(&err); ret = -1; //MAS_ERROR_OPERATION_FAILED; } else { - MAS_LOGD("[IN] mas send assistant specific command : pid(%d), command(%s)", pid, command); + MAS_LOGI("[IN] mas send assistant specific command : pid(%d), command(%s)", pid, command); ret = mas_client_set_assistant_specific_command(pid, command); } @@ -552,7 +552,7 @@ int ma_service_dbus_set_background_volume(DBusConnection* conn, DBusMessage* msg dbus_error_free(&err); ret = -1; //MAS_ERROR_OPERATION_FAILED; } else { - MAS_LOGD("[IN] mas set background volume : pid(%d), ratio(%f)", pid, ratio); + MAS_LOGI("[IN] mas set background volume : pid(%d), ratio(%f)", pid, ratio); ret = mas_client_set_background_volume(pid, ratio); } @@ -589,7 +589,7 @@ int ma_service_dbus_set_preprocessing_allow_mode(DBusConnection* conn, DBusMessa if (NULL != app_id && strcmp("#NULL", app_id)) { temp_app_id = strdup(app_id); } - MAS_LOGD("[IN] mas set preprocessing allow mode : pid(%d), mode(%d), app_id(%s)", pid, mode, temp_app_id); + MAS_LOGI("[IN] mas set preprocessing allow mode : pid(%d), mode(%d), app_id(%s)", pid, mode, temp_app_id); ret = mas_client_set_preprocessing_allow_mode(pid, mode, temp_app_id); if (NULL != temp_app_id) free(temp_app_id); @@ -622,7 +622,7 @@ int ma_service_dbus_send_preprocessing_result(DBusConnection* conn, DBusMessage* dbus_error_free(&err); ret = -1; //MAS_ERROR_OPERATION_FAILED; } else { - MAS_LOGD("[IN] mas send preprocessing result : pid(%d), result(%d)", pid, result); + MAS_LOGI("[IN] mas send preprocessing result : pid(%d), result(%d)", pid, result); ret = mas_client_send_preprocessing_result(pid, (bool)result); } @@ -653,7 +653,7 @@ int ma_service_dbus_set_wake_word_audio_require_flag(DBusConnection* conn, DBusM dbus_error_free(&err); ret = -1; //MAS_ERROR_OPERATION_FAILED; } else { - MAS_LOGD("[IN] mas set wake word audio require flag : pid(%d), require(%d)", pid, require); + MAS_LOGI("[IN] mas set wake word audio require flag : pid(%d), require(%d)", pid, require); ret = mas_client_set_wake_word_audio_require_flag(pid, (bool)require); } @@ -684,7 +684,7 @@ int ma_service_dbus_set_assistant_language(DBusConnection* conn, DBusMessage* ms dbus_error_free(&err); ret = -1; //MAS_ERROR_OPERATION_FAILED; } else { - MAS_LOGD("[IN] mas set assistant language : pid(%d), language(%s)", pid, language); + MAS_LOGI("[IN] mas set assistant language : pid(%d), language(%s)", pid, language); ret = mas_client_set_assistant_language(pid, language); } -- 2.7.4 From acbceddc62db46e1e0da287d6bca6b9dada43fd3 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Mon, 6 Jan 2020 17:08:10 +0900 Subject: [PATCH 06/16] Add test code for dumping pcm data from wakeup engines Change-Id: Ieec852c3317fb418966d90b94176f6dad4e562f6 --- .../wakeup-manager/src/wakeup_engine_manager.cpp | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/plugins/wakeup-manager/src/wakeup_engine_manager.cpp b/plugins/wakeup-manager/src/wakeup_engine_manager.cpp index 01372c7..41af682 100644 --- a/plugins/wakeup-manager/src/wakeup_engine_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_engine_manager.cpp @@ -13,6 +13,19 @@ namespace multiassistant namespace wakeup { +/* Sound buf save for test */ +#if 0 +#define BUF_SAVE_MODE +#endif + +#ifdef BUF_SAVE_MODE +static char g_temp_file_name[128] = {'\0', }; + +static FILE* g_pFile = NULL; + +static int g_count = 1; +#endif + /* Need to check whether this value needs to be configurable */ static int g_speech_pcm_wait_count = 400; @@ -269,6 +282,42 @@ void CWakeupEngineManager::streaming_speech_data_thread_func() MWR_LOGD("data_count : %d", interface->get_utterance_data_count()); +#ifdef BUF_SAVE_MODE + if (g_pFile) { + fclose(g_pFile); + g_pFile = NULL; + } else { + MWR_LOGD("[Recorder Info] File not found!"); + } + + while (1) { + snprintf(g_temp_file_name, sizeof(g_temp_file_name), "/tmp/ma_wue_%d_%d", getpid(), g_count); + int ret = access(g_temp_file_name, 0); + + if (0 == ret) { + MWR_LOGD("[Recorder ERROR] File is already exist"); + if (0 == remove(g_temp_file_name)) { + MWR_LOGD("[Recorder] Remove file"); + break; + } else { + g_count++; + } + } else { + break; + } + } + + MWR_LOGD("[Recorder] Temp file name=[%s]", g_temp_file_name); + + /* open test file */ + g_pFile = fopen(g_temp_file_name, "wb+x"); + if (!g_pFile) { + MWR_LOGD("[Recorder ERROR] File not found!"); + return; + } + g_count++; +#endif + mas_speech_data speech_data; int index = 0; bool finish_event_sent = false; @@ -287,6 +336,10 @@ void CWakeupEngineManager::streaming_speech_data_thread_func() while (!(mStopStreamingThread.load()) && index < count) { int ret = interface->get_wake_word_data(index, &speech_data); if (0 == ret) { +#ifdef BUF_SAVE_MODE + if (g_pFile) + fwrite(speech_data.buffer, 1, speech_data.len, g_pFile); +#endif for (const auto& observer : mObservers) { if (observer) { if (!observer->on_streaming_audio_data( @@ -331,6 +384,14 @@ void CWakeupEngineManager::streaming_speech_data_thread_func() if (g_speech_pcm_wait_count < cnt) { unsigned char final_buffer[2] = {'\0', }; MWR_LOGE("[ERROR] Wrong request, there's no pcm data"); +#ifdef BUF_SAVE_MODE + if (g_pFile) { + fwrite(final_buffer, 1, sizeof(final_buffer), g_pFile); + MWR_LOGE("[Recorder SUCCESS] File Close"); + fclose(g_pFile); + g_pFile = NULL; + } +#endif for (const auto& observer : mObservers) { if (observer) { if (!observer->on_streaming_audio_data( @@ -353,6 +414,20 @@ void CWakeupEngineManager::streaming_speech_data_thread_func() continue; } +#ifdef BUF_SAVE_MODE + if (g_pFile) + fwrite(speech_data.buffer, 1, speech_data.len, g_pFile); + + if (MAS_SPEECH_STREAMING_EVENT_FINISH == speech_data.event) { + if (g_pFile) { + MWR_LOGE("[Recorder SUCCESS] File Close"); + fclose(g_pFile); + g_pFile = NULL; + } else { + MWR_LOGE("[Recorder ERROR] File not found!"); + } + } +#endif for (const auto& observer : mObservers) { if (observer) { if (!observer->on_streaming_audio_data( @@ -382,6 +457,14 @@ void CWakeupEngineManager::streaming_speech_data_thread_func() } } } +#ifdef BUF_SAVE_MODE + if (g_pFile) { + fwrite(final_buffer, 1, sizeof(final_buffer), g_pFile); + MWR_LOGE("[Recorder SUCCESS] File Close"); + fclose(g_pFile); + g_pFile = NULL; + } +#endif } MWR_LOGI("[EXIT]"); -- 2.7.4 From 2e09888443aa2ebfa2f9a3724e1ed6295ad158c4 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Fri, 27 Dec 2019 13:55:56 +0900 Subject: [PATCH 07/16] Use message port for streaming audio data Change-Id: I758966ad20b79f6c43243acd4dcee471dd207284 --- CMakeLists.txt | 1 + inc/multi_assistant_service_client.h | 2 + packaging/org.tizen.multi-assistant-service.spec | 1 + .../wakeup-manager/src/wakeup_audio_manager.cpp | 1 - src/multi_assistant_dbus.c | 169 ++++++++++----------- src/multi_assistant_service.c | 22 ++- 6 files changed, 106 insertions(+), 90 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1717bcf..6e4df5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,7 @@ pkg_check_modules(pkgs REQUIRED capi-network-connection dlog ecore + capi-message-port dbus-1 glib-2.0 libxml-2.0 diff --git a/inc/multi_assistant_service_client.h b/inc/multi_assistant_service_client.h index b6d7f42..bba7085 100644 --- a/inc/multi_assistant_service_client.h +++ b/inc/multi_assistant_service_client.h @@ -71,6 +71,8 @@ int mas_get_client_pid_by_wakeup_word(const char *wakeup_word); int mas_get_client_pid_by_appid(const char *appid); +const char* mas_get_client_appid_by_pid(int pid); + bool mas_get_client_custom_ui_option_by_appid(const char *appid); const char* mas_get_client_appid_by_wakeup_word(const char *wakeup_word); diff --git a/packaging/org.tizen.multi-assistant-service.spec b/packaging/org.tizen.multi-assistant-service.spec index 32ad561..714b073 100644 --- a/packaging/org.tizen.multi-assistant-service.spec +++ b/packaging/org.tizen.multi-assistant-service.spec @@ -19,6 +19,7 @@ BuildRequires: pkgconfig(capi-media-audio-io) BuildRequires: pkgconfig(capi-network-connection) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(ecore) +BuildRequires: pkgconfig(capi-message-port) BuildRequires: pkgconfig(dbus-1) BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: pkgconfig(libxml-2.0) diff --git a/plugins/wakeup-manager/src/wakeup_audio_manager.cpp b/plugins/wakeup-manager/src/wakeup_audio_manager.cpp index efefeae..b7c9288 100644 --- a/plugins/wakeup-manager/src/wakeup_audio_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_audio_manager.cpp @@ -385,7 +385,6 @@ void CAudioManager::notify_audio_data_recording(long time, void* data, int len) if (observer) { if (!observer->on_recording_audio_data(time, data, len)) { LOGE("[Recorder WARNING] One of the observer returned false"); - return; } } } diff --git a/src/multi_assistant_dbus.c b/src/multi_assistant_dbus.c index 34de016..72d3eda 100644 --- a/src/multi_assistant_dbus.c +++ b/src/multi_assistant_dbus.c @@ -18,6 +18,7 @@ #include #include #include +#include #include "multi_assistant_main.h" #include "multi_assistant_dbus_server.h" @@ -28,6 +29,8 @@ static DBusConnection* g_conn_listener = NULL; static Ecore_Fd_Handler* g_dbus_fd_handler = NULL; +static int g_streaming_data_serial = 0; + int mas_dbus_reconnect() { if (!g_conn_sender || !g_conn_listener) { @@ -173,59 +176,72 @@ int masc_dbus_send_error_message(int reason, const char* err_msg) return 0; } -int masc_dbus_send_streaming_audio_data(int pid, int event, unsigned char* data, unsigned int data_size) -{ - if (0 != __dbus_check()) { - return -1; //MAS_ERROR_OPERATION_FAILED; - } - - DBusMessage* msg; - DBusError err; - dbus_error_init(&err); +const char *message_port = "ma_streaming_port"; - char service_name[64]; - memset(service_name, '\0', 64); - snprintf(service_name, 64, "%s_%d", MA_CLIENT_SERVICE_NAME, pid); +#define STREAMING_BUFFER_SIZE 4096 - msg = dbus_message_new_method_call( - service_name, - MA_CLIENT_SERVICE_OBJECT_PATH, - MA_CLIENT_SERVICE_INTERFACE, - MAS_METHOD_STREAMING_AUDIO_DATA); +typedef enum { + streaming_data_type_audio_data, + streaming_data_type_streaming_section +} streaming_data_type_e; - static int count = 0; - if (NULL == msg) { - MAS_LOGE(">>>> Request mas send utterance stream : Fail to make message"); - return -1; // MAS_ERROR_OPERATION_FAILED; - } else { - MAS_LOGD(">>>> Request mas send utterance stream : %s event(%d) %d", service_name, event, count++); - } +typedef struct { + unsigned int streaming_data_size; + int streaming_data_type; + int streaming_data_serial; +} streaming_data_header; - if (true != dbus_message_append_args(msg, - DBUS_TYPE_INT32, &event, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, - &data, data_size, - DBUS_TYPE_INVALID)) { - dbus_message_unref(msg); - MAS_LOGE("[ERROR] Fail to append args"); - return -1; - } +typedef struct { + int event; + unsigned int data_size; +} streaming_data_audio_data_header; - dbus_message_set_no_reply(msg, TRUE); +typedef struct { + int section; +} streaming_data_streaming_section_header; - if (1 != dbus_connection_send(g_conn_sender, msg, NULL)) { - MAS_LOGE("[Dbus ERROR] Fail to Send"); - return -1; // MAS_ERROR_OPERATION_FAILED; - } else { - static int last_event = -1; - if (event != last_event) { - MAS_LOGI("[Dbus DEBUG] Success to Send utterance stream : %d event (%d)", pid, event); - } - last_event = event; - dbus_connection_flush(g_conn_sender); - } +void masc_message_port_error(int error) +{ + MAS_LOGE("message_port error found : %s", + (MESSAGE_PORT_ERROR_NONE == error) ? "MESSAGE_PORT_ERROR_NONE" : + (MESSAGE_PORT_ERROR_IO_ERROR == error) ? "MESSAGE_PORT_ERROR_IO_ERROR" : + (MESSAGE_PORT_ERROR_OUT_OF_MEMORY == error) ? "MESSAGE_PORT_ERROR_OUT_OF_MEMORY" : + (MESSAGE_PORT_ERROR_INVALID_PARAMETER == error) ? "MESSAGE_PORT_ERROR_INVALID_PARAMETER" : + (MESSAGE_PORT_ERROR_PORT_NOT_FOUND == error) ? "MESSAGE_PORT_ERROR_PORT_NOT_FOUND" : + (MESSAGE_PORT_ERROR_CERTIFICATE_NOT_MATCH == error) ? "MESSAGE_PORT_ERROR_CERTIFICATE_NOT_MATCH" : + (MESSAGE_PORT_ERROR_MAX_EXCEEDED == error) ? "MESSAGE_PORT_ERROR_MAX_EXCEEDED" : + (MESSAGE_PORT_ERROR_RESOURCE_UNAVAILABLE == error) ? "MESSAGE_PORT_ERROR_RESOURCE_UNAVAILABLE" : + "MESSAGE_PORT_ERROR_UNKNOWN"); +} - dbus_message_unref(msg); +int masc_dbus_send_streaming_audio_data(int pid, int event, unsigned char* data, unsigned int data_size) +{ + bundle *b = bundle_create(); + + streaming_data_header header; + header.streaming_data_type = 0; + header.streaming_data_size = sizeof(streaming_data_header) + sizeof(streaming_data_audio_data_header) + data_size; + header.streaming_data_serial = g_streaming_data_serial++; + + streaming_data_audio_data_header audio_data_header; + audio_data_header.event = event; + audio_data_header.data_size = data_size; + + unsigned char buffer[STREAMING_BUFFER_SIZE]; + size_t total_size = 0; + memcpy(buffer, &header, sizeof(header)); + total_size += sizeof(header); + memcpy(buffer + total_size, &audio_data_header, sizeof(audio_data_header)); + total_size += sizeof(audio_data_header); + memcpy(buffer + total_size, data, data_size); + total_size += data_size; + + bundle_add_byte(b, "content", buffer, total_size); + int ret = message_port_send_message(mas_get_client_appid_by_pid(pid), message_port, b); + if (MESSAGE_PORT_ERROR_NONE != ret) + masc_message_port_error(ret); + + bundle_free(b); return 0; } @@ -347,52 +363,30 @@ int masc_dbus_send_preprocessing_information(int pid, const char* app_id) int masc_dbus_send_streaming_section_changed(int pid, int section) { - if (0 != __dbus_check()) { - return -1; //MAS_ERROR_OPERATION_FAILED; - } + static int serial = 0; + bundle *b = bundle_create(); - DBusMessage* msg; + streaming_data_header header; + header.streaming_data_type = 1; + header.streaming_data_size = sizeof(streaming_data_header) + sizeof(streaming_data_streaming_section_header); + header.streaming_data_serial = g_streaming_data_serial++; - DBusError err; - dbus_error_init(&err); + streaming_data_streaming_section_header streaming_section_header; + streaming_section_header.section = section; - char service_name[64]; - memset(service_name, '\0', 64); - snprintf(service_name, 64, "%s_%d", MA_CLIENT_SERVICE_NAME, pid); + unsigned char buffer[STREAMING_BUFFER_SIZE]; + size_t total_size = 0; + memcpy(buffer, &header, sizeof(header)); + total_size += sizeof(header); + memcpy(buffer + total_size, &streaming_section_header, sizeof(streaming_section_header)); + total_size += sizeof(streaming_section_header); - msg = dbus_message_new_method_call( - service_name, - MA_CLIENT_SERVICE_OBJECT_PATH, - MA_CLIENT_SERVICE_INTERFACE, - MAS_METHOD_AUDIO_STREAMING_DATA_SECTION); + bundle_add_byte(b, "content", buffer, total_size); + int ret = message_port_send_message(mas_get_client_appid_by_pid(pid), message_port, b); + if (MESSAGE_PORT_ERROR_NONE != ret) + masc_message_port_error(ret); - static int count = 0; - if (NULL == msg) { - MAS_LOGE(">>>> Request mas send streaming section changed information : Fail to make message"); - return -1; // MAS_ERROR_OPERATION_FAILED; - } else { - MAS_LOGD(">>>> Request mas send streaming section changed information : %s", service_name); - } - - if (true != dbus_message_append_args(msg, - DBUS_TYPE_INT32, §ion, - DBUS_TYPE_INVALID)) { - dbus_message_unref(msg); - MAS_LOGE("[ERROR] Fail to append args"); - return -1; - } - - dbus_message_set_no_reply(msg, TRUE); - - if (1 != dbus_connection_send(g_conn_sender, msg, NULL)) { - MAS_LOGE("[Dbus ERROR] Fail to Send"); - return -1; // MAS_ERROR_OPERATION_FAILED; - } else { - MAS_LOGI("[Dbus DEBUG] Success to Send streaming section changed information : %d %d", pid, section); - dbus_connection_flush(g_conn_sender); - } - - dbus_message_unref(msg); + bundle_free(b); return 0; } @@ -1115,7 +1109,6 @@ int mas_dbus_open_connection() MAS_LOGD("Get fd from dbus : %d", fd); } - g_dbus_fd_handler = ecore_main_fd_handler_add(fd, ECORE_FD_READ, (Ecore_Fd_Cb)listener_event_callback, g_conn_listener, NULL, NULL); if (NULL == g_dbus_fd_handler) { diff --git a/src/multi_assistant_service.c b/src/multi_assistant_service.c index d07cf18..08f0435 100644 --- a/src/multi_assistant_service.c +++ b/src/multi_assistant_service.c @@ -96,7 +96,6 @@ int ma_client_create(ma_client_s *info) } *data = *info; - g_client_list = g_slist_append(g_client_list, data); return 0; @@ -892,6 +891,27 @@ int mas_get_client_pid_by_appid(const char *appid) return ret; } +const char* mas_get_client_appid_by_pid(int pid) +{ + const char* ret = NULL; + + ma_client_s *client = NULL; + client = ma_client_find_by_pid(pid); + if (client) { + ret = client->appid; + } + + int status = aul_app_get_status_bypid(pid); + if (-1 != ret && 0 > status) { + MAS_LOGE("The appid for %d was %s, but it seems to be terminated : %d", + pid, (ret ? ret : "NULL"), status); + mas_client_deinitialize(pid); + ret = NULL; + } + + return ret; +} + bool mas_get_client_custom_ui_option_by_appid(const char *appid) { bool ret = false; -- 2.7.4 From 3102f06ddd39e3a52b24a5b0190696dcb0201f6b Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Mon, 6 Jan 2020 20:58:15 +0900 Subject: [PATCH 08/16] Bump version to 0.2.21 Change-Id: I8390431342e0b75a3413506134bd663558e98f89 --- org.tizen.multi-assistant-service.xml | 2 +- packaging/org.tizen.multi-assistant-service.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.tizen.multi-assistant-service.xml b/org.tizen.multi-assistant-service.xml index 8642e5a..0c6e070 100644 --- a/org.tizen.multi-assistant-service.xml +++ b/org.tizen.multi-assistant-service.xml @@ -1,5 +1,5 @@ - + Won Nam Jang Sooyeon Kim diff --git a/packaging/org.tizen.multi-assistant-service.spec b/packaging/org.tizen.multi-assistant-service.spec index 714b073..87c518b 100644 --- a/packaging/org.tizen.multi-assistant-service.spec +++ b/packaging/org.tizen.multi-assistant-service.spec @@ -1,6 +1,6 @@ Name: org.tizen.multi-assistant-service Summary: Multi assistant service -Version: 0.2.20 +Version: 0.2.21 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From 916c7e207b52ac035b31fc0c30c77ca6d54c090f Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Tue, 7 Jan 2020 15:57:28 +0900 Subject: [PATCH 09/16] Pack several messages in one packet for efficiency Change-Id: I572dd3e73270a05d0b2e2d1055096c1b401c641d --- src/multi_assistant_dbus.c | 51 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/src/multi_assistant_dbus.c b/src/multi_assistant_dbus.c index 72d3eda..a09d82d 100644 --- a/src/multi_assistant_dbus.c +++ b/src/multi_assistant_dbus.c @@ -216,7 +216,8 @@ void masc_message_port_error(int error) int masc_dbus_send_streaming_audio_data(int pid, int event, unsigned char* data, unsigned int data_size) { - bundle *b = bundle_create(); + static unsigned char pending_buffer[STREAMING_BUFFER_SIZE]; + static unsigned int pending_buffer_size = 0; streaming_data_header header; header.streaming_data_type = 0; @@ -236,12 +237,50 @@ int masc_dbus_send_streaming_audio_data(int pid, int event, unsigned char* data, memcpy(buffer + total_size, data, data_size); total_size += data_size; - bundle_add_byte(b, "content", buffer, total_size); - int ret = message_port_send_message(mas_get_client_appid_by_pid(pid), message_port, b); - if (MESSAGE_PORT_ERROR_NONE != ret) - masc_message_port_error(ret); + static int last_serial_waiting_for_flush = -1; + if (0 == header.streaming_data_serial % 50) { + last_serial_waiting_for_flush = header.streaming_data_serial; + MAS_LOGI("queueing streaming data, serial : %d", last_serial_waiting_for_flush); + } + if (pending_buffer_size + total_size > STREAMING_BUFFER_SIZE || + MAS_SPEECH_STREAMING_EVENT_FINISH == event) { + bundle *b = bundle_create(); + if (b) { + bundle_add_byte(b, "content", pending_buffer, pending_buffer_size); + int ret = message_port_send_message( + mas_get_client_appid_by_pid(pid), message_port, b); + if (MESSAGE_PORT_ERROR_NONE != ret) + masc_message_port_error(ret); + + pending_buffer_size = 0; + bundle_free(b); + } else { + MAS_LOGE("Bundle creation failed!!!"); + } - bundle_free(b); + if (-1 != last_serial_waiting_for_flush) { + MAS_LOGI("flushing streaming data, serial : %d", last_serial_waiting_for_flush); + last_serial_waiting_for_flush = -1; + } + } + + if (MAS_SPEECH_STREAMING_EVENT_FINISH == event) { + bundle *b = bundle_create(); + if (b) { + bundle_add_byte(b, "content", buffer, total_size); + int ret = message_port_send_message( + mas_get_client_appid_by_pid(pid), message_port, b); + if (MESSAGE_PORT_ERROR_NONE != ret) + masc_message_port_error(ret); + + bundle_free(b); + } else { + MAS_LOGE("Bundle creation failed!!!"); + } + } else { + memcpy(pending_buffer + pending_buffer_size, buffer, total_size); + pending_buffer_size += total_size; + } return 0; } -- 2.7.4 From 78ee43d15f6d17073b554738f35480ee6cc3d97b Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Tue, 7 Jan 2020 15:58:23 +0900 Subject: [PATCH 10/16] Bump version to 0.2.22 Change-Id: I5143156578e0706c003155d7c90bf924b74e7810 --- org.tizen.multi-assistant-service.xml | 2 +- packaging/org.tizen.multi-assistant-service.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.tizen.multi-assistant-service.xml b/org.tizen.multi-assistant-service.xml index 0c6e070..6e77c21 100644 --- a/org.tizen.multi-assistant-service.xml +++ b/org.tizen.multi-assistant-service.xml @@ -1,5 +1,5 @@ - + Won Nam Jang Sooyeon Kim diff --git a/packaging/org.tizen.multi-assistant-service.spec b/packaging/org.tizen.multi-assistant-service.spec index 87c518b..835e25e 100644 --- a/packaging/org.tizen.multi-assistant-service.spec +++ b/packaging/org.tizen.multi-assistant-service.spec @@ -1,6 +1,6 @@ Name: org.tizen.multi-assistant-service Summary: Multi assistant service -Version: 0.2.21 +Version: 0.2.22 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From 89dd076530a9d551d958ead849767b8b0fac6037 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Tue, 7 Jan 2020 16:49:03 +0900 Subject: [PATCH 11/16] Add volume.set privilege for sound ducking feature Change-Id: I405a53b9cd0068411bf9eccd4e9de37250e80420 --- org.tizen.multi-assistant-service.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/org.tizen.multi-assistant-service.xml b/org.tizen.multi-assistant-service.xml index 6e77c21..7ee7351 100644 --- a/org.tizen.multi-assistant-service.xml +++ b/org.tizen.multi-assistant-service.xml @@ -30,6 +30,7 @@ http://tizen.org/privilege/recorder http://tizen.org/privilege/internet http://tizen.org/privilege/network.get + http://tizen.org/privilege/volume.set http://tizen.org/privilege/bluetooth http://tizen.org/privilege/bluetooth.admin -- 2.7.4 From 05bc6c7a344c17a90f89556f36074171c251e0e8 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 8 Jan 2020 15:35:27 +0900 Subject: [PATCH 12/16] Fix incorrect parameter of vconf_ignore_key_changed() Change-Id: I6552ee7abf9477b991809f68c6b10284b254b01b --- plugins/wakeup-manager/src/wakeup_settings.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/wakeup-manager/src/wakeup_settings.cpp b/plugins/wakeup-manager/src/wakeup_settings.cpp index 7324838..c7c1142 100644 --- a/plugins/wakeup-manager/src/wakeup_settings.cpp +++ b/plugins/wakeup-manager/src/wakeup_settings.cpp @@ -231,10 +231,13 @@ void CWakeupSettings::initialize() void CWakeupSettings::deinitialize() { - vconf_ignore_key_changed(WAKEUP_SETTINGS_KEY_VOICE_INPUT_LANGUAGE, NULL); - vconf_ignore_key_changed(WAKEUP_SETTINGS_KEY_DEFAULT_ASSISTANT_APPID, NULL); + vconf_ignore_key_changed(WAKEUP_SETTINGS_KEY_VOICE_INPUT_LANGUAGE, + wakeup_setting_input_language_changed_cb); + vconf_ignore_key_changed(WAKEUP_SETTINGS_KEY_DEFAULT_ASSISTANT_APPID, + wakeup_setting_default_assistant_appid_changed_cb); if (true == mMultipleMode) { - vconf_ignore_key_changed(WAKEUP_SETTINGS_KEY_ENABLED_ASSISTANTS, NULL); + vconf_ignore_key_changed(WAKEUP_SETTINGS_KEY_ENABLED_ASSISTANTS, + wakeup_setting_enabled_assistants_changed_cb); } } -- 2.7.4 From d62799e297732a8b2a92f98e3466b9a6ea3bedcd Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 8 Jan 2020 15:48:41 +0900 Subject: [PATCH 13/16] Make sure to delete timer when deinitializing Change-Id: Ifda8f8dea1513600d236e6b4c85660bd07dcbf29 --- plugins/wakeup-manager/src/wakeup_manager.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/wakeup-manager/src/wakeup_manager.cpp b/plugins/wakeup-manager/src/wakeup_manager.cpp index b2c427d..6ccc94a 100644 --- a/plugins/wakeup-manager/src/wakeup_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_manager.cpp @@ -137,6 +137,11 @@ bool CWakeupManager::deinitialize() { MWR_LOGI("[ENTER]"); + if (mStreamingDurationTimer) { + ecore_timer_del(mStreamingDurationTimer); + mStreamingDurationTimer = nullptr; + } + dependency_resolver_deinitialize(); mAssistantConfigManager.deinitialize(); -- 2.7.4 From 0a9ba47e9872ce41830fd9bb2513359baa1601da Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 8 Jan 2020 15:36:25 +0900 Subject: [PATCH 14/16] Bump version to 0.2.23 Change-Id: I4271048f1d8ebd33f8b6b889291d84cf21bba1e0 --- org.tizen.multi-assistant-service.xml | 2 +- packaging/org.tizen.multi-assistant-service.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.tizen.multi-assistant-service.xml b/org.tizen.multi-assistant-service.xml index 7ee7351..dd53b5a 100644 --- a/org.tizen.multi-assistant-service.xml +++ b/org.tizen.multi-assistant-service.xml @@ -1,5 +1,5 @@ - + Won Nam Jang Sooyeon Kim diff --git a/packaging/org.tizen.multi-assistant-service.spec b/packaging/org.tizen.multi-assistant-service.spec index 835e25e..e461735 100644 --- a/packaging/org.tizen.multi-assistant-service.spec +++ b/packaging/org.tizen.multi-assistant-service.spec @@ -1,6 +1,6 @@ Name: org.tizen.multi-assistant-service Summary: Multi assistant service -Version: 0.2.22 +Version: 0.2.23 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From 81ba7072bd8a0fe016a864448c203e3805021a61 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Fri, 10 Jan 2020 19:21:30 +0900 Subject: [PATCH 15/16] Use aul_launch_app_async for launching voice assistants Change-Id: I86a4986fba9d4e811d70f0f23c99f8e800000ed1 --- src/multi_assistant_service.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/multi_assistant_service.c b/src/multi_assistant_service.c index 08f0435..7fb2f3e 100644 --- a/src/multi_assistant_service.c +++ b/src/multi_assistant_service.c @@ -1084,9 +1084,9 @@ int mas_launch_client_by_appid(const char *appid, CLIENT_LAUNCH_MODE launch_mode appid, b, result, get_error_message(result)); } - result = aul_launch_app(appid, b); + result = aul_launch_app_async(appid, b); if (result < AUL_R_OK) { - MAS_LOGE("ERROR : aul_launch_app failed. app_id [%s] bundle[%p] result[%d : %s]", + MAS_LOGE("ERROR : aul_launch_app_async failed. app_id [%s] bundle[%p] result[%d : %s]", appid, b, result, get_error_message(result)); } -- 2.7.4 From 44a92674edb7200b99a9cce2e3e51f9de16737d4 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Fri, 10 Jan 2020 19:21:52 +0900 Subject: [PATCH 16/16] Bump version to 0.2.24 Change-Id: I693804f54163f36e172cfb64a11486078ae6b5ac --- org.tizen.multi-assistant-service.xml | 2 +- packaging/org.tizen.multi-assistant-service.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.tizen.multi-assistant-service.xml b/org.tizen.multi-assistant-service.xml index dd53b5a..f0d6800 100644 --- a/org.tizen.multi-assistant-service.xml +++ b/org.tizen.multi-assistant-service.xml @@ -1,5 +1,5 @@ - + Won Nam Jang Sooyeon Kim diff --git a/packaging/org.tizen.multi-assistant-service.spec b/packaging/org.tizen.multi-assistant-service.spec index e461735..3e9c894 100644 --- a/packaging/org.tizen.multi-assistant-service.spec +++ b/packaging/org.tizen.multi-assistant-service.spec @@ -1,6 +1,6 @@ Name: org.tizen.multi-assistant-service Summary: Multi assistant service -Version: 0.2.23 +Version: 0.2.24 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4