2 * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 * http://www.apache.org/licenses/LICENSE-2.0
7 * Unless required by applicable law or agreed to in writing, software
8 * distributed under the License is distributed on an "AS IS" BASIS,
9 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 * See the License for the specific language governing permissions and
11 * limitations under the License.
18 #include "ttsd_main.h"
19 #include "ttsd_server.h"
20 #include "ttsd_stub.h"
22 #include "ttsd_tidl.h"
26 rpc_port_stub_tts_notify_cb_h notify_cb_h;
27 } tts_tidl_proxy_info_s;
29 static GList* g_tidl_proxy_infos = NULL;
31 static rpc_port_stub_tts_callback_s g_callback;
33 static pthread_mutex_t g_tidl_proxy_infos_mutex = PTHREAD_MUTEX_INITIALIZER;
36 static tts_tidl_proxy_info_s* __get_tidl_proxy_info_s(unsigned int uid)
39 tts_tidl_proxy_info_s* info = NULL;
41 if (g_list_length(g_tidl_proxy_infos) > 0) {
42 /* Get a first item */
43 iter = g_list_first(g_tidl_proxy_infos);
45 while (NULL != iter) {
47 if (info->uid == uid) {
52 iter = g_list_next(iter);
59 void __send_msg(int pid, unsigned int uid, bundle* msg)
61 SLOG(LOG_INFO, tts_tag(), "[TIDL] start : send msg : pid(%d), uid(%u)", pid, uid);
62 pthread_mutex_lock(&g_tidl_proxy_infos_mutex);
63 tts_tidl_proxy_info_s* info = __get_tidl_proxy_info_s(uid);
65 SLOG(LOG_ERROR, tts_tag(), "[TIDL] Uid is not valid. pid(%d), uid(%u)", pid, uid);
66 pthread_mutex_unlock(&g_tidl_proxy_infos_mutex);
70 rpc_port_stub_tts_notify_cb_h handle = info->notify_cb_h;
72 SLOG(LOG_INFO, tts_tag(), "notify callback handle null");
73 pthread_mutex_unlock(&g_tidl_proxy_infos_mutex);
77 if (0 != rpc_port_stub_tts_notify_cb_invoke(handle, pid, (int)uid, msg)) {
78 SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail to send msg");
79 pthread_mutex_unlock(&g_tidl_proxy_infos_mutex);
82 SLOG(LOG_INFO, tts_tag(), "send msg : pid(%d), uid(%u)", pid, uid);
83 pthread_mutex_unlock(&g_tidl_proxy_infos_mutex);
86 static void __create_client_cb(rpc_port_stub_tts_context_h context, void *user_data)
90 rpc_port_stub_tts_context_get_sender(context, &sender);
94 SLOG(LOG_ERROR, tts_tag(), ">>>>> Client connect. appid(%s)", sender);
98 static void __destroy_client_cb(rpc_port_stub_tts_context_h context, void *user_data)
101 rpc_port_stub_tts_context_get_tag(context, &tag);
104 unsigned int uid = (uintptr_t)tag;
105 SLOG(LOG_ERROR, tts_tag(), ">>>>> TTS FINALIZE. uid(%u)", uid);
107 if (0 != ttsd_server_finalize(uid)) {
111 pthread_mutex_lock(&g_tidl_proxy_infos_mutex);
112 tts_tidl_proxy_info_s* info = __get_tidl_proxy_info_s(uid);
114 SLOG(LOG_ERROR, tts_tag(), "[TIDL ERROR] Fail to set notify callback");
115 pthread_mutex_unlock(&g_tidl_proxy_infos_mutex);
119 rpc_port_stub_tts_notify_cb_destroy(info->notify_cb_h);
120 info->notify_cb_h = NULL;
122 g_tidl_proxy_infos = g_list_remove(g_tidl_proxy_infos, info);
125 SLOG(LOG_DEBUG, tts_tag(), "<<<<<");
127 pthread_mutex_unlock(&g_tidl_proxy_infos_mutex);
129 rpc_port_stub_tts_context_set_tag(context, NULL);
132 rpc_port_stub_tts_context_get_sender(context, &sender);
136 SLOG(LOG_INFO, tts_tag(), ">>>>> Client disconnect. appid(%s)", sender);
140 static void __register_cb(rpc_port_stub_tts_context_h context, int pid, int uid, int mode, rpc_port_stub_tts_notify_cb_h callback, void *user_data)
142 unsigned int u_uid = (unsigned int)uid;
143 SLOG(LOG_ERROR, tts_tag(), ">>>>> TTS REGISTER CALLBACK uid(%u), mode(%d)", u_uid, mode);
145 bool is_initialized = false;
146 ttsd_server_is_already_initialized(pid, u_uid, &is_initialized);
149 int credential_needed = 0;
150 if (false == is_initialized) {
151 bool is_credential_needed = false;
152 ret = ttsd_server_initialize(pid, u_uid, mode, TTS_IPC_METHOD_TIDL, &is_credential_needed);
154 SLOG(LOG_ERROR, tts_tag(), "[IN ERROR] ttsd Hello : server initialize, ret(%d)", ret);
157 credential_needed = is_credential_needed ? 1 : 0;
159 ret = TTS_ERROR_ALREADY_INITIALIZED;
160 credential_needed = TTS_CREDENTIAL_NEEDED_ALREADY_INITIALIZED;
163 uintptr_t ptr_uid = u_uid;
164 rpc_port_stub_tts_context_set_tag(context, (void*)ptr_uid);
166 pthread_mutex_lock(&g_tidl_proxy_infos_mutex);
167 tts_tidl_proxy_info_s* info = __get_tidl_proxy_info_s(u_uid);
169 info = (tts_tidl_proxy_info_s*)calloc(1, sizeof(tts_tidl_proxy_info_s));
171 SLOG(LOG_ERROR, tts_tag(), "[TIDL ERROR] Fail to allocate memory for tidl proxy");
172 pthread_mutex_unlock(&g_tidl_proxy_infos_mutex);
176 g_tidl_proxy_infos = g_list_remove(g_tidl_proxy_infos, info);
177 rpc_port_stub_tts_notify_cb_destroy(info->notify_cb_h);
178 info->notify_cb_h = NULL;
181 if (0 != rpc_port_stub_tts_notify_cb_clone(callback, &info->notify_cb_h)) {
182 SLOG(LOG_ERROR, tts_tag(), "[TIDL ERROR] Fail to set notify callback");
184 pthread_mutex_unlock(&g_tidl_proxy_infos_mutex);
189 g_tidl_proxy_infos = g_list_append(g_tidl_proxy_infos, info);
190 pthread_mutex_unlock(&g_tidl_proxy_infos_mutex);
192 SLOG(LOG_INFO, tts_tag(), "create player instance");
193 ttsdc_tidl_send_hello(pid, u_uid, ret, credential_needed);
195 SLOG(LOG_ERROR, tts_tag(), "<<<<<<<<<<<");
199 static int __register_cb_sync(rpc_port_stub_tts_context_h context, int pid, int uid, rpc_port_stub_tts_notify_cb_h callback, void* user_data)
201 unsigned int u_uid = (unsigned int)uid;
202 SLOG(LOG_ERROR, tts_tag(), ">>>>> TTS REGISTER CALLBACK synchronously uid(%u)", u_uid);
204 uintptr_t ptr_uid = u_uid;
205 rpc_port_stub_tts_context_set_tag(context, (void*)ptr_uid);
207 pthread_mutex_lock(&g_tidl_proxy_infos_mutex);
208 tts_tidl_proxy_info_s* info = __get_tidl_proxy_info_s(u_uid);
210 info = (tts_tidl_proxy_info_s*)calloc(1, sizeof(tts_tidl_proxy_info_s));
212 SLOG(LOG_ERROR, tts_tag(), "[TIDL ERROR] Fail to allocate memory for tidl proxy");
213 pthread_mutex_unlock(&g_tidl_proxy_infos_mutex);
214 return TTSD_ERROR_OUT_OF_MEMORY;
217 g_tidl_proxy_infos = g_list_remove(g_tidl_proxy_infos, info);
218 rpc_port_stub_tts_notify_cb_destroy(info->notify_cb_h);
219 info->notify_cb_h = NULL;
222 if (0 != rpc_port_stub_tts_notify_cb_clone(callback, &info->notify_cb_h)) {
223 SLOG(LOG_ERROR, tts_tag(), "[TIDL ERROR] Fail to set notify callback");
225 pthread_mutex_unlock(&g_tidl_proxy_infos_mutex);
226 return TTSD_ERROR_OPERATION_FAILED;
230 g_tidl_proxy_infos = g_list_append(g_tidl_proxy_infos, info);
231 pthread_mutex_unlock(&g_tidl_proxy_infos_mutex);
233 SLOG(LOG_ERROR, tts_tag(), "<<<<<<<<<<<");
235 return TTSD_ERROR_NONE;
238 int ttsdc_tidl_send_hello(int pid, unsigned int uid, int ret, int credential_needed)
240 SLOG(LOG_INFO, tts_tag(), "[TIDL] ttsdc_tidl_send_hello : pid(%d), uid(%u), credential_needed(%d)", pid, uid, credential_needed);
242 char tmp_val[10] = {0, };
243 char ret_val[12] = {0, };
244 snprintf(tmp_val, 10, "%d", credential_needed);
245 snprintf(ret_val, 12, "%d", ret);
247 bundle* msg = bundle_create();
249 SLOG(LOG_ERROR, tts_tag(), "[TIDL] Fail to create bundle: pid(%d), uid(%u)", pid, uid);
250 return TTSD_ERROR_OUT_OF_MEMORY;
253 bundle_add_str(msg, TTS_BUNDLE_METHOD, TTSD_METHOD_HELLO);
254 bundle_add_str(msg, TTS_BUNDLE_REASON, ret_val);
255 bundle_add_str(msg, TTS_BUNDLE_CREDENTIAL_NEEDED, tmp_val);
257 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTSD SEND HELLO MSG");
258 __send_msg(pid, uid, msg);
261 return TTSD_ERROR_NONE;
264 static int __initialize_cb(rpc_port_stub_tts_context_h context, int pid, int uid, int mode, bool *credential_needed, void *user_data)
266 unsigned int u_uid = (unsigned int)uid;
267 SECURE_SLOG(LOG_ERROR, tts_tag(), "[IN] tts initialize : pid(%d), uid(%u), mode(%d)", pid, u_uid, mode);
269 if (0 != ttsd_server_initialize(pid, u_uid, mode, TTS_IPC_METHOD_TIDL, credential_needed)) {
270 return TTSD_ERROR_OPERATION_FAILED;
273 SLOG(LOG_ERROR, tts_tag(), "[OUT] tts initialize credential_needed(%d)", *credential_needed);
274 return TTSD_ERROR_NONE;
277 static int __finalize_cb(rpc_port_stub_tts_context_h context, int uid, void *user_data)
279 unsigned int u_uid = (unsigned int)uid;
280 SLOG(LOG_ERROR, tts_tag(), ">>>>> TTS FINALIZE. uid(%u)", u_uid);
282 int ret = ttsd_server_finalize(u_uid);
283 if (TTSD_ERROR_NONE != ret) {
284 SLOG(LOG_ERROR, tts_tag(), "[ERROR] TTS FINALIZE (%u) fail (%d/%s) <<<<<", u_uid, ret, get_error_message(ret));
288 pthread_mutex_lock(&g_tidl_proxy_infos_mutex);
289 tts_tidl_proxy_info_s* info = __get_tidl_proxy_info_s(u_uid);
291 SLOG(LOG_ERROR, tts_tag(), "[TIDL ERROR] Fail to set notify callback");
292 pthread_mutex_unlock(&g_tidl_proxy_infos_mutex);
293 return TTSD_ERROR_INVALID_PARAMETER;
296 rpc_port_stub_tts_notify_cb_destroy(info->notify_cb_h);
297 info->notify_cb_h = NULL;
299 g_tidl_proxy_infos = g_list_remove(g_tidl_proxy_infos, info);
301 pthread_mutex_unlock(&g_tidl_proxy_infos_mutex);
303 rpc_port_stub_tts_context_set_tag(context, NULL);
304 SLOG(LOG_ERROR, tts_tag(), "<<<<<");
305 return TTSD_ERROR_NONE;
308 static int __add_text_cb(rpc_port_stub_tts_context_h context, int uid, const char *text, const char *lang,
309 int vctype, int speed, int uttid, const char *credential, void *user_data)
311 unsigned int u_uid = (unsigned int)uid;
312 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS ADD TEXT (%u)", u_uid);
314 int ret = ttsd_server_add_text(u_uid, text, lang, vctype, speed, uttid, credential);
315 if (TTSD_ERROR_NONE != ret) {
316 SLOG(LOG_ERROR, tts_tag(), "[ERROR] TTS ADD TEXT (%u) fail (%d/%s) <<<<<", u_uid, ret, get_error_message(ret));
320 SLOG(LOG_DEBUG, tts_tag(), "<<<<<");
321 return TTSD_ERROR_NONE;
324 static int __stop_cb(rpc_port_stub_tts_context_h context, int uid, void *user_data)
326 unsigned int u_uid = (unsigned int)uid;
327 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS STOP (%u)", u_uid);
329 int ret = ttsd_server_stop(u_uid);
330 if (TTSD_ERROR_NONE != ret) {
331 SLOG(LOG_ERROR, tts_tag(), "[ERROR] TTS STOP (%u) fail (%d/%s) <<<<<", u_uid, ret, get_error_message(ret));
336 SLOG(LOG_DEBUG, tts_tag(), "<<<<<");
338 return TTSD_ERROR_NONE;
341 static int __pause_cb(rpc_port_stub_tts_context_h context, int uid, void *user_data)
343 unsigned int u_uid = (unsigned int)uid;
344 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS PLAYER PAUSE (%u)", u_uid);
346 int ret = ttsd_server_pause(u_uid);
347 if (TTSD_ERROR_NONE != ret) {
348 SLOG(LOG_ERROR, tts_tag(), "[ERROR] TTS PLAYER PAUSE (%u) fail (%d/%s) <<<<<", u_uid, ret, get_error_message(ret));
352 SLOG(LOG_DEBUG, tts_tag(), "<<<<<");
354 return TTSD_ERROR_NONE;
357 static int __play_pcm_cb(rpc_port_stub_tts_context_h context, int uid, void *user_data)
359 unsigned int u_uid = (unsigned int)uid;
360 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS PLAY PCM (%u)", u_uid);
362 int ret = ttsd_server_play_pcm(u_uid);
363 if (TTSD_ERROR_NONE != ret) {
364 SLOG(LOG_ERROR, tts_tag(), "[ERROR] TTS PLAY PCM (%u) fail (%d/%s) <<<<<", u_uid, ret, get_error_message(ret));
368 SLOG(LOG_DEBUG, tts_tag(), "<<<<<");
370 return TTSD_ERROR_NONE;
373 static int __stop_pcm_cb(rpc_port_stub_tts_context_h context, int uid, void *user_data)
375 unsigned int u_uid = (unsigned int)uid;
376 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS STOP PCM (%u)", u_uid);
378 int ret = ttsd_server_stop(u_uid);
379 if (TTSD_ERROR_NONE != ret) {
380 SLOG(LOG_ERROR, tts_tag(), "[ERROR] TTS STOP PCM (%u) fail (%d/%s) <<<<<", u_uid, ret, get_error_message(ret));
384 SLOG(LOG_DEBUG, tts_tag(), "<<<<<");
385 return TTSD_ERROR_NONE;
388 static int __set_private_cb(rpc_port_stub_tts_context_h context, int uid, const char *key, const char *data, void *user_data)
390 unsigned int u_uid = (unsigned int)uid;
391 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS SET PRIVATE DATA (%u)", u_uid);
393 int ret = ttsd_server_set_private_data(u_uid, key, data);
394 if (TTSD_ERROR_NONE != ret) {
395 SLOG(LOG_ERROR, tts_tag(), "[ERROR] TTS SET PRIVATE DATA (%u) fail (%d/%s) <<<<<", u_uid, ret, get_error_message(ret));
399 SLOG(LOG_DEBUG, tts_tag(), "<<<<<");
401 return TTSD_ERROR_NONE;
404 static int __get_private_cb(rpc_port_stub_tts_context_h context, int uid, const char *key, char **data, void *user_data)
406 unsigned int u_uid = (unsigned int)uid;
407 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS GET PRIVATE DATA (%u)", u_uid);
409 int ret = ttsd_server_get_private_data(u_uid, key, data);
410 if (TTSD_ERROR_NONE != ret) {
411 SLOG(LOG_ERROR, tts_tag(), "[ERROR] TTS GET PRIVATE DATA (%u) fail (%d/%s) <<<<<", u_uid, ret, get_error_message(ret));
415 SLOG(LOG_DEBUG, tts_tag(), "<<<<<");
416 return TTSD_ERROR_NONE;
419 static int __play_cb(rpc_port_stub_tts_context_h context, int uid, const char *credential, void *user_data)
421 unsigned int u_uid = (unsigned int)uid;
422 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS PLAY (%u)", u_uid);
424 int ret = ttsd_server_play(u_uid, credential);
425 if (TTSD_ERROR_NONE != ret) {
426 SLOG(LOG_ERROR, tts_tag(), "[ERROR] TTS PLAY (%u) fail (%d/%s) <<<<<", u_uid, ret, get_error_message(ret));
430 SLOG(LOG_DEBUG, tts_tag(), "<<<<<");
431 return TTSD_ERROR_NONE;
434 static int __add_pcm_cb(rpc_port_stub_tts_context_h context, int uid, int event, rpc_port_stub_array_char_h pcm_data, int data_size, int audio_type, int rate, void *user_data)
436 unsigned int u_uid = (unsigned int)uid;
437 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS ADD PCM (%u)", u_uid);
439 char* pcm_data_raw = NULL;
440 int pcm_data_size = 0;
441 rpc_port_stub_array_char_get(pcm_data, &pcm_data_raw, &pcm_data_size);
443 int ret = ttsd_server_add_pcm(u_uid, event, (void *)pcm_data_raw, data_size, audio_type, rate);
446 if (TTSD_ERROR_NONE != ret) {
447 SLOG(LOG_ERROR, tts_tag(), "[ERROR] TTS ADD PCM (%u) fail (%d/%s) <<<<<", u_uid, ret, get_error_message(ret));
451 SLOG(LOG_DEBUG, tts_tag(), "<<<<<");
452 return TTSD_ERROR_NONE;
455 static int __get_service_state(rpc_port_stub_tts_context_h context, int uid, int* service_state, void *user_data)
457 unsigned int u_uid = (unsigned int)uid;
458 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS GET SERVICE STATE (%u)", u_uid);
460 int ret = ttsd_server_get_service_state(u_uid, service_state);
461 if (TTSD_ERROR_NONE != ret) {
462 SLOG(LOG_ERROR, tts_tag(), "[ERROR] TTS GET SERVICE STATE (%u) fail (%d/%s) <<<<<", u_uid, ret, get_error_message(ret));
466 SLOG(LOG_DEBUG, tts_tag(), "<<<<<");
467 return TTSD_ERROR_NONE;
470 int ttsd_tidl_open_connection()
472 SLOG(LOG_DEBUG, tts_tag(), "[TIDL] ttsd_tidl_open_connection");
474 g_callback.create = __create_client_cb;
475 g_callback.terminate = __destroy_client_cb;
476 g_callback.register_cb = __register_cb;
477 g_callback.register_cb_sync = __register_cb_sync;
478 g_callback.initialize = __initialize_cb;
479 g_callback.finalize = __finalize_cb;
480 g_callback.add_text = __add_text_cb;
481 g_callback.stop = __stop_cb;
482 g_callback.pause = __pause_cb;
483 g_callback.play_pcm = __play_pcm_cb;
484 g_callback.stop_pcm = __stop_pcm_cb;
485 g_callback.set_private = __set_private_cb;
486 g_callback.get_private = __get_private_cb;
487 g_callback.play = __play_cb;
488 g_callback.add_pcm = __add_pcm_cb;
489 g_callback.get_service_state = __get_service_state;
494 while (TTS_RETRY_MIN_COUNT >= count) {
495 ret = rpc_port_stub_tts_register(&g_callback, NULL);
497 SLOG(LOG_DEBUG, tts_tag(), "regitster callback");
498 return TTSD_ERROR_NONE;
504 SLOG(LOG_ERROR, tts_tag(), "Fail to register callback(%d)", ret);
505 return TTSE_ERROR_OPERATION_FAILED;
508 int ttsd_tidl_close_connection()
510 SLOG(LOG_DEBUG, tts_tag(), "[TIDL] ttsd_tidl_close_connection");
511 rpc_port_stub_tts_unregister();
513 return TTSD_ERROR_NONE;
516 static int __send_message(int pid, unsigned int uid, int data, const char *method)
518 SLOG(LOG_DEBUG, tts_tag(), "[TIDL] ttsdc_tidl_send_message");
520 char tmp_msg[10] = {0, };
522 bundle* msg = bundle_create();
523 snprintf(tmp_msg, 10, "%d", data);
524 bundle_add_str(msg, TTS_BUNDLE_METHOD, method);
525 bundle_add_str(msg, TTS_BUNDLE_MESSAGE, tmp_msg);
527 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTSD SEND MSG");
528 __send_msg(pid, uid, msg);
531 return TTSD_ERROR_NONE;
534 int ttsdc_tidl_send_utt_start_message(int pid, unsigned int uid, int uttid)
536 return __send_message(pid, uid, uttid, TTSD_METHOD_UTTERANCE_STARTED);
539 int ttsdc_tidl_send_utt_finish_message(int pid, unsigned int uid, int uttid)
541 return __send_message(pid, uid, uttid, TTSD_METHOD_UTTERANCE_COMPLETED);
544 int ttsdc_tidl_send_set_state_message(int pid, unsigned int uid, int state)
546 return __send_message(pid, uid, state, TTSD_METHOD_SET_STATE);
549 int ttsdc_tidl_send_set_service_state_message(int pid, unsigned int uid, int before_state, int current_state)
551 SLOG(LOG_DEBUG, tts_tag(), "[TIDL] ttsdc_tidl_send_set_service_state_message");
553 char str_before_state[10] = {0, };
554 char str_current_state[10] = {0, };
556 snprintf(str_before_state, 10, "%d", before_state);
557 snprintf(str_current_state, 10, "%d", current_state);
559 bundle* msg = bundle_create();
560 bundle_add_str(msg, TTS_BUNDLE_METHOD, TTSD_METHOD_SET_SERVICE_STATE);
561 bundle_add_str(msg, TTS_BUNDLE_BEFORE_STATE, str_before_state);
562 bundle_add_str(msg, TTS_BUNDLE_CURRENT_STATE, str_current_state);
564 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTSD SEND SET SERVICE STATE MESSAGE");
565 __send_msg(pid, uid, msg);
568 return TTSD_ERROR_NONE;
571 int ttsdc_tidl_send_error_message(int pid, unsigned int uid, int uttid, int reason, char* err_msg)
573 SLOG(LOG_DEBUG, tts_tag(), "[TIDL] ttsdc_tidl_send_error_message");
575 char tmp_uttid[10] = {0, };
576 char tmp_reason[10] = {0, };
578 bundle* msg = bundle_create();
579 snprintf(tmp_uttid, 10, "%d", uttid);
580 bundle_add_str(msg, TTS_BUNDLE_METHOD, TTSD_METHOD_ERROR);
581 bundle_add_str(msg, TTS_BUNDLE_UTTID, tmp_uttid);
582 bundle_add_str(msg, TTS_BUNDLE_REASON, tmp_reason);
583 bundle_add_str(msg, TTS_BUNDLE_ERR_MSG, err_msg);
585 SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTSD SEND ERROR MSG");
586 __send_msg(pid, uid, msg);
589 return TTSD_ERROR_NONE;