g_callback.play = __play_cb;
g_callback.add_pcm = __add_pcm_cb;
- if (0 != rpc_port_stub_tts_register(&g_callback, NULL)) {
- return TTSE_ERROR_OPERATION_FAILED;
- }
- SLOG(LOG_DEBUG, tts_tag(), "regitster callback");
+ int ret = -1;
+ int count = 0;
+ while (TTS_RETRY_MIN_COUNT >= count) {
+ ret = rpc_port_stub_tts_register(&g_callback, NULL);
+ if (0 == ret) {
+ SLOG(LOG_DEBUG, tts_tag(), "regitster callback");
+ return TTSE_ERROR_NONE;
+ }
+ usleep(100000);
+ count++;
+ }
- return TTSE_ERROR_NONE;
+ SLOG(LOG_ERROR, tts_tag(), "Fail to register callback(%d)", ret);
+ return TTSE_ERROR_OPERATION_FAILED;
}
int ttsd_tidl_close_connection()