static sound_stream_info_h g_stream_info_h;
static int g_focus_watch_id;
+
+
/*
* Internal Interfaces
*/
ret = sound_manager_get_current_playback_focus(&reason, &sound_behavior, &extra_info);
- SLOG(LOG_DEBUG, tts_tag(), "[Player] current playback focus: extra_info(%s), reason(%d), sound_behavior(%d)", extra_info, reason, sound_behavior, extra_info);
+ SLOG(LOG_DEBUG, tts_tag(), "[Player] current playback focus: extra_info(%s), reason(%d), sound_behavior(%d)", extra_info, reason, sound_behavior);
if (SOUND_MANAGER_ERROR_NONE == ret && NULL != extra_info && 0 < strlen(extra_info)) {
if (SOUND_STREAM_FOCUS_CHANGED_BY_VOICE_INFORMATION == reason && 0 == strncmp(extra_info, "TTSD_MODE_INTERRUPT", strlen(extra_info))) {
SLOG(LOG_DEBUG, tts_tag(), "[Player SUCCESS] Unprepare audio");
}
g_audio_state = AUDIO_STATE_READY;
-
- /* unset volume policy, volume will be 100% */
- __unset_policy_for_playing();
}
+ /* unset volume policy, volume will be 100% */
+ __unset_policy_for_playing();
return;
} else if (0 < ttsd_data_get_sound_data_size(player->uid)) {
/* new audio data come */
/* unset volume policy, volume will be 100% */
__unset_policy_for_playing();
- ttsd_data_clear_sound_data(&sound_data);
return;
}
SLOG(LOG_WARN, tts_tag(), "[Send WARNIING] Current player is not valid");
/* unset volume policy, volume will be 100% */
__unset_policy_for_playing();
- ttsd_data_clear_sound_data(&sound_data);
return;
}
if (0 != ttsdc_send_utt_finish_message(pid, player->uid, sound_data->utt_id)) {
}
}
SLOG(LOG_INFO, tts_tag(), "[Player] Finish utterance : uid(%d), uttid(%d)", player->uid, sound_data->utt_id);
- ttsd_data_clear_sound_data(&sound_data);
+ ttsd_data_clear_sound_data(player->uid, &sound_data);
continue;
}
}
if (g_sampling_rate != sound_data->rate || g_audio_type != sound_data->audio_type) {
- SLOG(LOG_DEBUG, tts_tag(), "[Player] Change audio handle : org type(%d) org rate(%d)", g_audio_type, g_sampling_rate);
+ SLOG(LOG_INFO, tts_tag(), "[Player] Change audio handle : org type(%d) org rate(%d)", g_audio_type, g_sampling_rate);
if (NULL != g_audio_h) {
__destroy_audio_out();
}
/* unset volume policy, volume will be 100% */
__unset_policy_for_playing();
- ttsd_data_clear_sound_data(&sound_data);
+ ttsd_data_clear_sound_data(player->uid, &sound_data);
return;
}
+ SLOG(LOG_INFO, tts_tag(), "[Player INFO] Success to destroy and recreate audio out");
__set_policy_for_playing(40);
}
/* unset volume policy, volume will be 100% */
__unset_policy_for_playing();
- ttsd_data_clear_sound_data(&sound_data);
+ ttsd_data_clear_sound_data(player->uid, &sound_data);
return;
}
}
char* temp_data = sound_data->data;
+ SLOG(LOG_INFO, tts_tag(), "[Player INFO] Before audio_out_write. data(%p), data[%d](%p), uid(%d), utt_id(%d), len(%d)",
+ temp_data, idx, &temp_data[idx], player->uid, sound_data->utt_id, len);
ret = audio_out_write(g_audio_h, &temp_data[idx], len);
if (0 > ret) {
SLOG(LOG_WARN, tts_tag(), "[Player WARNING] Fail to audio write - %d", ret);
} else {
idx += len;
+ SLOG(LOG_INFO, tts_tag(), "[Player INFO] After audio_out_write");
}
if (NULL == g_playing_info && APP_STATE_PAUSED != player->state) {
/* unset volume policy, volume will be 100% */
__unset_policy_for_playing();
- ttsd_data_clear_sound_data(&sound_data);
+ ttsd_data_clear_sound_data(player->uid, &sound_data);
return;
}
if (APP_STATE_PAUSED == player->state) {
/* Save data */
+ SLOG(LOG_DEBUG, tts_tag(), "[Player] player(%p)", player);
player->paused_data = sound_data;
player->is_paused_data = true;
player->idx = idx;
g_audio_state = AUDIO_STATE_READY;
+
SLOG(LOG_INFO, tts_tag(), "[Player] Stop player thread by pause");
/* Request prepare */
SLOG(LOG_DEBUG, tts_tag(), "[Player SUCCESS] Unprepare audio");
}
- ttsd_data_clear_sound_data(&sound_data);
+ ttsd_data_clear_sound_data(player->uid, &sound_data);
/* unset volume policy, volume will be 100% */
__unset_policy_for_playing();
return;
/* unset volume policy, volume will be 100% */
__unset_policy_for_playing();
- ttsd_data_clear_sound_data(&sound_data);
return;
}
/* unset volume policy, volume will be 100% */
__unset_policy_for_playing();
- ttsd_data_clear_sound_data(&sound_data);
+ ttsd_data_clear_sound_data(player->uid, &sound_data);
return;
}
SLOG(LOG_INFO, tts_tag(), "[Player] Finish utterance : uid(%d), uttid(%d)", player->uid, sound_data->utt_id);
}
- ttsd_data_clear_sound_data(&sound_data);
+ ttsd_data_clear_sound_data(player->uid, &sound_data);
if (NULL == g_playing_info) {
SLOG(LOG_ERROR, tts_tag(), "[Player ERROR] Current player is NULL");
if (NULL != g_playing_info) {
if (uid == g_playing_info->uid) {
/* release current playing info */
+ SLOG(LOG_DEBUG, tts_tag(), "[Player DEBUG] release current playing info (%d)", uid);
g_playing_info = NULL;
} else {
/* error case */
}
}
+ SLOG(LOG_DEBUG, tts_tag(), "[Player DEBUG] current player (%p), g_playing_info(%p)", current, g_playing_info);
+
current->state = APP_STATE_PAUSED;
- SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
- SLOG(LOG_ERROR, tts_tag(), "[Player] Active thread count : %d", ecore_thread_active_get());
- SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
+ if (NULL == g_playing_info) {
+ SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
+ SLOG(LOG_ERROR, tts_tag(), "[Player] Active thread count : %d", ecore_thread_active_get());
+ SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
- /* The thread should be released */
- int thread_count = ecore_thread_active_get();
- int count = 0;
- while (0 < thread_count) {
- usleep(10000);
+ /* The thread should be released */
+ int thread_count = ecore_thread_active_get();
+ int count = 0;
+ while (0 < thread_count) {
+ usleep(10000);
- count++;
- if (30 == count) {
- SLOG(LOG_WARN, tts_tag(), "[Player WARNING!!] Thread is blocked. Player release continue.");
- break;
+ count++;
+ SLOG(LOG_DEBUG, tts_tag(), "[Player DEBUG] current(%p), state(%d)", current, current->state);
+
+ if (30 == count) {
+ SLOG(LOG_WARN, tts_tag(), "[Player WARNING!!] Thread is blocked. Player release continue. current(%p) current state(%d)", current, current->state);
+ break;
+ }
+
+ thread_count = ecore_thread_active_get();
}
- thread_count = ecore_thread_active_get();
+ SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
+ SLOG(LOG_ERROR, tts_tag(), "[Player] Active thread count : %d", ecore_thread_active_get());
+ SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
}
- SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
- SLOG(LOG_ERROR, tts_tag(), "[Player] Active thread count : %d", ecore_thread_active_get());
- SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
SLOG(LOG_DEBUG, tts_tag(), "[Player SUCCESS] Pause player : uid(%d)", uid);