From a16bfdb58360d1087a5ea41d12927d9b7084bb54 Mon Sep 17 00:00:00 2001 From: "wn.jang" Date: Wed, 25 Mar 2020 17:21:50 +0900 Subject: [PATCH 01/16] Support multi-channel audio input Change-Id: Ib65dca91ab5c5f208d1bd1708ee3f88ca0734395 --- server/vcd_recorder.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/vcd_recorder.c b/server/vcd_recorder.c index 96abd7b..bfa8fd3 100644 --- a/server/vcd_recorder.c +++ b/server/vcd_recorder.c @@ -648,14 +648,20 @@ int vcd_recorder_set(const char* audio_type, vce_audio_type_e type, int rate, in SLOG(LOG_INFO, TAG_VCD, "[Recorder] New audio type(%d) rate(%d) channel(%d)", type, rate, channel); audio_in_destroy(g_audio_h); - audio_channel_e audio_ch; + audio_channel_e audio_ch = AUDIO_CHANNEL_MONO; audio_sample_type_e audio_sample_type; switch (channel) { case 1: audio_ch = AUDIO_CHANNEL_MONO; break; case 2: audio_ch = AUDIO_CHANNEL_STEREO; break; + case 3: audio_ch = AUDIO_CHANNEL_MULTI_3; break; + case 4: audio_ch = AUDIO_CHANNEL_MULTI_4; break; + case 5: audio_ch = AUDIO_CHANNEL_MULTI_5; break; + case 6: audio_ch = AUDIO_CHANNEL_MULTI_6; break; + case 7: audio_ch = AUDIO_CHANNEL_MULTI_7; break; + case 8: audio_ch = AUDIO_CHANNEL_MULTI_8; break; default: - SLOG(LOG_ERROR, TAG_VCD, "[Recorder ERROR] Input channel is not supported"); + SLOG(LOG_ERROR, TAG_VCD, "[Recorder ERROR] Input channel is not supported, audio_ch(%d)", audio_ch); return VCD_ERROR_OPERATION_FAILED; break; } -- 2.7.4 From f11b6adff3ae1f164311ab0c5452db43461975d0 Mon Sep 17 00:00:00 2001 From: sungrae jo Date: Mon, 16 Mar 2020 18:59:05 +0900 Subject: [PATCH 02/16] Fixed int to vc_tts_utterance_status_e for vc_mgr_dbus_send_utterance_status Change-Id: I7e043f8681c61d8763aeb296e26c643b2c4556fd Signed-off-by: sungrae jo --- client/vc_mgr.c | 26 +++++++++++++++++++------- client/vc_mgr_dbus.c | 2 +- client/vc_mgr_dbus.h | 2 +- include/voice_control_common.h | 2 +- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/client/vc_mgr.c b/client/vc_mgr.c index 53c8c32..e16ef72 100755 --- a/client/vc_mgr.c +++ b/client/vc_mgr.c @@ -4324,10 +4324,24 @@ int vc_mgr_stop_feedback(void) return ret; } -int vc_mgr_send_utterance_status(int pid, int utt_id, int utt_status) +int vc_mgr_send_utterance_status(int pid, int utt_id, vc_tts_utterance_status_e utt_status) { SLOG(LOG_INFO, TAG_VCM, "@@@ [Manager] send utterance status, pid(%d), utt_id(%d), utt_status(%d)", pid, utt_id, utt_status); + if (0 != __vc_mgr_get_feature_enabled()) { + SLOG(LOG_DEBUG, TAG_VCM, "@@@ [Manager] not supported"); + return VC_ERROR_NOT_SUPPORTED; + } + + if (0 != __vc_mgr_check_privilege()) { + return VC_ERROR_PERMISSION_DENIED; + } + + if (VC_TTS_UTTERANCE_NONE > utt_status || VC_TTS_UTTERANCE_CANCELED < utt_status) { + SLOG(LOG_ERROR, TAG_VCM, "[ERROR] utt_status is not valid. (%d)", utt_status); + return VC_ERROR_INVALID_PARAMETER; + } + vc_state_e state; if (0 != vc_mgr_client_get_client_state(g_vc_m, &state)) { SLOG(LOG_ERROR, TAG_VCM, "[ERROR] A handle is not available"); @@ -4352,15 +4366,13 @@ int vc_mgr_send_utterance_status(int pid, int utt_id, int utt_status) } int ret = vc_mgr_dbus_send_utterance_status(pid, utt_id, utt_status); - if (0 != ret) { + if (0 != ret) SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to send utterance status : %s", __vc_mgr_get_error_code(ret)); - return ret; - } else { + else SLOG(LOG_INFO, TAG_VCM, "[SUCCESS] Send utterance status"); - } - SLOG(LOG_DEBUG, TAG_VCM, "@@@"); - return 0; + SLOG(LOG_DEBUG, TAG_VCM, "@@@"); + return ret; } static float __get_volume_decibel(char* data, int size) diff --git a/client/vc_mgr_dbus.c b/client/vc_mgr_dbus.c index eb6d62e..f9a5493 100755 --- a/client/vc_mgr_dbus.c +++ b/client/vc_mgr_dbus.c @@ -2269,7 +2269,7 @@ int vc_mgr_dbus_send_specific_engine_request(int pid, const char* engine_app_id, return 0; } -int vc_mgr_dbus_send_utterance_status(int pid, int utt_id, int utt_status) +int vc_mgr_dbus_send_utterance_status(int pid, int utt_id, vc_tts_utterance_status_e utt_status) { if (0 != __dbus_check()) { return VC_ERROR_OPERATION_FAILED; diff --git a/client/vc_mgr_dbus.h b/client/vc_mgr_dbus.h index e0f5942..7d706f1 100644 --- a/client/vc_mgr_dbus.h +++ b/client/vc_mgr_dbus.h @@ -72,7 +72,7 @@ int vc_mgr_dbus_request_start_feedback(int pid); int vc_mgr_dbus_request_stop_feedback(int pid); -int vc_mgr_dbus_send_utterance_status(int pid, int utt_id, int utt_status); +int vc_mgr_dbus_send_utterance_status(int pid, int utt_id, vc_tts_utterance_status_e utt_status); int vc_mgr_dbus_send_audio_streaming(int pid, vc_audio_streaming_event_e event, unsigned char* buffer, unsigned int len); diff --git a/include/voice_control_common.h b/include/voice_control_common.h index 136e628..f8ca800 100644 --- a/include/voice_control_common.h +++ b/include/voice_control_common.h @@ -138,7 +138,7 @@ typedef enum { * @since_tizen 5.5 */ typedef enum { - VC_TTS_UTTERANCE_NONE = -1, /**< None */ + VC_TTS_UTTERANCE_NONE = 0, /**< None */ VC_TTS_UTTERANCE_STARTED = 1, /**< Utterance started */ VC_TTS_UTTERANCE_COMPLETED = 2, /**< Utterance completed */ VC_TTS_UTTERANCE_CANCELED = 3 /**< Utterance canceled */ -- 2.7.4 From 65599ec00b519d9ae76d2936b6c6d80f208910d5 Mon Sep 17 00:00:00 2001 From: sungrae jo Date: Thu, 26 Mar 2020 14:03:08 +0900 Subject: [PATCH 03/16] Update package version to 1.60.4 Change-Id: I3758f89883aa69dfabf04680a973932e60c4dcc4 Signed-off-by: sungrae jo --- CMakeLists.txt | 2 +- packaging/voice-control.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 600a632..c857df4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ PROJECT(vc) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(EXEC_PREFIX "${PREFIX}") -SET(VERSION 1.60.3) +SET(VERSION 1.60.4) FIND_PROGRAM(UNAME NAMES uname) EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") diff --git a/packaging/voice-control.spec b/packaging/voice-control.spec index 366cf7e..fb2155e 100644 --- a/packaging/voice-control.spec +++ b/packaging/voice-control.spec @@ -1,6 +1,6 @@ Name: voice-control Summary: Voice control client library and daemon -Version: 1.60.3 +Version: 1.60.4 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Apache-2.0 -- 2.7.4 From c97831faf4af101793f5ff9a04ea66d93cab5e43 Mon Sep 17 00:00:00 2001 From: "wn.jang" Date: Thu, 26 Mar 2020 18:23:38 +0900 Subject: [PATCH 04/16] Remove to check if current engine is same as vconf This is temporary solution. Currently, VD didn't change vconf value for default engine. So, voice conrtrol framework thinks that current engine is one of TC. It'll be enabled when VD changes vconf correctly. Change-Id: I393ce91f1293a53215089397d4569153d275896d --- server/vcd_server.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/vcd_server.c b/server/vcd_server.c index 56df9a5..b253aa4 100755 --- a/server/vcd_server.c +++ b/server/vcd_server.c @@ -1240,6 +1240,7 @@ static int __vcd_db_clean_up() return ret; } +#if 0 static bool __is_default_engine() { char* engine = NULL; @@ -1262,6 +1263,7 @@ static bool __is_default_engine() free(engine); return FALSE; } +#endif int vcd_initialize(vce_request_callback_s *callback) { @@ -1310,13 +1312,13 @@ int vcd_initialize(vce_request_callback_s *callback) /* Initialize manager info */ vcd_client_manager_unset(); - if (TRUE == __is_default_engine()) { +// if (TRUE == __is_default_engine()) { /* Open dbus connection */ if (0 != vcd_dbus_open_connection()) { SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail to open connection"); return VCD_ERROR_OPERATION_FAILED; } - } +// } vcd_config_set_service_state(VCD_STATE_READY); // vcdc_send_service_state(VCD_STATE_READY); -- 2.7.4 From 02de120e399fa806828c7d9ab15ef0ff6e6630f4 Mon Sep 17 00:00:00 2001 From: "wn.jang" Date: Thu, 26 Mar 2020 18:42:12 +0900 Subject: [PATCH 05/16] Update version to 1.60.5 Change-Id: I62990b9606090c15f5ea5842b20f549942600dad --- CMakeLists.txt | 2 +- packaging/voice-control.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c857df4..b0132f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ PROJECT(vc) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(EXEC_PREFIX "${PREFIX}") -SET(VERSION 1.60.4) +SET(VERSION 1.60.5) FIND_PROGRAM(UNAME NAMES uname) EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") diff --git a/packaging/voice-control.spec b/packaging/voice-control.spec index fb2155e..1c35223 100644 --- a/packaging/voice-control.spec +++ b/packaging/voice-control.spec @@ -1,6 +1,6 @@ Name: voice-control Summary: Voice control client library and daemon -Version: 1.60.4 +Version: 1.60.5 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Apache-2.0 -- 2.7.4 From 5c62a62db0da5d782c0b68fdf792979e78520a6d Mon Sep 17 00:00:00 2001 From: sungrae jo Date: Thu, 26 Mar 2020 17:22:54 +0900 Subject: [PATCH 06/16] Cleanup VC-manager internal functions Change-Id: Id682421019abfd55c8baf20756929646fea59fb8 Signed-off-by: sungrae jo --- client/vc_mgr.c | 113 +++++++++++++++++++------------ client/vc_mgr_dbus.c | 2 +- client/vc_mgr_dbus.h | 2 +- include/voice_control_manager_internal.h | 5 +- server/vcd_dbus_server.c | 2 +- server/vcd_server.c | 2 +- server/vcd_server.h | 2 +- 7 files changed, 76 insertions(+), 52 deletions(-) diff --git a/client/vc_mgr.c b/client/vc_mgr.c index d7879ae..e4bcd4f 100755 --- a/client/vc_mgr.c +++ b/client/vc_mgr.c @@ -4417,15 +4417,10 @@ static float __get_volume_decibel(char* data, int size) return db; } -int vc_mgr_send_audio_streaming(vc_audio_streaming_event_e event, unsigned char* buffer, unsigned int len) +int vc_mgr_send_audio_streaming(vc_audio_streaming_event_e event, char* buffer, unsigned int len) { SLOG(LOG_INFO, TAG_VCM, "[Manager] Send audio streaming to the engine service"); - if (NULL == buffer) { - SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Invalid parameter"); - return VC_ERROR_INVALID_PARAMETER; - } - if (0 != __vc_mgr_get_feature_enabled()) { SLOG(LOG_DEBUG, TAG_VCM, "@@@ [Manager] not supported"); return VC_ERROR_NOT_SUPPORTED; @@ -4435,47 +4430,56 @@ int vc_mgr_send_audio_streaming(vc_audio_streaming_event_e event, unsigned char* return VC_ERROR_PERMISSION_DENIED; } - vc_state_e state; - if (0 != vc_mgr_client_get_client_state(g_vc_m, &state)) { + if (VC_AUDIO_STREAMING_EVENT_FAIL > event || VC_AUDIO_STREAMING_EVENT_FINISH < event || 0 == event) { + SLOG(LOG_ERROR, TAG_VCM, "[ERROR] event is invalid parameter (%d)", event); + return VC_ERROR_INVALID_PARAMETER; + } + + if (NULL == buffer) { + SLOG(LOG_ERROR, TAG_VCM, "[ERROR] buffer is invalid parameter"); + return VC_ERROR_INVALID_PARAMETER; + } + + vc_state_e state = VC_STATE_NONE; + int ret = vc_mgr_client_get_client_state(g_vc_m, &state); + if (0 != ret) { SLOG(LOG_ERROR, TAG_VCM, "[ERROR] A handle is not available"); SLOG(LOG_DEBUG, TAG_VCM, "@@@"); return VC_ERROR_INVALID_STATE; } - /* check state */ if (state != VC_STATE_READY) { - SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Invalid State: Current state is not 'READY'"); SLOG(LOG_DEBUG, TAG_VCM, "@@@"); return VC_ERROR_INVALID_STATE; } - /* Check service state */ - vc_service_state_e service_state = -1; - vc_mgr_client_get_service_state(g_vc_m, &service_state); - if (VC_SERVICE_STATE_READY != service_state && VC_SERVICE_STATE_RECORDING != service_state) { + vc_service_state_e service_state = VC_SERVICE_STATE_NONE; + ret = vc_mgr_client_get_service_state(g_vc_m, &service_state); + if (0 != ret) { + SLOG(LOG_ERROR, TAG_VCM, "[ERROR] A handle is not available"); + SLOG(LOG_DEBUG, TAG_VCM, "@@@"); + return VC_ERROR_INVALID_STATE; + } + if (VC_SERVICE_STATE_READY != service_state && VC_SERVICE_STATE_RECORDING != service_state) { SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Invalid State: service state is not 'READY' and 'RECORDING', state(%d)", service_state); SLOG(LOG_DEBUG, TAG_VCM, "@@@"); return VC_ERROR_INVALID_STATE; } - /* set volume */ float volume = __get_volume_decibel((char*)buffer, len); __vc_mgr_set_volume(volume); - /* send audio streaming */ - int ret = vc_mgr_dbus_send_audio_streaming(g_vc_m->handle, event, buffer, len); - if (0 != ret) { + ret = vc_mgr_dbus_send_audio_streaming(g_vc_m->handle, event, buffer, len); + if (0 != ret) SLOG(LOG_WARN, TAG_VCM, "[WARNING] retry to send audio streaming data"); - } else { + else SLOG(LOG_INFO, TAG_VCM, "[DEBUG] Success to send"); - } - return ret; } -int vc_mgr_set_audio_streaming_mode(vc_audio_streaming_mode_e streaming_mode) +int vc_mgr_set_audio_streaming_mode(vc_audio_streaming_mode_e mode) { SLOG(LOG_INFO, TAG_VCM, "[Manager] Set multi assistant mode"); @@ -4488,22 +4492,41 @@ int vc_mgr_set_audio_streaming_mode(vc_audio_streaming_mode_e streaming_mode) return VC_ERROR_PERMISSION_DENIED; } - vc_state_e state; - if (0 != vc_mgr_client_get_client_state(g_vc_m, &state)) { + if (VC_AUDIO_STREAMING_MODE_VC_SERVICE > mode || VC_AUDIO_STREAMING_MODE_OUTSIDE < mode) { + SLOG(LOG_ERROR, TAG_VCM, "[ERROR] mode is invalid parameter (%d)", mode); + return VC_ERROR_INVALID_PARAMETER; + } + + vc_state_e state = VC_STATE_NONE; + int ret = vc_mgr_client_get_client_state(g_vc_m, &state); + if (0 != ret) { SLOG(LOG_ERROR, TAG_VCM, "[ERROR] A handle is not available"); SLOG(LOG_DEBUG, TAG_VCM, "@@@"); return VC_ERROR_INVALID_STATE; } - /* check state */ - if (state != VC_STATE_INITIALIZED) { + if (state != VC_STATE_READY) { + SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Invalid State: Current state is not 'READY'"); + SLOG(LOG_DEBUG, TAG_VCM, "@@@"); + return VC_ERROR_INVALID_STATE; + } + + vc_service_state_e service_state = VC_SERVICE_STATE_NONE; + ret = vc_mgr_client_get_service_state(g_vc_m, &service_state); + if (0 != ret) { + SLOG(LOG_ERROR, TAG_VCM, "[ERROR] A handle is not available"); + SLOG(LOG_DEBUG, TAG_VCM, "@@@"); + return VC_ERROR_INVALID_STATE; + } + if (VC_STATE_INITIALIZED != state && VC_SERVICE_STATE_READY != service_state) { SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Invalid State: Current state is not 'INITIALIZED', state(%d)", state); + SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Invalid State: Current service state is not 'READY', service_state(%d)", service_state); SLOG(LOG_DEBUG, TAG_VCM, "@@@"); return VC_ERROR_INVALID_STATE; } - int ret = vc_mgr_client_set_audio_streaming_mode(g_vc_m, streaming_mode); + ret = vc_mgr_client_set_audio_streaming_mode(g_vc_m, mode); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to set multi assistant mode, ret(%d)", ret); return VC_ERROR_INVALID_STATE; @@ -4621,9 +4644,9 @@ int __vc_recover_system_volume() return 0; } -int vc_mgr_change_system_volume(vc_system_volume_event_e volume_event) +int vc_mgr_change_system_volume(vc_system_volume_event_e event) { - SLOG(LOG_INFO, TAG_VCM, "[Manager] Change system volume, volume_event(%d)", volume_event); + SLOG(LOG_INFO, TAG_VCM, "[Manager] Change system volume"); if (0 != __vc_mgr_get_feature_enabled()) { SLOG(LOG_DEBUG, TAG_VCM, "@@@ [Manager] not supported"); @@ -4634,31 +4657,34 @@ int vc_mgr_change_system_volume(vc_system_volume_event_e volume_event) return VC_ERROR_PERMISSION_DENIED; } + if (VC_SYSTEM_VOLUME_EVENT_CHANGE_FOR_NEARFIELD > event || VC_SYSTEM_VOLUME_EVENT_CHANGE_FOR_FARFIELD < event) { + SLOG(LOG_ERROR, TAG_VCM, "[ERROR] event is invalid parameter (%d)", event); + return VC_ERROR_INVALID_PARAMETER; + } + vc_state_e state; - if (0 != vc_mgr_client_get_client_state(g_vc_m, &state)) { + int ret = vc_mgr_client_get_client_state(g_vc_m, &state); + if (0 != ret) { SLOG(LOG_ERROR, TAG_VCM, "[ERROR] A handle is not available"); SLOG(LOG_DEBUG, TAG_VCM, "@@@"); return VC_ERROR_INVALID_STATE; } - /* check state */ if (state != VC_STATE_READY && state != VC_STATE_INITIALIZED) { SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Invalid State: Current state is not 'READY' and not 'INITIALIZED', state(%d)", state); SLOG(LOG_DEBUG, TAG_VCM, "@@@"); return VC_ERROR_INVALID_STATE; } - /* change system volume */ - int ret = __vc_change_system_volume(volume_event); - if (0 != ret) { + ret = __vc_change_system_volume(event); + if (0 != ret) SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to change volume"); - } else { + else SLOG(LOG_INFO, TAG_VCM, "[DEBUG] Success to change volume"); - } return ret; } -int vc_mgr_recover_system_volume() +int vc_mgr_recover_system_volume(void) { SLOG(LOG_INFO, TAG_VCM, "[Manager] recover system volume"); @@ -4671,14 +4697,14 @@ int vc_mgr_recover_system_volume() return VC_ERROR_PERMISSION_DENIED; } - vc_state_e state; - if (0 != vc_mgr_client_get_client_state(g_vc_m, &state)) { + vc_state_e state = VC_STATE_NONE; + int ret = vc_mgr_client_get_client_state(g_vc_m, &state); + if (0 != ret) { SLOG(LOG_ERROR, TAG_VCM, "[ERROR] A handle is not available"); SLOG(LOG_DEBUG, TAG_VCM, "@@@"); return VC_ERROR_INVALID_STATE; } - /* check state */ if (state != VC_STATE_READY && state != VC_STATE_INITIALIZED) { SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Invalid State: Current state is not 'READY' and not 'INITIALIZED', state(%d)", state); SLOG(LOG_DEBUG, TAG_VCM, "@@@"); @@ -4686,11 +4712,10 @@ int vc_mgr_recover_system_volume() } /* recover volume */ - int ret = __vc_recover_system_volume(); - if (0 != ret) { + ret = __vc_recover_system_volume(); + if (0 != ret) SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Fail to recover volume"); - } else { + else SLOG(LOG_INFO, TAG_VCM, "[DEBUG] Success to recover volume"); - } return ret; } diff --git a/client/vc_mgr_dbus.c b/client/vc_mgr_dbus.c index eb6d62e..486f2fe 100755 --- a/client/vc_mgr_dbus.c +++ b/client/vc_mgr_dbus.c @@ -2306,7 +2306,7 @@ int vc_mgr_dbus_send_utterance_status(int pid, int utt_id, int utt_status) return 0; } -int vc_mgr_dbus_send_audio_streaming(int pid, vc_audio_streaming_event_e event, unsigned char* buffer, unsigned int len) +int vc_mgr_dbus_send_audio_streaming(int pid, vc_audio_streaming_event_e event, char* buffer, unsigned int len) { if (0 != __dbus_check()) { return VC_ERROR_OPERATION_FAILED; diff --git a/client/vc_mgr_dbus.h b/client/vc_mgr_dbus.h index e0f5942..da556d3 100644 --- a/client/vc_mgr_dbus.h +++ b/client/vc_mgr_dbus.h @@ -74,7 +74,7 @@ int vc_mgr_dbus_request_stop_feedback(int pid); int vc_mgr_dbus_send_utterance_status(int pid, int utt_id, int utt_status); -int vc_mgr_dbus_send_audio_streaming(int pid, vc_audio_streaming_event_e event, unsigned char* buffer, unsigned int len); +int vc_mgr_dbus_send_audio_streaming(int pid, vc_audio_streaming_event_e event, char* buffer, unsigned int len); int vc_mgr_dbus_change_system_volume(int pid, vc_system_volume_event_e volume_event); diff --git a/include/voice_control_manager_internal.h b/include/voice_control_manager_internal.h index 2a887ef..4d6cc27 100644 --- a/include/voice_control_manager_internal.h +++ b/include/voice_control_manager_internal.h @@ -42,8 +42,7 @@ typedef enum { typedef enum { VC_SYSTEM_VOLUME_EVENT_CHANGE_FOR_NEARFIELD, - VC_SYSTEM_VOLUME_EVENT_CHANGE_FOR_FARFIELD, - VC_SYSTEM_VOLUME_EVENT_RECOVER + VC_SYSTEM_VOLUME_EVENT_CHANGE_FOR_FARFIELD } vc_system_volume_event_e; #define VC_SERVICE_STATE_UPDATING 5 /**< 'Updating' state */ @@ -104,7 +103,7 @@ int vc_mgr_set_domain(const char* domain); * @since_tizen 5.0 * */ -int vc_mgr_send_audio_streaming(vc_audio_streaming_event_e event, unsigned char* buffer, unsigned int len); +int vc_mgr_send_audio_streaming(vc_audio_streaming_event_e event, char* buffer, unsigned int len); int vc_mgr_set_audio_streaming_mode(vc_audio_streaming_mode_e streaming_mode); diff --git a/server/vcd_dbus_server.c b/server/vcd_dbus_server.c index 2adb89e..119d5f8 100755 --- a/server/vcd_dbus_server.c +++ b/server/vcd_dbus_server.c @@ -1046,7 +1046,7 @@ int vcd_dbus_server_mgr_send_audio_streaming(DBusConnection* conn, DBusMessage* int pid = 0; int event = 0; - unsigned char* buffer = NULL; + char* buffer = NULL; unsigned int len = 0; int ret = VCD_ERROR_OPERATION_FAILED; diff --git a/server/vcd_server.c b/server/vcd_server.c index 56df9a5..6913285 100755 --- a/server/vcd_server.c +++ b/server/vcd_server.c @@ -2307,7 +2307,7 @@ int vcd_server_mgr_stop_feedback(void) return VCD_ERROR_NONE; } -int vcd_server_mgr_send_audio_streaming(int pid, int event, unsigned char* buffer, unsigned int len) +int vcd_server_mgr_send_audio_streaming(int pid, int event, char* buffer, unsigned int len) { SLOG(LOG_INFO, TAG_VCD, "[DEBUG] Send Audio Streaming from Multi-assistant. event(%d), buffer(%p), len(%d)", event, &buffer, len); diff --git a/server/vcd_server.h b/server/vcd_server.h index 23ec32a..e675b0b 100644 --- a/server/vcd_server.h +++ b/server/vcd_server.h @@ -87,7 +87,7 @@ int vcd_server_mgr_start_feedback(void); int vcd_server_mgr_stop_feedback(void); /* for Multi-assistant */ -int vcd_server_mgr_send_audio_streaming(int pid, int event, unsigned char* buffer, unsigned int len); +int vcd_server_mgr_send_audio_streaming(int pid, int event, char* buffer, unsigned int len); /* -- 2.7.4 From 76b88d002760d8aa747b09292cdbf246ae89bc16 Mon Sep 17 00:00:00 2001 From: sungrae jo Date: Mon, 30 Mar 2020 10:53:37 +0900 Subject: [PATCH 07/16] Update version to 1.60.6 Change-Id: I88c9a6821617005e566b9e22eb0f3bb457f8ae0d Signed-off-by: sungrae jo --- CMakeLists.txt | 2 +- packaging/voice-control.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b0132f8..4b63cf0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ PROJECT(vc) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(EXEC_PREFIX "${PREFIX}") -SET(VERSION 1.60.5) +SET(VERSION 1.60.6) FIND_PROGRAM(UNAME NAMES uname) EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") diff --git a/packaging/voice-control.spec b/packaging/voice-control.spec index 1c35223..b099c4e 100644 --- a/packaging/voice-control.spec +++ b/packaging/voice-control.spec @@ -1,6 +1,6 @@ Name: voice-control Summary: Voice control client library and daemon -Version: 1.60.5 +Version: 1.60.6 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Apache-2.0 -- 2.7.4 From cf760861bb9b1219a75e62729f813b343c84a1ef Mon Sep 17 00:00:00 2001 From: sungrae jo Date: Tue, 31 Mar 2020 12:51:13 +0900 Subject: [PATCH 08/16] Changed VC mgr internal state for vc_mgr_set_audio_streaming_mode vc_mgr_set_audio_streaming_mode will be using VC_STATE_INITIALIZED or VC_SERVICE_STATE_READY. Change-Id: Ia5e36362f898f632d0fa8bcc744e447717abf81f Signed-off-by: sungrae jo --- client/vc_mgr.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/client/vc_mgr.c b/client/vc_mgr.c index 48dc9f9..84c69b8 100755 --- a/client/vc_mgr.c +++ b/client/vc_mgr.c @@ -4517,12 +4517,6 @@ int vc_mgr_set_audio_streaming_mode(vc_audio_streaming_mode_e mode) return VC_ERROR_INVALID_STATE; } - if (state != VC_STATE_READY) { - SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Invalid State: Current state is not 'READY'"); - SLOG(LOG_DEBUG, TAG_VCM, "@@@"); - return VC_ERROR_INVALID_STATE; - } - vc_service_state_e service_state = VC_SERVICE_STATE_NONE; ret = vc_mgr_client_get_service_state(g_vc_m, &service_state); if (0 != ret) { -- 2.7.4 From c5d4a6b38467c29c6c768258454f6c984512f960 Mon Sep 17 00:00:00 2001 From: "wn.jang" Date: Wed, 1 Apr 2020 15:06:10 +0900 Subject: [PATCH 09/16] Add log to analyze easily Change-Id: Icf91294f6dbd992d63a0b26c118d3965dff4e6d2 --- client/vc_mgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/vc_mgr.c b/client/vc_mgr.c index 84c69b8..40e5d15 100755 --- a/client/vc_mgr.c +++ b/client/vc_mgr.c @@ -4431,7 +4431,7 @@ static float __get_volume_decibel(char* data, int size) int vc_mgr_send_audio_streaming(vc_audio_streaming_event_e event, char* buffer, unsigned int len) { - SLOG(LOG_INFO, TAG_VCM, "[Manager] Send audio streaming to the engine service"); + SLOG(LOG_INFO, TAG_VCM, "[Manager] Send audio streaming to the engine service, event(%d)", event); if (0 != __vc_mgr_get_feature_enabled()) { SLOG(LOG_DEBUG, TAG_VCM, "@@@ [Manager] not supported"); @@ -4493,7 +4493,7 @@ int vc_mgr_send_audio_streaming(vc_audio_streaming_event_e event, char* buffer, int vc_mgr_set_audio_streaming_mode(vc_audio_streaming_mode_e mode) { - SLOG(LOG_INFO, TAG_VCM, "[Manager] Set multi assistant mode"); + SLOG(LOG_INFO, TAG_VCM, "[Manager] Set multi assistant mode, mode(%d)", mode); if (0 != __vc_mgr_get_feature_enabled()) { SLOG(LOG_DEBUG, TAG_VCM, "@@@ [Manager] not supported"); -- 2.7.4 From 1baf38236e48681675e0229fb82cd6ee2ae1e7dc Mon Sep 17 00:00:00 2001 From: sungrae jo Date: Mon, 16 Mar 2020 19:10:43 +0900 Subject: [PATCH 10/16] Added vc_mgr_send_utterance_status for voice control manager header. Change-Id: I7e3852a8ed721199a21acafb52ad8a7bb025f609 Signed-off-by: sungrae jo --- include/voice_control_manager.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/include/voice_control_manager.h b/include/voice_control_manager.h index 3d4ece3..2abd2c4 100644 --- a/include/voice_control_manager.h +++ b/include/voice_control_manager.h @@ -1758,6 +1758,31 @@ int vc_mgr_set_vc_tts_streaming_cb(vc_mgr_vc_tts_streaming_cb callback, void* us */ int vc_mgr_unset_vc_tts_streaming_cb(void); +/** + * @platform + * @brief Sends the utterance status to the VC client. + * @since_tizen 6.0 + * + * @privlevel platform + * @privilege %http://tizen.org/privilege/voicecontrol.manager + * + * @param[in] pid The process id of the VC client + * @param[in] utt_id The utterance id + * @param[in] utt_status The utterance status + * + * @return 0 on success, otherwise a negative error value + * @retval #VC_ERROR_NONE Successful + * @retval #VC_ERROR_NOT_SUPPORTED VC not supported + * @retval #VC_ERROR_PERMISSION_DENIED Permission denied + * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #VC_ERROR_OUT_OF_MEMORY Not enough memory + * @retval #VC_ERROR_INVALID_STATE Invalid state + * @retval #VC_ERROR_OPERATION_FAILED Operation fail + * + * @pre The service state should be #VC_SERVICE_STATE_READY. + */ +int vc_mgr_send_utterance_status(int pid, int utt_id, vc_tts_utterance_status_e utt_status); + #ifdef __cplusplus } -- 2.7.4 From 0839f9266d89e1f4280db120c68a3d494be87ea3 Mon Sep 17 00:00:00 2001 From: "wn.jang" Date: Wed, 1 Apr 2020 15:09:28 +0900 Subject: [PATCH 11/16] Update version to 1.60.7 Change-Id: Idb4c80b9b7f99d00aa1123345f97e44110736d18 --- CMakeLists.txt | 2 +- packaging/voice-control.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b63cf0..b8ccc24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ PROJECT(vc) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(EXEC_PREFIX "${PREFIX}") -SET(VERSION 1.60.6) +SET(VERSION 1.60.7) FIND_PROGRAM(UNAME NAMES uname) EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") diff --git a/packaging/voice-control.spec b/packaging/voice-control.spec index b099c4e..3328c35 100644 --- a/packaging/voice-control.spec +++ b/packaging/voice-control.spec @@ -1,6 +1,6 @@ Name: voice-control Summary: Voice control client library and daemon -Version: 1.60.6 +Version: 1.60.7 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Apache-2.0 -- 2.7.4 From f67db1372a1e9acbac4f5b4604ed05f38e8918ca Mon Sep 17 00:00:00 2001 From: "wn.jang" Date: Mon, 13 Apr 2020 10:06:45 +0900 Subject: [PATCH 12/16] Initialize values after use Crash was happened due to memory corruption on fd handler. Because fd handler was deleted, but it was not initialized, it could be used even if it was checked by NULL. Change-Id: Ic261af84e52608f083ec10f12637579b4266b8dd --- common/vc_config_mgr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/vc_config_mgr.c b/common/vc_config_mgr.c index 2a34402..c8988a8 100644 --- a/common/vc_config_mgr.c +++ b/common/vc_config_mgr.c @@ -1120,6 +1120,9 @@ int __vc_config_mgr_unregister_config_event() ecore_main_fd_handler_del(g_fd_handler_lang); inotify_rm_watch(g_fd_lang, g_wd_lang); close(g_fd_lang); + g_fd_handler_lang = NULL; + g_wd_lang = NULL; + g_fd_lang = NULL; vconf_ignore_key_changed(VCONFKEY_LANGSET, __vc_config_language_changed_cb); } -- 2.7.4 From 3e5341178bab79d8ff5c442a0bb45a9ff0adf355 Mon Sep 17 00:00:00 2001 From: "wn.jang" Date: Thu, 16 Apr 2020 10:09:03 +0900 Subject: [PATCH 13/16] Update version to 1.60.8 Change-Id: Ic1fb807db006a2cca0290bf114f556e449711f99 --- CMakeLists.txt | 2 +- packaging/voice-control.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b8ccc24..686f357 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ PROJECT(vc) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(EXEC_PREFIX "${PREFIX}") -SET(VERSION 1.60.7) +SET(VERSION 1.60.8) FIND_PROGRAM(UNAME NAMES uname) EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") diff --git a/packaging/voice-control.spec b/packaging/voice-control.spec index 3328c35..33499f2 100644 --- a/packaging/voice-control.spec +++ b/packaging/voice-control.spec @@ -1,6 +1,6 @@ Name: voice-control Summary: Voice control client library and daemon -Version: 1.60.7 +Version: 1.60.8 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Apache-2.0 -- 2.7.4 From f59559eadfc7d96864087dae8a32f782ca9bc6d9 Mon Sep 17 00:00:00 2001 From: "wn.jang" Date: Thu, 16 Apr 2020 14:09:34 +0900 Subject: [PATCH 14/16] Fix wrong initialize value Change-Id: I6889e8e2d3a8dcd1fccd66d2698707752c7064eb --- common/vc_config_mgr.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/common/vc_config_mgr.c b/common/vc_config_mgr.c index c8988a8..5d5fd12 100644 --- a/common/vc_config_mgr.c +++ b/common/vc_config_mgr.c @@ -63,8 +63,8 @@ static vc_config_s* g_config_info; static int g_lang_ref_count; static Ecore_Fd_Handler* g_fd_handler_lang = NULL; -static int g_fd_lang; -static int g_wd_lang; +static int g_fd_lang = -1; +static int g_wd_lang = -1; static GList* g_ino_list = NULL; @@ -577,12 +577,17 @@ Eina_Bool vc_config_mgr_inotify_event_cb(void* data, Ecore_Fd_Handler *fd_handle { SLOG(LOG_DEBUG, vc_config_tag(), "@@@ Config changed callback event"); + if (g_fd_lang < 0) { + SLOG(LOG_WARN, vc_config_tag(), "[WARN] FD for config file is closed"); + SLOG(LOG_DEBUG, vc_config_tag(), "@@@"); + return ECORE_CALLBACK_PASS_ON; + } + int length; struct inotify_event event; memset(&event, '\0', sizeof(struct inotify_event)); length = read(g_fd_lang, &event, sizeof(struct inotify_event)); - if (0 > length) { SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Empty Inotify event"); SLOG(LOG_DEBUG, vc_config_tag(), "@@@"); @@ -1121,8 +1126,7 @@ int __vc_config_mgr_unregister_config_event() inotify_rm_watch(g_fd_lang, g_wd_lang); close(g_fd_lang); g_fd_handler_lang = NULL; - g_wd_lang = NULL; - g_fd_lang = NULL; + g_fd_lang = -1; vconf_ignore_key_changed(VCONFKEY_LANGSET, __vc_config_language_changed_cb); } -- 2.7.4 From dbc1961a5ec3eb506588cd50cc95e57dad2f114c Mon Sep 17 00:00:00 2001 From: Suyeon Hwang Date: Thu, 16 Apr 2020 15:25:32 +0900 Subject: [PATCH 15/16] Use buffer size as minimum value of buffer_size and BUFFER_LENGTH buffer_size can be different from BUFFER_LENGTH. However, if buffer_size is bigger than BUFFER_LENGTH, buffer overflow can be occured. Thus, I use minimum value of buffer_size and BUFFER_LENGTH as parameter. And also, this patch pass the same variable to g_audio_cb and get_volume_decibel. Change-Id: I1231f056226415e820b079da3241e5ee82f8793d Signed-off-by: Suyeon Hwang --- server/vcd_recorder.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/vcd_recorder.c b/server/vcd_recorder.c index bfa8fd3..a2d2648 100644 --- a/server/vcd_recorder.c +++ b/server/vcd_recorder.c @@ -777,10 +777,12 @@ Eina_Bool __read_test_func(void *data) if (buffer_size != BUFFER_LENGTH) SLOG(LOG_DEBUG, TAG_VCD, "[Recorder test] Get data size(%d)", buffer_size); + buffer_size = MIN(buffer_size, BUFFER_LENGTH); + if (NULL != g_audio_cb && buffer_size != 0) g_audio_cb(buffer, buffer_size); - float vol_db = get_volume_decibel(buffer, BUFFER_LENGTH); + float vol_db = get_volume_decibel(buffer, buffer_size); if (0 != vcdc_send_set_volume(vcd_client_manager_get_pid(), vol_db)) SLOG(LOG_ERROR, TAG_VCD, "[Recorder test] Fail to send recording volume(%f)", vol_db); -- 2.7.4 From d544da971e0a3c30676a2edf1af7bd19ad666aeb Mon Sep 17 00:00:00 2001 From: "wn.jang" Date: Thu, 16 Apr 2020 18:22:25 +0900 Subject: [PATCH 16/16] Update version to 1.60.9 Change-Id: I91b3abcb3241c1553fd5467c5c5ee517a1bd912b --- CMakeLists.txt | 2 +- packaging/voice-control.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 686f357..27c15fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ PROJECT(vc) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(EXEC_PREFIX "${PREFIX}") -SET(VERSION 1.60.8) +SET(VERSION 1.60.9) FIND_PROGRAM(UNAME NAMES uname) EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") diff --git a/packaging/voice-control.spec b/packaging/voice-control.spec index 33499f2..7c5fcbd 100644 --- a/packaging/voice-control.spec +++ b/packaging/voice-control.spec @@ -1,6 +1,6 @@ Name: voice-control Summary: Voice control client library and daemon -Version: 1.60.8 +Version: 1.60.9 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Apache-2.0 -- 2.7.4