From 4868ab966bf10868b4691ff462693e912a39b2cc Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 26 May 2022 17:36:47 +0900 Subject: [PATCH] Add logs for checking if audio fetching is being retried properly Change-Id: I1cae28820288888d3bba0a75b6e5706244ea7d09 --- plugins/wakeup-manager/src/wakeup_engine_manager.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/plugins/wakeup-manager/src/wakeup_engine_manager.cpp b/plugins/wakeup-manager/src/wakeup_engine_manager.cpp index 5fb0b0c..bc2873b 100644 --- a/plugins/wakeup-manager/src/wakeup_engine_manager.cpp +++ b/plugins/wakeup-manager/src/wakeup_engine_manager.cpp @@ -301,7 +301,9 @@ void CWakeupEngineManager::streaming_speech_data_thread_func() NULL == interface->get_utterance_data_count) return; - MWR_LOGD("data_count : %d", interface->get_utterance_data_count()); + MWR_LOGE("data_count : %s, %d", + mSelectedEngine->engine_name.c_str(), + interface->get_utterance_data_count()); #ifdef BUF_SAVE_MODE if (g_pFile) { @@ -385,6 +387,8 @@ void CWakeupEngineManager::streaming_speech_data_thread_func() } int burst_count = 0; + int sleep_count = 0; + while (!(mStopStreamingThread.load())) { int ret = -1; int cnt = 0; @@ -396,14 +400,21 @@ void CWakeupEngineManager::streaming_speech_data_thread_func() if (0 != ret) { /* empty queue */ - MWR_LOGD("[DEBUG] No feedback data. Waiting mode : %d %d", ret, cnt); + MWR_LOGI("[DEBUG] No feedback data. Waiting mode : %d %d", ret, cnt); + sleep_count = 0; /* waiting */ while (!(mStopStreamingThread.load())) { burst_count = 0; + if (++sleep_count >= 100) { + MWR_LOGI("Still waiting : %d %p %p", sleep_count, + interface->get_utterance_data, + interface->get_utterance_data_count); + sleep_count = 0; + } this_thread::sleep_for(chrono::milliseconds(10)); if (index < interface->get_utterance_data_count()) { - MWR_LOGD("[INFO] Resume thread, %d", cnt); + MWR_LOGI("[INFO] Resume thread, %d", cnt); break; } mStreamingHistory.last_count_fetched.store(get_current_milliseconds_after_epoch()); -- 2.7.4