Merge "Fix incorrect log message" into tizen_5.5
authorJi-hoon Lee <dalton.lee@samsung.com>
Fri, 10 Apr 2020 00:13:34 +0000 (00:13 +0000)
committerGerrit Code Review <gerrit@review>
Fri, 10 Apr 2020 00:13:34 +0000 (00:13 +0000)
inc/multi_assistant_main.h
org.tizen.multi-assistant-service.xml
packaging/org.tizen.multi-assistant-service.spec
plugins/wakeup-manager/dependency-default/src/dependency_default_audio.cpp
plugins/wakeup-manager/inc/wakeup_audio_manager.h
plugins/wakeup-manager/src/wakeup_audio_manager.cpp
plugins/wakeup-manager/src/wakeup_engine_manager.cpp
plugins/wakeup-manager/src/wakeup_manager.cpp
src/multi_assistant_dbus.c
src/multi_assistant_service.c

index 81018ac..27250ef 100644 (file)
@@ -66,7 +66,7 @@
 #define MA_METHOD_SET_PREPROCESSING_ALLOW_MODE         "ma_method_set_preprocessing_allow_mode"
 #define MA_METHOD_SEND_PREPROCESSING_RESULT                    "ma_method_send_preprocessing_result"
 #define MA_METHOD_SET_WAKE_WORD_AUDIO_REQUIRE_FLAG     "ma_method_set_wake_word_audio_require_flag"
-#define MA_METHOD_SET_ASSISTANT_LANGUAGE                       "ma_method_set_assistant_language"
+#define MA_METHOD_SET_ASSISTANT_WAKEUP_LANGUAGE                        "ma_method_set_assistant_wakeup_language"
 #define MA_METHOD_ERROR                                                                "ma_method_error"
 
 #define MA_UI_METHOD_INITIALIZE                                                "ma_ui_method_initialize"
index 90b60c8..58de9dd 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" ?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="5.0" package="org.tizen.multi-assistant-service" version="0.2.28">
+<manifest xmlns="http://tizen.org/ns/packages" api-version="5.0" package="org.tizen.multi-assistant-service" version="0.2.29">
        <label>Multi Assistant Service</label>
        <author email="wn.jang@samsung.com" href="www.samsung.com">Won Nam Jang</author>
        <author email="sooyeon.kim@samsung.com" href="www.samsung.com">Sooyeon Kim</author>
index 57438b7..74d58b2 100644 (file)
@@ -1,6 +1,6 @@
 Name:          org.tizen.multi-assistant-service
 Summary:       Multi assistant service
-Version:       0.2.28
+Version:       0.2.29
 Release:       1
 Group:         Graphics & UI Framework/Voice Framework
 License:       Flora-1.1
index e1cb9ab..ed4ab66 100644 (file)
@@ -27,9 +27,9 @@ static sound_stream_info_h g_stream_info = NULL;
 static thread g_recorder_thread;
 static atomic_bool g_stop_recorder_thread{false};
 
