Add logs for checking if audio fetching is being retried properly 65/275565/1
authorJi-hoon Lee <dalton.lee@samsung.com>
Thu, 26 May 2022 08:36:47 +0000 (17:36 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Thu, 26 May 2022 08:36:47 +0000 (17:36 +0900)
Change-Id: I1cae28820288888d3bba0a75b6e5706244ea7d09

plugins/wakeup-manager/src/wakeup_engine_manager.cpp

index 5fb0b0c..bc2873b 100644 (file)
@@ -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());