Add more logs for streaming events 44/252944/1
authorJi-hoon Lee <dalton.lee@samsung.com>
Thu, 21 Jan 2021 06:11:20 +0000 (15:11 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Thu, 21 Jan 2021 06:11:20 +0000 (15:11 +0900)
Change-Id: I4bbbeed3a2d357cc491e985301060806bc89dd69

plugins/wakeup-manager/src/wakeup_audio_manager.cpp
plugins/wakeup-manager/src/wakeup_engine_manager.cpp
plugins/wakeup-manager/src/wakeup_manager_wrapper.cpp
src/service_ipc_dbus.cpp
src/service_plugin.cpp

index a33a84c..65f691c 100644 (file)
@@ -310,6 +310,7 @@ void CAudioManager::streaming_audio_data_thread_func(long long start_time)
                unsigned char final_buffer[2] = {'\0', };
                for (const auto& observer : mObservers) {
                        if (observer) {
+                               MWR_LOGI("No FINISH event sent yet, adding to finalize streaming session");
                                if (!observer->on_streaming_audio_data(
                                        MAS_SPEECH_STREAMING_EVENT_FINISH, final_buffer, sizeof(final_buffer))) {
                                        LOGE("[Recorder WARNING] One of the observer returned false");
@@ -361,6 +362,7 @@ void CAudioManager::feed_audio_data(mas_speech_streaming_event_e event, void* bu
 
 void CAudioManager::finalize_audio_data()
 {
+       MWR_LOGI("Adding FINISH event to audio data list");
        unsigned char final_buffer[2] = {'\0', };
        mas_speech_data speech_data;
        speech_data.event = MAS_SPEECH_STREAMING_EVENT_FINISH;
@@ -400,6 +402,7 @@ void CAudioManager::notify_audio_data_recording(long time, void* data, int len)
 
 void CAudioManager::start_streaming_current_utterance_data(long long start_time)
 {
+       MWR_LOGI("[ENTER]");
        if (mStreamingThread.joinable()) {
                MWR_LOGE("ERROR : mStreamingThread is joinable, will not start a new thread");
                return;
@@ -410,6 +413,7 @@ void CAudioManager::start_streaming_current_utterance_data(long long start_time)
 
 void CAudioManager::stop_streaming_current_utterance_data()
 {
+       MWR_LOGI("[ENTER]");
        if (mStreamingThread.joinable()) {
                MWR_LOGD("mStreamingThread is joinable, trying join()");
                mStopStreamingThread.store(true);
@@ -426,6 +430,7 @@ void CAudioManager::stop_streaming_current_utterance_data()
 
 void CAudioManager::start_streaming_previous_utterance_data()
 {
+       MWR_LOGI("[ENTER]");
        if (mStreamingPreviousThread.joinable()) {
                MWR_LOGE("ERROR : mStreamingPreviousThread is joinable, will not start a new thread");
                return;
@@ -436,6 +441,7 @@ void CAudioManager::start_streaming_previous_utterance_data()
 
 void CAudioManager::stop_streaming_previous_utterance_data()
 {
+       MWR_LOGI("[ENTER]");
        if (mStreamingPreviousThread.joinable()) {
                MWR_LOGD("mStreamingPreviousThread is joinable, trying join()");
                mStopStreamingPreviousThread.store(true);
@@ -450,6 +456,7 @@ void CAudioManager::stop_streaming_previous_utterance_data()
 
 void CAudioManager::start_streaming_follow_up_data()
 {
+       MWR_LOGI("[ENTER]");
        if (mStreamingThread.joinable()) {
                MWR_LOGE("ERROR : mStreamingThread is joinable, will not start a new thread");
                return;
@@ -460,6 +467,7 @@ void CAudioManager::start_streaming_follow_up_data()
 
 void CAudioManager::stop_streaming_follow_up_data()
 {
+       MWR_LOGI("[ENTER]");
        if (mStreamingThread.joinable()) {
                MWR_LOGD("mStreamingThread is joinable, trying join()");
                mStopStreamingThread.store(true);
index 56c06ca..bacc74a 100644 (file)
@@ -466,6 +466,7 @@ void CWakeupEngineManager::streaming_speech_data_thread_func()
                unsigned char final_buffer[2] = {'\0', };
                for (const auto& observer : mObservers) {
                        if (observer) {
+                               MWR_LOGI("No FINISH event sent yet, adding to finalize streaming session");
                                if (!observer->on_streaming_audio_data(
                                        MAS_SPEECH_STREAMING_EVENT_FINISH, final_buffer, sizeof(final_buffer))) {
                                        LOGE("[Recorder WARNING] One of the observer returned false");
@@ -487,6 +488,7 @@ void CWakeupEngineManager::streaming_speech_data_thread_func()
 
 void CWakeupEngineManager::start_streaming_current_utterance_data()
 {
+       MWR_LOGI("[ENTER]");
        if (mStreamingThread.joinable()) {
                MWR_LOGE("ERROR : mStreamingThread is joinable, will not start a new thread");
                return;
@@ -496,6 +498,7 @@ void CWakeupEngineManager::start_streaming_current_utterance_data()
 
 void CWakeupEngineManager::stop_streaming_current_utterance_data()
 {
+       MWR_LOGI("[ENTER]");
        if (mStreamingThread.joinable()) {
                MWR_LOGD("mStreamingThread is joinable, trying join()");
                mStopStreamingThread.store(true);
index d88dd34..da02392 100644 (file)
@@ -788,10 +788,10 @@ void CWakeupEventObserver::on_streaming_audio_data(
        mas_speech_streaming_event_e event, void* buffer, unsigned int len)
 {
        if (MAS_SPEECH_STREAMING_EVENT_START == event) {
-               MWR_LOGD("streaming_cb START");
+               MWR_LOGI("streaming_cb START");
        }
        if (MAS_SPEECH_STREAMING_EVENT_FINISH == event) {
-               MWR_LOGD("streaming_cb FINISH");
+               MWR_LOGI("streaming_cb FINISH");
        }
        if (NULL != g_utterance_streaming_cb) {
                g_utterance_streaming_cb(event, buffer, len, g_utterance_streaming_user_data);
index a816966..48b349c 100644 (file)
@@ -270,6 +270,7 @@ int CServiceIpcDbus::send_streaming_audio_data(pid_t pid, int event, void* data,
        }
 
        if (MAS_SPEECH_STREAMING_EVENT_FINISH == event) {
+               MAS_LOGE("Sending FINISH event");
                bundle *b = bundle_create();
                if (b) {
                        bundle_add_byte(b, "content", buffer, total_size);
index 6f820c6..6fd9f71 100644 (file)
@@ -363,7 +363,7 @@ static void __audio_streaming_cb(mas_speech_streaming_event_e event, void* buffe
        }
        static int count = 0;
        if (event != MAS_SPEECH_STREAMING_EVENT_CONTINUE || count % 100 == 0) {
-               MAS_LOGD("[SUCCESS] __audio_streaming_cb is called, event(%d), buffer(%p), len(%d)",
+               MAS_LOGI("[SUCCESS] __audio_streaming_cb is called, event(%d), buffer(%p), len(%d)",
                        event, buffer, len);
        }
        ++count;