-static long get_current_milliseconds_after_epoch()
+static long long get_current_milliseconds_after_epoch()
 {
-       auto now = chrono::system_clock::now();
+       auto now = chrono::steady_clock::now();
        auto now_ms = chrono::time_point_cast<chrono::milliseconds>(now);
        /* number of milliseconds since the epoch of system_clock */
        auto value = now_ms.time_since_epoch();
index 5e179c1..fdae382 100644 (file)
@@ -79,7 +79,7 @@ public:
        void finalize_audio_data();
        void clear_audio_data();
 
-       void start_streaming_current_utterance_data(long start_time = 0);
+       void start_streaming_current_utterance_data(long long start_time = 0);
        void stop_streaming_current_utterance_data();
 
        void start_streaming_previous_utterance_data();
@@ -90,11 +90,11 @@ public:
 
        void set_background_volume(double ratio);
 private:
-       void add_audio_data(mas_speech_data& data, long time);
+       void add_audio_data(mas_speech_data& data, long long time);
        void notify_audio_data_recording(long time, void* data, int len);
 
        void streaming_previous_audio_data_thread_func();
-       void streaming_audio_data_thread_func(long start_time);
+       void streaming_audio_data_thread_func(long long start_time);
 
        int mSoundFocusWatchId{0};
        bool mRecordingRequired{false};
@@ -108,9 +108,9 @@ private:
        thread mStreamingPreviousThread;
        atomic_bool mStopStreamingPreviousThread{false};
 
-       static constexpr long mAudioRecordingDurationMilliseconds = 10 * 1000;
+       static constexpr long long mAudioRecordingDurationMilliseconds = 10 * 1000;
        typedef struct {
-               long time;
+               long long time;
                mas_speech_data data;
        } mas_speech_data_with_time;
        vector<mas_speech_data_with_time> mPreviousAudioData;
index b7c9288..a69e567 100644 (file)
@@ -15,9 +15,9 @@ namespace wakeup
 /* Need to check whether this value needs to be configurable */
 static int g_speech_pcm_wait_count = 800;
 
-static long get_current_milliseconds_after_epoch()
+static long long get_current_milliseconds_after_epoch()
 {
-       auto now = chrono::system_clock::now();
+       auto now = chrono::steady_clock::now();
        auto now_ms = chrono::time_point_cast<chrono::milliseconds>(now);
        /* number of milliseconds since the epoch of system_clock */
        auto value = now_ms.time_since_epoch();
@@ -203,7 +203,7 @@ void CAudioManager::streaming_previous_audio_data_thread_func()
        MWR_LOGI("[EXIT]");
 }
 
-void CAudioManager::streaming_audio_data_thread_func(long start_time)
+void CAudioManager::streaming_audio_data_thread_func(long long start_time)
 {
        MWR_LOGI("[ENTER]");
 
@@ -312,9 +312,9 @@ void CAudioManager::streaming_audio_data_thread_func(long start_time)
        MWR_LOGI("[EXIT]");
 }
 
-void CAudioManager::add_audio_data(mas_speech_data& data, long time)
+void CAudioManager::add_audio_data(mas_speech_data& data, long long time)
 {
-       long delta = mAudioRecordingDurationMilliseconds;
+       long long delta = mAudioRecordingDurationMilliseconds;
 
        notify_audio_data_recording(time, data.buffer, data.len);
 
@@ -342,7 +342,7 @@ void CAudioManager::feed_audio_data(mas_speech_streaming_event_e event, void* bu
        mas_speech_data speech_data;
        speech_data.buffer = vm_malloc_simple(len);
        if (speech_data.buffer) {
-               long time = get_current_milliseconds_after_epoch();
+               long long time = get_current_milliseconds_after_epoch();
 
                speech_data.event = event;
                speech_data.len = len;
@@ -359,7 +359,7 @@ void CAudioManager::finalize_audio_data()
        speech_data.len = sizeof(final_buffer);
        speech_data.buffer = vm_malloc_simple(speech_data.len);
        if (speech_data.buffer) {
-               long time = get_current_milliseconds_after_epoch();
+               long long time = get_current_milliseconds_after_epoch();
 
                memcpy(speech_data.buffer, final_buffer, speech_data.len);
                add_audio_data(speech_data, time);
@@ -390,7 +390,7 @@ void CAudioManager::notify_audio_data_recording(long time, void* data, int len)
        }
 }
 
-void CAudioManager::start_streaming_current_utterance_data(long start_time)
+void CAudioManager::start_streaming_current_utterance_data(long long start_time)
 {
        if (mStreamingThread.joinable()) {
                MWR_LOGE("ERROR : mStreamingThread is joinable, will not start a new thread");
index 642b0f8..aa31ab7 100644 (file)
@@ -27,7 +27,7 @@ static int g_count = 1;
 #endif
 
 /* Need to check whether this value needs to be configurable */
-static int g_speech_pcm_wait_count = 400;
+static int g_speech_pcm_wait_count = 800;
 
 /* Utility function for checking if an element exists in a container */
 template<class C, class T>
index d4a0ed3..ab2b8a4 100644 (file)
@@ -478,9 +478,9 @@ bool CWakeupManager::update_recognition_result(string appid, int result)
        return true;
 }
 
-static long get_current_milliseconds_after_epoch()
+static long long get_current_milliseconds_after_epoch()
 {
-       auto now = chrono::system_clock::now();
+       auto now = chrono::steady_clock::now();
        auto now_ms = chrono::time_point_cast<chrono::milliseconds>(now);
        /* number of milliseconds since the epoch of system_clock */
        auto value = now_ms.time_since_epoch();
index a7f567c..a3f2777 100644 (file)
@@ -1079,7 +1079,7 @@ static Eina_Bool listener_event_callback(void* data, Ecore_Fd_Handler *fd_handle
                } else if (dbus_message_is_method_call(msg, MA_SERVER_SERVICE_INTERFACE, MA_METHOD_SET_WAKE_WORD_AUDIO_REQUIRE_FLAG)) {
                        ma_service_dbus_set_wake_word_audio_require_flag(g_conn_listener, msg);
 
-               } else if (dbus_message_is_method_call(msg, MA_SERVER_SERVICE_INTERFACE, MA_METHOD_SET_ASSISTANT_LANGUAGE)) {
+               } else if (dbus_message_is_method_call(msg, MA_SERVER_SERVICE_INTERFACE, MA_METHOD_SET_ASSISTANT_WAKEUP_LANGUAGE)) {
                        ma_service_dbus_set_assistant_language(g_conn_listener, msg);
 
                } else if (dbus_message_is_method_call(msg, MA_SERVER_SERVICE_INTERFACE, MA_UI_METHOD_INITIALIZE)) {
index 0e5ff55..d815200 100644 (file)
@@ -742,6 +742,11 @@ static int init_plugin(void)
                return -1;
        }
 
+       memset(&g_maclient_info, 0x00, sizeof(g_maclient_info));
+       g_current_maclient_info = -1;
+       g_current_preprocessing_maclient_info = -1;
+       g_wakeup_maclient_appid = NULL;
+
        if (0 == mas_config_get_assistant_info(__mas_assistant_info_cb, NULL)) {
                for (int loop = 0; loop < MAX_MACLIENT_INFO_NUM; loop++) {
                        int inner_loop;
@@ -1203,7 +1208,8 @@ int mas_update_voice_key_support_mode()
        if (0 == multi_assistant_service_plugin_get_default_assistant(&default_assistant)) {
                for (int loop = 0; loop < MAX_MACLIENT_INFO_NUM; loop++) {
                        if (g_maclient_info[loop].used) {
-                               if (strncmp(default_assistant, g_maclient_info[loop].appid, MAX_APPID_LEN) == 0) {
+                               if (default_assistant &&
+                                       strncmp(default_assistant, g_maclient_info[loop].appid, MAX_APPID_LEN) == 0) {
                                        float duration = g_maclient_info[loop].voice_key_tap_duration;
                                        if (0.0f < duration) {
                                                multi_assistant_service_plugin_set_voice_key_tap_duration(duration);