};
#define DEFAULT_FOCUS_THREAD_READY_TIMEOUT 5
+#define MAX_FOCUS_THREAD_READY_WAIT_RETRY 6
typedef struct mm_sound_focus_thread_data {
const int *sockfd;
int MMSoundMgrFocusSocketReadyToWork(const int *sockfd)
{
- debug_enter();
focus_thread_data_t *thread_data = NULL;
+ int retry_remaining = MAX_FOCUS_THREAD_READY_WAIT_RETRY;
if (*sockfd < 0) {
debug_error("input param sockfd [%d] is not valid", *sockfd);
goto ERROR_INTERNAL;
}
- if (!__focus_thread_ready_wait(thread_data, DEFAULT_FOCUS_THREAD_READY_TIMEOUT)) {
- debug_error("focus thread is not ready for %u sec!!!", DEFAULT_FOCUS_THREAD_READY_TIMEOUT);
- goto ERROR_INTERNAL;
- }
-
- debug_leave();
+ do {
+ if (__focus_thread_ready_wait(thread_data, DEFAULT_FOCUS_THREAD_READY_TIMEOUT)) {
+ debug_msg("[%d] wait success!!", retry_remaining);
+ return MM_ERROR_NONE;
+ }
- return MM_ERROR_NONE;
+ debug_error("[%d] focus thread is not ready for %u sec!!!",
+ retry_remaining, DEFAULT_FOCUS_THREAD_READY_TIMEOUT);
+ } while (--retry_remaining > 0);
ERROR_INTERNAL:
__focus_thread_data_destroy(thread_data);
#include "include/mm_sound_common.h"
#include "include/mm_sound_focus_socket.h"
-#define MAX_CONNECT_RETRY 10
+#define MAX_CONNECT_RETRY 100
#define RETRY_CONNECT_INTERVAL_US 300000
#define _FILL_SOCKET_PARAM(x_param, x_func_name, x_pid) \
#define PA_BUS_NAME "org.pulseaudio.Server"
#define PA_SOUND_PLAYER_OBJECT_PATH "/org/pulseaudio/SoundPlayer"
#define PA_SOUND_PLAYER_INTERFACE "org.pulseaudio.SoundPlayer"
-#define PA_SOUND_RESPONSE_TIMEOUT 2000
+#define PA_SOUND_RESPONSE_TIMEOUT 5000
static int __mm_sound_simple_dbus(const char *filename, int volume_config, const char *method);
#endif /* USE_PIPE */