From 26affd08fabbb73a92e13e430b5f9a352b5d9d3a Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 13 Aug 2020 14:32:28 +0900 Subject: [PATCH 01/16] Add more logs for tracking detailed streaming process Change-Id: Ic252bfc9af80f8fb49a882d49cc34f94e409d016 --- plugins/wakeup-manager/src/wakeup_engine_manager.cpp | 4 +++- plugins/wakeup-manager/src/wakeup_manager.cpp | 5 +++++ src/client_manager.cpp | 5 +++++ src/service_main.cpp | 2 ++ src/service_plugin.cpp | 1 + 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/plugins/wakeup-manager/src/wakeup_engine_manager.cpp b/plugins/wakeup-manager/src/wakeup_engine_manager.cpp index 0706120..2765498 100644 --- a/plugins/wakeup-manager/src/wakeup_engine_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_engine_manager.cpp @@ -270,8 +270,10 @@ void CWakeupEngineManager::streaming_speech_data_thread_func() { MWR_LOGI("[ENTER]"); - if (nullptr == mSelectedEngine) + if (nullptr == mSelectedEngine) { + MWR_LOGE("No Engine Selected"); return; + } const wakeup_engine_interface *interface = &(mSelectedEngine->interface); diff --git a/plugins/wakeup-manager/src/wakeup_manager.cpp b/plugins/wakeup-manager/src/wakeup_manager.cpp index d1331cb..5b04280 100644 --- a/plugins/wakeup-manager/src/wakeup_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_manager.cpp @@ -888,7 +888,9 @@ void CWakeupManager::set_dependency_module_command(string engine_name, string co void CWakeupManager::start_streaming_duration_timer() { + MWR_LOGI("DURATION_TIMER START"); ecore_main_loop_thread_safe_call_async([](void* data) { + MWR_LOGI("DURATION_TIMER START - async"); CWakeupManager* manager = static_cast(data); if (!manager) return; @@ -907,7 +909,9 @@ void CWakeupManager::stop_streaming_duration_timer() { MWR_LOGI("DURATION_TIMER STOP"); if (mStreamingDurationTimer) { + MWR_LOGI("DURATION_TIMER STOP - has timer"); ecore_main_loop_thread_safe_call_async([](void* data) { + MWR_LOGI("DURATION_TIMER STOP - async"); CWakeupManager* manager = static_cast(data); if (!manager) return; @@ -921,6 +925,7 @@ void CWakeupManager::stop_streaming_duration_timer() void CWakeupManager::set_streaming_duration_timer(Ecore_Timer* timer) { + MWR_LOGI("DURATION_TIMER SET : %p", timer); mStreamingDurationTimer = timer; } diff --git a/src/client_manager.cpp b/src/client_manager.cpp index 01cd9d5..18339df 100644 --- a/src/client_manager.cpp +++ b/src/client_manager.cpp @@ -38,6 +38,7 @@ int CClientManager::create_client(pid_t pid, std::string appid) data->pid = pid; data->appid = appid; mClientList = g_slist_append(mClientList, data); + MAS_LOGI("Create client : %s %d", appid.c_str(), pid); } else { MAS_LOGE("[ERROR] data is NULL"); return -1;// MA_ERROR_OUT_OF_MEMORY; @@ -74,6 +75,7 @@ int CClientManager::destroy_client_by_appid(std::string appid) ma_client_s* CClientManager::find_client_by_appid(std::string appid) { + MAS_LOGI("Looking for client with appid : %s", appid.c_str()); ma_client_s *data = NULL; int count = g_slist_length(mClientList); @@ -84,6 +86,7 @@ ma_client_s* CClientManager::find_client_by_appid(std::string appid) if (NULL != data) { if (0 == appid.compare(data->appid)) { + MAS_LOGI("Found client : %s %d", data->appid.c_str(), data->pid); return data; } } @@ -138,6 +141,7 @@ pid_t CClientManager::find_client_pid_by_index(unsigned int index) pid_t CClientManager::find_client_pid_by_appid(std::string appid) { + MAS_LOGI("Checking PID of appid : %s", appid.c_str()); pid_t pid = -1; if (nullptr == mApplicationManager) { @@ -147,6 +151,7 @@ pid_t CClientManager::find_client_pid_by_appid(std::string appid) ma_client_s* client = find_client_by_appid(appid); if (client) { + MAS_LOGI("Found client : %s %d", client->appid.c_str(), client->pid); bool running = mApplicationManager->is_application_running(client->pid); if (false == running) { MAS_LOGE("The PID for %s was %d, but it seems to be terminated", diff --git a/src/service_main.cpp b/src/service_main.cpp index a741ae0..bb377a2 100644 --- a/src/service_main.cpp +++ b/src/service_main.cpp @@ -199,6 +199,7 @@ int CServiceMain::client_send_recognition_result(pid_t pid, int result) int CServiceMain::client_start_streaming_audio_data(pid_t pid, int type) { + MAS_LOGI("[ENTER"); int ret = -1; const char *current_maclient_appid = NULL; if (mCurrentClientInfo >= 0 && mCurrentClientInfo < MAX_MACLIENT_INFO_NUM) { @@ -748,6 +749,7 @@ pid_t CServiceMain::get_current_audio_processing_pid() pid_t CServiceMain::get_client_pid_by_appid(const char *appid) { + MAS_LOGI("Checking PID of appid : %s", appid); pid_t ret = -1; if (appid) { diff --git a/src/service_plugin.cpp b/src/service_plugin.cpp index 254fb8e..7f26d00 100644 --- a/src/service_plugin.cpp +++ b/src/service_plugin.cpp @@ -1020,6 +1020,7 @@ int CServicePlugin::process_event(int event, void *data, int len) int CServicePlugin::start_streaming_utterance_data(void) { + MAS_LOGI("[ENTER"); int ret = -1; if (NULL != mPluginHandle) { wakeup_manager_start_streaming_utterance_data func = mWakeupManagerInterface.start_streaming_utterance_data; -- 2.7.4 From d8d75be5cdb3ebe1b55d33426fbcb38bcc7d79a9 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 13 Aug 2020 14:34:31 +0900 Subject: [PATCH 02/16] Bump version to 0.3.7 Change-Id: I7d91386600cd93aab861f3b68644a607c0c978d5 --- 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 7ac0e5a..2f8a2db 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 6957ade..80dfbcb 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.3.6 +Version: 0.3.7 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From 1b6655cf77b6081571eef2897b64196bc6b77fec Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 19 Aug 2020 15:23:34 +0900 Subject: [PATCH 03/16] Check sender validity on streaming related requests Change-Id: I648536f129462e4980a8b31e11e10d9dac996aac --- inc/service_main.h | 1 + src/service_main.cpp | 42 +++++++++++++++++++++++++++++++----------- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/inc/service_main.h b/inc/service_main.h index 414a3b9..766e512 100644 --- a/inc/service_main.h +++ b/inc/service_main.h @@ -157,6 +157,7 @@ private: bool check_preprocessing_assistant_exists(); ma_preprocessing_allow_mode_e get_preprocessing_allow_mode(const char* appid); bool is_current_preprocessing_assistant(const char* appid); + bool is_current_assistant(pid_t pid); private: std::string mCurrentLanguage{"en_US"}; diff --git a/src/service_main.cpp b/src/service_main.cpp index bb377a2..bbf3098 100644 --- a/src/service_main.cpp +++ b/src/service_main.cpp @@ -57,6 +57,24 @@ bool CServiceMain::check_preprocessing_assistant_exists() return ret; } +bool CServiceMain::is_current_assistant(pid_t pid) +{ + bool ret = false; + const char *current_maclient_appid = NULL; + if (mCurrentClientInfo >= 0 && mCurrentClientInfo < MAX_MACLIENT_INFO_NUM) { + current_maclient_appid = mClientInfo[mCurrentClientInfo].appid; + pid_t pid_by_appid = mClientManager.find_client_pid_by_appid( + std::string{current_maclient_appid}); + if (pid == pid_by_appid) { + ret = true; + } else { + MAS_LOGE("[ERROR] Current client: [%d], active client : [%d %s]", + pid, pid_by_appid, current_maclient_appid); + } + } + return ret; +} + bool CServiceMain::is_current_preprocessing_assistant(const char* appid) { if (NULL == appid) return false; @@ -138,6 +156,8 @@ int CServiceMain::client_send_voice_key_status_change(pid_t pid, ma_voice_key_st int CServiceMain::client_send_asr_result(pid_t pid, int event, const char* asr_result) { MAS_LOGD("[Enter] pid(%d), event(%d), asr_result(%s)", pid, event, asr_result); + if (!is_current_assistant(pid)) return -1; + bool ui_panel_enabled = mServicePlugin.is_ui_panel_enabled(); int ret = 0; if (ui_panel_enabled) { @@ -156,6 +176,8 @@ int CServiceMain::client_send_result(pid_t pid, const char* display_text, const char* utterance_text, const char* result_json) { MAS_LOGD("[Enter] pid(%d), display_text(%s), utterance_text(%s), result_json(%s)", pid, display_text, utterance_text, result_json); + if (!is_current_assistant(pid)) return -1; + bool ui_panel_enabled = mServicePlugin.is_ui_panel_enabled(); int ret = 0; if (ui_panel_enabled) { @@ -178,6 +200,8 @@ int CServiceMain::client_send_result(pid_t pid, const char* display_text, int CServiceMain::client_send_recognition_result(pid_t pid, int result) { MAS_LOGD("[Enter] pid(%d), result(%d)", pid, result); + if (!is_current_assistant(pid)) return -1; + bool ui_panel_enabled = mServicePlugin.is_ui_panel_enabled(); int ret = 0; if (ui_panel_enabled) { @@ -200,18 +224,10 @@ int CServiceMain::client_send_recognition_result(pid_t pid, int result) int CServiceMain::client_start_streaming_audio_data(pid_t pid, int type) { MAS_LOGI("[ENTER"); + int ret = -1; - const char *current_maclient_appid = NULL; - if (mCurrentClientInfo >= 0 && mCurrentClientInfo < MAX_MACLIENT_INFO_NUM) { - current_maclient_appid = mClientInfo[mCurrentClientInfo].appid; - pid_t pid_by_appid = mClientManager.find_client_pid_by_appid( - std::string{current_maclient_appid}); - if (pid != pid_by_appid) { - MAS_LOGE("[ERROR] Current client: [%d], active client : [%d %s]", - pid, pid_by_appid, current_maclient_appid); - return ret; - } - } + if (!is_current_assistant(pid)) return ret; + switch(type) { case MA_AUDIO_STREAMING_DATA_TYPE_CURRENT_UTTERANCE: ret = mServicePlugin.start_streaming_utterance_data(); @@ -232,6 +248,8 @@ int CServiceMain::client_start_streaming_audio_data(pid_t pid, int type) int CServiceMain::client_stop_streaming_audio_data(pid_t pid, int type) { int ret = -1; + if (!is_current_assistant(pid)) return ret; + switch(type) { case MA_AUDIO_STREAMING_DATA_TYPE_CURRENT_UTTERANCE: ret = mServicePlugin.stop_streaming_utterance_data(); @@ -270,6 +288,8 @@ int CServiceMain::client_set_assistant_specific_command(pid_t pid, const char *c int CServiceMain::client_set_background_volume(pid_t pid, double ratio) { + if (!is_current_assistant(pid)) return -1; + std::string pid_appid; boost::optional appid_by_pid = mApplicationManager.get_appid_by_pid(pid); if (appid_by_pid) { -- 2.7.4 From c0e901fe1e4d9963cb9ee1196c6923f836e21f4d Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 19 Aug 2020 15:25:56 +0900 Subject: [PATCH 04/16] Bump version to 0.3.8 Change-Id: I768c61e5d71633032fb2f4e6c222429b39aa1db1 --- 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 2f8a2db..758e906 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 80dfbcb..cbd3503 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.3.7 +Version: 0.3.8 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From 7221b868f05816b602529d053b145e84a025db44 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 26 Aug 2020 11:27:14 +0900 Subject: [PATCH 05/16] Update selected wakeup info based on wakeup engine name Change-Id: Ib9098fd831797fbd1e6c0509438e090f5593a47f --- plugins/wakeup-manager/src/wakeup_engine_manager.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/plugins/wakeup-manager/src/wakeup_engine_manager.cpp b/plugins/wakeup-manager/src/wakeup_engine_manager.cpp index 2765498..09803a8 100644 --- a/plugins/wakeup-manager/src/wakeup_engine_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_engine_manager.cpp @@ -160,14 +160,18 @@ bool CWakeupEngineManager::get_audio_data_required() void CWakeupEngineManager::set_selected_wakeup_info(mas_wakeup_event_info wakeup_info) { mSelectedEngine = nullptr; - for (const auto& info : mEngineInfo) { - string appid = string{wakeup_info.wakeup_appid}; - bool found = contains(info.assistant_list, appid); - if (found) { - mSelectedEngine = &info; - MWR_LOGD("Selected : %s", info.engine_name.c_str()); - } + const auto& iter = find_if(mEngineInfo.begin(), mEngineInfo.end(), + [wakeup_info](const EngineInfo& info) { + if (nullptr == wakeup_info.wakeup_engine) + return false; + + return (0 == info.engine_name.compare(wakeup_info.wakeup_engine)); + }); + + if (iter != mEngineInfo.end()) { + mSelectedEngine = &(*iter); + MWR_LOGD("Selected : %s", iter->engine_name.c_str()); } } -- 2.7.4 From 3cf9d456596c4410baa1a67ffca0e410986d6c80 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 27 Aug 2020 18:32:15 +0900 Subject: [PATCH 06/16] Bump version to 0.3.9 Change-Id: I64e064c0ed61e3faa6e71ad3d82604abb2ec69ce --- 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 758e906..1db9ad8 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 cbd3503..9e6a485 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.3.8 +Version: 0.3.9 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From ac37506f1b804ef4aca67cbcf171cc85f0ba2047 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 3 Sep 2020 21:00:38 +0900 Subject: [PATCH 07/16] Use appropriate pid when handling streaming failure event Change-Id: I6b2eda900ec9d17c6e37b36f046a8c9bcc0975a4 --- src/service_plugin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/service_plugin.cpp b/src/service_plugin.cpp index 7f26d00..97ad519 100644 --- a/src/service_plugin.cpp +++ b/src/service_plugin.cpp @@ -342,7 +342,8 @@ void handle_speech_streaming_event_failure(void* data) if (plugin) service_main = plugin->get_service_main(); if (service_main) { - service_main->client_send_recognition_result(0, MA_RECOGNITION_RESULT_EVENT_ERROR); + pid_t pid = service_main->get_current_client_pid(); + service_main->client_send_recognition_result(pid, MA_RECOGNITION_RESULT_EVENT_ERROR); } delete param; -- 2.7.4 From c5141574a82c4ccbf2fd0e9af59c7e53f418ff71 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 3 Sep 2020 21:33:53 +0900 Subject: [PATCH 08/16] Bump version to 0.3.10 Change-Id: I492c2c5f92d7312b7401bfe0204c4a36ff0ed607 --- 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 1db9ad8..c0ccb3a 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 9e6a485..f933fa9 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.3.9 +Version: 0.3.10 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From 923f2e524890115adf014484f32c24c7229e9ddd Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 7 Oct 2020 14:05:26 +0900 Subject: [PATCH 09/16] Change log level of some messages for better trackability Change-Id: Iee9c8cbe63735f2003e415689016dd312b78268b --- plugins/wakeup-manager/src/wakeup_manager.cpp | 60 ++++++++--------- .../wakeup-manager/src/wakeup_manager_wrapper.cpp | 76 +++++++++++----------- src/service_main.cpp | 14 ++-- 3 files changed, 75 insertions(+), 75 deletions(-) diff --git a/plugins/wakeup-manager/src/wakeup_manager.cpp b/plugins/wakeup-manager/src/wakeup_manager.cpp index 5b04280..642ea65 100644 --- a/plugins/wakeup-manager/src/wakeup_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_manager.cpp @@ -100,7 +100,7 @@ void CWakeupManager::initialize_wakeup_policy() bool CWakeupManager::initialize() { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); mPolicyEventObserver.set_wakeup_manager(this); mEngineEventObserver.set_wakeup_manager(this); @@ -184,7 +184,7 @@ void CWakeupManager::unsubscribe_setting_observer(ISettingValueObserver* observe bool CWakeupManager::activate(void) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (WAKEUP_MANAGER_STATE_INACTIVE != mWakeupManagerState) return false; @@ -204,7 +204,7 @@ bool CWakeupManager::activate(void) bool CWakeupManager::deactivate(void) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (WAKEUP_MANAGER_STATE_INACTIVE == mWakeupManagerState) return false; @@ -222,7 +222,7 @@ bool CWakeupManager::deactivate(void) bool CWakeupManager::add_assistant_language(string appid, string language) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); bool found = false; for (auto& info : mAssistantLanguageInfo) { if(0 == info.appid.compare(appid)) { @@ -248,7 +248,7 @@ bool CWakeupManager::add_assistant_language(string appid, string language) bool CWakeupManager::add_assistant_wakeup_word(string appid, string wakeup_word, string language) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); mWakeupEngineManager.engine_add_wakeup_word(appid, wakeup_word, language); @@ -258,7 +258,7 @@ bool CWakeupManager::add_assistant_wakeup_word(string appid, string wakeup_word, bool CWakeupManager::remove_assistant_wakeup_word(string appid, string wakeup_word, string language) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); mWakeupEngineManager.engine_remove_wakeup_word(appid, wakeup_word, language); @@ -268,7 +268,7 @@ bool CWakeupManager::remove_assistant_wakeup_word(string appid, string wakeup_wo bool CWakeupManager::set_assistant_wakeup_engine(string appid, string engine) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); mWakeupEngineManager.engine_add_target_assistant(engine, appid); @@ -278,7 +278,7 @@ bool CWakeupManager::set_assistant_wakeup_engine(string appid, string engine) bool CWakeupManager::set_assistant_language(string appid, string language) { - MWR_LOGD("[ENTER] : %s, %s", appid.c_str(), language.c_str()); + MWR_LOGI("[ENTER] : %s, %s", appid.c_str(), language.c_str()); mWakeupEngineManager.set_assistant_language(appid, language); mAssistantConfigManager.set_assistant_language(appid, language); @@ -289,7 +289,7 @@ bool CWakeupManager::set_assistant_language(string appid, string language) bool CWakeupManager::set_assistant_enabled(string appid, bool enabled) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); mAssistantEnabled[appid] = enabled; bool activated = enabled; @@ -307,7 +307,7 @@ bool CWakeupManager::set_assistant_enabled(string appid, bool enabled) bool CWakeupManager::set_default_assistant(string appid) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); /* Check if previous default assistant has to be deactivated */ bool activated = true; @@ -340,7 +340,7 @@ bool CWakeupManager::get_assistant_enabled(string appid) bool CWakeupManager::set_language(string language) { bool valid = false; - MWR_LOGD("[ENTER] : %s", language.c_str()); + MWR_LOGI("[ENTER] : %s", language.c_str()); if (check_language_valid(language)) { mCurrentLanguage = language; @@ -420,7 +420,7 @@ wakeup_manager_state_e CWakeupManager::get_manager_state() bool CWakeupManager::update_voice_feedback_state(string appid, bool state) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (state) { if (WAKEUP_MANAGER_STATE_LISTENING == mWakeupManagerState || @@ -439,7 +439,7 @@ bool CWakeupManager::update_voice_feedback_state(string appid, bool state) bool CWakeupManager::set_assistant_specific_command(string appid, string command) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); /* static const string voice_key_pressed{"voice_key_pressed"}; @@ -469,7 +469,7 @@ bool CWakeupManager::set_background_volume(string appid, double ratio) bool CWakeupManager::update_recognition_result(string appid, int result) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); stop_streaming_utterance_data(); stop_streaming_previous_utterance_data(); @@ -511,7 +511,7 @@ bool CWakeupManager::change_voice_key_status(ma_voice_key_status_e status) { bool CWakeupManager::process_plugin_event(mas_plugin_event_e event, void* data, int len) { - MWR_LOGD("[ENTER] : %d", event); + MWR_LOGI("[ENTER] : %d", event); if (WAKEUP_MANAGER_STATE_INACTIVE == mWakeupManagerState) return false; @@ -653,7 +653,7 @@ static Eina_Bool streaming_duration_expired(void *data) bool CWakeupManager::start_streaming_utterance_data() { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); mAudioManager.stop_streaming_current_utterance_data(); mWakeupEngineManager.stop_streaming_current_utterance_data(); @@ -679,7 +679,7 @@ bool CWakeupManager::start_streaming_utterance_data() bool CWakeupManager::stop_streaming_utterance_data() { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (STREAMING_MODE::UTTERANCE != mStreamingMode) return false; mAudioManager.stop_streaming_current_utterance_data(); @@ -701,7 +701,7 @@ bool CWakeupManager::stop_streaming_utterance_data() bool CWakeupManager::start_streaming_follow_up_data() { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); mAudioManager.stop_streaming_follow_up_data(); mWakeupEngineManager.stop_streaming_current_utterance_data(); @@ -726,7 +726,7 @@ bool CWakeupManager::start_streaming_follow_up_data() bool CWakeupManager::stop_streaming_follow_up_data() { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (STREAMING_MODE::FOLLOW_UP != mStreamingMode) return false; mAudioManager.stop_streaming_follow_up_data(); @@ -753,7 +753,7 @@ bool CWakeupManager::stop_streaming_follow_up_data() bool CWakeupManager::start_streaming_previous_utterance_data() { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); mAudioManager.stop_streaming_previous_utterance_data(); mWakeupEngineManager.stop_streaming_current_utterance_data(); @@ -770,7 +770,7 @@ bool CWakeupManager::start_streaming_previous_utterance_data() bool CWakeupManager::stop_streaming_previous_utterance_data() { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (STREAMING_MODE::PREVIOUS_UTTERANCE != mStreamingMode) return false; mAudioManager.stop_streaming_previous_utterance_data(); @@ -792,7 +792,7 @@ bool CWakeupManager::stop_streaming_previous_utterance_data() bool CWakeupManager::get_audio_format(int* rate, int* channel, int* audio_type) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (!audio_type || !rate || !channel) { MWR_LOGE("[ERROR] Invalid parameter"); @@ -807,7 +807,7 @@ bool CWakeupManager::get_audio_format(int* rate, int* channel, int* audio_type) bool CWakeupManager::get_audio_source_type(char** type) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (!type) { MWR_LOGE("[ERROR] Invalid parameter"); @@ -822,7 +822,7 @@ bool CWakeupManager::get_audio_source_type(char** type) bool CWakeupManager::set_wake_word_audio_require_flag(bool require) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); mWakeupEngineManager.set_wake_word_audio_require_flag(require); @@ -832,7 +832,7 @@ bool CWakeupManager::set_wake_word_audio_require_flag(bool require) bool CWakeupManager::set_voice_key_tap_duration(float duration) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); dependency_resolver_set_voice_key_tap_duration(duration); @@ -842,7 +842,7 @@ bool CWakeupManager::set_voice_key_tap_duration(float duration) bool CWakeupManager::unset_voice_key_tap_duration() { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); dependency_resolver_unset_voice_key_tap_duration(); @@ -936,7 +936,7 @@ Ecore_Timer* CWakeupManager::get_streaming_duration_timer() bool CWakeupManager::CEngineEventObserver::on_wakeup_event(string engine_name, mas_wakeup_event_info wakeup_info) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (nullptr == mWakeupManager) return false; if (nullptr == wakeup_info.wakeup_appid) return false; @@ -956,7 +956,7 @@ bool CWakeupManager::CEngineEventObserver::on_wakeup_event(string engine_name, m bool CWakeupManager::CEngineEventObserver::on_speech_status(string engine_name, mas_speech_status_e status) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (nullptr == mWakeupManager) return false; return true; @@ -964,7 +964,7 @@ bool CWakeupManager::CEngineEventObserver::on_speech_status(string engine_name, bool CWakeupManager::CEngineEventObserver::on_error(string engine_name, int error_code, string error_message) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (nullptr == mWakeupManager) return false; return true; @@ -972,7 +972,7 @@ bool CWakeupManager::CEngineEventObserver::on_error(string engine_name, int erro bool CWakeupManager::CEngineEventObserver::on_audio_data_require_status(string engine_name, bool require) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (nullptr == mWakeupManager) return false; if (WAKEUP_MANAGER_STATE_INACTIVE == mWakeupManager->get_manager_state()) return false; diff --git a/plugins/wakeup-manager/src/wakeup_manager_wrapper.cpp b/plugins/wakeup-manager/src/wakeup_manager_wrapper.cpp index 423561d..922a403 100644 --- a/plugins/wakeup-manager/src/wakeup_manager_wrapper.cpp +++ b/plugins/wakeup-manager/src/wakeup_manager_wrapper.cpp @@ -77,7 +77,7 @@ static std::unique_ptr g_wakeup_manager; int wakeup_manager_initialize(void) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); try { g_wakeup_event_observer.reset(new CWakeupEventObserver); @@ -174,7 +174,7 @@ int wakeup_manager_get_settings(ma_plugin_settings **settings, size_t *struct_si int wakeup_manager_add_assistant_wakeup_word(const char* appid, const char* wakeup_word, const char* language) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (NULL == appid || NULL == wakeup_word) { MWR_LOGD("[ERROR] Parameter is invalid, appid(%s), wakeup_word(%s), language(%s)", appid, wakeup_word, language); @@ -191,7 +191,7 @@ int wakeup_manager_add_assistant_wakeup_word(const char* appid, const char* wake int wakeup_manager_remove_assistant_wakeup_word(const char* appid, const char* wakeup_word, const char* language) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (NULL == appid || NULL == wakeup_word) { MWR_LOGD("[ERROR] Parameter is invalid, appid(%s), wakeup_word(%s), language(%s)", appid, wakeup_word, language); @@ -208,7 +208,7 @@ int wakeup_manager_remove_assistant_wakeup_word(const char* appid, const char* w int wakeup_manager_add_assistant_language(const char* appid, const char* language) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (NULL == appid || NULL == language) { MWR_LOGD("[ERROR] Parameter is invalid, appid(%s), language(%s)", appid, language); @@ -226,7 +226,7 @@ int wakeup_manager_add_assistant_language(const char* appid, const char* languag int wakeup_manager_set_assistant_wakeup_engine(const char* appid, const char* engine) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (NULL == appid || NULL == engine) { MWR_LOGD("[ERROR] Parameter is invalid, appid(%s), wakeup engine(%s)", appid, engine); @@ -243,7 +243,7 @@ int wakeup_manager_set_assistant_wakeup_engine(const char* appid, const char* en int wakeup_manager_set_default_assistant(const char* appid) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (NULL == appid) { MWR_LOGD("[ERROR] Parameter is NULL"); @@ -275,7 +275,7 @@ int wakeup_manager_get_default_assistant(const char** appid) int wakeup_manager_set_language(const char* language) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (NULL == language) { MWR_LOGD("[ERROR] Parameter is NULL"); @@ -298,7 +298,7 @@ int wakeup_manager_change_state(wakeup_manager_state_e state) int wakeup_manager_activate(void) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (nullptr == g_wakeup_manager) return -1; g_wakeup_manager->activate(); @@ -309,7 +309,7 @@ int wakeup_manager_activate(void) int wakeup_manager_deactivate(void) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (nullptr == g_wakeup_manager) return -1; g_wakeup_manager->deactivate(); @@ -320,7 +320,7 @@ int wakeup_manager_deactivate(void) int wakeup_manager_update_voice_feedback_state(const char* appid, int state) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); string appid_string; if (NULL == appid) { @@ -338,7 +338,7 @@ int wakeup_manager_update_voice_feedback_state(const char* appid, int state) int wakeup_manager_set_assistant_specific_command(const char* appid, const char* command) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); string appid_string; string command_string; @@ -357,7 +357,7 @@ int wakeup_manager_set_assistant_specific_command(const char* appid, const char* int wakeup_manager_set_background_volume(const char* appid, double ratio) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); string appid_string; if (NULL == appid) { @@ -375,7 +375,7 @@ int wakeup_manager_set_background_volume(const char* appid, double ratio) int wakeup_manager_update_recognition_result(const char* appid, int result) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); string appid_string; if (NULL == appid) { @@ -393,7 +393,7 @@ int wakeup_manager_update_recognition_result(const char* appid, int result) int wakeup_manager_process_plugin_event(mas_plugin_event_e event, void* data, int len) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (nullptr == g_wakeup_manager) return -1; g_wakeup_manager->process_plugin_event(event, data, len); @@ -404,7 +404,7 @@ int wakeup_manager_process_plugin_event(mas_plugin_event_e event, void* data, in int wakeup_manager_start_streaming_utterance_data(void) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (nullptr == g_wakeup_manager) return -1; g_wakeup_manager->start_streaming_utterance_data(); @@ -415,7 +415,7 @@ int wakeup_manager_start_streaming_utterance_data(void) int wakeup_manager_stop_streaming_utterance_data(void) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (nullptr == g_wakeup_manager) return -1; g_wakeup_manager->stop_streaming_utterance_data(); @@ -426,7 +426,7 @@ int wakeup_manager_stop_streaming_utterance_data(void) int wakeup_manager_start_streaming_follow_up_data(void) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (nullptr == g_wakeup_manager) return -1; g_wakeup_manager->start_streaming_follow_up_data(); @@ -437,7 +437,7 @@ int wakeup_manager_start_streaming_follow_up_data(void) int wakeup_manager_stop_streaming_follow_up_data(void) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (nullptr == g_wakeup_manager) return -1; g_wakeup_manager->stop_streaming_follow_up_data(); @@ -448,7 +448,7 @@ int wakeup_manager_stop_streaming_follow_up_data(void) int wakeup_manager_start_streaming_previous_utterance_data(void) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (nullptr == g_wakeup_manager) return -1; g_wakeup_manager->start_streaming_previous_utterance_data(); @@ -459,7 +459,7 @@ int wakeup_manager_start_streaming_previous_utterance_data(void) int wakeup_manager_stop_streaming_previous_utterance_data(void) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (nullptr == g_wakeup_manager) return -1; g_wakeup_manager->stop_streaming_previous_utterance_data(); @@ -470,7 +470,7 @@ int wakeup_manager_stop_streaming_previous_utterance_data(void) int wakeup_manager_get_audio_format(int* rate, int* channel, int* audio_type) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (!audio_type || !rate || !channel) { MWR_LOGE("[ERROR] Invalid parameter"); @@ -486,7 +486,7 @@ int wakeup_manager_get_audio_format(int* rate, int* channel, int* audio_type) int wakeup_manager_get_audio_source_type(char** type) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (!type) { MWR_LOGE("[ERROR] Invalid parameter"); @@ -502,7 +502,7 @@ int wakeup_manager_get_audio_source_type(char** type) int wakeup_manager_set_voice_key_tap_duration(float duration) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (nullptr == g_wakeup_manager) return -1; g_wakeup_manager->set_voice_key_tap_duration(duration); @@ -513,7 +513,7 @@ int wakeup_manager_set_voice_key_tap_duration(float duration) int wakeup_manager_unset_voice_key_tap_duration() { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (nullptr == g_wakeup_manager) return -1; g_wakeup_manager->unset_voice_key_tap_duration(); @@ -524,7 +524,7 @@ int wakeup_manager_unset_voice_key_tap_duration() int wakeup_manager_set_voice_key_support_mode(int mode) { - MWR_LOGD("[ENTER] : %d", mode); + MWR_LOGI("[ENTER] : %d", mode); if (nullptr == g_wakeup_manager) return -1; g_wakeup_manager->set_voice_key_support_mode(static_cast(mode)); @@ -535,7 +535,7 @@ int wakeup_manager_set_voice_key_support_mode(int mode) int wakeup_manager_set_wake_word_audio_require_flag(bool require) { - MWR_LOGD("[ENTER] : %d", require); + MWR_LOGI("[ENTER] : %d", require); if (nullptr == g_wakeup_manager) return -1; g_wakeup_manager->set_wake_word_audio_require_flag(require); @@ -546,7 +546,7 @@ int wakeup_manager_set_wake_word_audio_require_flag(bool require) int wakeup_manager_set_assistant_language(const char* appid, const char* language) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); string appid_string; string language_string; @@ -566,7 +566,7 @@ int wakeup_manager_set_assistant_language(const char* appid, const char* languag int wakeup_manager_set_wakeup_event_callback(wakeup_service_wakeup_event_cb callback, void* user_data) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (NULL == callback) { MWR_LOGE("[ERROR] Input parameter is NULL"); @@ -582,7 +582,7 @@ int wakeup_manager_set_wakeup_event_callback(wakeup_service_wakeup_event_cb call int wakeup_manager_set_utterance_streaming_callback(wakeup_service_speech_streaming_cb callback, void* user_data) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (NULL == callback) { MWR_LOGE("[ERROR] Input parameter is NULL"); @@ -598,7 +598,7 @@ int wakeup_manager_set_utterance_streaming_callback(wakeup_service_speech_stream int wakeup_manager_set_previous_utterance_streaming_callback(wakeup_service_speech_streaming_cb callback, void* user_data) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (NULL == callback) { MWR_LOGE("[ERROR] Input parameter is NULL"); @@ -614,7 +614,7 @@ int wakeup_manager_set_previous_utterance_streaming_callback(wakeup_service_spee int wakeup_manager_set_follow_up_streaming_callback(wakeup_service_speech_streaming_cb callback, void* user_data) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (NULL == callback) { MWR_LOGE("[ERROR] Input parameter is NULL"); @@ -630,7 +630,7 @@ int wakeup_manager_set_follow_up_streaming_callback(wakeup_service_speech_stream int wakeup_manager_set_speech_status_callback(wakeup_service_speech_status_cb callback, void* user_data) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (NULL == callback) { MWR_LOGE("[ERROR] Input parameter is NULL"); @@ -646,7 +646,7 @@ int wakeup_manager_set_speech_status_callback(wakeup_service_speech_status_cb ca int wakeup_manager_set_setting_changed_callback(wakeup_service_setting_changed_cb callback, void* user_data) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (NULL == callback) { MWR_LOGE("[ERROR] Input parameter is NULL"); @@ -662,7 +662,7 @@ int wakeup_manager_set_setting_changed_callback(wakeup_service_setting_changed_c int wakeup_manager_set_error_callback(wakeup_service_error_cb callback, void* user_data) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (NULL == callback) { MWR_LOGE("[ERROR] Input parameter is NULL"); @@ -678,7 +678,7 @@ int wakeup_manager_set_error_callback(wakeup_service_error_cb callback, void* us int wakeup_manager_set_streaming_section_changed_callback(wakeup_service_streaming_section_changed_cb callback, void* user_data) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (NULL == callback) { MWR_LOGE("[ERROR] Input parameter is NULL"); @@ -694,7 +694,7 @@ int wakeup_manager_set_streaming_section_changed_callback(wakeup_service_streami int wakeup_manager_set_wakeup_engine_command_callback(wakeup_service_engine_command_cb callback, void* user_data) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (NULL == callback) { MWR_LOGE("[ERROR] Input parameter is NULL"); @@ -710,7 +710,7 @@ int wakeup_manager_set_wakeup_engine_command_callback(wakeup_service_engine_comm int wakeup_manager_set_wakeup_service_state_changed_callback(wakeup_service_state_changed_cb callback, void* user_data) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (NULL == callback) { MWR_LOGE("[ERROR] Input parameter is NULL"); @@ -726,7 +726,7 @@ int wakeup_manager_set_wakeup_service_state_changed_callback(wakeup_service_stat int wakeup_manager_set_voice_key_status_changed_callback(wakeup_service_voice_key_status_changed_cb callback, void* user_data) { - MWR_LOGD("[ENTER]"); + MWR_LOGI("[ENTER]"); if (NULL == callback) { MWR_LOGE("[ERROR] Input parameter is NULL"); diff --git a/src/service_main.cpp b/src/service_main.cpp index bbf3098..1adff91 100644 --- a/src/service_main.cpp +++ b/src/service_main.cpp @@ -94,7 +94,7 @@ bool CServiceMain::is_current_preprocessing_assistant(const char* appid) int CServiceMain::client_get_audio_format(pid_t pid, int* rate, int* channel, int* audio_type) { - MAS_LOGD("[Enter] pid(%d)", pid); + MAS_LOGI("[Enter] pid(%d)", pid); int ret = mServicePlugin.get_recording_audio_format(rate, channel, audio_type); if (0 != ret){ @@ -107,7 +107,7 @@ int CServiceMain::client_get_audio_format(pid_t pid, int* rate, int* channel, in #define MAX_LOCAL_VARIABLE_STRING_LEN 256 int CServiceMain::client_get_audio_source_type(pid_t pid, char** type) { - MAS_LOGD("[Enter] pid(%d)", pid); + MAS_LOGI("[Enter] pid(%d)", pid); if (NULL == type) return -1; @@ -127,7 +127,7 @@ int CServiceMain::client_get_audio_source_type(pid_t pid, char** type) int CServiceMain::client_send_preprocessing_information(pid_t pid) { int ret = -1; - MAS_LOGD("[Enter] pid(%d)", pid); + MAS_LOGI("[Enter] pid(%d)", pid); boost::optional preprocessing_appid = mPreferenceManager.get_string(WAKEUP_SETTINGS_KEY_PREPROCESSING_ASSISTANT_APPID); @@ -142,7 +142,7 @@ int CServiceMain::client_send_preprocessing_information(pid_t pid) int CServiceMain::client_send_voice_key_status_change(pid_t pid, ma_voice_key_status_e status) { int ret = -1; - MAS_LOGD("[Enter] pid(%d)", pid); + MAS_LOGI("[Enter] pid(%d)", pid); ret = mServiceIpc.change_voice_key_status(pid, status); if (0 != ret) { @@ -155,7 +155,7 @@ int CServiceMain::client_send_voice_key_status_change(pid_t pid, ma_voice_key_st int CServiceMain::client_send_asr_result(pid_t pid, int event, const char* asr_result) { - MAS_LOGD("[Enter] pid(%d), event(%d), asr_result(%s)", pid, event, asr_result); + MAS_LOGI("[Enter] pid(%d), event(%d), asr_result(%s)", pid, event, asr_result); if (!is_current_assistant(pid)) return -1; bool ui_panel_enabled = mServicePlugin.is_ui_panel_enabled(); @@ -175,7 +175,7 @@ int CServiceMain::client_send_asr_result(pid_t pid, int event, const char* asr_r int CServiceMain::client_send_result(pid_t pid, const char* display_text, const char* utterance_text, const char* result_json) { - MAS_LOGD("[Enter] pid(%d), display_text(%s), utterance_text(%s), result_json(%s)", pid, display_text, utterance_text, result_json); + MAS_LOGI("[Enter] pid(%d), display_text(%s), utterance_text(%s), result_json(%s)", pid, display_text, utterance_text, result_json); if (!is_current_assistant(pid)) return -1; bool ui_panel_enabled = mServicePlugin.is_ui_panel_enabled(); @@ -199,7 +199,7 @@ int CServiceMain::client_send_result(pid_t pid, const char* display_text, int CServiceMain::client_send_recognition_result(pid_t pid, int result) { - MAS_LOGD("[Enter] pid(%d), result(%d)", pid, result); + MAS_LOGI("[Enter] pid(%d), result(%d)", pid, result); if (!is_current_assistant(pid)) return -1; bool ui_panel_enabled = mServicePlugin.is_ui_panel_enabled(); -- 2.7.4 From 64096eaeb823ebae42ea9687f7bdce672b55299f Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 5 Nov 2020 17:22:17 +0900 Subject: [PATCH 10/16] Prevent audio streaming when there is no data available Change-Id: I2f01e72f0c636b951bab414b99c2f0e0469faaec --- .../wakeup-manager/src/wakeup_audio_manager.cpp | 41 +++++++++++++--------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/plugins/wakeup-manager/src/wakeup_audio_manager.cpp b/plugins/wakeup-manager/src/wakeup_audio_manager.cpp index 8646a88..c110c01 100644 --- a/plugins/wakeup-manager/src/wakeup_audio_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_audio_manager.cpp @@ -116,7 +116,9 @@ void CAudioManager::sound_focus_changed() void CAudioManager::subscribe(IAudioEventObserver *observer) { - mObservers.push_back(observer); + if (observer) { + mObservers.push_back(observer); + } } void CAudioManager::unsubscribe(IAudioEventObserver *observer) @@ -217,7 +219,7 @@ void CAudioManager::streaming_audio_data_thread_func(long long start_time) iter = lead; advance(lead, 1); } - MWR_LOGD("data_count : %zu", mAudioData.size()); + MWR_LOGI("data_count : %zu", mAudioData.size()); lock.unlock(); while (!(mStopStreamingThread.load())) { @@ -275,27 +277,32 @@ void CAudioManager::streaming_audio_data_thread_func(long long start_time) continue; } - iter = lead; - /* FIXME : Extracted audio data here should be used as previous audio data*/ - mas_speech_data& speech_data = iter->data; - for (const auto& observer : mObservers) { - if (observer) { - if (!observer->on_streaming_audio_data( - speech_data.event, speech_data.buffer, speech_data.len)) { - LOGE("[Recorder WARNING] One of the observer returned false"); + lock.lock(); + end = mAudioData.end(); + + if (lead != end) { + iter = lead; + mas_speech_data& speech_data = iter->data; + for (const auto& observer : mObservers) { + if (observer) { + if (!observer->on_streaming_audio_data( + speech_data.event, speech_data.buffer, speech_data.len)) { + LOGE("[Recorder WARNING] One of the observer returned false"); + } } } - } - if (MAS_SPEECH_STREAMING_EVENT_FINISH == speech_data.event) { - MWR_LOGI("[INFO] Finish to get and send speech data"); - finish_event_sent = true; - break; - } + if (MAS_SPEECH_STREAMING_EVENT_FINISH == speech_data.event) { + MWR_LOGI("[INFO] Finish to get and send speech data"); + finish_event_sent = true; + break; + } - advance(lead, 1); + advance(lead, 1); + } + lock.unlock(); } if (true != finish_event_sent) { -- 2.7.4 From ea194c64b906c6e2666974f8c224a5fc622705e5 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 5 Nov 2020 17:22:25 +0900 Subject: [PATCH 11/16] Bump version to 0.3.11 Change-Id: I08800124b2e073c817b5c03ba6dea759f451bf12 --- 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 c0ccb3a..4f4e7aa 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 f933fa9..beb4a22 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.3.10 +Version: 0.3.11 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4 From 644fabbbfb305a6a9c5665267972e48572a037b4 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Tue, 1 Dec 2020 13:48:37 +0900 Subject: [PATCH 12/16] Add try-catch statements for handling exceptions Change-Id: Ib7309102e3e7a533bc532ff7f20ac75452ac2af9 --- src/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 33129a9..8b32458 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include #include @@ -80,7 +81,12 @@ int main(int argc, char* argv[]) service_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, service_app_lang_changed, &ad); service_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, service_app_region_changed, &ad); - int ret = service_app_main(argc, argv, &event_callback, ad); + int ret = 0; + try { + ret = service_app_main(argc, argv, &event_callback, ad); + } catch (const std::exception& e) { + LOGE("Exception caught : %s", e.what()); + } LOGI("Main function exits with : %d", ret); return ret; } -- 2.7.4 From 8b1576cd5ef691253fc0ce824bef45a10019737c Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 2 Dec 2020 16:49:37 +0900 Subject: [PATCH 13/16] Remove unnecessary FINISH event emission on timeout Change-Id: I2ee7f8157aa5115f50653fadef27b23d127888cd --- plugins/wakeup-manager/src/wakeup_manager.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/plugins/wakeup-manager/src/wakeup_manager.cpp b/plugins/wakeup-manager/src/wakeup_manager.cpp index 642ea65..5399c78 100644 --- a/plugins/wakeup-manager/src/wakeup_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_manager.cpp @@ -636,12 +636,6 @@ static Eina_Bool streaming_duration_expired(void *data) break; } - unsigned char final_buffer[2] = {'\0', }; - vector observers = wakeup_manager->get_wakeup_observers(); - for (const auto& observer : observers) { - observer->on_streaming_audio_data( - MAS_SPEECH_STREAMING_EVENT_FINISH, final_buffer, sizeof(final_buffer)); - } wakeup_manager->set_streaming_mode(STREAMING_MODE::NONE); if (WAKEUP_MANAGER_STATE_UTTERANCE == wakeup_manager->get_manager_state()) { -- 2.7.4 From 7fe11c55ddcb53d534b0bd95f82ef5647e831d40 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 2 Dec 2020 18:11:27 +0900 Subject: [PATCH 14/16] Remove unnecessary log messages from INFO tag Change-Id: I53375ef3e1f4f1bebe19b70bc6a43b3a71235fde --- src/client_manager.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/client_manager.cpp b/src/client_manager.cpp index 18339df..2fd5b61 100644 --- a/src/client_manager.cpp +++ b/src/client_manager.cpp @@ -75,7 +75,7 @@ int CClientManager::destroy_client_by_appid(std::string appid) ma_client_s* CClientManager::find_client_by_appid(std::string appid) { - MAS_LOGI("Looking for client with appid : %s", appid.c_str()); + MAS_LOGD("Looking for client with appid : %s", appid.c_str()); ma_client_s *data = NULL; int count = g_slist_length(mClientList); @@ -86,7 +86,7 @@ ma_client_s* CClientManager::find_client_by_appid(std::string appid) if (NULL != data) { if (0 == appid.compare(data->appid)) { - MAS_LOGI("Found client : %s %d", data->appid.c_str(), data->pid); + MAS_LOGD("Found client : %s %d", data->appid.c_str(), data->pid); return data; } } @@ -141,7 +141,7 @@ pid_t CClientManager::find_client_pid_by_index(unsigned int index) pid_t CClientManager::find_client_pid_by_appid(std::string appid) { - MAS_LOGI("Checking PID of appid : %s", appid.c_str()); + MAS_LOGD("Checking PID of appid : %s", appid.c_str()); pid_t pid = -1; if (nullptr == mApplicationManager) { @@ -151,7 +151,7 @@ pid_t CClientManager::find_client_pid_by_appid(std::string appid) ma_client_s* client = find_client_by_appid(appid); if (client) { - MAS_LOGI("Found client : %s %d", client->appid.c_str(), client->pid); + MAS_LOGD("Found client : %s %d", client->appid.c_str(), client->pid); bool running = mApplicationManager->is_application_running(client->pid); if (false == running) { MAS_LOGE("The PID for %s was %d, but it seems to be terminated", @@ -160,6 +160,9 @@ pid_t CClientManager::find_client_pid_by_appid(std::string appid) pid = client->pid; } } + if (-1 == pid) { + MAS_LOGE("PID lookup failed for : %s", appid.c_str()); + } return pid; } -- 2.7.4 From 45d9a3e1ab5a8273937c3f80704196446cf059b7 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 2 Dec 2020 19:27:32 +0900 Subject: [PATCH 15/16] Enable heap tracer and disallow free'ing unmanaged chunks Change-Id: If153dcbe74fc218c1c06228e14a10019dbaaf9b3 --- plugins/wakeup-manager/src/heap_tracer.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/plugins/wakeup-manager/src/heap_tracer.cpp b/plugins/wakeup-manager/src/heap_tracer.cpp index acf5bc6..fc24d84 100644 --- a/plugins/wakeup-manager/src/heap_tracer.cpp +++ b/plugins/wakeup-manager/src/heap_tracer.cpp @@ -18,7 +18,8 @@ const bool HEAP_TRACER_LOG_ENABLED = false ; #define DESCRIPTION_LENGTH 255 -//#define USE_HEAP_TRACER +#define USE_HEAP_TRACER +//#define ALLOW_FREE_UNMANAGED //#define RECORD_ALL_HISTORY void* vm_calloc(size_t nmemb, size_t size, const char *fmt, ...) @@ -60,14 +61,24 @@ void vm_free(void *ptr, const char *fmt, ...) va_list argptr; va_start(argptr, fmt); + bool managed = true; char description[DESCRIPTION_LENGTH]; vsnprintf(description, sizeof(description), fmt, argptr); if (false == _tracer.Delete(ptr, description)) { + managed = false; _tracer.Find(ptr); } - va_end(argptr); +#ifdef ALLOW_FREE_UNMANAGED + free(ptr); +#else + if (managed) { + free(ptr); + } #endif + va_end(argptr); +#else free(ptr); +#endif } else { LOGD("Trying to free a null pointer"); } -- 2.7.4 From 070192d25da12e8b67de6e596ca521d8e775fb6e Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 2 Dec 2020 19:27:57 +0900 Subject: [PATCH 16/16] Bump version to 0.3.12 Change-Id: Ie0a617563a3e7bc93f7a5c807349b129c1c209f9 --- 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 4f4e7aa..d0e72d1 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 beb4a22..27c266d 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.3.11 +Version: 0.3.12 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Flora-1.1 -- 2.7.4