Revise unnecessary logs, remove build warnings 80/139680/2 accepted/tizen/unified/20170721.202218 submit/tizen/20170721.042445
authorSeungbae Shin <seungbae.shin@samsung.com>
Tue, 18 Jul 2017 07:07:42 +0000 (16:07 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Thu, 20 Jul 2017 06:09:23 +0000 (15:09 +0900)
[Version] 0.11.14
[Issue Type] Cleanup

Change-Id: I3168b80a822f054a073f76ff7acaf448c2dd01c2

23 files changed:
focus_server/mm_sound_focus_server.c
focus_server/mm_sound_mgr_focus.c
focus_server/mm_sound_mgr_focus_dbus.c
focus_server/mm_sound_mgr_focus_socket.c
include/mm_sound_client.h
include/mm_sound_common.h
mm_sound.c
mm_sound_bootsound.c
mm_sound_client.c
mm_sound_device.c
mm_sound_focus.c
mm_sound_focus_socket.c
mm_sound_keysound.c
mm_sound_pa_client.c
packaging/libmm-sound.spec
server/mm_sound_mgr_codec.c
server/mm_sound_mgr_ipc.c
server/mm_sound_mgr_ipc_dbus.c
server/mm_sound_plugin.c
server/mm_sound_server.c
server/mm_sound_thread_pool.c
server/plugin/tone/mm_sound_plugin_codec_tone.c
testsuite/mm_sound_testsuite_simple.c

index f836b3c..42a98c0 100644 (file)
@@ -57,7 +57,7 @@ static void _mainloop_run()
 {
        g_mainloop = g_main_loop_new(NULL, TRUE);
        if (g_mainloop == NULL) {
-               debug_error("g_main_loop_new() failed\n");
+               debug_error("g_main_loop_new() failed");
        }
 
        g_main_loop_run(g_mainloop);
@@ -232,7 +232,7 @@ int main(int argc, char **argv)
        if (_get_option(argc, argv, &serveropt))
                return 1;
 
-       debug_warning("focus_server [%d] init \n", getpid());
+       debug_warning("focus_server [%d] init ", getpid());
 
        _signal_initialize();
 
@@ -247,7 +247,7 @@ int main(int argc, char **argv)
        }
 
        /* focus Server Starts!!!*/
-       debug_warning("focus_server [%d] start \n", getpid());
+       debug_warning("focus_server [%d] start ", getpid());
 
        signal(SIGPIPE, SIG_IGN); //ignore SIGPIPE
 
@@ -267,11 +267,11 @@ int main(int argc, char **argv)
 #endif
        if (serveropt.startserver) {
                if (MMSoundMgrFocusSocketInit(&socket_fd)) {
-                       debug_error("focus_server [%d] terminating, due to the error of socket init.\n", getpid());
+                       debug_error("focus_server [%d] terminating, due to the error of socket init.", getpid());
                        return 0;
                }
                if (MMSoundMgrFocusSocketReadyToWork(socket_fd)) {
-                       debug_error("focus_server [%d] terminating, due to the error of thread init.\n", getpid());
+                       debug_error("focus_server [%d] terminating, due to the error of thread init.", getpid());
                        return 0;
                }
                MMSoundMgrFocusDbusInit();
@@ -279,7 +279,7 @@ int main(int argc, char **argv)
                g_socket_fd = socket_fd;
        }
 
-       debug_warning("focus_server [%d] initialization complete...now, start running!!\n", getpid());
+       debug_warning("focus_server [%d] initialization complete...now, start running!!", getpid());
 
        if (serveropt.startserver) {
                unlink(PA_READY); // remove pa_ready file after focus-server init.
@@ -310,7 +310,7 @@ int main(int argc, char **argv)
                _mainloop_run();
        }
 
-       debug_warning("focus_server [%d] terminating \n", getpid());
+       debug_warning("focus_server [%d] terminating ", getpid());
 
        if (serveropt.startserver) {
                MMSoundMgrFocusDbusFini();
@@ -320,7 +320,7 @@ int main(int argc, char **argv)
 
        _signal_finalize();
 
-       debug_warning("focus_server [%d] exit ----------------- END \n", getpid());
+       debug_warning("focus_server [%d] exit ----------------- END ", getpid());
 
        return 0;
 }
index 11e577e..d614b78 100644 (file)
@@ -60,7 +60,7 @@ typedef struct {
 #define CLEAR_DEAD_NODE_LIST(x)  do { \
        debug_warning("list = %p, node = %p, pid=[%d]", x, node, (node)? node->pid : -1); \
        if (x && node && (mm_sound_util_is_process_alive(node->pid) == FALSE)) { \
-               debug_warning("PID:%d does not exist now! remove from device cb list\n", node->pid); \
+               debug_warning("PID:%d does not exist now! remove from device cb list", node->pid); \
                __clear_focus_pipe(node); \
                x = g_list_remove (x, node); \
                g_free (node); \
@@ -150,7 +150,7 @@ static int _mm_sound_mgr_focus_get_priority_from_stream_type(int *priority, cons
 
        if (priority == NULL || stream_type == NULL) {
                ret = MM_ERROR_INVALID_ARGUMENT;
-               debug_error("invalid argument, priority[0x%x], stream_type[%s], ret[0x%x]\n", priority, stream_type, ret);
+               debug_error("invalid argument, priority[0x%x], stream_type[%s], ret[0x%x]", priority, stream_type, ret);
        } else {
                for (i = 0; i < AVAIL_STREAMS_MAX; i++) {
                        if (g_stream_list.stream_types[i] &&
@@ -161,9 +161,9 @@ static int _mm_sound_mgr_focus_get_priority_from_stream_type(int *priority, cons
                }
                if (i == AVAIL_STREAMS_MAX) {
                        ret = MM_ERROR_NOT_SUPPORT_API;
-                       debug_error("not supported stream_type[%s], ret[0x%x]\n", stream_type, ret);
+                       debug_error("not supported stream_type[%s], ret[0x%x]", stream_type, ret);
                } else {
-                       debug_log("[%s] has priority of [%d]\n", stream_type, *priority);
+                       debug_log("[%s] has priority of [%d]", stream_type, *priority);
                }
        }
 
@@ -228,7 +228,7 @@ static void _invoke_watch_callback(focus_node_t *node, const char *stream_type,
        focus_cb_data cb_data;
 
        if (!node || !stream_type) {
-               debug_error("[CB] invalid argument, node[%p], stream_type[%s]\n", node, stream_type);
+               debug_error("[CB] invalid argument, node[%p], stream_type[%s]", node, stream_type);
                return;
        }
 
@@ -258,7 +258,7 @@ static void _invoke_watch_callback(focus_node_t *node, const char *stream_type,
        if ((fd_FOCUS = open(filename, O_WRONLY|O_NONBLOCK)) == -1) {
                char str_error[256];
                strerror_r(errno, str_error, sizeof(str_error));
-               debug_error("[CB] failed to open watch pipe (%s, err:%s)\n", filename, str_error);
+               debug_error("[CB] failed to open watch pipe (%s, err:%s)", filename, str_error);
                goto RELEASE;
        }
 
@@ -276,7 +276,7 @@ static void _invoke_watch_callback(focus_node_t *node, const char *stream_type,
        if ((fd_FOCUS_R= open(filename2, O_RDONLY|O_NONBLOCK)) == -1) {
                char str_error[256];
                strerror_r(errno, str_error, sizeof(str_error));
-               debug_error("[RETCB] failed to open watch return pipe (%s, err:%s)\n", filename2, str_error);
+               debug_error("[RETCB] failed to open watch return pipe (%s, err:%s)", filename2, str_error);
                goto RELEASE;
        }
 
@@ -286,7 +286,7 @@ static void _invoke_watch_callback(focus_node_t *node, const char *stream_type,
        if (write(fd_FOCUS, &cb_data ,sizeof(cb_data)) == -1) {
                char str_error[256];
                strerror_r(errno, str_error, sizeof(str_error));
-               debug_error("[CB] failed to write (err:%s)\n", str_error);
+               debug_error("[CB] failed to write (err:%s)", str_error);
                goto RELEASE;
        }
 
@@ -298,17 +298,17 @@ static void _invoke_watch_callback(focus_node_t *node, const char *stream_type,
        pfd.fd = fd_FOCUS_R;
        pfd.events = POLLIN;
        pfd.revents = 0;
-       debug_msg("[RETCB] wait WATCH CALLBACK (client pid=%d, cmd=%d, timeout=%d(ms))\n", cb_data.pid, command, CALLBACK_TIMEOUT);
+       debug_msg("[RETCB] wait WATCH CALLBACK (client pid=%d, cmd=%d, timeout=%d(ms))", cb_data.pid, command, CALLBACK_TIMEOUT);
        pret = poll(&pfd, 1, CALLBACK_TIMEOUT);
        if (pret < 0) {
-               debug_error("[RETCB] poll failed (%d)\n", pret);
+               debug_error("[RETCB] poll failed (%d)", pret);
                goto RELEASE;
        }
        if (pfd.revents & POLLIN) {
                if (read(fd_FOCUS_R, &ret, sizeof(ret)) == -1) {
                        char str_error[256];
                        strerror_r(errno, str_error, sizeof(str_error));
-                       debug_error("[RETCB] failed to read (err:%s)\n", str_error);
+                       debug_error("[RETCB] failed to read (err:%s)", str_error);
                        goto RELEASE;
                }
        }
@@ -316,7 +316,7 @@ static void _invoke_watch_callback(focus_node_t *node, const char *stream_type,
        /* Calculate endtime and display*/
        gettimeofday(&time, NULL);
        endtime = time.tv_sec * 1000000 + time.tv_usec;
-       debug_msg("[RETCB] WATCH CALLBACK returned (cbtimelab=%d(ms), client pid=%d, return handle=%d)\n", ((endtime-starttime)/1000), cb_data.pid, ret);
+       debug_msg("[RETCB] WATCH CALLBACK returned (cbtimelab=%d(ms), client pid=%d, return handle=%d)", ((endtime-starttime)/1000), cb_data.pid, ret);
 
        /**************************************
         *
@@ -464,7 +464,7 @@ int _mm_sound_mgr_focus_do_callback(focus_command_e command, focus_node_t *victi
 
        focus_cb_data cb_data;
 
-       debug_msg(" __mm_sound_mgr_focus_do_callback_ for pid(%d) handle(%d)\n", victim_node->pid, victim_node->handle_id);
+       debug_msg("for pid(%d) handle(%d)", victim_node->pid, victim_node->handle_id);
 
        memset(&cb_data, 0, sizeof(focus_cb_data));
        cb_data.pid= victim_node->pid;
@@ -519,7 +519,7 @@ int _mm_sound_mgr_focus_do_callback(focus_command_e command, focus_node_t *victi
        if ((fd_FOCUS = open(filename, O_WRONLY|O_NONBLOCK)) == -1) {
                char str_error[256];
                strerror_r(errno, str_error, sizeof(str_error));
-               debug_error("[CB] failed to open pipe (%s, err:%s)\n", filename, str_error);
+               debug_error("[CB] failed to open pipe (%s, err:%s)", filename, str_error);
                res = -1;
                goto RELEASE;
        }
@@ -539,7 +539,7 @@ int _mm_sound_mgr_focus_do_callback(focus_command_e command, focus_node_t *victi
        if ((fd_FOCUS_R = open(filename2,O_RDONLY|O_NONBLOCK)) == -1) {
                char str_error[256];
                strerror_r(errno, str_error, sizeof(str_error));
-               debug_error("[RETCB] failed to open return pipe (%s, err:%s)\n", filename2, str_error);
+               debug_error("[RETCB] failed to open return pipe (%s, err:%s)", filename2, str_error);
                res = -1;
                goto RELEASE;
        }
@@ -550,7 +550,7 @@ int _mm_sound_mgr_focus_do_callback(focus_command_e command, focus_node_t *victi
        if (write(fd_FOCUS, &cb_data, sizeof(cb_data)) == -1) {
                char str_error[256];
                strerror_r(errno, str_error, sizeof(str_error));
-               debug_error("[CB] failed to write (err:%s)\n", str_error);
+               debug_error("[CB] failed to write (err:%s)", str_error);
                res = -1;
                goto RELEASE;
        }
@@ -563,10 +563,10 @@ int _mm_sound_mgr_focus_do_callback(focus_command_e command, focus_node_t *victi
        pfd.fd = fd_FOCUS_R;
        pfd.events = POLLIN;
        pfd.revents = 0;
-       debug_msg("[RETCB] wait CALLBACK (client pid=%d, handle=%d, cmd=%d, timeout=%d(ms))\n",cb_data.pid, cb_data.handle, command, CALLBACK_TIMEOUT);
+       debug_msg("[RETCB] wait CALLBACK (client pid=%d, handle=%d, cmd=%d, timeout=%d(ms))",cb_data.pid, cb_data.handle, command, CALLBACK_TIMEOUT);
        pret = poll(&pfd, 1, CALLBACK_TIMEOUT);
        if (pret < 0) {
-               debug_error("[RETCB] poll failed (%d)\n", pret);
+               debug_error("[RETCB] poll failed (%d)", pret);
                res = -1;
                goto RELEASE;
        }
@@ -574,7 +574,7 @@ int _mm_sound_mgr_focus_do_callback(focus_command_e command, focus_node_t *victi
                if (read(fd_FOCUS_R, &ret, sizeof(ret)) == -1) {
                        char str_error[256];
                        strerror_r(errno, str_error, sizeof(str_error));
-                       debug_error("[RETCB] failed to read (err:%s)\n", str_error);
+                       debug_error("[RETCB] failed to read (err:%s)", str_error);
                        res = -1;
                        goto RELEASE;
                }
@@ -584,14 +584,14 @@ int _mm_sound_mgr_focus_do_callback(focus_command_e command, focus_node_t *victi
                if (victim_node->reacquisition != (bool)((ret >> 16) & 0xf)) {
                        reacquisition_changed = true;
                        victim_node->reacquisition = (bool)((ret >> 16) & 0xf);
-                       debug_msg("[RETCB] victim's reacquisition is changed to (%d)\n", victim_node->reacquisition);
+                       debug_msg("[RETCB] victim's reacquisition is changed to (%d)", victim_node->reacquisition);
                }
        }
 
        /* Calculate endtime and display*/
        gettimeofday(&time, NULL);
        endtime = time.tv_sec * 1000000 + time.tv_usec;
-       debug_msg("[RETCB] CALLBACK returned (cbtimelab=%d(ms), client pid=%d, returned handle=%d)\n", ((endtime-starttime)/1000), cb_data.pid, ret_handle);
+       debug_msg("[RETCB] CALLBACK returned (cbtimelab=%d(ms), client pid=%d, returned handle=%d)", ((endtime-starttime)/1000), cb_data.pid, ret_handle);
 
        /* update victim node */
        if (command == FOCUS_COMMAND_RELEASE) {
@@ -683,16 +683,16 @@ static int _mm_sound_mgr_focus_list_dump ()
        GList *list = NULL;
        focus_node_t *node = NULL;
 
-       debug_msg("================================================ focus node list : start ===================================================\n");
+       debug_msg("================================================ focus node list : start ===================================================");
        for (list = g_focus_node_list; list != NULL; list = list->next) {
                if ((node = (focus_node_t *)list->data) && !node->is_for_watch) {
-                       debug_msg("*** pid[%5d]/handle_id[%2d]/[%14s]:priority[%2d],status[%s],taken_by[P(%5d/%2d/%2d)C(%5d/%2d/%2d)],session[%d],option[0x%x/0x%x],ext_info[%s/%s]\n",
+                       debug_msg("*** pid[%5d]/handle_id[%2d]/[%14s]:priority[%2d],status[%s],taken_by[P(%5d/%2d/%2d)C(%5d/%2d/%2d)],session[%d],option[0x%x/0x%x],ext_info[%s/%s]",
                                  node->pid, node->handle_id, node->stream_type, node->priority, focus_status_str[node->status],
                                  node->taken_by_id[0].pid, node->taken_by_id[0].handle_id, node->taken_by_id[0].by_session, node->taken_by_id[1].pid,
                                  node->taken_by_id[1].handle_id, node->taken_by_id[1].by_session, node->is_for_session, node->option[0], node->option[1], node->ext_info[0], node->ext_info[1]);
                }
        }
-       debug_msg("================================================ focus node list : end =====================================================\n");
+       debug_msg("================================================ focus node list : end =====================================================");
 
        return ret;
 }
@@ -703,13 +703,13 @@ static int _mm_sound_mgr_focus_watch_list_dump()
        GList *list = NULL;
        focus_node_t *node = NULL;
 
-       debug_msg("============================================= focus watch node list : start =================================================\n");
+       debug_msg("============================================= focus watch node list : start =================================================");
        for (list = g_focus_node_list; list != NULL; list = list->next) {
                if ((node = (focus_node_t *)list->data) && node->is_for_watch)
-                       debug_msg("*** pid[%5d]/handle_id[%d]/watch on focus status[%s]/for_session[%d]/for_monitor[%d]\n",
+                       debug_msg("*** pid[%5d]/handle_id[%d]/watch on focus status[%s]/for_session[%d]/for_monitor[%d]",
                                  node->pid, node->handle_id, focus_status_str[node->status], node->is_for_session, node->is_for_monitor);
        }
-       debug_msg("============================================= focus watch node list : end ===================================================\n");
+       debug_msg("============================================= focus watch node list : end ===================================================");
 
        return ret;
 }
@@ -745,7 +745,7 @@ int mm_sound_mgr_focus_create_node(const _mm_sound_mgr_focus_param_t *param)
                CONTINUE_IF_LIST_DATA_IS_NULL(node, list);
                CONTINUE_IF_NOT_MY_FOCUS_NODE(node, param);
 
-               debug_error("the node of pid[%d]/handle_id[%d] is already created\n", param->pid, param->handle_id);
+               debug_error("the node of pid[%d]/handle_id[%d] is already created", param->pid, param->handle_id);
                ret = MM_ERROR_INVALID_ARGUMENT;
                goto FINISH;
        }
@@ -766,9 +766,9 @@ int mm_sound_mgr_focus_create_node(const _mm_sound_mgr_focus_param_t *param)
 
        g_focus_node_list = g_list_append(g_focus_node_list, node);
        if (g_focus_node_list) {
-               debug_log("new focus node is added\n");
+               debug_log("new focus node is added");
        } else {
-               debug_error("g_list_append failed\n");
+               debug_error("g_list_append failed");
                ret = MM_ERROR_SOUND_INTERNAL;
                g_free(node);
        }
@@ -801,12 +801,12 @@ int mm_sound_mgr_focus_destroy_node(const _mm_sound_mgr_focus_param_t *param)
                CONTINUE_IF_LIST_DATA_IS_NULL(node, list);
                CONTINUE_IF_NOT_MY_FOCUS_NODE(node, param);
 
-               debug_log("found the node of pid[%d]/handle_id[%d]\n", param->pid, param->handle_id);
+               debug_log("found the node of pid[%d]/handle_id[%d]", param->pid, param->handle_id);
                my_node = node;
                break;
        }
        if (my_node == NULL) {
-               debug_error("could not find any node of pid[%d]/handle_id[%d]/is_for_session[%d]\n", param->pid, param->handle_id, param->is_for_session);
+               debug_error("could not find any node of pid[%d]/handle_id[%d]/is_for_session[%d]", param->pid, param->handle_id, param->is_for_session);
                ret = MM_ERROR_INVALID_ARGUMENT;
                goto FINISH;
        }
@@ -830,7 +830,7 @@ int mm_sound_mgr_focus_destroy_node(const _mm_sound_mgr_focus_param_t *param)
                _mm_sound_mgr_focus_param_t *new_param = NULL;
 
                if (!(new_param = g_malloc0(sizeof(_mm_sound_mgr_focus_param_t)))) {
-                       debug_error("Fail to g_malloc0 for new_param\n");
+                       debug_error("Fail to g_malloc0 for new_param");
                        goto CLEAR_NODE;
                }
                new_param->pid = param->pid;
@@ -862,7 +862,7 @@ int mm_sound_mgr_focus_destroy_node(const _mm_sound_mgr_focus_param_t *param)
                                        if (node->taken_by_id[i].handle_id == new_param->handle_id || node->taken_by_id[i].by_session) {
                                                /* do callback for resumption */
                                                if ((ret = _mm_sound_mgr_focus_do_callback(FOCUS_COMMAND_ACQUIRE, node, new_param)))
-                                                       debug_error("Fail to _focus_do_callback for COMMAND ACQUIRE to node[%x], ret[0x%x]\n", node, ret);
+                                                       debug_error("Fail to _focus_do_callback for COMMAND ACQUIRE to node[%x], ret[0x%x]", node, ret);
                                                if (!strncmp(my_node->stream_type, node->stream_type, MAX_STREAM_TYPE_LEN)) {
                                                        need_to_trigger_watch_cb = false;
                                                        my_node->status &= ~(new_param->request_type);
@@ -911,16 +911,16 @@ int mm_sound_mgr_focus_set_reacquisition(const _mm_sound_mgr_focus_param_t *para
                CONTINUE_IF_NOT_MY_FOCUS_NODE(node, param);
 
                if (node->reacquisition == param->reacquisition) {
-                       debug_msg("it is already set as same value of reacquisition(%d)\n", param->reacquisition);
+                       debug_msg("it is already set as same value of reacquisition(%d)", param->reacquisition);
                        goto FINISH;
                }
                node->reacquisition = param->reacquisition;
-               debug_msg("found a node(pid[%d]/handle_id[%d]) to set reacquisition to (%d)\n", node->pid, node->handle_id, param->reacquisition);
+               debug_msg("found a node(pid[%d]/handle_id[%d]) to set reacquisition to (%d)", node->pid, node->handle_id, param->reacquisition);
                my_node = node;
                break;
        }
        if (my_node == NULL) {
-               debug_error("could not find any node of pid[%d]/handle_id[%d]\n", param->pid, param->handle_id);
+               debug_error("could not find any node of pid[%d]/handle_id[%d]", param->pid, param->handle_id);
                ret = MM_ERROR_INVALID_ARGUMENT;
                goto FINISH;
        }
@@ -992,7 +992,7 @@ int mm_sound_mgr_focus_get_stream_type_of_acquired_focus(focus_type_e focus_type
                          * backward compatibilty. */
                        int index = (focus_type == FOCUS_TYPE_BOTH) ? FOCUS_TYPE_PLAYBACK - 1 : focus_type - 1;
 
-                       debug_msg("found a node : request_focus_type(%d), stream_type(%s)/ext info(%s) of acquired focus\n",
+                       debug_msg("found a node : request_focus_type(%d), stream_type(%s)/ext info(%s) of acquired focus",
                                  focus_type, node->stream_type, node->ext_info[index]);
 
                        *stream_type = node->stream_type;
@@ -1028,7 +1028,7 @@ static void update_reacquisition_with_released_state(focus_node_t *node, int dir
        if (!strncmp("audio-io acquire focus", node->ext_info[direction], MM_SOUND_NAME_NUM) ||
            !strncmp("mm-player acquire focus", node->ext_info[direction], MM_SOUND_NAME_NUM) ||
            !strncmp("mm-camcorder acquire focus", node->ext_info[direction], MM_SOUND_NAME_NUM)) {
-               debug_msg("this node[pid:%d, handle_id:%d] needs reacquisition with focus released state\n", node->pid, node->handle_id);
+               debug_msg("this node[pid:%d, handle_id:%d] needs reacquisition with focus released state", node->pid, node->handle_id);
                node->reacquisition_with_released_state = true;
        }
 }
@@ -1107,7 +1107,7 @@ int mm_sound_mgr_focus_request_acquire(const _mm_sound_mgr_focus_param_t *param)
                                if (my_node->priority >= node->priority) {
                                        /* do callback for interruption */
                                        if ((ret = _mm_sound_mgr_focus_do_callback(FOCUS_COMMAND_RELEASE, node, param_s))) {
-                                               debug_error("Fail to _focus_do_callback for COMMAND RELEASE to node[%x], ret[0x%x]\n", node, ret);
+                                               debug_error("Fail to _focus_do_callback for COMMAND RELEASE to node[%x], ret[0x%x]", node, ret);
                                                /* but, keep going */
                                                ret = MM_ERROR_NONE;
                                        }
@@ -1233,7 +1233,7 @@ int mm_sound_mgr_focus_request_release(const _mm_sound_mgr_focus_param_t *param)
                                                }
                                                /* do callback for resumption */
                                                if ((ret = _mm_sound_mgr_focus_do_callback(FOCUS_COMMAND_ACQUIRE, node, param_s)))
-                                                       debug_error("Fail to _focus_do_callback for COMMAND ACQUIRE to node[%x], ret[0x%x]\n", node, ret);
+                                                       debug_error("Fail to _focus_do_callback for COMMAND ACQUIRE to node[%x], ret[0x%x]", node, ret);
                                                if (!strncmp(my_node->stream_type, node->stream_type, MAX_STREAM_TYPE_LEN)) {
                                                        need_to_trigger_watch_cb = false;
                                                }
@@ -1284,7 +1284,7 @@ int mm_sound_mgr_focus_set_watch_cb(const _mm_sound_mgr_focus_param_t *param)
        for (list = g_focus_node_list; list != NULL; list = list->next) {
                CONTINUE_IF_LIST_DATA_IS_NULL(node, list);
                if ((node->pid == param->pid) && (node->handle_id == param->handle_id) && node->is_for_watch) {
-                       debug_error("the node of pid[%d]/handle_id[%d] for watch focus is already created\n", param->pid, param->handle_id);
+                       debug_error("the node of pid[%d]/handle_id[%d] for watch focus is already created", param->pid, param->handle_id);
                        ret = MM_ERROR_INVALID_ARGUMENT;
                        goto FINISH;
                }
@@ -1300,9 +1300,9 @@ int mm_sound_mgr_focus_set_watch_cb(const _mm_sound_mgr_focus_param_t *param)
 
        g_focus_node_list = g_list_append(g_focus_node_list, node);
        if (g_focus_node_list) {
-               debug_log("new focus node is added\n");
+               debug_log("new focus node is added");
        } else {
-               debug_error("g_list_append failed\n");
+               debug_error("g_list_append failed");
                ret = MM_ERROR_SOUND_INTERNAL;
                g_free(node);
        }
@@ -1331,7 +1331,7 @@ int mm_sound_mgr_focus_unset_watch_cb(const _mm_sound_mgr_focus_param_t *param)
        for (list = g_focus_node_list; list != NULL; list = list->next) {
                CONTINUE_IF_LIST_DATA_IS_NULL(node, list);
                if ((node->pid == param->pid) && (node->handle_id == param->handle_id) && node->is_for_watch) {
-                       debug_log("found the node of pid[%d]/handle_id[%d] for watch focus\n", param->pid, param->handle_id);
+                       debug_log("found the node of pid[%d]/handle_id[%d] for watch focus", param->pid, param->handle_id);
                        __clear_focus_pipe(node);
                        g_focus_node_list = g_list_remove(g_focus_node_list, node);
                        g_free(node);
@@ -1340,7 +1340,7 @@ int mm_sound_mgr_focus_unset_watch_cb(const _mm_sound_mgr_focus_param_t *param)
                }
        }
        if (list == NULL) {
-               debug_error("could not find any node of pid[%d]/handle_id[%d] for watch focus\n", param->pid, param->handle_id);
+               debug_error("could not find any node of pid[%d]/handle_id[%d] for watch focus", param->pid, param->handle_id);
                ret = MM_ERROR_INVALID_ARGUMENT;
                goto FINISH;
        }
@@ -1371,20 +1371,20 @@ int mm_sound_mgr_focus_deliver(const _mm_sound_mgr_focus_param_t *param)
        for (list = g_focus_node_list; list != NULL; list = list->next) {
                CONTINUE_IF_LIST_DATA_IS_NULL(src_node, list);
                if ((src_node->pid == param->pid) && (src_node->handle_id == param->handle_id)) {
-                       debug_log("SRC: found the node of pid[%d]/handle_id[%d] for watch focus\n",
+                       debug_log("SRC: found the node of pid[%d]/handle_id[%d] for watch focus",
                                  param->pid, param->handle_id);
                        break;
                }
        }
        if (src_node == NULL) {
-               debug_error("could not find the source node of param, pid[%d]/handle_id[%d]\n",
+               debug_error("could not find the source node of param, pid[%d]/handle_id[%d]",
                            param->pid, param->handle_id);
                ret = MM_ERROR_INVALID_ARGUMENT;
                goto FINISH;
        }
 
        if (!(src_node->status & param->request_type)) {
-               debug_error("invalid request type(0x%x), src_node->status(0x%x)\n",
+               debug_error("invalid request type(0x%x), src_node->status(0x%x)",
                            param->request_type, src_node->status);
                ret = MM_ERROR_SOUND_INVALID_STATE;
                goto FINISH;
@@ -1393,13 +1393,13 @@ int mm_sound_mgr_focus_deliver(const _mm_sound_mgr_focus_param_t *param)
        for (list = g_focus_node_list; list != NULL; list = list->next) {
                CONTINUE_IF_LIST_DATA_IS_NULL(dst_node, list);
                if ((dst_node->pid == param->pid) && (dst_node->handle_id == param->handle_id_dst)) {
-                       debug_log("DST: found the destination node of param, pid[%d]/handle_id[%d]\n",
+                       debug_log("DST: found the destination node of param, pid[%d]/handle_id[%d]",
                                  param->pid, param->handle_id_dst);
                        break;
                }
        }
        if (dst_node == NULL) {
-               debug_error("could not find the destination node of param, pid[%d]/handle_id[%d]\n",
+               debug_error("could not find the destination node of param, pid[%d]/handle_id[%d]",
                            param->pid, param->handle_id_dst);
                ret = MM_ERROR_INVALID_ARGUMENT;
                goto FINISH;
@@ -1415,14 +1415,14 @@ int mm_sound_mgr_focus_deliver(const _mm_sound_mgr_focus_param_t *param)
                        if ((node->taken_by_id[i].pid == src_node->pid) &&
                            (node->taken_by_id[i].handle_id == src_node->handle_id) &&
                            (node->taken_by_id[i].by_session == false)) {
-                               debug_log("found the node that focus was taken by this src node, update it\n",
+                               debug_log("found the node that focus was taken by this src node, update it",
                                          node->pid, node->handle_id);
                                UPDATE_FOCUS_TAKEN_INFO(by_id, node, dst_node->pid, dst_node->handle_id, false);
                        }
                        if ((node->taken_backup[i].pid == src_node->pid) &&
                            (node->taken_backup[i].handle_id == src_node->handle_id) &&
                            (node->taken_backup[i].by_session == false)) {
-                               debug_log("found the node that focus was taken by this src node and set reacquisition to false, update it\n",
+                               debug_log("found the node that focus was taken by this src node and set reacquisition to false, update it",
                                          node->pid, node->handle_id);
                                UPDATE_FOCUS_TAKEN_INFO(backup, node, dst_node->pid, dst_node->handle_id, false);
                        }
@@ -1521,7 +1521,7 @@ int mm_sound_mgr_focus_emergent_exit(const _mm_sound_mgr_focus_param_t *param)
                                        if (node->taken_by_id[i].pid == param_s.pid && node->taken_by_id[i].handle_id == param_s.handle_id) {
                                                /* do callback for resumption */
                                                if ((ret = _mm_sound_mgr_focus_do_callback(FOCUS_COMMAND_ACQUIRE, node, &param_s)))
-                                                       debug_error("Fail to _focus_do_callback for COMMAND ACQUIRE to node[%x], ret[0x%x]\n", node, ret);
+                                                       debug_error("Fail to _focus_do_callback for COMMAND ACQUIRE to node[%x], ret[0x%x]", node, ret);
                                                if (!strncmp(my_node->stream_type, node->stream_type, MAX_STREAM_TYPE_LEN))
                                                        need_to_trigger_watch_cb = false;
                                        }
@@ -1529,7 +1529,7 @@ int mm_sound_mgr_focus_emergent_exit(const _mm_sound_mgr_focus_param_t *param)
                        }
                        if (need_to_trigger_watch_cb) {
                                if ((ret = _mm_sound_mgr_focus_do_watch_callback((focus_type_e)param_s.request_type, FOCUS_COMMAND_RELEASE, my_node, &param_s)))
-                                       debug_error("Fail to _focus_do_watch_callback, ret[0x%x]\n", ret);
+                                       debug_error("Fail to _focus_do_watch_callback, ret[0x%x]", ret);
                        }
 
                        __clear_focus_pipe(my_node);
@@ -1555,7 +1555,7 @@ int MMSoundMgrFocusInit(void)
 
        ret = __mm_sound_mgr_focus_dbus_get_stream_list(&g_stream_list);
        if (ret)
-               debug_error("failed to __mm_sound_mgr_focus_dbus_get_stream_list()\n");
+               debug_error("failed to __mm_sound_mgr_focus_dbus_get_stream_list()");
 
        debug_fleave();
        return ret;
index da00c31..b8942d3 100644 (file)
@@ -751,11 +751,11 @@ int MMSoundMgrFocusDbusInit(void)
                return MM_ERROR_SOUND_INTERNAL;
 
        if (_mm_sound_mgr_focus_dbus_own_name(G_BUS_TYPE_SYSTEM, BUS_NAME_FOCUS_SERVER, &focus_server_owner_id) != MM_ERROR_NONE) {
-               debug_error("dbus own name for focus-server error\n");
+               debug_error("dbus own name for focus-server error");
                return MM_ERROR_SOUND_INTERNAL;
        }
        if (mm_sound_dbus_signal_subscribe_to(AUDIO_PROVIDER_AUDIO_CLIENT, AUDIO_EVENT_EMERGENT_EXIT, emergent_exit_signal_handler, NULL, NULL, &emergent_exit_subs_id) != MM_ERROR_NONE) {
-               debug_error("dbus signal subscribe for emergent exit error\n");
+               debug_error("dbus signal subscribe for emergent exit error");
                return MM_ERROR_SOUND_INTERNAL;
        }
 
index 8075892..bf12efa 100644 (file)
@@ -144,7 +144,7 @@ static void *thread_func(void *data)
        char ret_buf[MAX_ERROR_LEN] = {'\0',};
 
        if (data == NULL) {
-               debug_error("invalid data\n");
+               debug_error("invalid data");
                pthread_exit(NULL);
        }
 
@@ -173,9 +173,9 @@ static void *thread_func(void *data)
                        debug_error("failed to read(), err: %s", str_error);
                } else if (rval == sizeof(_mm_sound_mgr_focus_socket_param_t)) {
                        int ret = MM_ERROR_NONE;
-                       debug_log("data read successfully..\n");
-                       debug_log(" : pid[%d], handle_id[%d], focus_type[%d]\n", read_data.pid, read_data.handle_id, read_data.focus_type);
-                       debug_log(" : option[%d], ext_info[%s], is_for_session[%d]\n", read_data.option, read_data.ext_info, read_data.is_for_session);
+                       debug_log("data read successfully..");
+                       debug_log(" : pid[%d], handle_id[%d], focus_type[%d]", read_data.pid, read_data.handle_id, read_data.focus_type);
+                       debug_log(" : option[%d], ext_info[%s], is_for_session[%d]", read_data.option, read_data.ext_info, read_data.is_for_session);
 
                        if ((ret = focus_functions_handler(&read_data)))
                                debug_log("failed to focus_function_handler(), err[0x%x]", ret);
@@ -183,7 +183,7 @@ static void *thread_func(void *data)
                        snprintf(ret_buf, sizeof(ret_buf), "%s", convert_error_string_from_int(ret));
                        if (write(accepted_fd, ret_buf, sizeof(ret_buf)) < 0) {
                                strerror_r(errno, str_error, sizeof(str_error));
-                               debug_error("failed to write(), err: %s\n", str_error);
+                               debug_error("failed to write(), err: %s", str_error);
                        }
                } else {
                        debug_error("failed to read(), read size mismatched, rval(%d), expect size(%d)", rval,sizeof(_mm_sound_mgr_focus_socket_param_t));
@@ -204,14 +204,14 @@ int MMSoundMgrFocusSocketInit(int *fd)
        char str_error[128] = {'\0',};
 
        if (fd == NULL) {
-               debug_error("input param fd is null\n");
+               debug_error("input param fd is null");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        socket_fd = socket(AF_UNIX, SOCK_STREAM, 0);
        if (socket_fd < 0) {
                strerror_r(errno, str_error, sizeof(str_error));
-               debug_error("failed to socket(), err: %s\n", str_error);
+               debug_error("failed to socket(), err: %s", str_error);
                return MM_ERROR_SOUND_INTERNAL;
        }
 
@@ -223,13 +223,13 @@ int MMSoundMgrFocusSocketInit(int *fd)
 
        if (bind(socket_fd, (struct sockaddr *)&addr_un, sizeof(addr_un))) {
                strerror_r(errno, str_error, sizeof(str_error));
-               debug_error("failed to bind(), err: %s\n", str_error);
+               debug_error("failed to bind(), err: %s", str_error);
                if (errno == EADDRINUSE) {
                        unlink(FOCUS_SERVER_SOCK);
-                       debug_msg("unlink socket and bind again...\n");
+                       debug_msg("unlink socket and bind again...");
                        if (bind(socket_fd, (struct sockaddr *)&addr_un, sizeof(addr_un))) {
                                strerror_r(errno, str_error, sizeof(str_error));
-                               debug_error("failed to bind() again, err: %s\n", str_error);
+                               debug_error("failed to bind() again, err: %s", str_error);
                                close(socket_fd);
                                return MM_ERROR_SOUND_INTERNAL;
                        }
@@ -269,11 +269,11 @@ int MMSoundMgrFocusSocketReadyToWork(int fd)
        debug_enter();
 
        if (fd < 0) {
-               debug_error("input param fd [%d] is not valid\n", fd);
+               debug_error("input param fd [%d] is not valid", fd);
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
-       debug_log("fd [%d]\n", fd);
+       debug_log("fd [%d]", fd);
        if (pthread_create(&g_focus_work_thread_id, NULL, (void *)thread_func, (void *)fd)) {
                debug_error("failed to start work thread");
                return MM_ERROR_SOUND_INTERNAL;
index 3d1c23c..5c293e0 100644 (file)
@@ -83,11 +83,11 @@ int mm_sound_client_test(int a, int b, int* get);
 
 typedef void (*mm_sound_volume_changed_wrapper_cb)(const char *direction, const char *volume_type_str, int volume_level, void *userdata);
 typedef void (*mm_sound_device_connected_wrapper_cb)(int device_id, const char *device_type, int io_direction, int state,
-               const char *name, int *vendor_id, int *product_id, int *stream_id, int stream_num, gboolean is_connected, void *userdata);
+               const char *name, int vendor_id, int product_id, int *stream_id, int stream_num, gboolean is_connected, void *userdata);
 typedef void (*mm_sound_device_info_changed_wrapper_cb)(int device_id, const char *device_type, int io_direction, int state,
-               const char *name, int *vendor_id, int *product_id, int *stream_id, int stream_num, int changed_device_info_type, void *userdata);
+               const char *name, int vendor_id, int product_id, int *stream_id, int stream_num, int changed_device_info_type, void *userdata);
 typedef void (*mm_sound_device_state_changed_wrapper_cb)(int device_id, const char *device_type, int io_direction, int state,
-               const char *name, int *vendor_id, int *product_id, int *stream_id, int stream_num, void *userdata);
+               const char *name, int vendor_id, int product_id, int *stream_id, int stream_num, void *userdata);
 typedef void (*mm_sound_stop_callback_wrapper_func)(int id, void *userdata);
 
 #endif /* __MM_SOUND_CLIENT_H__ */
index e41517e..3662814 100644 (file)
@@ -32,7 +32,7 @@
 switch ( pthread_mutex_lock( x_mutex ) ) \
 { \
 case EINVAL: \
-       debug_warning("try mutex init..\n"); \
+       debug_warning("try mutex init.."); \
        if( 0 > pthread_mutex_init( x_mutex, NULL) ) { \
                return; \
        } else { \
@@ -42,7 +42,7 @@ case EINVAL: \
 case 0: \
        break; \
 default: \
-       debug_error("mutex lock failed\n"); \
+       debug_error("mutex lock failed"); \
        return; \
 }
 
@@ -50,7 +50,7 @@ default: \
 switch ( pthread_mutex_lock( x_mutex ) ) \
 { \
 case EINVAL: \
-       debug_warning("try mutex init..\n"); \
+       debug_warning("try mutex init.."); \
        if( 0 > pthread_mutex_init( x_mutex, NULL) ) { \
                return x_return; \
        } else { \
@@ -60,13 +60,13 @@ case EINVAL: \
 case 0: \
        break; \
 default: \
-       debug_error("mutex lock failed\n"); \
+       debug_error("mutex lock failed"); \
        return x_return; \
 }
 
 #define MMSOUND_LEAVE_CRITICAL_SECTION(x_mutex) \
 if( pthread_mutex_unlock( x_mutex ) ) { \
-       debug_error("mutex unlock failed\n"); \
+       debug_error("mutex unlock failed"); \
 }
 
 #define MMSOUND_STRNCPY(dst, src, size) \
index 3f86b9b..b29da0f 100644 (file)
@@ -119,13 +119,13 @@ int mm_sound_add_volume_changed_callback(mm_sound_volume_changed_cb func, void*
        int ret = MM_ERROR_NONE;
 
        if (func == NULL || subs_id == NULL) {
-               debug_error("argument is not valid\n");
+               debug_error("argument is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        ret = mm_sound_client_add_volume_changed_callback(func, user_data, subs_id);
        if (ret < 0) {
-               debug_error("Can not add volume changed callback, ret = %x\n", ret);
+               debug_error("Can not add volume changed callback, ret = %x", ret);
        }
 
        return ret;
@@ -138,7 +138,7 @@ int mm_sound_remove_volume_changed_callback(unsigned int subs_id)
 
        ret = mm_sound_client_remove_volume_changed_callback(subs_id);
        if (ret < 0) {
-               debug_error("Can not remove volume changed callback, ret = %x\n", ret);
+               debug_error("Can not remove volume changed callback, ret = %x", ret);
        }
 
        return ret;
@@ -153,7 +153,7 @@ int mm_sound_volume_set_value(volume_type_t volume_type, const unsigned int volu
 
        /* Check input param */
        if (0 > _validate_volume(volume_type, (int)volume_level)) {
-               debug_error("invalid volume type %d, value %u\n", volume_type, volume_level);
+               debug_error("invalid volume type %d, value %u", volume_type, volume_level);
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
@@ -172,11 +172,11 @@ int mm_sound_volume_get_value(volume_type_t type, unsigned int *value)
 
        /* Check input param */
        if (value == NULL) {
-               debug_error("invalid argument\n");
+               debug_error("invalid argument");
                return MM_ERROR_INVALID_ARGUMENT;
        }
        if (type < 0 || type >= VOLUME_TYPE_MAX) {
-               debug_error("invalid volume type value %d\n", type);
+               debug_error("invalid volume type value %d", type);
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
@@ -193,12 +193,12 @@ int mm_sound_volume_primary_type_set(volume_type_t type)
 
        /* Check input param */
        if(type < VOLUME_TYPE_UNKNOWN || type >= VOLUME_TYPE_MAX) {
-               debug_error("invalid argument\n");
+               debug_error("invalid argument");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        if (vconf_set_int(VCONFKEY_SOUND_PRIMARY_VOLUME_TYPE, type)) {
-               debug_error("could not set vconf for RIMARY_VOLUME_TYPE\n");
+               debug_error("could not set vconf for RIMARY_VOLUME_TYPE");
                ret = MM_ERROR_SOUND_INTERNAL;
        } else {
                debug_msg("set primary volume type forcibly %d(%s)", type, _get_volume_str(type));
@@ -215,13 +215,13 @@ int mm_sound_volume_primary_type_get(volume_type_t *type)
 
        /* Check input param */
        if(type == NULL) {
-               debug_error("invalid argument\n");
+               debug_error("invalid argument");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        /* check force set */
        if (vconf_get_int(VCONFKEY_SOUND_PRIMARY_VOLUME_TYPE, &voltype)) {
-               debug_error("could not get vconf for PRIMARY_VOLUME_TYPE\n");
+               debug_error("could not get vconf for PRIMARY_VOLUME_TYPE");
                ret = MM_ERROR_SOUND_INTERNAL;
        } else {
                debug_msg("get primary volume type %d(%s)", voltype, _get_volume_str(voltype));
@@ -317,25 +317,25 @@ int mm_sound_play_sound_ex(MMSoundPlayParam *param, int *handle)
        int volume_type = 0;
        /* Check input param */
        if (param == NULL) {
-               debug_error("param is null\n");
+               debug_error("param is null");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        volume_type = MM_SOUND_VOLUME_CONFIG_TYPE(param->volume_config);
 
        if (param->filename == NULL) {
-               debug_error("filename is NULL\n");
+               debug_error("filename is NULL");
                return MM_ERROR_SOUND_FILE_NOT_FOUND;
        }
        if (volume_type < 0 || volume_type >= VOLUME_TYPE_MAX) {
-               debug_error("Volume type is invalid %d\n", volume_type);
+               debug_error("Volume type is invalid %d", volume_type);
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        /* Play sound */
        err = mm_sound_client_play_sound(param, 0, &lhandle);
        if (err < 0) {
-               debug_error("Failed to play sound\n");
+               debug_error("Failed to play sound");
                return err;
        }
 
@@ -343,10 +343,10 @@ int mm_sound_play_sound_ex(MMSoundPlayParam *param, int *handle)
        if (handle) {
                *handle = lhandle;
        } else {
-               debug_critical("The sound hadle cannot be get [%d]\n", lhandle);
+               debug_critical("The sound hadle cannot be get [%d]", lhandle);
        }
 
-       debug_warning ("success : handle=[%p]\n", handle);
+       debug_warning ("success : handle=[%p]", handle);
 
        return MM_ERROR_NONE;
 }
@@ -369,11 +369,11 @@ int mm_sound_play_sound_with_stream_info(const char *filename, char *stream_type
 
        err = mm_sound_client_play_sound_with_stream_info(&param, handle, stream_type, stream_id);
        if (err < 0) {
-               debug_error("Failed to play sound\n");
+               debug_error("Failed to play sound");
                return err;
        }
 
-       debug_warning ("success : handle=[%p]\n", handle);
+       debug_warning ("success : handle=[%p]", handle);
 
        return MM_ERROR_NONE;
 
@@ -385,14 +385,14 @@ int mm_sound_stop_sound(int handle)
 {
        int err;
 
-       debug_warning ("enter : handle=[%d]\n", handle);
+       debug_warning ("enter : handle=[%d]", handle);
        /* Stop sound */
        err = mm_sound_client_stop_sound(handle);
        if (err < 0) {
-               debug_error("Fail to stop sound\n");
+               debug_error("Fail to stop sound");
                return err;
        }
-       debug_warning ("success : handle=[%d]\n", handle);
+       debug_warning ("success : handle=[%d]", handle);
 
        return MM_ERROR_NONE;
 }
@@ -411,27 +411,27 @@ int mm_sound_play_tone_ex (MMSoundTone_t num, int volume_config, const double vo
 
        /* Check input param */
        if (duration < -1) {
-               debug_error("number is invalid %d\n", duration);
+               debug_error("number is invalid %d", duration);
                return MM_ERROR_INVALID_ARGUMENT;
        }
        if (num < MM_SOUND_TONE_DTMF_0 || num >= MM_SOUND_TONE_NUM) {
-               debug_error("TONE Value is invalid %d\n", num);
+               debug_error("TONE Value is invalid %d", num);
                return MM_ERROR_INVALID_ARGUMENT;
        }
        if (volume_type < 0 || volume_type >= VOLUME_TYPE_MAX) {
-               debug_error("Volume type is invalid %d\n", volume_type);
+               debug_error("Volume type is invalid %d", volume_type);
                return MM_ERROR_INVALID_ARGUMENT;
        }
        if (volume < 0.0 || volume > 1.0) {
-               debug_error("Volume Value is invalid %d\n", volume);
+               debug_error("Volume Value is invalid %d", volume);
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        /* Play tone */
-       debug_msg("Call MMSoundClientPlayTone\n");
+       debug_msg("Call MMSoundClientPlayTone");
        err = mm_sound_client_play_tone(num, volume_config, volume, duration, &lhandle, enable_session);
        if (err < 0) {
-               debug_error("Failed to play sound\n");
+               debug_error("Failed to play sound");
                return err;
        }
 
@@ -439,7 +439,7 @@ int mm_sound_play_tone_ex (MMSoundTone_t num, int volume_config, const double vo
        if (handle)
                *handle = lhandle;
        else
-               debug_critical("The sound handle cannot be get [%d]\n", lhandle);
+               debug_critical("The sound handle cannot be get [%d]", lhandle);
 
        debug_fleave();
        return MM_ERROR_NONE;
@@ -453,7 +453,7 @@ int mm_sound_play_tone_with_stream_info(MMSoundTone_t tone, char *stream_type, i
 
        err = mm_sound_client_play_tone_with_stream_info(tone, stream_type, stream_id, volume, duration, handle);
        if (err <0) {
-               debug_error("Failed to play sound\n");
+               debug_error("Failed to play sound");
                return err;
        }
 
@@ -484,7 +484,7 @@ int mm_sound_test(int a, int b, int* getv)
        }
        ret = mm_sound_client_test(a, b, getv);
        if (ret < 0) {
-               debug_error("Can not mm sound test, ret = %x\n", ret);
+               debug_error("Can not mm sound test, ret = %x", ret);
        }
        debug_log("mm_sound_test leave");
 
@@ -496,17 +496,17 @@ int mm_sound_add_test_callback(mm_sound_test_cb func, void *user_data, unsigned
 {
        int ret = MM_ERROR_NONE;
 
-       debug_log("mm_sound_add_test_callback enter");
+       debug_log("enter");
        if (!func || !subs_id) {
-               debug_error("argument is not valid\n");
+               debug_error("argument is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        ret = mm_sound_client_add_test_callback(func, user_data, subs_id);
        if (ret < 0) {
-               debug_error("Can not add test callback, ret = %x\n", ret);
+               debug_error("Can not add test callback, ret = %x", ret);
        }
-       debug_log("mm_sound_add_test_callback leave");
+       debug_log("leave");
 
        return ret;
 }
@@ -516,12 +516,12 @@ int mm_sound_remove_test_callback(unsigned int subs_id)
 {
        int ret = MM_ERROR_NONE;
 
-       debug_log("mm_sound_remove_test_callback enter");
+       debug_log("enter");
        ret = mm_sound_client_remove_test_callback(subs_id);
        if (ret < 0) {
-               debug_error("Can not remove test callback, ret = %x\n", ret);
+               debug_error("Can not remove test callback, ret = %x", ret);
        }
-       debug_log("mm_sound_remove_test_callback leave");
+       debug_log("leave");
 
        return ret;
 }
@@ -556,7 +556,7 @@ static void _dbus_signal_callback (const char *signal_name, int value, void *use
        if (ret)
                return;
 
-       debug_msg("signal: name[%s], value[%d], user_data[%p], type[%d]\n",
+       debug_msg("signal: name[%s], value[0x%08x], user_data[%p], type[%d]",
                        signal_name, value, user_data, subscribe_cb->signal_type);
 
        if (subscribe_cb->signal_type == MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS) {
@@ -565,12 +565,12 @@ static void _dbus_signal_callback (const char *signal_name, int value, void *use
                * |<-- pid (16bits) -->|<-- value (16bits) -->|,
                * FYI, #define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000 : 0x8000).
                * In case of daemon usage, it uses the client_pid of subscribe_cb. */
-               debug_msg ("client_pid[%d], getpid[%d], value>>16[%d], callback[%p]\n",
+               debug_msg ("client_pid[%d], getpid[%d], value>>16[%d], callback[%p]",
                                subscribe_cb->client_pid, getpid(), (value >> 16), subscribe_cb);
                if ((subscribe_cb->client_pid ? subscribe_cb->client_pid : getpid()) == (value >> 16))
                        subscribe_cb->callback(signal, (value & 0x0000FFFF), subscribe_cb->user_data);
        } else {
-               debug_warning("not supported type[%d]\n", subscribe_cb->signal_type);
+               debug_warning("not supported type[%d]", subscribe_cb->signal_type);
        }
 
        debug_fleave();
@@ -593,7 +593,7 @@ static void signal_callback(GDBusConnection *conn,
                        sender_name, object_path, interface_name, signal_name);
        if (g_variant_is_of_type(parameters, G_VARIANT_TYPE("(i)"))) {
                g_variant_get(parameters, "(i)",&value);
-               debug_msg(" - value : %d\n", value);
+               debug_msg(" - value : 0x08%x", value);
                _dbus_signal_callback(signal_name, value, user_data);
        } else  {
                value_type = g_variant_get_type(parameters);
index 0f5a129..7d6ecc3 100644 (file)
@@ -51,13 +51,13 @@ do { \
                strncpy(dst,src,size-1); \
                dst[size-1] = '\0';\
        } else if(dst == NULL) {       \
-               debug_error("STRNCPY ERROR: Destination String is NULL\n"); \
+               debug_error("STRNCPY ERROR: Destination String is NULL"); \
        }       \
        else if(size <= 0) {      \
-               debug_error("STRNCPY ERROR: Destination String is NULL\n"); \
+               debug_error("STRNCPY ERROR: Destination String is NULL"); \
        }       \
        else {    \
-               debug_error("STRNCPY ERROR: Destination String is NULL\n"); \
+               debug_error("STRNCPY ERROR: Destination String is NULL"); \
        }       \
 } while(0)
 
@@ -79,7 +79,7 @@ int mm_sound_boot_ready(int timeout_sec)
 
        if (sem_timedwait(sem, &ts) == -1) {
                if (errno == ETIMEDOUT)
-                       debug_warning("[BOOT] timeout!\n");
+                       debug_warning("[BOOT] timeout!");
        } else {
                debug_msg("[BOOT] ready wait success!!!!");
                sem_post(sem);
@@ -105,7 +105,7 @@ int mm_sound_boot_play_sound(char* path)
        if (fd == -1) {
                char str_error[256];
                strerror_r(errno, str_error, sizeof(str_error));
-               debug_error("file open failed with [%s][%d]\n", str_error, errno);
+               debug_error("file open failed with [%s][%d]", str_error, errno);
                switch (errno) {
                case ENOENT:
                        return MM_ERROR_SOUND_FILE_NOT_FOUND;
@@ -119,7 +119,7 @@ int mm_sound_boot_play_sound(char* path)
        /* Open PIPE */
        fd = open(KEYTONE_PATH, O_WRONLY | O_NONBLOCK);
        if (fd == -1) {
-               debug_error("Fail to open pipe\n");
+               debug_error("Fail to open pipe");
                return MM_ERROR_SOUND_FILE_NOT_FOUND;
        }
 
@@ -127,7 +127,7 @@ int mm_sound_boot_play_sound(char* path)
        MMSOUND_STRNCPY(data.role, "system", ROLE_NAME_LEN);
        MMSOUND_STRNCPY(data.volume_gain_type, "booting", VOLUME_GAIN_TYPE_LEN);
 
-       debug_msg("filepath=[%s], role=[%s], volume_gain_type=[%s]\n", data.filename, data.role, data.volume_gain_type);
+       debug_msg("filepath=[%s], role=[%s], volume_gain_type=[%s]", data.filename, data.role, data.volume_gain_type);
        size = sizeof(ipc_t);
 
        /* Write to PIPE */
@@ -135,7 +135,7 @@ int mm_sound_boot_play_sound(char* path)
        if (err < 0) {
                char str_error[256];
                strerror_r(errno, str_error, sizeof(str_error));
-               debug_error("Fail to write data: [%s][%d]\n", str_error, errno);
+               debug_error("Fail to write data: [%s][%d]", str_error, errno);
                close(fd);
                return MM_ERROR_SOUND_INTERNAL;
        }
index de07557..433f780 100644 (file)
@@ -161,9 +161,9 @@ void _system_signal_handler(int signo)
        if (g_need_emergent_exit) {
                ret = mm_sound_proxy_emergent_exit(getpid());
                if (ret == MM_ERROR_NONE)
-                       debug_msg("[Client] Success to emergnet_exit\n");
+                       debug_msg("Success to emergnet_exit");
                else
-                       debug_error("[Client] Error occurred : 0x%x \n",ret);
+                       debug_error("Error occurred : 0x%x", ret);
        }
 
        sigprocmask(SIG_SETMASK, &old_mask, NULL);
@@ -236,9 +236,9 @@ int mm_sound_client_finalize(void)
        if (g_need_emergent_exit) {
                ret = mm_sound_proxy_emergent_exit(getpid());
                if (ret == MM_ERROR_NONE)
-                       debug_msg("[Client] Success to emergnet_exit\n");
+                       debug_msg("Success to emergent_exit");
                else
-                       debug_error("[Client] Error occurred : 0x%x \n",ret);
+                       debug_error("Error occurred : 0x%x", ret);
        }
 
        sigaction(SIGINT, &system_int_old_action, NULL);
@@ -345,21 +345,21 @@ int mm_sound_client_play_tone(int number, int volume_config, double volume,
 
        if (enable_session) {
                if (MM_ERROR_NONE != _mm_session_util_read_information(-1, &session_type, &session_options)) {
-                       debug_warning("[Client] Read Session Information failed. use default \"media\" type\n");
+                       debug_warning("Read Session Information failed. use default \"media\" type");
                        session_type = MM_SESSION_TYPE_MEDIA;
 
                        if(MM_ERROR_NONE != mm_session_init(session_type)) {
-                               debug_critical("[Client] MMSessionInit() failed\n");
+                               debug_critical("MMSessionInit() failed");
                                return MM_ERROR_POLICY_INTERNAL;
                        }
                }
        }
 
         // instance = getpid();
-        //debug_log("[Client] pid for client ::: [%d]\n", instance);
+        //debug_log("pid for client ::: [%d]", instance);
 
         /* Send msg */
-        debug_msg("[Client] Input number : %d\n", number);
+        debug_msg("Input number : %d", number);
         /* Send req memory */
 
        mm_sound_convert_volume_type_to_stream_type(volume_type, stream_type);
@@ -398,7 +398,7 @@ static void _mm_sound_stop_callback_wrapper_func(int ended_handle, void *userdat
        struct callback_data *cb_data = (struct callback_data*) userdata;
        play_sound_end_callback_data_t *end_cb_data;
 
-       debug_log("[Wrapper CB][Play Stop] ended_handle : %d", ended_handle);
+       debug_log("ended_handle : %d", ended_handle);
 
        if (cb_data == NULL) {
                debug_warning("stop callback data null");
@@ -454,11 +454,11 @@ int mm_sound_client_play_sound(MMSoundPlayParam *param, int tone, int *handle)
 
        if (param->skip_session == false) {
                if(MM_ERROR_NONE != _mm_session_util_read_information(-1, &session_type, &session_options)) {
-                       debug_warning("[Client] Read MMSession Type failed. use default \"media\" type\n");
+                       debug_warning("Read MMSession Type failed. use default \"media\" type");
                        session_type = MM_SESSION_TYPE_MEDIA;
 
                        if(MM_ERROR_NONE != mm_session_init(session_type)) {
-                               debug_critical("[Client] MMSessionInit() failed\n");
+                               debug_critical("MMSessionInit() failed");
                                return MM_ERROR_POLICY_INTERNAL;
                        }
                }
@@ -563,16 +563,16 @@ static int _mm_sound_client_device_list_dump (GList *device_list)
                return MM_ERROR_SOUND_INTERNAL;
        }
 
-       debug_log("======================== device list : start ==========================\n");
+       debug_log("======================== device list : start ==========================");
        for (list = device_list; list != NULL; list = list->next) {
                device_node = (mm_sound_device_t *)list->data;
                if (device_node) {
-                       debug_log(" list idx[%d]: type[%17s], id[%02d], io_direction[%d], state[%d], name[%s]\n",
+                       debug_log(" list idx[%d]: type[%17s], id[%02d], io_direction[%d], state[%d], name[%s]",
                                                count++, device_node->type, device_node->id, device_node->io_direction,
                                                device_node->state, device_node->name);
                }
        }
-       debug_log("======================== device list : end ============================\n");
+       debug_log("======================== device list : end ============================");
 
        return ret;
 }
@@ -589,7 +589,7 @@ int mm_sound_client_get_current_connected_device_list(int device_flags, mm_sound
        }
 
        if ((ret = mm_sound_proxy_get_current_connected_device_list(device_flags, &device_list->list)) != MM_ERROR_NONE) {
-               debug_error("[Client] failed to get current connected device list with dbus, ret[0x%x]", ret);
+               debug_error("failed to get current connected device list with dbus, ret[0x%x]", ret);
                goto failed;
        }
        if (!device_list->list) {
@@ -611,7 +611,7 @@ int mm_sound_client_get_device_by_id(int device_id, mm_sound_device_t **device)
        debug_fenter();
 
        if ((ret = mm_sound_proxy_get_device_by_id(device_id, device)) != MM_ERROR_NONE)
-               debug_error("[Client] failed to get device by id");
+               debug_error("failed to get device by id");
 
        debug_fleave();
 
@@ -906,7 +906,7 @@ int mm_sound_client_is_stream_on_device(int stream_id, int device_id, bool *is_o
        }
 
        if ((ret = mm_sound_proxy_is_stream_on_device(stream_id, device_id, is_on)) != MM_ERROR_NONE) {
-               debug_error("[Client] failed to query is stream on device, ret[0x%x]", ret);
+               debug_error("failed to query is stream on device, ret[0x%x]", ret);
                goto failed;
        }
 
@@ -1014,7 +1014,7 @@ static void _mm_sound_volume_changed_callback_wrapper_func(const char *direction
        volume_type_t volume_type = 0;
        struct callback_data *cb_data = (struct callback_data *) userdata;
 
-       debug_log("[Wrapper CB][Volume Changed] direction : %s, volume_type : %s, volume_level : %d",
+       debug_log("direction : %s, volume_type : %s, volume_level : %d",
                        direction, volume_type_str, volume_level);
 
        if (cb_data == NULL) {
@@ -1115,7 +1115,7 @@ static gboolean _interrupted_completed(gpointer *data)
 static void _session_interrupted_cb(int id, mm_sound_focus_type_e focus_type, mm_sound_focus_state_e state,
                                     const char *reason_for_change, const char *ext_info, void *user_data)
 {
-       debug_msg("SESSION INTERRUPTED CB is called : id(%d), focus_type(%d), state(%d), reason(%s)", id, focus_type, state, reason_for_change);
+       debug_msg("id(%d), focus_type(%d), state(%d), reason(%s)", id, focus_type, state, reason_for_change);
 
        if (id != g_focus_session_interrupt_info.watch_cb_id) {
                debug_error("id is not valid(param id:%d, g_focus_session_interrupt_watch_cb_id:%d)",
@@ -1191,10 +1191,10 @@ static gpointer _focus_thread_func(gpointer data)
        unsigned int thread_id = (unsigned int)pthread_self();
        GMainLoop *focus_loop = (GMainLoop*)data;
 
-       debug_warning(">>> thread func : thread id(%u), mainloop[%p]", thread_id, focus_loop);
+       debug_warning(">>> thread id(%u), mainloop[%p]", thread_id, focus_loop);
        if (focus_loop)
                g_main_loop_run(focus_loop);
-       debug_warning("<<< quit thread func : thread id(%u), mainloop[%p]", thread_id, focus_loop);
+       debug_warning("<<< quit : thread id(%u), mainloop[%p]", thread_id, focus_loop);
 
        return NULL;
 }
@@ -1267,7 +1267,7 @@ static gboolean _focus_callback_handler(gpointer user_data)
        int tid = 0;
        focus_cb_data_lib cb_data;
 
-       debug_log(">>> _focus_callback_handler(), this thread id(%u)\n", (unsigned int)pthread_self());
+       debug_log(">>> thread id(%u)", (unsigned int)pthread_self());
 
        if (!focus_handle) {
                debug_error("focus_handle is null");
@@ -1317,7 +1317,7 @@ static gboolean _focus_callback_handler(gpointer user_data)
                        if (tmpfd < 0) {
                                char str_error[256];
                                strerror_r(errno, str_error, sizeof(str_error));
-                               debug_warning("[RETCB][Failed(May Server Close First)]tid(%d) fd(%d) %s errno=%d(%s)\n",
+                               debug_warning("[RETCB][Failed(May Server Close First)]tid(%d) fd(%d) %s errno=%d(%s)",
                                                        tid, tmpfd, filename2, errno, str_error);
                                g_free(filename2);
                                g_mutex_unlock(&focus_handle->focus_lock);
@@ -1329,7 +1329,7 @@ static gboolean _focus_callback_handler(gpointer user_data)
                        rett = write(tmpfd, &buf, sizeof(buf));
                        close(tmpfd);
                        g_free(filename2);
-                       debug_msg("[RETCB] tid(%d) finishing CB (write=%d)\n", tid, rett);
+                       debug_msg("[RETCB] tid(%d) finishing CB (write=%d)", tid, rett);
                }
 #endif
        }
@@ -1349,7 +1349,7 @@ static gboolean _focus_watch_callback_handler(gpointer user_data)
        int tid = 0;
        focus_cb_data_lib cb_data;
 
-       debug_log(">>> _focus_watch_callback_handler(), this thread id(%u)\n", (unsigned int)pthread_self());
+       debug_log(">>> thread id(%u)", (unsigned int)pthread_self());
 
        if (!focus_handle) {
                debug_error("focus_handle is null");
@@ -1406,7 +1406,7 @@ SKIP_CB_AND_RET:
                        if (tmpfd < 0) {
                                char str_error[256];
                                strerror_r(errno, str_error, sizeof(str_error));
-                               debug_warning("[RETCB][Failed(May Server Close First)]tid(%d) fd(%d) %s errno=%d(%s)\n",
+                               debug_warning("[RETCB][Failed(May Server Close First)]tid(%d) fd(%d) %s errno=%d(%s)",
                                                        tid, tmpfd, filename2, errno, str_error);
                                g_free(filename2);
                                g_mutex_unlock(&focus_handle->focus_lock);
@@ -1416,7 +1416,7 @@ SKIP_CB_AND_RET:
                        rett = write(tmpfd, &buf, sizeof(buf));
                        close(tmpfd);
                        g_free(filename2);
-                       debug_msg("[RETCB] tid(%d) finishing CB (write=%d)\n", tid, rett);
+                       debug_msg("[RETCB] tid(%d) finishing CB (write=%d)", tid, rett);
                }
 #endif
        }
@@ -1836,14 +1836,14 @@ int mm_sound_client_register_focus(int id, int pid, const char *stream_type, boo
 
        ret = mm_sound_proxy_register_focus(id, pid, stream_type, callback, is_for_session, user_data);
        if (ret == MM_ERROR_NONE) {
-               debug_msg("[Client] Success to register focus\n");
+               debug_msg("Success to register focus");
                g_need_emergent_exit = TRUE;
                if (_focus_init_context(index)) {
                        ret = MM_ERROR_SOUND_INTERNAL;
                        goto cleanup;
                }
        } else {
-               debug_error("[Client] Error occurred : 0x%x \n",ret);
+               debug_error("Error occurred : 0x%x",ret);
                goto cleanup;
        }
 
@@ -1887,9 +1887,9 @@ int mm_sound_client_unregister_focus(int id)
 
        ret = mm_sound_proxy_unregister_focus(instance, id, g_focus_sound_handle[index].is_for_session);
        if (ret == MM_ERROR_NONE)
-               debug_msg("[Client] Success to unregister focus\n");
+               debug_msg("Success to unregister focus");
        else
-               debug_error("[Client] Error occurred : 0x%x \n",ret);
+               debug_error("Error occurred : 0x%x", ret);
 
        g_mutex_unlock(&g_focus_sound_handle[index].focus_lock);
 
@@ -1927,22 +1927,22 @@ int mm_sound_client_set_focus_reacquisition(int id, bool reacquisition, bool is_
 
        ret = mm_sound_client_is_focus_cb_thread(g_thread_self(), &result);
        if (ret) {
-               debug_error("[Client] mm_sound_client_is_focus_cb_thread failed");
+               debug_error("mm_sound_client_is_focus_cb_thread failed");
                goto cleanup;
        } else if (!result) {
                ret = mm_sound_proxy_set_focus_reacquisition(instance, id, reacquisition, is_for_session);
                if (ret == MM_ERROR_NONE) {
-                       debug_msg("[Client] Success to set focus reacquisition to [%d]\n", reacquisition);
+                       debug_msg("Success to set focus reacquisition to [%d]", reacquisition);
                } else {
-                       debug_error("[Client] Error occurred : 0x%x \n",ret);
+                       debug_error("Error occurred : 0x%x",ret);
                        goto cleanup;
                }
        } else {
-               debug_warning("[Client] Inside the focus cb thread, set focus reacquisition to [%d]\n", reacquisition);
+               debug_warning("Inside the focus cb thread, set focus reacquisition to [%d]", reacquisition);
        }
 
        g_focus_sound_handle[index].auto_reacquire = reacquisition;
-       debug_msg("[Client] set focus reacquisition(%d) for id(%d)\n", reacquisition, id);
+       debug_msg("set focus reacquisition(%d) for id(%d)", reacquisition, id);
 
 cleanup:
        MMSOUND_LEAVE_CRITICAL_SECTION(&g_index_mutex);
@@ -1972,7 +1972,7 @@ int mm_sound_client_get_focus_reacquisition(int id, bool *reacquisition)
        }
 
        *reacquisition = g_focus_sound_handle[index].auto_reacquire;
-       debug_msg("[Client] get focus reacquisition(%d) for id(%d)\n", *reacquisition, id);
+       debug_msg("get focus reacquisition(%d) for id(%d)", *reacquisition, id);
 
 cleanup:
        MMSOUND_LEAVE_CRITICAL_SECTION(&g_index_mutex);
@@ -1990,14 +1990,14 @@ int mm_sound_client_get_acquired_focus_stream_type(int focus_type, char **stream
 
        ret = mm_sound_proxy_get_acquired_focus_stream_type(focus_type, &stream_type_str, option, &ext_info_str);
        if (ret == MM_ERROR_NONE) {
-               debug_msg("[Client] Success to get stream type of acquired focus, stream_type(%s), ext_info(%s)\n",
+               debug_msg("Success to get stream type of acquired focus, stream_type(%s), ext_info(%s)",
                          stream_type_str, ext_info_str);
                *stream_type = strdup(stream_type_str);
                *ext_info = strdup(ext_info_str);
                g_free(stream_type_str);
                g_free(ext_info_str);
        } else {
-               debug_error("[Client] Error occurred : 0x%x \n",ret);
+               debug_error("Error occurred : 0x%x",ret);
        }
 
        debug_fleave();
@@ -2023,9 +2023,9 @@ int mm_sound_client_acquire_focus(int id, mm_sound_focus_type_e type, int option
 
        ret = mm_sound_proxy_acquire_focus(instance, id, type, option, ext_info, g_focus_sound_handle[index].is_for_session);
        if (ret == MM_ERROR_NONE)
-               debug_msg("[Client] Success to acquire focus\n");
+               debug_msg("Success to acquire focus");
        else
-               debug_error("[Client] Error occurred : 0x%x \n",ret);
+               debug_error("Error occurred : 0x%x", ret);
 
 cleanup:
        MMSOUND_LEAVE_CRITICAL_SECTION(&g_index_mutex);
@@ -2052,9 +2052,9 @@ int mm_sound_client_release_focus(int id, mm_sound_focus_type_e type, int option
 
        ret = mm_sound_proxy_release_focus(instance, id, type, option, ext_info, g_focus_sound_handle[index].is_for_session);
        if (ret == MM_ERROR_NONE)
-               debug_msg("[Client] Success to release focus\n");
+               debug_msg("Success to release focus");
        else
-               debug_error("[Client] Error occurred : 0x%x \n",ret);
+               debug_error("Error occurred : 0x%x",ret);
 
 cleanup:
        MMSOUND_LEAVE_CRITICAL_SECTION(&g_index_mutex);
@@ -2068,7 +2068,7 @@ int mm_sound_client_update_stream_focus_status(int id, unsigned int status)
        debug_fenter();
 
        if ((ret = mm_sound_proxy_update_stream_focus_status(id, status)) != MM_ERROR_NONE)
-               debug_error("[Client] failed to update stream focus status, ret[0x%x]", ret);
+               debug_error("failed to update stream focus status, ret[0x%x]", ret);
 
        debug_fleave();
        return ret;
@@ -2080,7 +2080,7 @@ int mm_sound_client_deliver_focus(int pid, int src_id, int dst_id, mm_sound_focu
        debug_fenter();
 
        if ((ret = mm_sound_proxy_deliver_focus(pid, src_id, dst_id, focus_type)) != MM_ERROR_NONE)
-               debug_error("[Client] failed to deliver focus, ret[0x%x]", ret);
+               debug_error("failed to deliver focus, ret[0x%x]", ret);
 
        debug_fleave();
        return ret;
@@ -2127,14 +2127,14 @@ int mm_sound_client_set_focus_watch_callback(int pid, mm_sound_focus_type_e focu
                                                      is_for_session, is_for_monitor, callback, user_data);
 
        if (ret == MM_ERROR_NONE) {
-               debug_msg("[Client] Success to watch focus");
+               debug_msg("Success to watch focus");
                g_need_emergent_exit = TRUE;
                if (_focus_init_context(index)) {
                        ret = MM_ERROR_SOUND_INTERNAL;
                        goto cleanup;
                }
        } else {
-               debug_error("[Client] Error occurred : 0x%x",ret);
+               debug_error("Error occurred : 0x%x",ret);
                goto cleanup;
        }
 
@@ -2196,9 +2196,9 @@ int mm_sound_client_unset_focus_watch_callback(int id)
                                                        g_focus_sound_handle[index].is_for_session);
 
        if (ret == MM_ERROR_NONE)
-               debug_msg("[Client] Success to unwatch focus\n");
+               debug_msg("Success to unwatch focus");
        else
-               debug_error("[Client] Error occurred : 0x%x \n",ret);
+               debug_error("Error occurred : 0x%x",ret);
 
 
        g_mutex_unlock(&g_focus_sound_handle[index].focus_lock);
@@ -2231,11 +2231,11 @@ static gboolean _idle_event_callback(void *data)
        switch (idle_event_data->type) {
        case IDLE_EVENT_TYPE_UNSET_FOCUS_WATCH_CB:
                if ((ret = mm_sound_client_unset_focus_watch_callback(idle_event_data->data)))
-                       debug_error("Could not unset focus watch callback, id(%d), ret = %x\n", idle_event_data->data, ret);
+                       debug_error("Could not unset focus watch callback, id(%d), ret = %x", idle_event_data->data, ret);
                break;
        case IDLE_EVENT_TYPE_UNREGISTER_FOCUS:
                if ((ret = mm_sound_client_unregister_focus(idle_event_data->data)))
-                       debug_error("Could not unregister focus, id(%d), ret = %x\n", idle_event_data->data, ret);
+                       debug_error("Could not unregister focus, id(%d), ret = %x", idle_event_data->data, ret);
                break;
        default:
                debug_warning("invalid type(%d)", idle_event_data->type);
index fd1eb33..305f03b 100644 (file)
@@ -60,7 +60,7 @@ static int _check_for_valid_mask (int flags)
                ret = MM_ERROR_INVALID_ARGUMENT;
        }
        if (ret) {
-               debug_error("flags[0x%x] is not valid\n", flags);
+               debug_error("flags[0x%x] is not valid", flags);
        }
        return ret;
 }
@@ -117,14 +117,14 @@ int mm_sound_add_device_connected_callback(int flags, mm_sound_device_connected_
        int ret = MM_ERROR_NONE;
 
        if (func == NULL || id == NULL) {
-               debug_error("argument is not valid\n");
+               debug_error("argument is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
        ret = _check_for_valid_mask(flags);
        if (ret == MM_ERROR_NONE) {
                ret = mm_sound_client_add_device_connected_callback(flags, func, user_data, id);
                if (ret < 0) {
-                       debug_error("Could not add device connected callback, ret = %x\n", ret);
+                       debug_error("Could not add device connected callback, ret = %x", ret);
                }
        }
 
@@ -138,7 +138,7 @@ int mm_sound_remove_device_connected_callback(unsigned int id)
 
        ret = mm_sound_client_remove_device_connected_callback(id);
        if (ret < 0) {
-               debug_error("Could not remove device connected callback, ret = %x\n", ret);
+               debug_error("Could not remove device connected callback, ret = %x", ret);
        }
 
        return ret;
@@ -150,14 +150,14 @@ int mm_sound_add_device_information_changed_callback(int flags, mm_sound_device_
        int ret = MM_ERROR_NONE;
 
        if (func == NULL || id == NULL) {
-               debug_error("argument is not valid\n");
+               debug_error("argument is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
        ret = _check_for_valid_mask(flags);
        if (ret == MM_ERROR_NONE) {
                ret = mm_sound_client_add_device_info_changed_callback(flags, func, user_data, id);
                if (ret < 0) {
-                       debug_error("Could not add device information changed callback, ret = %x\n", ret);
+                       debug_error("Could not add device information changed callback, ret = %x", ret);
                }
        }
 
@@ -171,7 +171,7 @@ int mm_sound_remove_device_information_changed_callback(unsigned int id)
 
        ret = mm_sound_client_remove_device_info_changed_callback(id);
        if (ret < 0) {
-               debug_error("Could not remove device information changed callback, ret = %x\n", ret);
+               debug_error("Could not remove device information changed callback, ret = %x", ret);
        }
 
        return ret;
@@ -183,14 +183,14 @@ int mm_sound_add_device_state_changed_callback(int flags, mm_sound_device_state_
        int ret = MM_ERROR_NONE;
 
        if (func == NULL || id == NULL) {
-               debug_error("argument is not valid\n");
+               debug_error("argument is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
        ret = _check_for_valid_mask(flags);
        if (ret == MM_ERROR_NONE) {
                ret = mm_sound_client_add_device_state_changed_callback(flags, func, user_data, id);
                if (ret < 0) {
-                       debug_error("Could not add device state changed callback, ret = %x\n", ret);
+                       debug_error("Could not add device state changed callback, ret = %x", ret);
                }
        }
 
@@ -204,7 +204,7 @@ int mm_sound_remove_device_state_changed_callback(unsigned int id)
 
        ret = mm_sound_client_remove_device_state_changed_callback(id);
        if (ret < 0) {
-               debug_error("Could not remove device state changed callback, ret = %x\n", ret);
+               debug_error("Could not remove device state changed callback, ret = %x", ret);
        }
 
        return ret;
@@ -236,7 +236,7 @@ int mm_sound_get_current_device_list(mm_sound_device_flags_e flags, MMSoundDevic
 
        ret = mm_sound_client_get_current_connected_device_list(flags, &g_device_list);
        if (ret < 0) {
-               debug_error("Could not get current connected device list, ret = %x\n", ret);
+               debug_error("Could not get current connected device list, ret = %x", ret);
                g_device_list.list = NULL;
        } else {
                *device_list = &g_device_list;
@@ -263,7 +263,7 @@ int mm_sound_get_device_list(int flags, MMSoundDeviceList_t *device_list)
        }
 
        if (!(_device_list = g_malloc0(sizeof(mm_sound_device_list_t)))) {
-               debug_error("[Client] Allocate device list failed");
+               debug_error("Allocate device list failed");
                return MM_ERROR_SOUND_INTERNAL;
        }
 
@@ -271,7 +271,7 @@ int mm_sound_get_device_list(int flags, MMSoundDeviceList_t *device_list)
 
        ret = mm_sound_client_get_current_connected_device_list(flags, _device_list);
        if (ret < 0) {
-               debug_error("Could not get current connected device list, ret = %x\n", ret);
+               debug_error("Could not get current connected device list, ret = %x", ret);
                g_free(_device_list);
        } else {
                *device_list = _device_list;
@@ -308,7 +308,7 @@ int mm_sound_get_device_by_id(int device_id, MMSoundDevice_t *device_h)
 
        ret = mm_sound_client_get_device_by_id(device_id, &device);
        if (ret < 0)
-               debug_error("Could not get device by id, ret = %x\n", ret);
+               debug_error("Could not get device by id, ret = %x", ret);
        else
                *device_h = device;
 
@@ -339,7 +339,7 @@ int mm_sound_get_next_device (MMSoundDeviceList_t device_list, MMSoundDevice_t *
                        device_list_t->list = node;
                }
                *device = (mm_sound_device_t*)node->data;
-               debug_log("next device[0x%x]\n", *device);
+               debug_log("next device[0x%x]", *device);
        }
        return ret;
 }
@@ -357,11 +357,11 @@ int mm_sound_get_prev_device (MMSoundDeviceList_t device_list, MMSoundDevice_t *
        node = g_list_previous(device_list_t->list);
        if (!node) {
                ret = MM_ERROR_SOUND_NO_DATA;
-               debug_error("Could not get previous device, ret = %x\n", ret);
+               debug_error("Could not get previous device, ret = %x", ret);
        } else {
                device_list_t->list = node;
                *device = (mm_sound_device_t*)node->data;
-               debug_log("previous device[0x%x]\n", *device);
+               debug_log("previous device[0x%x]", *device);
        }
        return ret;
 }
@@ -371,11 +371,11 @@ int mm_sound_get_device_type(MMSoundDevice_t device_h, mm_sound_device_type_e *t
 {
        mm_sound_device_t *device = (mm_sound_device_t*)device_h;
        if(!device || !type) {
-               debug_error("invalid argument\n");
+               debug_error("invalid argument");
                return MM_ERROR_INVALID_ARGUMENT;
        }
        __convert_device_type_to_enum(device->type, type);
-       debug_log("device_handle:0x%x, type:%d\n", device, *type);
+       debug_log("device_handle:0x%x, type:%d", device, *type);
 
        return MM_ERROR_NONE;
 }
@@ -385,11 +385,11 @@ int mm_sound_get_device_io_direction(MMSoundDevice_t device_h, mm_sound_device_i
 {
        mm_sound_device_t *device = (mm_sound_device_t*)device_h;
        if(!device) {
-               debug_error("invalid handle\n");
+               debug_error("invalid handle");
                return MM_ERROR_INVALID_ARGUMENT;
        }
        *io_direction = device->io_direction;
-       debug_log("device_handle:0x%x, io_direction:%d (1:IN,2:OUT,3:INOUT)\n", device, *io_direction);
+       debug_log("device_handle:0x%x, io_direction:%d (1:IN,2:OUT,3:INOUT)", device, *io_direction);
 
        return MM_ERROR_NONE;
 }
@@ -399,11 +399,11 @@ int mm_sound_get_device_id(MMSoundDevice_t device_h, int *id)
 {
        mm_sound_device_t *device = (mm_sound_device_t*)device_h;
        if(!device) {
-               debug_error("invalid handle\n");
+               debug_error("invalid handle");
                return MM_ERROR_INVALID_ARGUMENT;
        }
        *id = device->id;
-       debug_log("device_handle:0x%x, id:%d\n", device, *id);
+       debug_log("device_handle:0x%x, id:%d", device, *id);
 
        return MM_ERROR_NONE;
 }
@@ -413,11 +413,11 @@ int mm_sound_get_device_state(MMSoundDevice_t device_h, mm_sound_device_state_e
 {
        mm_sound_device_t *device = (mm_sound_device_t*)device_h;
        if(!device) {
-               debug_error("invalid handle\n");
+               debug_error("invalid handle");
                return MM_ERROR_INVALID_ARGUMENT;
        }
        *state = device->state;
-       debug_log("device_handle:0x%x, state:%d (0:INACTIVATED,1:ACTIVATED)\n", device, *state);
+       debug_log("device_handle:0x%x, state:%d (0:INACTIVATED,1:ACTIVATED)", device, *state);
 
        return MM_ERROR_NONE;
 }
@@ -427,11 +427,11 @@ int mm_sound_get_device_name(MMSoundDevice_t device_h, char **name)
 {
        mm_sound_device_t *device = (mm_sound_device_t*)device_h;
        if(!device) {
-               debug_error("invalid handle\n");
+               debug_error("invalid handle");
                return MM_ERROR_INVALID_ARGUMENT;
        }
        *name = device->name;
-       debug_log("device_handle:0x%x, name:%s\n", device, *name);
+       debug_log("device_handle:0x%x, name:%s", device, *name);
 
        return MM_ERROR_NONE;
 }
@@ -441,11 +441,11 @@ int mm_sound_get_device_vendor_id(MMSoundDevice_t device_h, int *vendor_id)
 {
        mm_sound_device_t *device = (mm_sound_device_t*)device_h;
        if(!device) {
-               debug_error("invalid handle\n");
+               debug_error("invalid handle");
                return MM_ERROR_INVALID_ARGUMENT;
        }
        *vendor_id = device->vendor_id;
-       debug_log("device_handle:0x%x, vendor id:%04x\n", device, *vendor_id);
+       debug_log("device_handle:0x%x, vendor id:%04x", device, *vendor_id);
 
        return MM_ERROR_NONE;
 }
@@ -455,11 +455,11 @@ int mm_sound_get_device_product_id(MMSoundDevice_t device_h, int *product_id)
 {
        mm_sound_device_t *device = (mm_sound_device_t*)device_h;
        if(!device) {
-               debug_error("invalid handle\n");
+               debug_error("invalid handle");
                return MM_ERROR_INVALID_ARGUMENT;
        }
        *product_id = device->product_id;
-       debug_log("device_handle:0x%x, product id:%04x\n", device, *product_id);
+       debug_log("device_handle:0x%x, product id:%04x", device, *product_id);
 
        return MM_ERROR_NONE;
 }
@@ -473,7 +473,7 @@ int mm_sound_is_stream_on_device(int stream_id, MMSoundDevice_t device_h, bool *
        bool _is_on = false;
 
        if(!device || !is_on) {
-               debug_error("invalid argument\n");
+               debug_error("invalid argument");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
@@ -494,7 +494,7 @@ int mm_sound_is_stream_on_device(int stream_id, MMSoundDevice_t device_h, bool *
                }
        }
 
-       debug_log("device(%d) %s stream(%d)\n", device->id, _is_on ? "has" : "doesn't have", stream_id);
+       debug_log("device(%d) %s stream(%d)", device->id, _is_on ? "has" : "doesn't have", stream_id);
        *is_on = _is_on;
 
        return ret;
index 46dbfc0..3ad33b6 100644 (file)
@@ -35,7 +35,7 @@
        if (ret) \
                return ret; \
        if (result) { \
-               debug_error("it might be called in the thread of focus callback, it is not allowed\n"); \
+               debug_error("it might be called in the thread of focus callback, it is not allowed"); \
                return MM_ERROR_SOUND_INVALID_OPERATION; \
        } \
 } \
@@ -68,7 +68,7 @@ int mm_sound_focus_unset_session_interrupt_callback(void)
 
        ret = mm_sound_client_unset_session_interrupt_callback();
        if (ret) {
-               debug_error("Failed to mm_sound_client_unset_session_interrupt_callback(), ret[0x%x]\n", ret);
+               debug_error("Failed to mm_sound_client_unset_session_interrupt_callback(), ret[0x%x]", ret);
        }
 
        debug_fleave();
@@ -87,7 +87,7 @@ int mm_sound_focus_get_id(int *id)
 
        ret = mm_sound_client_get_unique_id(id);
        if (ret) {
-               debug_error("Failed to mm_sound_client_get_unique_id(), ret[0x%x]\n", ret);
+               debug_error("Failed to mm_sound_client_get_unique_id(), ret[0x%x]", ret);
        }
 
        debug_fleave();
@@ -105,7 +105,7 @@ int mm_sound_focus_is_cb_thread(bool *result)
        ret = mm_sound_client_is_focus_cb_thread(g_thread_self(), result);
        if (!ret) {
                if (*result)
-                       debug_msg("it might be called in the thread of focus callback\n");
+                       debug_msg("it might be called in the thread of focus callback");
        }
 
        debug_fleave();
@@ -123,13 +123,13 @@ int mm_sound_register_focus(int id, const char *stream_type, mm_sound_focus_chan
        RETURN_ERROR_IF_FOCUS_CB_THREAD(g_thread_self());
 
        if (id < 0 || callback == NULL) {
-               debug_error("argument is not valid\n");
+               debug_error("argument is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        ret = mm_sound_client_register_focus(id, getpid(), stream_type, false, callback, user_data);
        if (ret) {
-               debug_error("Could not register focus, ret[0x%x]\n", ret);
+               debug_error("Could not register focus, ret[0x%x]", ret);
        }
 
        debug_fleave();
@@ -147,13 +147,13 @@ int mm_sound_register_focus_for_session(int id, int pid, const char *stream_type
        RETURN_ERROR_IF_FOCUS_CB_THREAD(g_thread_self());
 
        if (id < 0 || callback == NULL) {
-               debug_error("argument is not valid\n");
+               debug_error("argument is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        ret = mm_sound_client_register_focus(id, pid, stream_type, true, callback, user_data);
        if (ret) {
-               debug_error("Could not register focus for session, ret[0x%x]\n", ret);
+               debug_error("Could not register focus for session, ret[0x%x]", ret);
        }
 
        debug_fleave();
@@ -170,14 +170,14 @@ int mm_sound_unregister_focus(int id)
        debug_fenter();
 
        if (id < 0) {
-               debug_error("argument is not valid\n");
+               debug_error("argument is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        mm_sound_client_is_focus_cb_thread(g_thread_self(), &result);
        if (!result) {
                if ((ret = mm_sound_client_unregister_focus(id)))
-                       debug_error("Could not unregister focus, ret = %x\n", ret);
+                       debug_error("Could not unregister focus, ret = %x", ret);
        } else {
                ret = mm_sound_client_execute_focus_func_in_main_context(IDLE_EVENT_TYPE_UNREGISTER_FOCUS, id);
        }
@@ -195,12 +195,12 @@ int mm_sound_set_focus_reacquisition(int id, bool reacquisition)
        debug_fenter();
 
        if (id < 0) {
-               debug_error("argument is not valid\n");
+               debug_error("argument is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        if ((ret = mm_sound_client_set_focus_reacquisition(id, reacquisition, false)))
-               debug_error("Could not set focus reacquisition, ret[0x%x]\n", ret);
+               debug_error("Could not set focus reacquisition, ret[0x%x]", ret);
 
        debug_fleave();
 
@@ -215,12 +215,12 @@ int mm_sound_set_focus_reacquisition_for_session(int id, bool reacquisition)
        debug_fenter();
 
        if (id < 0) {
-               debug_error("argument is not valid\n");
+               debug_error("argument is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        if ((ret = mm_sound_client_set_focus_reacquisition(id, reacquisition, true)))
-               debug_error("Could not set focus reacquisition, ret[0x%x]\n", ret);
+               debug_error("Could not set focus reacquisition, ret[0x%x]", ret);
 
        debug_fleave();
 
@@ -235,13 +235,13 @@ int mm_sound_get_focus_reacquisition(int id, bool *reacquisition)
        debug_fenter();
 
        if (id < 0 || !reacquisition) {
-               debug_error("argument is not valid\n");
+               debug_error("argument is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        ret = mm_sound_client_get_focus_reacquisition(id, reacquisition);
        if (ret) {
-               debug_error("Could not get focus reacquisition, ret[0x%x]\n", ret);
+               debug_error("Could not get focus reacquisition, ret[0x%x]", ret);
        }
 
        debug_fleave();
@@ -257,13 +257,13 @@ int mm_sound_get_stream_type_of_acquired_focus(int focus_type, char **stream_typ
        debug_fenter();
 
        if (stream_type == NULL) {
-               debug_error("argument is not valid\n");
+               debug_error("argument is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        ret = mm_sound_client_get_acquired_focus_stream_type(focus_type, stream_type, option, ext_info);
        if (ret) {
-               debug_error("Could not get acquired focus stream type, ret[0x%x]\n", ret);
+               debug_error("Could not get acquired focus stream type, ret[0x%x]", ret);
        }
 
        debug_fleave();
@@ -281,17 +281,17 @@ int mm_sound_acquire_focus(int id, mm_sound_focus_type_e focus_type, const char
        RETURN_ERROR_IF_FOCUS_CB_THREAD(g_thread_self());
 
        if (id < 0) {
-               debug_error("argument is not valid\n");
+               debug_error("argument is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
        if (focus_type < FOCUS_FOR_PLAYBACK || focus_type > FOCUS_FOR_BOTH) {
-               debug_error("argument is not valid\n");
+               debug_error("argument is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        ret = mm_sound_client_acquire_focus(id, focus_type, 0, ext_info);
        if (ret) {
-               debug_error("Could not acquire focus, ret[0x%x]\n", ret);
+               debug_error("Could not acquire focus, ret[0x%x]", ret);
        }
 
        debug_fleave();
@@ -309,17 +309,17 @@ int mm_sound_release_focus(int id, mm_sound_focus_type_e focus_type, const char
        RETURN_ERROR_IF_FOCUS_CB_THREAD(g_thread_self());
 
        if (id < 0) {
-               debug_error("argument is not valid\n");
+               debug_error("argument is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
        if (focus_type < FOCUS_FOR_PLAYBACK || focus_type > FOCUS_FOR_BOTH) {
-               debug_error("argument is not valid\n");
+               debug_error("argument is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        ret = mm_sound_client_release_focus(id, focus_type, 0, ext_info);
        if (ret) {
-               debug_error("Could not release focus, ret[0x%x]\n", ret);
+               debug_error("Could not release focus, ret[0x%x]", ret);
        }
 
        debug_fleave();
@@ -335,23 +335,23 @@ int mm_sound_acquire_focus_with_option(int id, mm_sound_focus_type_e focus_type,
        debug_fenter();
 
        if (id < 0) {
-               debug_error("id is not valid\n");
+               debug_error("id is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        if (option < 0) {
-               debug_error("option is not valid\n");
+               debug_error("option is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        if (focus_type < FOCUS_FOR_PLAYBACK || focus_type > FOCUS_FOR_BOTH) {
-               debug_error("focus type is not valid\n");
+               debug_error("focus type is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        ret = mm_sound_client_acquire_focus(id, focus_type, option, ext_info);
        if (ret) {
-               debug_error("Could not acquire focus, ret[0x%x]\n", ret);
+               debug_error("Could not acquire focus, ret[0x%x]", ret);
        }
 
        debug_fleave();
@@ -367,23 +367,23 @@ int mm_sound_release_focus_with_option(int id, mm_sound_focus_type_e focus_type,
        debug_fenter();
 
        if (id < 0) {
-               debug_error("id is not valid\n");
+               debug_error("id is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        if (option < 0) {
-               debug_error("option is not valid\n");
+               debug_error("option is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        if (focus_type < FOCUS_FOR_PLAYBACK || focus_type > FOCUS_FOR_BOTH) {
-               debug_error("focus type is not valid\n");
+               debug_error("focus type is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        ret = mm_sound_client_release_focus(id, focus_type, option, ext_info);
        if (ret) {
-               debug_error("Could not release focus, ret[0x%x]\n", ret);
+               debug_error("Could not release focus, ret[0x%x]", ret);
        }
 
        debug_fleave();
@@ -397,7 +397,7 @@ int mm_sound_update_focus_status(int id, unsigned int status)
        int ret = MM_ERROR_NONE;
 
        if ((ret = mm_sound_client_update_stream_focus_status(id, status)))
-               debug_error("failed to mm_sound_client_update_stream_focus_status(), id(%d), status(%d, ret[0x%x]\n",
+               debug_error("failed to mm_sound_client_update_stream_focus_status(), id(%d), status(%d, ret[0x%x]",
                                        id, status, ret);
 
        return ret;
@@ -409,7 +409,7 @@ int mm_sound_deliver_focus(int src_id, int dst_id, mm_sound_focus_type_e focus_t
        int ret = MM_ERROR_NONE;
 
        if ((ret = mm_sound_client_deliver_focus(getpid(), src_id, dst_id, focus_type)))
-               debug_error("failed to mm_sound_client_deliver_focus(), ret[0x%x]\n", ret);
+               debug_error("failed to mm_sound_client_deliver_focus(), ret[0x%x]", ret);
 
        return ret;
 }
@@ -424,12 +424,12 @@ int mm_sound_set_focus_watch_callback(mm_sound_focus_type_e focus_type, mm_sound
        RETURN_ERROR_IF_FOCUS_CB_THREAD(g_thread_self());
 
        if (callback == NULL || id == NULL) {
-               debug_error("argument is not valid\n");
+               debug_error("argument is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
        ret = mm_sound_client_set_focus_watch_callback(getpid(), focus_type, false, false, callback, user_data, id);
        if (ret) {
-               debug_error("Could not set focus watch callback, ret[0x%x]\n", ret);
+               debug_error("Could not set focus watch callback, ret[0x%x]", ret);
        }
 
        debug_fleave();
@@ -447,12 +447,12 @@ int mm_sound_set_focus_watch_callback_for_session(int pid, mm_sound_focus_type_e
        RETURN_ERROR_IF_FOCUS_CB_THREAD(g_thread_self());
 
        if (callback == NULL || id == NULL) {
-               debug_error("argument is not valid\n");
+               debug_error("argument is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
        ret = mm_sound_client_set_focus_watch_callback(pid, focus_type, true, false, callback, user_data, id);
        if (ret) {
-               debug_error("Could not set focus watch callback, ret[0x%x]\n", ret);
+               debug_error("Could not set focus watch callback, ret[0x%x]", ret);
        }
 
        debug_fleave();
@@ -470,12 +470,12 @@ int mm_sound_set_focus_watch_callback_for_session_monitor(int pid, mm_sound_focu
        RETURN_ERROR_IF_FOCUS_CB_THREAD(g_thread_self());
 
        if (callback == NULL || id == NULL) {
-               debug_error("argument is not valid\n");
+               debug_error("argument is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
        ret = mm_sound_client_set_focus_watch_callback(pid, focus_type, true, true, callback, user_data, id);
        if (ret) {
-               debug_error("Could not set focus watch callback, ret[0x%x]\n", ret);
+               debug_error("Could not set focus watch callback, ret[0x%x]", ret);
        }
 
        debug_fleave();
@@ -492,22 +492,22 @@ int mm_sound_unset_focus_watch_callback(int id)
        debug_fenter();
 
        if (id < 0) {
-               debug_error("argument is not valid\n");
+               debug_error("argument is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
        if ((ret = mm_sound_client_request_unset_focus_watch_callback(id))) {
-               debug_error("failed to mm_sound_client_request_unset_focus_watch_callback, ret[0x%x]\n", ret);
+               debug_error("failed to mm_sound_client_request_unset_focus_watch_callback, ret[0x%x]", ret);
                return ret;
        }
 
        mm_sound_client_is_focus_cb_thread(g_thread_self(), &result);
        if (!result) {
                if ((ret = mm_sound_client_unset_focus_watch_callback(id)))
-                       debug_error("Could not unset focus watch callback, id(%d), ret[0x%x]\n", id, ret);
+                       debug_error("Could not unset focus watch callback, id(%d), ret[0x%x]", id, ret);
        } else {
                ret = mm_sound_client_execute_focus_func_in_main_context(IDLE_EVENT_TYPE_UNSET_FOCUS_WATCH_CB, id);
-               debug_msg("mm_sound_client_execute_focus_func_in_main_context() is called, id(%d), ret[0x%x]\n", id, ret);
+               debug_msg("mm_sound_client_execute_focus_func_in_main_context() is called, id(%d), ret[0x%x]", id, ret);
        }
 
        debug_fleave();
index 5bbffdc..7f1b6da 100644 (file)
@@ -45,7 +45,7 @@ static int _convert_error_from_string(const char *error_string)
        int ret = MM_ERROR_NONE;
 
        if (error_string == NULL) {
-               debug_error("error_string is null\n");
+               debug_error("error_string is null");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
@@ -62,7 +62,7 @@ static int _convert_error_from_string(const char *error_string)
        else
                ret = MM_ERROR_SOUND_INTERNAL;
 
-       debug_msg("error_string[%s], ret[0x%x]\n", error_string, ret);
+       debug_msg("error_string[%s], ret[0x%x]", error_string, ret);
 
        return ret;
 }
@@ -73,7 +73,7 @@ static int _get_client_socket_fd(int *fd)
        char str_error[128] = {'\0',};
 
        if (fd == NULL) {
-               debug_error("input param fd is null\n");
+               debug_error("input param fd is null");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
@@ -97,7 +97,7 @@ static int _connect_socket_fd(int fd)
        char str_error[128] = {'\0',};
 
        if (fd < 0) {
-               debug_error("invalid fd[%d]\n", fd);
+               debug_error("invalid fd[%d]", fd);
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
@@ -164,11 +164,11 @@ int mm_sound_focus_socket_acquire(int instance, int id, mm_sound_focus_type_e fo
        }
 
        if ((ret = _get_client_socket_fd(&fd))) {
-               debug_error("failed to _get_client_socket_fd()\n");
+               debug_error("failed to _get_client_socket_fd()");
                return MM_ERROR_SOUND_INTERNAL;
        }
        if ((ret = _connect_socket_fd(fd))) {
-               debug_error("failed to _connect_socket_fd()\n");
+               debug_error("failed to _connect_socket_fd()");
                close(fd);
                return MM_ERROR_SOUND_INTERNAL;
        }
@@ -178,7 +178,7 @@ int mm_sound_focus_socket_acquire(int instance, int id, mm_sound_focus_type_e fo
                          option, ext_info, is_in_thread, is_for_session);
 
        if ((ret = _send_data_to_server(fd, &data))) {
-               debug_error("failed to _send_data_to_server(), ret[0x%x]\n", ret);
+               debug_error("failed to _send_data_to_server(), ret[0x%x]", ret);
                close(fd);
                return ret;
        }
@@ -204,7 +204,7 @@ int mm_sound_focus_socket_release(int instance, int id, mm_sound_focus_type_e fo
                return MM_ERROR_INVALID_ARGUMENT;
        }
        if (focus_type < FOCUS_FOR_PLAYBACK || focus_type > FOCUS_FOR_BOTH) {
-               debug_error("focus type is not valid\n");
+               debug_error("focus type is not valid");
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
index 2daa6e9..558a8c6 100644 (file)
@@ -144,7 +144,7 @@ static int _mm_sound_play_keysound(const char *filename, int volume_config, ipc_
                if (fd == -1) {
                        char str_error[256];
                        strerror_r(errno, str_error, sizeof(str_error));
-                       debug_error("file open failed with [%s][%d]\n", str_error, errno);
+                       debug_error("file open failed with [%s][%d]", str_error, errno);
                        switch (errno) {
                        case ENOENT:
                                return MM_ERROR_SOUND_FILE_NOT_FOUND;
@@ -158,7 +158,7 @@ static int _mm_sound_play_keysound(const char *filename, int volume_config, ipc_
                /* Open PIPE */
                fd = open(KEYTONE_PATH, O_WRONLY | O_NONBLOCK);
                if (fd == -1) {
-                       debug_error("Fail to open pipe\n");
+                       debug_error("Fail to open pipe");
                        return MM_ERROR_SOUND_FILE_NOT_FOUND;
                }
 
@@ -172,7 +172,7 @@ static int _mm_sound_play_keysound(const char *filename, int volume_config, ipc_
 
                MMSOUND_STRNCPY(data.filename, filename, FILE_FULL_PATH);
 
-               debug_msg("filepath=[%s], role=[%s], volume_gain_type=[%s]\n", data.filename, data.role, data.volume_gain_type);
+               debug_msg("filepath=[%s], role=[%s], volume_gain_type=[%s]", data.filename, data.role, data.volume_gain_type);
                size = sizeof(ipc_t);
 
                /* Write to PIPE */
@@ -180,7 +180,7 @@ static int _mm_sound_play_keysound(const char *filename, int volume_config, ipc_
                if (res < 0) {
                        char str_error[256];
                        strerror_r(errno, str_error, sizeof(str_error));
-                       debug_error("Fail to write data: [%s][%d]\n", str_error, errno);
+                       debug_error("Fail to write data: [%s][%d]", str_error, errno);
                        ret = MM_ERROR_SOUND_INTERNAL;
                }
                /* Close PIPE */
index e1ed46a..32bbbe8 100644 (file)
@@ -306,7 +306,7 @@ int mm_sound_pa_open(MMSoundHandleMode mode, int volume_config, pa_sample_spec*
 
     case HANDLE_MODE_OUTPUT_AP_CALL:
 #if defined(_MMFW_I386_ALL_SIMULATOR)
-        debug_msg("Does not support AP call mode at i386 simulator\n");
+        debug_msg("Does not support AP call mode at i386 simulator");
         s = NULL;
 #else
         period_time = PA_SIMPLE_PERIOD_TIME_FOR_VOIP_LATENCY_MSEC;
@@ -323,7 +323,7 @@ int mm_sound_pa_open(MMSoundHandleMode mode, int volume_config, pa_sample_spec*
         break;
     case HANDLE_MODE_INPUT_AP_CALL:
 #if defined(_MMFW_I386_ALL_SIMULATOR)
-        debug_msg("Does not support AP call mode at i386 simulator\n");
+        debug_msg("Does not support AP call mode at i386 simulator");
         s = NULL;
 #else
         period_time = PA_SIMPLE_PERIOD_TIME_FOR_VOIP_LATENCY_MSEC;
@@ -345,7 +345,7 @@ int mm_sound_pa_open(MMSoundHandleMode mode, int volume_config, pa_sample_spec*
     }
 
     if (!s) {
-        debug_error("Open pulseaudio handle has failed - %s\n", pa_strerror(err));
+        debug_error("Open pulseaudio handle has failed - %s", pa_strerror(err));
         if (!strncmp(pa_strerror(err), "Access denied by security check",strlen(pa_strerror(err)))) {
             err = MM_ERROR_SOUND_PERMISSION_DENIED;
         } else {
@@ -368,14 +368,14 @@ int mm_sound_pa_open(MMSoundHandleMode mode, int volume_config, pa_sample_spec*
     ATOMIC_INC(&mm_sound_handle_mgr.lock, mm_sound_handle_mgr.handle_count); // 0 is not used
 
     if (0 > pa_simple_get_stream_index(s, &handle->stream_idx, &err)) {
-        debug_msg("Can not get stream index %s\n", pa_strerror(err));
+        debug_msg("Can not get stream index %s", pa_strerror(err));
         err = MM_ERROR_SOUND_INTERNAL;
         goto fail;
     }
     mm_sound_handle_mgr.handles = g_list_append(mm_sound_handle_mgr.handles, handle);
 
     if(handle->handle == 0) {
-        debug_msg("out of range. handle(%d)\n", handle->handle);
+        debug_msg("out of range. handle(%d)", handle->handle);
         goto fail;
     }
 
@@ -427,7 +427,7 @@ int mm_sound_pa_write(const int handle, void* buf, const int size)
     }
 
     if (0 > pa_simple_write(phandle->s, buf, size, &err)) {
-        debug_error("pa_simple_write() failed with %s\n", pa_strerror(err));
+        debug_error("pa_simple_write() failed with %s", pa_strerror(err));
         return MM_ERROR_SOUND_INTERNAL;
     }
 
@@ -459,7 +459,7 @@ int mm_sound_pa_close(const int handle)
        case HANDLE_MODE_OUTPUT_VIDEO:
                if (0 > pa_simple_flush(phandle->s, &err)) {
             err = MM_ERROR_SOUND_INTERNAL;
-                       debug_msg("pa_simple_flush() failed with %s\n", pa_strerror(err));
+                       debug_msg("pa_simple_flush() failed with %s", pa_strerror(err));
                }
                break;
        default:
@@ -469,7 +469,7 @@ int mm_sound_pa_close(const int handle)
        pa_simple_free(phandle->s);
     phandle->s = NULL;
 
-    debug_msg("leave: handle[%d] stream_index[%d]\n", handle, phandle->stream_idx);
+    debug_msg("leave: handle[%d] stream_index[%d]", handle, phandle->stream_idx);
 
     mm_sound_handle_mgr.handles = g_list_remove(mm_sound_handle_mgr.handles, phandle);
     if(phandle != NULL) {
@@ -493,7 +493,7 @@ int mm_sound_pa_drain(const int handle)
         return MM_ERROR_SOUND_INTERNAL;
 
     if (0 > pa_simple_drain(phandle->s, &err)) {
-               debug_error("pa_simple_drain() failed with %s\n", pa_strerror(err));
+               debug_error("pa_simple_drain() failed with %s", pa_strerror(err));
                err = MM_ERROR_SOUND_INTERNAL;
        }
 
index 3f1e120..48be586 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-sound
 Summary:    MMSound Package contains client lib and sound_server binary
-Version:    0.11.13
+Version:    0.11.14
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index 43b474e..4739960 100644 (file)
@@ -24,6 +24,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <pthread.h>
+#include <unistd.h>
 
 #include <mm_error.h>
 #include <mm_types.h>
@@ -78,8 +79,8 @@ static pthread_mutex_t g_slot_mutex;
 GSourceFunc g_shutdown_cb;
 guint g_timer_id = 0;
 
-#define SLOT_LOCK() do { pthread_mutex_lock(&g_slot_mutex); /* debug_msg("After Slot_mutex LOCK\n"); */ } while (0)
-#define SLOT_UNLOCK() do { pthread_mutex_unlock(&g_slot_mutex); /* debug_msg("After Slot_mutex UNLOCK\n"); */ } while (0)
+#define SLOT_LOCK() do { pthread_mutex_lock(&g_slot_mutex); /* debug_msg("After Slot_mutex LOCK"); */ } while (0)
+#define SLOT_UNLOCK() do { pthread_mutex_unlock(&g_slot_mutex); /* debug_msg("After Slot_mutex UNLOCK"); */ } while (0)
 
 static int _MMSoundMgrCodecRegisterInterface(MMSoundPluginType *plugin);
 static int _MMSoundMgrCodecStopCallback(int param);
@@ -148,11 +149,11 @@ static void _sound_codec_device_connected_callback(MMSoundDevice_t device, bool
                                debug_warning("sound device unplugged");
                                result = MMSoundMgrCodecStop(slotid);
                                if (result != MM_ERROR_NONE)
-                                       debug_error("MMSoundMgrCodecStop error %d\n", result);
+                                       debug_error("MMSoundMgrCodecStop error %d", result);
 
                                result = mm_sound_remove_device_connected_callback(g_slots[slotid].subs_id);
                                if (result != MM_ERROR_NONE)
-                                       debug_error("mm_sound_remove_device_connected_callback error %d\n", result);
+                                       debug_error("mm_sound_remove_device_connected_callback error %d", result);
                        }
                        break;
 
@@ -252,7 +253,7 @@ int MMSoundMgrCodecInit(const char *targetdir, GSourceFunc _shutdown_cb)
        memset(g_slots, 0, sizeof(g_slots));
 
        if (pthread_mutex_init(&g_slot_mutex, NULL)) {
-               debug_error("pthread_mutex_init failed\n");
+               debug_error("pthread_mutex_init failed");
                return MM_ERROR_SOUND_INTERNAL;
        }
 
@@ -260,7 +261,7 @@ int MMSoundMgrCodecInit(const char *targetdir, GSourceFunc _shutdown_cb)
                _mm_sound_mgr_codec_slot_clear(slotid);
 
        if (g_codec_plugins) {
-               debug_warning("Please Check Init twice\n");
+               debug_warning("Please Check Init twice");
                MMSoundPluginRelease(g_codec_plugins);
        }
 
@@ -332,19 +333,19 @@ int MMSoundMgrCodecPlay(int *slotid, const mmsound_mgr_codec_param_t *param)
 
        err = g_plugins[plugin_id].Parse(param->pfilename, &info);
        if (err != MM_ERROR_NONE) {
-               debug_error("Could not parse file [%s] by plugin[%d]\n", param->pfilename, plugin_id);
+               debug_error("Could not parse file [%s] by plugin[%d]", param->pfilename, plugin_id);
                goto cleanup;
        }
 
-       debug_msg("DTMF[%d] Repeat[%d] Volume[%f] plugin_codec[%d]\n", param->tone, param->repeat_count, param->volume, plugin_id);
+       debug_msg("DTMF[%d] Repeat[%d] Volume[%f] plugin_codec[%d]", param->tone, param->repeat_count, param->volume, plugin_id);
 
 #ifdef DEBUG_DETAIL
-       debug_msg("Get New handle\n");
+       debug_msg("Get New handle");
 #endif
 
        err = _mm_sound_mgr_codec_slot_get_empty(slotid);
        if (err != MM_ERROR_NONE || *slotid < 0) {
-               debug_error("Empty g_slot is not found\n");
+               debug_error("Empty g_slot is not found");
                goto cleanup;
        }
 
@@ -433,12 +434,12 @@ int MMSoundMgrCodecPlay(int *slotid, const mmsound_mgr_codec_param_t *param)
        g_slots[*slotid].pid = (int)param->param;
 
 
-       debug_msg("Using Slotid : [%d] Slot Status : [%d]\n", *slotid, g_slots[*slotid].status);
+       debug_msg("Using Slotid : [%d] Slot Status : [%d]", *slotid, g_slots[*slotid].status);
 
        err = g_plugins[g_slots[*slotid].pluginid].Create(&codec_param, &info, &(g_slots[*slotid].plughandle));
-       debug_msg("Created audio handle : [%d]\n", g_slots[*slotid].plughandle);
+       debug_msg("Created audio handle : [%d]", g_slots[*slotid].plughandle);
        if (err != MM_ERROR_NONE) {
-               debug_error("Plugin create fail : 0x%08X\n", err);
+               debug_error("Plugin create fail : 0x%08X", err);
                g_slots[*slotid].status = STATUS_IDLE;
                SLOT_UNLOCK();
 #ifdef FOCUS_INTEGRATION
@@ -451,7 +452,7 @@ int MMSoundMgrCodecPlay(int *slotid, const mmsound_mgr_codec_param_t *param)
 
        err = g_plugins[g_slots[*slotid].pluginid].Play(g_slots[*slotid].plughandle);
        if (err != MM_ERROR_NONE) {
-               debug_error("Fail to play : 0x%08X\n", err);
+               debug_error("Fail to play : 0x%08X", err);
                g_plugins[g_slots[*slotid].pluginid].Destroy(g_slots[*slotid].plughandle);
 #ifdef FOCUS_INTEGRATION
                if (param->focus_handle) {
@@ -520,13 +521,13 @@ int MMSoundMgrCodecPlayWithStreamInfo(int *slotid, const mmsound_mgr_codec_param
 
        err = g_plugins[plugin_id].Parse(param->pfilename, &info);
        if (err != MM_ERROR_NONE) {
-               debug_error("Could not parse file [%s] by plugin[%d]\n", param->pfilename, plugin_id);
+               debug_error("Could not parse file [%s] by plugin[%d]", param->pfilename, plugin_id);
                goto cleanup;
        }
 
        err = _mm_sound_mgr_codec_slot_get_empty(slotid);
        if (err != MM_ERROR_NONE || *slotid < 0) {
-               debug_error("Empty g_slot is not found\n");
+               debug_error("Empty g_slot is not found");
                goto cleanup;
        }
 
@@ -545,12 +546,12 @@ int MMSoundMgrCodecPlayWithStreamInfo(int *slotid, const mmsound_mgr_codec_param
        g_slots[*slotid].pluginid = plugin_id;
        g_slots[*slotid].param    = param->param;               /* This arg is used callback data */
 
-       debug_msg("Using Slotid : [%d] Slot Status : [%d]\n", *slotid, g_slots[*slotid].status);
+       debug_msg("Using Slotid : [%d] Slot Status : [%d]", *slotid, g_slots[*slotid].status);
 
        err = g_plugins[g_slots[*slotid].pluginid].Create(&codec_param, &info, &(g_slots[*slotid].plughandle));
-       debug_msg("Created audio handle : [%p]\n", g_slots[*slotid].plughandle);
+       debug_msg("Created audio handle : [%p]", g_slots[*slotid].plughandle);
        if (err != MM_ERROR_NONE) {
-               debug_error("Plugin create fail : 0x%08X\n", err);
+               debug_error("Plugin create fail : 0x%08X", err);
                g_slots[*slotid].status = STATUS_IDLE;
                SLOT_UNLOCK();
                goto cleanup;
@@ -558,7 +559,7 @@ int MMSoundMgrCodecPlayWithStreamInfo(int *slotid, const mmsound_mgr_codec_param
 
        err = g_plugins[g_slots[*slotid].pluginid].Play(g_slots[*slotid].plughandle);
        if (err != MM_ERROR_NONE) {
-               debug_error("Fail to play : 0x%08X\n", err);
+               debug_error("Fail to play : 0x%08X", err);
                g_plugins[g_slots[*slotid].pluginid].Destroy(g_slots[*slotid].plughandle);
        }
 
@@ -598,22 +599,22 @@ int MMSoundMgrCodecPlayDtmf(int *slotid, const mmsound_mgr_codec_param_t *param)
        }
 
        /*The count num means codec type DTMF */
-       debug_msg("DTMF[%d] Repeat[%d] Volume[%f] plugin_codec[%d]\n", param->tone, param->repeat_count, param->volume, plugin_id);
+       debug_msg("DTMF[%d] Repeat[%d] Volume[%f] plugin_codec[%d]", param->tone, param->repeat_count, param->volume, plugin_id);
 
        if (g_plugins[plugin_id].GetSupportTypes == NULL) {     /* Codec not found */
-               debug_error("unsupported file type %d\n", plugin_id);
-               printf("unsupported file type %d\n", plugin_id);
+               debug_error("unsupported file type %d", plugin_id);
+               printf("unsupported file type %d", plugin_id);
                err = MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE;
                goto cleanup;
        }
 
 #ifdef DEBUG_DETAIL
-       debug_msg("Get New handle\n");
+       debug_msg("Get New handle");
 #endif
 
        err = _mm_sound_mgr_codec_slot_get_empty(slotid);
        if (err != MM_ERROR_NONE || *slotid < 0) {
-               debug_error("Empty g_slot is not found\n");
+               debug_error("Empty g_slot is not found");
                goto cleanup;
        }
 
@@ -700,13 +701,13 @@ int MMSoundMgrCodecPlayDtmf(int *slotid, const mmsound_mgr_codec_param_t *param)
        g_slots[*slotid].pid = (int)param->param;
 
 #ifdef DEBUG_DETAIL
-       debug_msg("Using Slotid : [%d] Slot Status : [%d]\n", *slotid, g_slots[*slotid].status);
+       debug_msg("Using Slotid : [%d] Slot Status : [%d]", *slotid, g_slots[*slotid].status);
 #endif
 
        err = g_plugins[g_slots[*slotid].pluginid].Create(&codec_param, &info, &(g_slots[*slotid].plughandle));
-       debug_msg("Created audio handle : [%d]\n", g_slots[*slotid].plughandle);
+       debug_msg("Created audio handle : [%d]", g_slots[*slotid].plughandle);
        if (err != MM_ERROR_NONE) {
-               debug_error("Plugin create fail : 0x%08X\n", err);
+               debug_error("Plugin create fail : 0x%08X", err);
                g_slots[*slotid].status = STATUS_IDLE;
                SLOT_UNLOCK();
 #ifdef FOCUS_INTEGRATION
@@ -717,7 +718,7 @@ int MMSoundMgrCodecPlayDtmf(int *slotid, const mmsound_mgr_codec_param_t *param)
 
        err = g_plugins[g_slots[*slotid].pluginid].Play(g_slots[*slotid].plughandle);
        if (err != MM_ERROR_NONE) {
-               debug_error("Fail to play : 0x%08X\n", err);
+               debug_error("Fail to play : 0x%08X", err);
                g_plugins[g_slots[*slotid].pluginid].Destroy(g_slots[*slotid].plughandle);
 #ifdef FOCUS_INTEGRATION
                need_focus_unregister = 1;
@@ -725,7 +726,7 @@ int MMSoundMgrCodecPlayDtmf(int *slotid, const mmsound_mgr_codec_param_t *param)
        }
 
        SLOT_UNLOCK();
-       debug_msg("Using Slotid : [%d] Slot Status : [%d]\n", *slotid, g_slots[*slotid].status);
+       debug_msg("Using Slotid : [%d] Slot Status : [%d]", *slotid, g_slots[*slotid].status);
 
 cleanup:
 #ifdef FOCUS_INTEGRATION
@@ -780,23 +781,23 @@ int MMSoundMgrCodecPlayDtmfWithStreamInfo(int *slotid, const mmsound_mgr_codec_p
        }
 
        /*The count num means codec type DTMF */
-       debug_msg("DTMF[%d] Repeat[%d] Volume[%f] plugin_codec[%d]\n", param->tone, param->repeat_count, param->volume, plugin_id);
+       debug_msg("DTMF[%d] Repeat[%d] Volume[%f] plugin_codec[%d]", param->tone, param->repeat_count, param->volume, plugin_id);
 
        if (g_plugins[plugin_id].GetSupportTypes == NULL) { /* Codec not found */
-               debug_error("unsupported file type %d\n", plugin_id);
-               printf("unsupported file type %d\n", plugin_id);
+               debug_error("unsupported file type %d", plugin_id);
+               printf("unsupported file type %d", plugin_id);
                err = MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE;
                goto cleanup;
        }
 
 #ifdef DEBUG_DETAIL
-       debug_msg("Get New handle\n");
+       debug_msg("Get New handle");
 #endif
 
        err = _mm_sound_mgr_codec_slot_get_empty(slotid);
        if (err != MM_ERROR_NONE || *slotid < 0)
        {
-               debug_error("Empty g_slot is not found\n");
+               debug_error("Empty g_slot is not found");
                goto cleanup;
        }
 
@@ -816,13 +817,13 @@ int MMSoundMgrCodecPlayDtmfWithStreamInfo(int *slotid, const mmsound_mgr_codec_p
        g_slots[*slotid].enable_session = param->enable_session;
 
 #ifdef DEBUG_DETAIL
-       debug_msg("Using Slotid : [%d] Slot Status : [%d]\n", *slotid, g_slots[*slotid].status);
+       debug_msg("Using Slotid : [%d] Slot Status : [%d]", *slotid, g_slots[*slotid].status);
 #endif
 
        err = g_plugins[g_slots[*slotid].pluginid].Create(&codec_param, &info, &(g_slots[*slotid].plughandle));
-       debug_msg("Created audio handle : [%d]\n", g_slots[*slotid].plughandle);
+       debug_msg("Created audio handle : [%d]", g_slots[*slotid].plughandle);
        if (err != MM_ERROR_NONE) {
-               debug_error("Plugin create fail : 0x%08X\n", err);
+               debug_error("Plugin create fail : 0x%08X", err);
                g_slots[*slotid].status = STATUS_IDLE;
                SLOT_UNLOCK();
                goto cleanup;
@@ -830,12 +831,12 @@ int MMSoundMgrCodecPlayDtmfWithStreamInfo(int *slotid, const mmsound_mgr_codec_p
 
        err = g_plugins[g_slots[*slotid].pluginid].Play(g_slots[*slotid].plughandle);
        if (err != MM_ERROR_NONE) {
-               debug_error("Fail to play : 0x%08X\n", err);
+               debug_error("Fail to play : 0x%08X", err);
                g_plugins[g_slots[*slotid].pluginid].Destroy(g_slots[*slotid].plughandle);
        }
 
        SLOT_UNLOCK();
-       debug_msg("Using Slotid : [%d] Slot Status : [%d]\n", *slotid, g_slots[*slotid].status);
+       debug_msg("Using Slotid : [%d] Slot Status : [%d]", *slotid, g_slots[*slotid].status);
 
 cleanup:
 #ifdef DEBUG_DETAIL
@@ -850,7 +851,7 @@ int MMSoundMgrCodecStop(const int slotid)
 {
        int err = MM_ERROR_NONE;
 
-       debug_enter("(Slotid : [%d])\n", slotid);
+       debug_enter("(Slotid : [%d])", slotid);
 
        if (slotid < 0 || MANAGER_HANDLE_MAX <= slotid) {
                return MM_ERROR_INVALID_ARGUMENT;
@@ -859,23 +860,23 @@ int MMSoundMgrCodecStop(const int slotid)
        SLOT_LOCK();
        if (g_slots[slotid].status == STATUS_IDLE) {
                err = MM_ERROR_SOUND_INVALID_STATE;
-               debug_warning("The playing slots is not found, Slot ID : [%d]\n", slotid);
+               debug_warning("The playing slots is not found, Slot ID : [%d]", slotid);
                goto cleanup;
        }
 #ifdef DEBUG_DETAIL
-       debug_msg("Found slot, Slotid [%d] State [%d]\n", slotid, g_slots[slotid].status);
+       debug_msg("Found slot, Slotid [%d] State [%d]", slotid, g_slots[slotid].status);
 #endif
 
        g_slots[slotid].stop_by_user = true;
 
        err = g_plugins[g_slots[slotid].pluginid].Stop(g_slots[slotid].plughandle);
        if (err != MM_ERROR_NONE) {
-               debug_error("Fail to STOP Code : 0x%08X\n", err);
+               debug_error("Fail to STOP Code : 0x%08X", err);
        }
 
 cleanup:
        SLOT_UNLOCK();
-       debug_leave("(err : 0x%08X)\n", err);
+       debug_leave("(err : 0x%08X)", err);
 
        return err;
 }
@@ -885,7 +886,7 @@ int MMSoundMgrCodecClearFocus(int pid)
        int err = MM_ERROR_NONE;
        int slotid;
 
-       debug_enter("(pid : [%d])\n", pid);
+       debug_enter("(pid : [%d])", pid);
 
        SLOT_LOCK();
 
@@ -930,7 +931,7 @@ int MMSoundMgrCodecClearFocus(int pid)
 
 cleanup:
        SLOT_UNLOCK();
-       debug_leave("(err : 0x%08X)\n", err);
+       debug_leave("(err : 0x%08X)", err);
 
        return err;
 }
@@ -945,7 +946,7 @@ static int _MMSoundMgrCodecStopCallback(int param)
                return MM_ERROR_INVALID_ARGUMENT;
        }
 
-       debug_enter("(Slot : %d) stop-by-user : %d\n", param, g_slots[param].stop_by_user);
+       debug_enter("(Slot : %d) stop-by-user : %d", param, g_slots[param].stop_by_user);
 
        if (g_slots[param].stop_by_user == false) {
                SLOT_LOCK();
@@ -993,12 +994,12 @@ static int _MMSoundMgrCodecStopCallback(int param)
 #endif
 
        __mm_sound_mgr_ipc_notify_play_file_end(param);
-       debug_msg("Client callback msg_type (instance) : [%d]\n", (int)g_slots[param].param);
+       debug_msg("Client callback msg_type (instance) : [%d]", (int)g_slots[param].param);
 
-       debug_msg("Handle allocated handle : [0x%08X]\n", g_slots[param].plughandle);
+       debug_msg("Handle allocated handle : [0x%08X]", g_slots[param].plughandle);
        err = g_plugins[g_slots[param].pluginid].Destroy(g_slots[param].plughandle);
        if (err < 0)
-               debug_critical("[CODEC MGR] Fail to destroy slot number : [%d] err [0x%x]\n", param, err);
+               debug_critical("[CODEC MGR] Fail to destroy slot number : [%d] err [0x%x]", param, err);
 
        _mm_sound_mgr_codec_slot_clear(param);
        if (_mm_sound_mgr_codec_slot_is_empty())
@@ -1033,20 +1034,20 @@ static int _MMSoundMgrCodecRegisterInterface(MMSoundPluginType *plugin)
        }
 
        if (plugin_id == MM_SOUND_SUPPORTED_CODEC_NUM) {
-               debug_critical("The plugin support type is not valid\n");
+               debug_critical("The plugin support type is not valid");
                return MM_ERROR_COMMON_OUT_OF_RANGE;
        }
 
        err = MMSoundPluginGetSymbol(plugin, CODEC_GET_INTERFACE_FUNC_NAME, &getinterface);
        if (err != MM_ERROR_NONE) {
-               debug_error("Get Symbol CODEC_GET_INTERFACE_FUNC_NAME is fail : %x\n", err);
+               debug_error("Get Symbol CODEC_GET_INTERFACE_FUNC_NAME is fail : %x", err);
                goto cleanup;
        }
-       debug_msg("interface[%p] empty_slot[%d]\n", getinterface, plugin_id);
+       debug_msg("interface[%p] empty_slot[%d]", getinterface, plugin_id);
 
        err = MMSoundPlugCodecCastGetInterface(getinterface)(&g_plugins[plugin_id]);
        if (err != MM_ERROR_NONE) {
-               debug_error("Get interface fail : %x\n", err);
+               debug_error("Get interface fail : %x", err);
 
 cleanup:
                /* If error occur, clean interface */
index cafc558..91f5862 100644 (file)
@@ -53,7 +53,7 @@ int _MMSoundMgrIpcPlayFile(char* filename,int tone, int repeat, int volume, int
 
        ret = MMSoundMgrCodecPlay(codechandle, &param);
        if (ret != MM_ERROR_NONE) {
-               debug_error("Will be closed a sources, codechandle : 0x%08X\n", *codechandle);
+               debug_error("Will be closed a sources, codechandle : 0x%08X", *codechandle);
                return ret;
        }
 
@@ -67,7 +67,7 @@ int _MMSoundMgrIpcStop(int handle)
        ret = MMSoundMgrCodecStop(handle);
 
        if (ret != MM_ERROR_NONE) {
-               debug_error("Fail to stop sound\n");
+               debug_error("Fail to stop sound");
                return ret;
        }
 
@@ -82,7 +82,7 @@ int _MMSoundMgrIpcClearFocus(int pid)
        ret = MMSoundMgrCodecClearFocus(pid);
 
        if (ret != MM_ERROR_NONE) {
-               debug_error("Fail to clear focus\n");
+               debug_error("Fail to clear focus");
                return ret;
        }
 
@@ -106,7 +106,7 @@ int _MMSoundMgrIpcPlayFileWithStreamInfo(char *filename, int repeat, int volume,
 
        ret = MMSoundMgrCodecPlayWithStreamInfo(codechandle, &param);
        if (ret != MM_ERROR_NONE) {
-               debug_error("Will be closed a sources, codechandle : 0x%08X\n", *codechandle);
+               debug_error("Will be closed a sources, codechandle : 0x%08X", *codechandle);
                return ret;
        }
 
@@ -133,17 +133,17 @@ int _MMSoundMgrIpcPlayDTMF(int tone, int repeat, int volume, int volume_config,
        param.stream_index = stream_index;
        MMSOUND_STRNCPY(param.stream_type, stream_type, MAX_STREAM_TYPE_LEN);
 
-       debug_msg("DTMF %d\n", param.tone);
-       debug_msg("Loop %d\n", param.repeat_count);
-       debug_msg("Volume %d\n",param.volume);
-       debug_msg("VolumeConfig %x\n",param.volume_config);
-       debug_msg("session %d\n", param.session_type);
-       debug_msg("session options %x\n", param.session_options);
-       debug_msg("enable_session %d\n", param.enable_session);
+       debug_msg("DTMF %d", param.tone);
+       debug_msg("Loop %d", param.repeat_count);
+       debug_msg("Volume %d",param.volume);
+       debug_msg("VolumeConfig %x",param.volume_config);
+       debug_msg("session %d", param.session_type);
+       debug_msg("session options %x", param.session_options);
+       debug_msg("enable_session %d", param.enable_session);
 
        ret = MMSoundMgrCodecPlayDtmf(codechandle, &param);
        if ( ret != MM_ERROR_NONE) {
-               debug_error("Will be closed a sources, codec handle : [0x%d]\n", *codechandle);
+               debug_error("Will be closed a sources, codec handle : [0x%d]", *codechandle);
                return ret;
        }
 
@@ -163,16 +163,16 @@ int _MMSoundMgrIpcPlayDTMFWithStreamInfo(int tone, int repeat, int volume, int c
        param.stream_index = stream_index;
        MMSOUND_STRNCPY(param.stream_type, stream_type, MAX_STREAM_TYPE_LEN);
 
-       debug_msg("DTMF %d\n", param.tone);
-       debug_msg("Loop %d\n", param.repeat_count);
-       debug_msg("Volume %d\n",param.volume);
-       debug_msg("stream type %s\n", param.stream_type);
-       debug_msg("stream index %d\n", param.stream_index);
+       debug_msg("DTMF %d", param.tone);
+       debug_msg("Loop %d", param.repeat_count);
+       debug_msg("Volume %d",param.volume);
+       debug_msg("stream type %s", param.stream_type);
+       debug_msg("stream index %d", param.stream_index);
 
 
        ret = MMSoundMgrCodecPlayDtmfWithStreamInfo(codechandle, &param);
        if ( ret != MM_ERROR_NONE) {
-               debug_error("Will be closed a sources, codec handle : [0x%d]\n", *codechandle);
+               debug_error("Will be closed a sources, codec handle : [0x%d]", *codechandle);
                return ret;
        }
 
index 0ac7a4c..bd37bc0 100644 (file)
@@ -627,7 +627,7 @@ int MMSoundMgrDbusInit(void)
        }
 
        if (_mm_sound_mgr_dbus_own_name(G_BUS_TYPE_SYSTEM, BUS_NAME_SOUND_SERVER, &sound_server_owner_id) != MM_ERROR_NONE) {
-               debug_error("dbus own name for sound-server error\n");
+               debug_error("dbus own name for sound-server error");
                return MM_ERROR_SOUND_INTERNAL;
        }
 
@@ -638,12 +638,12 @@ int MMSoundMgrDbusInit(void)
 
 void MMSoundMgrDbusFini(void)
 {
-       debug_enter("\n");
+       debug_enter();
 
        _mm_sound_mgr_dbus_unown_name(sound_server_owner_id);
        g_dbus_node_info_unref(introspection_data);
 
-       debug_leave("\n");
+       debug_leave();
 }
 
 
index 1f50045..2e7f082 100644 (file)
@@ -46,14 +46,14 @@ int MMSoundPluginScan(const char *plugindir, const int type, MMSoundPluginType *
 
     debug_fenter ();
 
-    debug_msg(" Plugin dir :: %s \n", plugindir);
+    debug_msg(" Plugin dir :: %s ", plugindir);
     err = _MMSoundPluginGetList(plugindir, &list);
     if (err != MM_ERROR_NONE)
         return err;
 
     while((item = list[index++]) != NULL) {
         if(MMSoundPluginOpen(item, &plugin[plugin_index]) != MM_ERROR_NONE) {
-            debug_warning("%s is not sound plugin\n", item);
+            debug_warning("%s is not sound plugin", item);
             continue;
         }
         if (plugin[plugin_index].type != type)
@@ -66,7 +66,7 @@ int MMSoundPluginScan(const char *plugindir, const int type, MMSoundPluginType *
 
     *pluginlist = (MMSoundPluginType*) malloc(sizeof(MMSoundPluginType) * (plugin_index+1));
     if ((*pluginlist) == NULL) {
-        debug_critical("Memory allocation fail\n");
+        debug_critical("Memory allocation fail");
         /* Occur segmentation fault */
         *pluginlist = (void*)1;
     }
@@ -109,19 +109,19 @@ int MMSoundPluginOpen(char *file, MMSoundPluginType *plugin)
     pdll = dlopen(file, RTLD_NOW|RTLD_GLOBAL);
 
     if (pdll == NULL) {
-        debug_error("%s\n", dlerror());
+        debug_error("%s", dlerror());
         return MM_ERROR_SOUND_INVALID_FILE;
     }
 
     func = (int (*)(void))dlsym(pdll, "MMSoundGetPluginType");
     if (func == NULL) {
         dlclose(pdll);
-        debug_error("Cannot find symbol : MMSoundGetPluginType\n");
+        debug_error("Cannot find symbol : MMSoundGetPluginType");
         return MM_ERROR_SOUND_INVALID_FILE;
     }
     t = func();
 
-    debug_msg("%s is %s\n", file,
+    debug_msg("%s is %s", file,
                 t == MM_SOUND_PLUGIN_TYPE_CODEC ? "CODEC":
                 t == MM_SOUND_PLUGIN_TYPE_RUN ? "RUN" : "Unknown");
     switch(t)
@@ -132,7 +132,7 @@ int MMSoundPluginOpen(char *file, MMSoundPluginType *plugin)
             plugin->module = pdll;
             break;
         default:
-            debug_error("Type is %d\n",t);
+            debug_error("Type is %d",t);
             dlclose(pdll);
             return MM_ERROR_SOUND_INVALID_FILE;
     }
@@ -184,7 +184,7 @@ static int _MMSoundPluginGetList(const char *plugdir ,char ***list)
        int ret = MM_ERROR_NONE;
 
        items = scandir(plugdir, &entry, NULL, alphasort);
-       debug_msg("Items %d\n", items);
+       debug_msg("Items %d", items);
 
        if (items == -1)
                return MM_ERROR_INVALID_ARGUMENT;
@@ -206,7 +206,7 @@ static int _MMSoundPluginGetList(const char *plugdir ,char ***list)
        }
        /* FIXME : need to handle error case */
        if (chdir(plugdir) != 0) {
-               debug_error("chdir error\n");
+               debug_error("chdir error");
                if (temp) {
                        free (temp);
                        temp = NULL;
@@ -217,7 +217,7 @@ static int _MMSoundPluginGetList(const char *plugdir ,char ***list)
 
        for(item_idx = items; item_idx--; ) {
                if(stat(entry[item_idx]->d_name, &finfo) < 0) {
-                       debug_error("Stat error\n");
+                       debug_error("Stat error");
                        if (temp) {
                                free(temp);
                                temp = NULL;
@@ -226,7 +226,7 @@ static int _MMSoundPluginGetList(const char *plugdir ,char ***list)
                        goto free_entry;
                }
 
-               debug_log("item %d is %s\n", item_idx, entry[item_idx]->d_name);
+               debug_log("item %d is %s", item_idx, entry[item_idx]->d_name);
 
                if (S_ISREG(finfo.st_mode)) {
                        temp[tn++] = __strcatdup(plugdir, "/", entry[item_idx]->d_name);
index a5e7a60..5489d79 100644 (file)
@@ -75,7 +75,7 @@ static void _mainloop_run()
 {
        g_mainloop = g_main_loop_new(NULL, TRUE);
        if (g_mainloop == NULL) {
-               debug_error("g_main_loop_new() failed\n");
+               debug_error("g_main_loop_new() failed");
                return;
        }
 
@@ -182,7 +182,7 @@ int main(int argc, char **argv)
        if (_get_option(argc, argv, &serveropt))
                return 1;
 
-       debug_warning("sound_server [%d] init \n", getpid());
+       debug_warning("sound_server [%d] init ", getpid());
 
        /* Daemon process create */
        if (!serveropt.testmode && serveropt.startserver) {
@@ -192,7 +192,7 @@ int main(int argc, char **argv)
        }
 
        /* Sound Server Starts!!!*/
-       debug_warning("sound_server [%d] start \n", getpid());
+       debug_warning("sound_server [%d] start ", getpid());
 
        signal(SIGPIPE, SIG_IGN); //ignore SIGPIPE
 
@@ -221,14 +221,14 @@ int main(int argc, char **argv)
                MMSoundMgrCodecInit(serveropt.plugdir, _shutdown_cb);
        }
 
-       debug_warning("sound_server [%d] initialization complete...now, start running!!\n", getpid());
+       debug_warning("sound_server [%d] initialization complete...now, start running!!", getpid());
 
        if (serveropt.startserver) {
                /* Start MainLoop */
                _mainloop_run();
        }
 
-       debug_warning("sound_server [%d] terminating \n", getpid());
+       debug_warning("sound_server [%d] terminating ", getpid());
 
        if (serveropt.startserver || serveropt.printlist) {
                MMSoundMgrCodecFini();
@@ -236,7 +236,7 @@ int main(int argc, char **argv)
                MMSoundMgrDbusFini();
        }
 
-       debug_warning("sound_server [%d] exit ----------------- END \n", getpid());
+       debug_warning("sound_server [%d] exit ----------------- END ", getpid());
 
        return 0;
 }
index 659fe1d..02e2e74 100644 (file)
@@ -41,7 +41,7 @@ typedef struct __THREAD_INFO
 
 static void __DummyWork(void *param)
 {
-       debug_msg("thread index = %d\n", (int)param);
+       debug_msg("thread index = %d", (int)param);
        sleep(1);
 }
 
@@ -50,36 +50,36 @@ static void __ThreadWork(gpointer data, gpointer user_data)
        THREAD_INFO *info = (THREAD_INFO *)data;
        if (info) {
                if (info->func) {
-                       debug_log("Calling [%p] with param [%p]\n", info->func, info->param);
+                       debug_log("Calling [%p] with param [%p]", info->func, info->param);
                        info->func(info->param);
                } else {
-                       debug_warning("No func to call....\n");
+                       debug_warning("No func to call....");
                }
 
                /* Info was allocated by MMSoundThreadPoolRun().
                        The actual content of info should be  freed whether inside func or outside (if handle) */
-               debug_log ("free [%p]\n", info);
+               debug_log ("free [%p]", info);
                free(info);
                info = NULL;
        } else {
-               debug_warning("No valid thread info...Nothing to do...\n");
+               debug_warning("No valid thread info...Nothing to do...");
        }
 }
 
 int MMSoundThreadPoolDump(int fulldump)
 {
        if (g_pool == NULL) {
-               debug_error("No thread pool initialized....\n");
+               debug_error("No thread pool initialized....");
                return MM_ERROR_SOUND_INTERNAL;
        }
 
        if (fulldump) {
-               debug_log("##### [ThreadPool] max threads=[%d], max unused=[%d], max idle time=[%d]\n",
+               debug_log("##### [ThreadPool] max threads=[%d], max unused=[%d], max idle time=[%d]",
                                g_thread_pool_get_max_threads (g_pool),
                                g_thread_pool_get_max_unused_threads(),
                                g_thread_pool_get_max_idle_time());
        }
-       debug_log("***** [ThreadPool] running=[%d], unused=[%d]\n",
+       debug_log("***** [ThreadPool] running=[%d], unused=[%d]",
                        g_thread_pool_get_num_threads (g_pool),
                        g_thread_pool_get_num_unused_threads());
 
@@ -96,22 +96,22 @@ int MMSoundThreadPoolInit()
        /* Create thread pool (non-exclude mode with infinite max threads) */
        g_pool = g_thread_pool_new(__ThreadWork, NULL, -1, FALSE, &error);
        if (g_pool == NULL && error != NULL) {
-               debug_error("thread pool created failed : %s\n", error->message);
+               debug_error("thread pool created failed : %s", error->message);
                g_error_free (error);
                return MM_ERROR_SOUND_INTERNAL;
        }
-       debug_msg ("thread pool created successfully\n");
+       debug_msg ("thread pool created successfully");
 
        MMSoundThreadPoolDump(TRUE);
 
        /* Thread pool setting : this will maintain at least 10 unused threads and this will be reused. */
        /* If no unused thread left, new thread will be created, but always maintain 10 unused thread */
-       debug_msg ("thread pool set max unused threads to %d\n", MAX_UNUSED_THREADS_IN_THREADPOOL);
+       debug_msg ("thread pool set max unused threads to %d", MAX_UNUSED_THREADS_IN_THREADPOOL);
        g_thread_pool_set_max_unused_threads(MAX_UNUSED_THREADS_IN_THREADPOOL);
 
        /* To reserve unused threads, let's start some threads for beginning
                his dummy thread will be remained unused as soon as it started */
-       debug_msg("run threads to reserve minimum thread\n");
+       debug_msg("run threads to reserve minimum thread");
        for (i = 0; i < MAX_UNUSED_THREADS_IN_THREADPOOL; i++) {
                MMSoundThreadPoolRun((void *)i, __DummyWork);
        }
@@ -130,7 +130,7 @@ int MMSoundThreadPoolRun(void *param, void (*func)(void*))
        debug_enter();
 
        if (g_pool == NULL) {
-               debug_error("No thread pool initialized....\n");
+               debug_error("No thread pool initialized....");
                return MM_ERROR_SOUND_INTERNAL;
        }
 
@@ -143,18 +143,18 @@ int MMSoundThreadPoolRun(void *param, void (*func)(void*))
        if (thread_info) {
                thread_info->func = func;
                thread_info->param = param;
-               debug_log("alloc thread_info = %p\n", thread_info);
+               debug_log("alloc thread_info = %p", thread_info);
 
                /* Add thread to queue of thread pool */
                g_thread_pool_push(g_pool, thread_info, &error);
                if (error) {
-                       debug_error("g_thread_pool_push failed : %s\n", error->message);
+                       debug_error("g_thread_pool_push failed : %s", error->message);
                        g_error_free(error);
                        free(thread_info);
                        return MM_ERROR_SOUND_INTERNAL;
                }
        } else {
-               debug_error("failed to alloc thread info\n");
+               debug_error("failed to alloc thread info");
                return MM_ERROR_SOUND_INTERNAL;
        }
 
@@ -176,7 +176,7 @@ int MMSoundThreadPoolFini(void)
        debug_enter();
 
        if (g_pool) {
-               debug_msg("thread pool will be free\n");
+               debug_msg("thread pool will be free");
                g_thread_pool_free(g_pool, TRUE, FALSE);
                g_pool = NULL;
        }
index dd427f5..66ce076 100644 (file)
@@ -750,9 +750,9 @@ static void _running_tone(void *param);
 
 int* MMSoundPlugCodecToneGetSupportTypes(void)
 {
-    debug_enter("\n");
+    debug_enter();
     static int suported[2] = {MM_SOUND_SUPPORTED_CODEC_DTMF, 0};
-    debug_leave("\n");
+    debug_leave();
     return suported;
 }
 
@@ -766,11 +766,11 @@ int MMSoundPlugCodecToneCreate(mmsound_codec_param_t *param, mmsound_codec_info_
        int result = MM_ERROR_NONE;
        int wait_count = 0;
 
-       debug_enter("\n");
+       debug_enter();
 
        toneInfo = (tone_info_t *)malloc(sizeof(tone_info_t));
        if (toneInfo == NULL) {
-               debug_error("memory allocation error\n");
+               debug_error("memory allocation error");
                return MM_ERROR_OUT_OF_MEMORY;
        }
 
@@ -788,16 +788,16 @@ int MMSoundPlugCodecToneCreate(mmsound_codec_param_t *param, mmsound_codec_info_
 
        toneInfo->handle = mm_sound_pa_open(HANDLE_MODE_OUTPUT, param->volume_config, &ss, NULL, &size, param->stream_type, param->stream_index);
        if (!toneInfo->handle) {
-               debug_error("Device Open Error 0x%x\n", result);
+               debug_error("Device Open Error 0x%x", result);
                goto Error;
        }
-       debug_log("Create audio_handle is %lu\n", toneInfo->handle);
+       debug_log("Create audio_handle is %lu", toneInfo->handle);
 
-       debug_msg("tone : %d\n", param->tone);
-       debug_msg("repeat : %d\n", param->repeat_count);
-       debug_msg("volume config : %x\n", param->volume_config);
-       debug_msg("callback : %p\n", param->stop_cb);
-       debug_msg("pid : %d\n", param->pid);
+       debug_msg("tone : %d", param->tone);
+       debug_msg("repeat : %d", param->repeat_count);
+       debug_msg("volume config : %x", param->volume_config);
+       debug_msg("callback : %p", param->stop_cb);
+       debug_msg("pid : %d", param->pid);
 
        toneInfo->number = param->tone;
        toneInfo->time = param->repeat_count;
@@ -808,7 +808,7 @@ int MMSoundPlugCodecToneCreate(mmsound_codec_param_t *param, mmsound_codec_info_
 
        result = g_thread_pool_func(toneInfo, _running_tone);
        if (result != 0) {
-               debug_error("pthread_create() fail in pcm thread\n");
+               debug_error("pthread_create() fail in pcm thread");
                result = MM_ERROR_SOUND_INTERNAL;
                goto Error;
        }
@@ -827,14 +827,14 @@ int MMSoundPlugCodecToneCreate(mmsound_codec_param_t *param, mmsound_codec_info_
                debug_msg("_running_tone thread is started");
        }
 
-       debug_leave("\n");
+       debug_leave();
        return MM_ERROR_NONE;
 
 Error:
        if(toneInfo) {
                if(toneInfo->handle) {
                        if(MM_ERROR_NONE != mm_sound_pa_close(toneInfo->handle))
-                               debug_error("mm_sound_pa_close() fail. handle(%lu)\n", toneInfo->handle);
+                               debug_error("mm_sound_pa_close() fail. handle(%lu)", toneInfo->handle);
                }
                free(toneInfo);
        }
@@ -848,17 +848,17 @@ int MMSoundPlugCodecToneDestroy(MMHandleType handle)
        tone_info_t *toneInfo = (tone_info_t*) handle;
        int err = MM_ERROR_NONE;
        if (!toneInfo) {
-               debug_critical("Confirm the hadle (is NULL)\n");
+               debug_critical("Confirm the hadle (is NULL)");
                return MM_ERROR_SOUND_INTERNAL;
        }
 
-       debug_enter("(handle %x)\n", handle);
+       debug_enter("(handle %x)", handle);
 
        pthread_mutex_destroy(&toneInfo->mutex);
        if (toneInfo)
                free (toneInfo);
 
-       debug_leave("\n");
+       debug_leave();
        return err;
 }
 
@@ -867,13 +867,13 @@ int MMSoundPlugCodecTonePlay(MMHandleType handle)
 {
        tone_info_t *toneInfo = (tone_info_t *) handle;
 
-       debug_enter("(handle %x)\n", handle);
+       debug_enter("(handle %x)", handle);
        pthread_mutex_lock(&toneInfo->mutex);
        toneInfo->state = STATE_BEGIN;
        pthread_mutex_unlock(&toneInfo->mutex);
-       debug_msg("sent start signal\n");
+       debug_msg("sent start signal");
 
-       debug_leave("\n");
+       debug_leave();
 
        return MM_ERROR_NONE;
 }
@@ -902,7 +902,7 @@ _create_tone(double *sample, TONE _TONE, double volume, int *toneSize, gboolean
        }
 
        if(sample == NULL) {
-               debug_error("Sample buffer is not allocated\n");
+               debug_error("Sample buffer is not allocated");
                return NULL;
        }
 
@@ -915,12 +915,12 @@ _create_tone(double *sample, TONE _TONE, double volume, int *toneSize, gboolean
        *toneSize = ((*toneSize+1)>>1)<<1;
        sample_size = (*toneSize) / (SAMPLE_SIZE / 8);
 
-       debug_log("%0.f, %0.f, %0.f _TONE.playing_time: %d toneSize: %d\n",
+       debug_log("%0.f, %0.f, %0.f _TONE.playing_time: %d toneSize: %d",
                        low_frequency, middle_frequency, high_frequency, _TONE.playingTime, *toneSize);
 
        buffer = g_malloc (*toneSize);
        if(buffer == NULL) {
-               debug_error("Buffer is not allocated\n");
+               debug_error("Buffer is not allocated");
                return NULL;
        } else {
                pbuf = (short*)buffer;
@@ -984,7 +984,7 @@ _mm_get_waveCnt_PlayingTime(int toneTime, TONE _TONE, int *waveCnt, int *waveRes
 {
        int ret = MM_ERROR_NONE;
        if(waveCnt == NULL || waveRestPlayTime == NULL) {
-               debug_error("waveCnt || waveRestPlayTime buffer is NULL\n");
+               debug_error("waveCnt || waveRestPlayTime buffer is NULL");
                return MM_ERROR_SOUND_INTERNAL;
        }
        /*Set  wave count and wave playing time*/
@@ -1003,7 +1003,7 @@ _mm_get_CurIndex(TONE _TONE, int *CurArrayPlayCnt, int *CurIndex)
 {
        int ret = MM_ERROR_NONE;
        if(CurArrayPlayCnt == NULL || CurIndex == NULL) {
-               debug_error("CurArrayPlayCnt || CurIndex buffer is NULL\n");
+               debug_error("CurArrayPlayCnt || CurIndex buffer is NULL");
                return MM_ERROR_SOUND_INTERNAL;
        }
 
@@ -1028,7 +1028,7 @@ static void _running_tone(void *param)
        char filename[100];
 
        if(param == NULL) {
-               debug_error("param Buffer is not allocated\n");
+               debug_error("param Buffer is not allocated");
                return;
        }
        tone_info_t *toneInfo = (tone_info_t*) param;
@@ -1045,7 +1045,7 @@ static void _running_tone(void *param)
        int CurArrayPlayCnt = 0;
        gboolean is_cycle_ended = FALSE;
 
-       debug_enter("\n");
+       debug_enter();
        pthread_mutex_lock(&toneInfo->mutex);
        toneInfo->thread_state = THREAD_STATE_START;
        debug_msg("set thread_state as  THREAD_STATE_START");
@@ -1054,23 +1054,23 @@ static void _running_tone(void *param)
        toneTime = toneInfo->time;
        if(toneTime != 0) {
                toneKey = toneInfo->number;
-               debug_msg ("toneKey number = %d\n", toneKey);
+               debug_msg ("toneKey number = %d", toneKey);
 
                /* Set pid check file */
                snprintf(filename, sizeof(filename), "/proc/%d/cmdline", toneInfo->pid);
 
-               debug_msg("Wait start signal\n");
+               debug_msg("Wait start signal");
                while(toneInfo->state == STATE_READY)
                        usleep(10);
-               debug_msg("Recv start signal\n");
+               debug_msg("Recv start signal");
                pthread_mutex_lock(&toneInfo->mutex);
 
                if ((toneInfo->state == STATE_STOP)||(toneInfo->thread_state == THREAD_STATE_STOP)) {
-                       debug_msg("state is stop. state(%d)  thread_state(%d) goto exit.\n", toneInfo->state, toneInfo->thread_state );
+                       debug_msg("state is stop. state(%d)  thread_state(%d) goto exit.", toneInfo->state, toneInfo->thread_state );
                        pthread_mutex_unlock(&toneInfo->mutex);
                        goto exit;
                } else {
-                       debug_msg("set state STATE_PLAY\n");
+                       debug_msg("set state STATE_PLAY");
                        toneInfo->state = STATE_PLAY;
                }
                pthread_mutex_unlock(&toneInfo->mutex);
@@ -1082,16 +1082,16 @@ static void _running_tone(void *param)
        while (toneInfo->thread_state == THREAD_STATE_START) {
                TONE _TONE = _mm_get_tone(toneKey, CurIndex); /*Pop one of Tone Set */
                if(_mm_get_waveCnt_PlayingTime(toneTime, _TONE, &numWave, &waveRestPlayTime) != MM_ERROR_NONE) {
-                       debug_error("_mm_get_waveCnt_PlayingTime return value error\n");
+                       debug_error("_mm_get_waveCnt_PlayingTime return value error");
                        goto exit;
                }
 
                if(_mm_get_CurIndex(_TONE, &CurArrayPlayCnt, &CurIndex) != MM_ERROR_NONE) {
-                       debug_error("_mm_get_CurIndex return value error\n");
+                       debug_error("_mm_get_CurIndex return value error");
                        goto exit;
                }
 
-               debug_log ("Predefined Tone[%d] Total Play time (ms) : %d, _TONE.playing_time: %d _numWave = %d low_frequency: %0.f, middle_frequency: %0.f, high_frequency: %0.f\n",
+               debug_log ("Predefined Tone[%d] Total Play time (ms) : %d, _TONE.playing_time: %d _numWave = %d low_frequency: %0.f, middle_frequency: %0.f, high_frequency: %0.f",
                        CurIndex, toneTime, _TONE.playingTime, numWave, _TONE.low_frequency, _TONE.middle_frequency, _TONE.high_frequency);
 
 
@@ -1123,35 +1123,35 @@ static void _running_tone(void *param)
 
                        ptoneBuf = _create_tone(&sample, _TONE, toneInfo->volume, &toneSize, is_cycle_ended);
                        if(ptoneBuf == NULL) {
-                               debug_error("Tone Buffer is not allocated\n");
+                               debug_error("Tone Buffer is not allocated");
                                goto exit;
                        }
-                       debug_log ("[TONE] Play.....%dth %dms\n", CurWaveIndex, playingTime);
+                       debug_log ("[TONE] Play.....%dth %dms", CurWaveIndex, playingTime);
                        mm_sound_pa_write(toneInfo->handle, ptoneBuf, ((toneSize * playingTime /duration + 1)>>1)<<1);
                        prePlayingTime += playingTime;
-                       debug_log ("previous_sum: %d\n", prePlayingTime);
+                       debug_log ("previous_sum: %d", prePlayingTime);
                        g_free (ptoneBuf);
                        ptoneBuf = NULL;
 
                        if(prePlayingTime == toneTime || toneInfo->state != STATE_PLAY) {
-                               debug_log ("Finished.....on Total Playing Time : %d _TONE.playing_time: %d\n", prePlayingTime, _TONE.playingTime);
+                               debug_log ("Finished.....on Total Playing Time : %d _TONE.playing_time: %d", prePlayingTime, _TONE.playingTime);
                                mm_sound_pa_drain(toneInfo->handle);
-                               debug_log ("Finished.....quit loop\n");
+                               debug_log ("Finished.....quit loop");
                                goto exit;
                        }
-                       debug_log ("[%d] CurIndex: %d previous_sum: %d\n", CurArrayPlayCnt, CurIndex, prePlayingTime);
+                       debug_log ("[%d] CurIndex: %d previous_sum: %d", CurArrayPlayCnt, CurIndex, prePlayingTime);
                }
        }
 
 exit :
        if(MM_ERROR_NONE != mm_sound_pa_close(toneInfo->handle))
-               debug_error("mm_sound_pa_close() fail. handle(%lu)\n", toneInfo->handle);
+               debug_error("mm_sound_pa_close() fail. handle(%lu)", toneInfo->handle);
 
 #if 0
        pthread_mutex_destroy(&g_control.syncker);
 #endif
 
-       debug_msg("Play end\n");
+       debug_msg("Play end");
        pthread_mutex_lock(&toneInfo->mutex);
        toneInfo->state = STATE_NONE;
        pthread_mutex_unlock(&toneInfo->mutex);
@@ -1159,7 +1159,7 @@ exit :
        if (toneInfo->stop_cb)
                toneInfo->stop_cb(toneInfo->cb_param);
 
-       debug_leave("\n");
+       debug_leave();
 }
 
 static
@@ -1167,24 +1167,24 @@ int MMSoundPlugCodecToneStop(MMHandleType handle)
 {
        tone_info_t *toneInfo = (tone_info_t*) handle;
 
-       debug_enter("(handle %x)\n", handle);
+       debug_enter("(handle %x)", handle);
        pthread_mutex_lock(&toneInfo->mutex);
        /*If stopped why stop again*/
        if (toneInfo->state == STATE_NONE || toneInfo->state == STATE_STOP) {
                pthread_mutex_unlock(&toneInfo->mutex);
-               debug_msg("state(%d) is already STOP or NONE. return\n", toneInfo->state);
+               debug_msg("state(%d) is already STOP or NONE. return", toneInfo->state);
                return MM_ERROR_NONE;
        }
        toneInfo->state = STATE_STOP;
        toneInfo->thread_state = THREAD_STATE_STOP;
        pthread_mutex_unlock(&toneInfo->mutex);
-       debug_msg("sent stop signal\n");
+       debug_msg("sent stop signal");
 
        while(toneInfo->state != STATE_NONE) {
                usleep(30000);
        }
 
-       debug_leave("\n");
+       debug_leave();
 
        return MM_ERROR_NONE;
 }
@@ -1192,9 +1192,9 @@ int MMSoundPlugCodecToneStop(MMHandleType handle)
 static
 int MMSoundPlugCodecToneSetThreadPool(int (*func)(void*, void (*)(void*)))
 {
-    debug_enter("(func : 0x%x)\n", func);
+    debug_enter("(func : 0x%x)", func);
     g_thread_pool_func = func;
-    debug_leave("\n");
+    debug_leave();
     return MM_ERROR_NONE;
 }
 
@@ -1216,15 +1216,15 @@ static int _MMSoundToneFini(void)
 EXPORT_API
 int MMSoundGetPluginType(void)
 {
-    debug_enter("\n");
-    debug_leave("\n");
+    debug_enter();
+    debug_leave();
     return MM_SOUND_PLUGIN_TYPE_CODEC;
 }
 
 EXPORT_API
 int MMSoundPlugCodecGetInterface(mmsound_codec_interface_t *intf)
 {
-    debug_enter("\n");
+    debug_enter();
 
     intf->GetSupportTypes   = MMSoundPlugCodecToneGetSupportTypes;
     intf->Create            = MMSoundPlugCodecToneCreate;
@@ -1233,7 +1233,7 @@ int MMSoundPlugCodecGetInterface(mmsound_codec_interface_t *intf)
     intf->Stop              = MMSoundPlugCodecToneStop;
     intf->SetThreadPool     = MMSoundPlugCodecToneSetThreadPool;
 
-    debug_leave("\n");
+    debug_leave();
 
     return MM_ERROR_NONE;
 }
index 2fddd97..1e14115 100755 (executable)
@@ -85,19 +85,19 @@ void mycallback(void *data, int id)
 {
        char *str = (char*)data;
        if(data != NULL)
-               debug_log("mycallback called (user data:%s ,id:%d)\n", str, id);
+               debug_log("mycallback called (user data:%s ,id:%d)", str, id);
        else
-               debug_log("mycallback called (no user data)\n");
+               debug_log("mycallback called (no user data)");
 }
 volatile char test_callback_done;
 void test_callback(void *data, int id)
 {
-       debug_log("test_callback is called\n");
+       debug_log("test_callback is called");
        test_callback_done = 1;
 }
 void mm_sound_test_cb1(int a, void *user_data)
 {
-       debug_log("dbus test user callback called: param(%d), userdata(%d)\n", a, (int)user_data);
+       debug_log("dbus test user callback called: param(%d), userdata(%d)", a, (int)user_data);
        g_print("my callback pid : %u  tid : %ld\n", getpid(), pthread_self());
 }
 void device_connected_cb (MMSoundDevice_t device_h, bool is_connected, void *user_data)
@@ -110,30 +110,30 @@ void device_connected_cb (MMSoundDevice_t device_h, bool is_connected, void *use
        int vendor_id = -1, product_id = -1;
        char *name = NULL;
 
-       debug_log("*** device_connected_cb is called, device_h[%p], is_connected[%d], user_data[%p]\n", device_h, is_connected, user_data);
+       debug_log("*** device_connected_cb is called, device_h[%p], is_connected[%d], user_data[%p]", device_h, is_connected, user_data);
        ret = mm_sound_get_device_type(device_h, &device_type);
        if (ret)
-               debug_error("failed to mm_sound_get_device_type()\n");
+               debug_error("failed to mm_sound_get_device_type()");
        ret = mm_sound_get_device_io_direction(device_h, &io_direction);
        if (ret)
-               debug_error("failed to mm_sound_get_device_io_direction()\n");
+               debug_error("failed to mm_sound_get_device_io_direction()");
        ret = mm_sound_get_device_state(device_h, &state);
        if (ret)
-               debug_error("failed to mm_sound_get_device_state()\n");
+               debug_error("failed to mm_sound_get_device_state()");
        ret = mm_sound_get_device_id(device_h, &id);
        if (ret)
-               debug_error("failed to mm_sound_get_device_id()\n");
+               debug_error("failed to mm_sound_get_device_id()");
        ret = mm_sound_get_device_name(device_h, &name);
        if (ret)
-               debug_error("failed to mm_sound_get_device_name()\n");
+               debug_error("failed to mm_sound_get_device_name()");
        ret = mm_sound_get_device_vendor_id(device_h, &vendor_id);
        if (ret)
-               debug_error("failed to mm_sound_get_device_vendor_id()\n");
+               debug_error("failed to mm_sound_get_device_vendor_id()");
        ret = mm_sound_get_device_product_id(device_h, &product_id);
        if (ret)
-               debug_error("failed to mm_sound_get_device_produt_id()\n");
+               debug_error("failed to mm_sound_get_device_produt_id()");
        debug_log("*** --- type[%d], id[%d], io_direction[%d], state[%d], name[%s], "
-                       "vendor-id(%04x) product-id(%04x)\n",
+                       "vendor-id(%04x) product-id(%04x)",
                        device_type, id, io_direction, state, name, vendor_id, product_id);
 }
 void device_state_changed_cb (MMSoundDevice_t device_h, mm_sound_device_state_e new_state, void *user_data)
@@ -146,30 +146,30 @@ void device_state_changed_cb (MMSoundDevice_t device_h, mm_sound_device_state_e
        char *name = NULL;
        int vendor_id = -1, product_id = -1;
 
-       debug_log("*** device_state_changed_cb is called, device_h[%p], state[%d], user_data[%p]\n", device_h, new_state, user_data);
+       debug_log("*** device_state_changed_cb is called, device_h[%p], state[%d], user_data[%p]", device_h, new_state, user_data);
        ret = mm_sound_get_device_type(device_h, &device_type);
        if (ret)
-               debug_error("failed to mm_sound_get_device_type()\n");
+               debug_error("failed to mm_sound_get_device_type()");
        ret = mm_sound_get_device_io_direction(device_h, &io_direction);
        if (ret)
-               debug_error("failed to mm_sound_get_device_io_direction()\n");
+               debug_error("failed to mm_sound_get_device_io_direction()");
        ret = mm_sound_get_device_state(device_h, &state);
        if (ret)
-               debug_error("failed to mm_sound_get_device_state()\n");
+               debug_error("failed to mm_sound_get_device_state()");
        ret = mm_sound_get_device_id(device_h, &id);
        if (ret)
-               debug_error("failed to mm_sound_get_device_id()\n");
+               debug_error("failed to mm_sound_get_device_id()");
        ret = mm_sound_get_device_name(device_h, &name);
        if (ret)
-               debug_error("failed to mm_sound_get_device_name()\n");
+               debug_error("failed to mm_sound_get_device_name()");
        ret = mm_sound_get_device_vendor_id(device_h, &vendor_id);
        if (ret)
-               debug_error("failed to mm_sound_get_device_vendor_id()\n");
+               debug_error("failed to mm_sound_get_device_vendor_id()");
        ret = mm_sound_get_device_product_id(device_h, &product_id);
        if (ret)
-               debug_error("failed to mm_sound_get_device_produt_id()\n");
+               debug_error("failed to mm_sound_get_device_produt_id()");
        debug_log("*** --- type[%d], id[%d], io_direction[%d], state[%d], name[%s], "
-                       "vendor-id(%04x) product-id(%04x)\n",
+                       "vendor-id(%04x) product-id(%04x)",
                        device_type, id, io_direction, state, name, vendor_id, product_id);
 }
 #ifdef USE_FOCUS
@@ -180,7 +180,7 @@ void focus_cb0(int index, mm_sound_focus_type_e type, mm_sound_focus_state_e sta
                _state = "RELEASED";
        else
                _state = "ACQUIRED";
-       debug_log("*** focus_cb0 is called, index[%d], focus_type[%d], state[%s], reason_for_change[%s], option[0x%x], ext_info[%s], user_data[%s]\n",
+       debug_log("*** focus_cb0 is called, index[%d], focus_type[%d], state[%s], reason_for_change[%s], option[0x%x], ext_info[%s], user_data[%s]",
                        index, type, _state, reason_for_change, option, ext_info, (char*)user_data);
 }
 void focus_cb1(int index, mm_sound_focus_type_e type, mm_sound_focus_state_e state, const char *reason_for_change, int option, const char *ext_info, void *user_data)
@@ -190,7 +190,7 @@ void focus_cb1(int index, mm_sound_focus_type_e type, mm_sound_focus_state_e sta
                _state = "RELEASED";
        else
                _state = "ACQUIRED";
-       debug_log("*** focus_cb1 is called, index[%d], focus_type[%d], state[%s], reason_for_change[%s], option[0x%x], ext_info[%s], user_data[%s]\n",
+       debug_log("*** focus_cb1 is called, index[%d], focus_type[%d], state[%s], reason_for_change[%s], option[0x%x], ext_info[%s], user_data[%s]",
                        index, type, _state, reason_for_change, option, ext_info, (char*)user_data);
 }
 void focus_watch_cb(int index, mm_sound_focus_type_e type, mm_sound_focus_state_e state, const char *reason_for_change, const char *ext_info, void *user_data)
@@ -200,7 +200,7 @@ void focus_watch_cb(int index, mm_sound_focus_type_e type, mm_sound_focus_state_
                _state = "RELEASED";
        else
                _state = "ACQUIRED";
-       debug_log("*** focus_watch_cb is called, index[%d], focus_type[%d], state[%s], reason_for_change[%s], ext_info[%s], user_data[%s]\n",
+       debug_log("*** focus_watch_cb is called, index[%d], focus_type[%d], state[%s], reason_for_change[%s], ext_info[%s], user_data[%s]",
                        index, type, _state, reason_for_change, ext_info, (char*)user_data);
 }
 #endif
@@ -391,37 +391,37 @@ static void interpret (char *cmd)
                        if(strncmp(cmd, "DS", 2) == 0) {
                                ret = mm_sound_subscribe_signal(MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, &g_subscribe_id1, __mm_sound_signal_cb1, NULL);
                                if(ret < 0)
-                                       debug_log("mm_sound_subscribe_signal() failed with 0x%x\n", ret);
+                                       debug_log("mm_sound_subscribe_signal() failed with 0x%x", ret);
                                else
-                                       debug_log("id: %u, callback:%p\n", g_subscribe_id1, __mm_sound_signal_cb1);
+                                       debug_log("id: %u, callback:%p", g_subscribe_id1, __mm_sound_signal_cb1);
                                ret = mm_sound_subscribe_signal(MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, &g_subscribe_id2, __mm_sound_signal_cb2, NULL);
                                if(ret < 0)
-                                       debug_log("mm_sound_subscribe_signal() failed with 0x%x\n", ret);
+                                       debug_log("mm_sound_subscribe_signal() failed with 0x%x", ret);
                                else
-                                       debug_log("id: %u, callback:%p\n", g_subscribe_id2, __mm_sound_signal_cb2);
+                                       debug_log("id: %u, callback:%p", g_subscribe_id2, __mm_sound_signal_cb2);
                        }
 
                        else if(strncmp(cmd, "DU", 2) == 0) {
                                mm_sound_unsubscribe_signal(g_subscribe_id1);
-                               debug_log("unsubscribe_signal for id[%d]\n", g_subscribe_id1);
+                               debug_log("unsubscribe_signal for id[%d]", g_subscribe_id1);
                                mm_sound_unsubscribe_signal(g_subscribe_id2);
-                               debug_log("unsubscribe_signal for id[%d]\n", g_subscribe_id2);
+                               debug_log("unsubscribe_signal for id[%d]", g_subscribe_id2);
                        }
 
                        else if(strncmp(cmd, "SS", 2) == 0) {
                                int value = 0;
                                ret = mm_sound_send_signal(MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, 1);
                                if(ret < 0)
-                                       debug_log("mm_sound_send_signal() failed with 0x%x\n", ret);
+                                       debug_log("mm_sound_send_signal() failed with 0x%x", ret);
                                else
-                                       debug_log("mm_sound_send_signal for signal[%d], value[%d] is success\n", MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, 1);
+                                       debug_log("mm_sound_send_signal for signal[%d], value[%d] is success", MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, 1);
                                mm_sound_get_signal_value (MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, &value);
                                g_print (" -- get value of RELEASE_INTERNAL_FOCUS : %d\n", value);
                                ret = mm_sound_send_signal(MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, 0);
                                if(ret < 0)
-                                       debug_log("mm_sound_send_signal() failed with 0x%x\n", ret);
+                                       debug_log("mm_sound_send_signal() failed with 0x%x", ret);
                                else
-                                       debug_log("mm_sound_send_signal for signal[%d], value[%d] is success\n", MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, 0);
+                                       debug_log("mm_sound_send_signal for signal[%d], value[%d] is success", MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, 0);
                                mm_sound_get_signal_value (MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, &value);
                                g_print (" -- get value of RELEASE_INTERNAL_FOCUS : %d\n", value);
                        }
@@ -430,9 +430,9 @@ static void interpret (char *cmd)
                                int id = 0;
                                ret = mm_sound_focus_get_id(&id);
                                if(ret < 0)
-                                       debug_log("mm_sound_focus_get_id() failed with 0x%x\n", ret);
+                                       debug_log("mm_sound_focus_get_id() failed with 0x%x", ret);
                                else
-                                       debug_log("id : %d\n", id);
+                                       debug_log("id : %d", id);
                        }
 
                        else if(strncmp(cmd, "SF", 2) == 0) {
@@ -727,7 +727,7 @@ static void interpret (char *cmd)
                        {
                                ret = mm_sound_play_keysound(KEYTONE_FILE, 0);
                                if(ret < 0)
-                                       debug_log("keysound play failed with 0x%x\n", ret);
+                                       debug_log("keysound play failed with 0x%x", ret);
                        }
                        else if (strcmp(cmd, "dbus-m") == 0) {
                            int ret = 0;
@@ -767,7 +767,7 @@ static void interpret (char *cmd)
                                unsigned int value = 100;
                                ret = mm_sound_volume_get_value(g_volume_type, &value);
                                if(ret < 0) {
-                                       debug_log("mm_sound_volume_get_value 0x%x\n", ret);
+                                       debug_log("mm_sound_volume_get_value 0x%x", ret);
                                }
                                else{
                                        g_print("*** MEDIA VOLUME : %u ***\n", value);
@@ -779,7 +779,7 @@ static void interpret (char *cmd)
                                unsigned int value = 100;
                                ret = mm_sound_volume_get_value(g_volume_type, &value);
                                if(ret < 0) {
-                                       debug_log("mm_sound_volume_get_value 0x%x\n", ret);
+                                       debug_log("mm_sound_volume_get_value 0x%x", ret);
                                }
                                else {
                                        if(value != 0) {
@@ -788,7 +788,7 @@ static void interpret (char *cmd)
 
                                        ret = mm_sound_volume_set_value(g_volume_type, value);
                                        if(ret < 0) {
-                                               debug_log("mm_sound_volume_set_value 0x%x\n", ret);
+                                               debug_log("mm_sound_volume_set_value 0x%x", ret);
                                        }
                                }
                        }
@@ -797,7 +797,7 @@ static void interpret (char *cmd)
                                unsigned int value = 100;
                                ret = mm_sound_volume_get_value(VOLUME_TYPE_SYSTEM, &value);
                                if(ret < 0) {
-                                       debug_log("mm_sound_volume_get_value 0x%x\n", ret);
+                                       debug_log("mm_sound_volume_get_value 0x%x", ret);
                                }
                                else{
                                        g_print("*** SYSTEM VOLUME : %u ***\n", value);
@@ -809,7 +809,7 @@ static void interpret (char *cmd)
                                unsigned int value = 100;
                                ret = mm_sound_volume_get_value(VOLUME_TYPE_SYSTEM, &value);
                                if(ret < 0) {
-                                       debug_log("mm_sound_volume_get_value 0x%x\n", ret);
+                                       debug_log("mm_sound_volume_get_value 0x%x", ret);
                                }
                                else {
                                        if(value != 0) {
@@ -818,7 +818,7 @@ static void interpret (char *cmd)
 
                                        ret = mm_sound_volume_set_value(VOLUME_TYPE_SYSTEM, value);
                                        if(ret < 0) {
-                                               debug_log("mm_sound_volume_set_value 0x%x\n", ret);
+                                               debug_log("mm_sound_volume_set_value 0x%x", ret);
                                        }else {
                                                g_print("Current System volume is %d\n", value);
                                        }
@@ -829,7 +829,7 @@ static void interpret (char *cmd)
                                unsigned int value = 100;
                                ret = mm_sound_volume_get_value(VOLUME_TYPE_VOICE, &value);
                                if(ret < 0) {
-                                       debug_log("mm_sound_volume_get_value 0x%x\n", ret);
+                                       debug_log("mm_sound_volume_get_value 0x%x", ret);
                                }
                                else{
                                        g_print("*** VOICE VOLUME : %u ***\n", value);
@@ -841,7 +841,7 @@ static void interpret (char *cmd)
                                unsigned int value = 100;
                                ret = mm_sound_volume_get_value(VOLUME_TYPE_VOICE, &value);
                                if(ret < 0) {
-                                       debug_log("mm_sound_volume_get_value 0x%x\n", ret);
+                                       debug_log("mm_sound_volume_get_value 0x%x", ret);
                                }
                                else {
                                        if(value != 0) {
@@ -850,7 +850,7 @@ static void interpret (char *cmd)
 
                                        ret = mm_sound_volume_set_value(VOLUME_TYPE_VOICE, value);
                                        if(ret < 0) {
-                                               debug_log("mm_sound_volume_set_value 0x%x\n", ret);
+                                               debug_log("mm_sound_volume_set_value 0x%x", ret);
                                        }else {
                                                g_print("Current Voice volume is %d\n", value);
                                        }
@@ -858,24 +858,24 @@ static void interpret (char *cmd)
                        }
                        else if(strncmp(cmd, "an", 2) == 0)
                        {
-                               debug_log("volume is %d type, %d\n", g_volume_type, g_volume_value);
+                               debug_log("volume is %d type, %d", g_volume_type, g_volume_value);
                                ret = mm_sound_play_sound(g_file_name, g_volume_type, mycallback ,"USERDATA", &handle);
                                if(ret < 0)
-                                       debug_log("mm_sound_play_sound() failed with 0x%x\n", ret);
+                                       debug_log("mm_sound_play_sound() failed with 0x%x", ret);
                        }
                        else if(strncmp(cmd, "as", 2) == 0)
                        {
-                               debug_log("stream %s type, %d\n", "media", g_volume_value);
+                               debug_log("stream %s type, %d", "media", g_volume_value);
                                ret = mm_sound_play_sound_with_stream_info(g_file_name, "media", -1, 1, mycallback ,"USERDATA", &handle);
                                if(ret < 0)
-                                       debug_log("mm_sound_play_sound() failed with 0x%x\n", ret);
+                                       debug_log("mm_sound_play_sound() failed with 0x%x", ret);
                        }
                        else if(strncmp(cmd, "A", 1) == 0)
                        {
-                               debug_log("volume is %d type, %d\n", g_volume_type, g_volume_value);
+                               debug_log("volume is %d type, %d", g_volume_type, g_volume_value);
                                ret = mm_sound_play_loud_solo_sound(g_file_name, g_volume_type, mycallback ,"USERDATA", &handle);
                                if(ret < 0)
-                                       debug_log("mm_sound_play_sound_loud_solo() failed with 0x%x\n", ret);
+                                       debug_log("mm_sound_play_sound_loud_solo() failed with 0x%x", ret);
                        }
                        else if(strncmp(cmd, "FN", 2) == 0)
                        {
@@ -991,7 +991,7 @@ static void interpret (char *cmd)
                                                tok = strtok(NULL, " ");
                                                if(tok)  enable_session = (bool)atof(tok);
 
-                                               debug_log("volume type: %d\t volume is %f\t tonetime: %d\t enable_session %d \n", volume_type, volume, tonetime, enable_session);
+                                               debug_log("volume type: %d\t volume is %f\t tonetime: %d\t enable_session %d ", volume_type, volume, tonetime, enable_session);
                                                ret = mm_sound_play_tone_ex(tone, volume_type, volume, tonetime, &handle, enable_session);
                                                if(ret<0)
                                                        debug_log ("[magpie] Play DTMF sound cannot be played ! %d\n", handle);
@@ -1110,10 +1110,10 @@ static void interpret (char *cmd)
                                                        tonetime = MIN_TONE_PLAY_TIME;
                                                }
 
-                                               debug_log("stream type: %s\t volume is %f\t tonetime: %d\n", stream_type, volume, tonetime);
+                                               debug_log("stream type: %s\t volume is %f\t tonetime: %d", stream_type, volume, tonetime);
                                                ret = mm_sound_play_tone_with_stream_info(tone, stream_type, -1, volume, tonetime, &handle);
                                                if(ret<0)
-                                                       debug_log ("[magpie] Play DTMF sound with stream type cannot be played ! %d\n", handle);
+                                                       debug_log ("[magpie] Play DTMF sound with stream type cannot be played ! %d", handle);
                                        } else {
                                                g_print ("### fgets return  NULL\n");
                                        }
@@ -1142,7 +1142,7 @@ static void interpret (char *cmd)
                                                        continue;
                                                memset(fullpath, '\0' ,sizeof(fullpath));
                                                snprintf(fullpath, sizeof(fullpath)-1,"%s/%s", g_dir_name, entry->d_name);
-                                               debug_log("Try %s\n", fullpath);
+                                               debug_log("Try %s", fullpath);
 
                                                if (lstat(fullpath, &file_stat) == -1)
                                                        continue;
@@ -1155,14 +1155,14 @@ static void interpret (char *cmd)
                                                        ret = mm_sound_play_sound(fullpath, g_volume_type, test_callback, NULL, &handle);
                                                        if(ret != MM_ERROR_NONE)
                                                        {
-                                                               debug_log("Play file error : %s\n", fullpath);
+                                                               debug_log("Play file error : %s", fullpath);
                                                                sleep(4);
                                                                playfail = 1;
                                                        }
                                                }
                                                else
                                                {
-                                                       debug_log("this is not regular file : %s\n", fullpath);
+                                                       debug_log("this is not regular file : %s", fullpath);
                                                        playfail = 1;
                                                }
                                                while((test_callback_done == 0) && (playfail ==0))
@@ -1173,20 +1173,20 @@ static void interpret (char *cmd)
                                                        {
                                                                if((++mywait)%5 == 0)
                                                                {
-                                                                       debug_log("I'm waiting callback for %d seconds after play %s\n",
+                                                                       debug_log("I'm waiting callback for %d seconds after play %s",
                                                                                        (int)(current_time.tv_sec - start_time.tv_sec),
                                                                                        fullpath);
                                                                }
                                                        }
                                                        sleep(2);
                                                }
-                                               debug_log("goto next file\n");
+                                               debug_log("goto next file");
                                        }
                                        closedir(basedir);
                                }
                                else
                                {
-                                       debug_log("Cannot Open such a directory %s\n", g_dir_name);
+                                       debug_log("Cannot Open such a directory %s", g_dir_name);
                                }
 
                        }
@@ -1203,9 +1203,9 @@ static void interpret (char *cmd)
                        soundparam.volume_config = g_volume_type;
 
                        if ((mm_sound_play_sound_ex (&soundparam, &handle))<0)
-                               debug_log ("Play EX sound cannot be played !\n");
+                               debug_log ("Play EX sound cannot be played !");
 
-                       debug_log ("Ex sound is played Handle is [%d]\n", handle);
+                       debug_log ("Ex sound is played Handle is [%d]", handle);
                }
                else if (strncmp (cmd, "f",1) == 0) {
                        g_menu_state=CURRENT_STATUS_FILENAME;
@@ -1216,7 +1216,7 @@ static void interpret (char *cmd)
                }
                else if (strncmp (cmd, "s",1) == 0) {
                        if(mm_sound_stop_sound(handle))
-                               debug_log (" Cannot stop sound !!! %d \n", handle);
+                               debug_log (" Cannot stop sound !!! %d ", handle);
                }
                else if (strncmp (cmd, "1",1) == 0) {
                        //ap to spk
@@ -1324,32 +1324,32 @@ static void interpret (char *cmd)
                                        } else {
                                                ret = mm_sound_get_device_type(device_h, &device_type);
                                                if (ret) {
-                                                       debug_error("failed to mm_sound_get_device_type()\n");
+                                                       debug_error("failed to mm_sound_get_device_type()");
                                                }
                                                ret = mm_sound_get_device_io_direction(device_h, &io_direction);
                                                if (ret) {
-                                                       debug_error("failed to mm_sound_get_device_io_direction()\n");
+                                                       debug_error("failed to mm_sound_get_device_io_direction()");
                                                }
                                                ret = mm_sound_get_device_state(device_h, &state);
                                                if (ret) {
-                                                       debug_error("failed to mm_sound_get_device_state()\n");
+                                                       debug_error("failed to mm_sound_get_device_state()");
                                                }
                                                ret = mm_sound_get_device_id(device_h, &id);
                                                if (ret) {
-                                                       debug_error("failed to mm_sound_get_device_id()\n");
+                                                       debug_error("failed to mm_sound_get_device_id()");
                                                }
                                                ret = mm_sound_get_device_name(device_h, &name);
                                                if (ret) {
-                                                       debug_error("failed to mm_sound_get_device_name()\n");
+                                                       debug_error("failed to mm_sound_get_device_name()");
                                                }
                                                ret = mm_sound_get_device_vendor_id(device_h, &vendor_id);
                                                if (ret)
-                                                       debug_error("failed to mm_sound_get_device_vendor_id()\n");
+                                                       debug_error("failed to mm_sound_get_device_vendor_id()");
                                                ret = mm_sound_get_device_product_id(device_h, &product_id);
                                                if (ret)
-                                                       debug_error("failed to mm_sound_get_device_product_id()\n");
+                                                       debug_error("failed to mm_sound_get_device_product_id()");
                                                debug_log("*** --- [NEXT DEVICE] type[%d], id[%d], io_direction[%d], state[%d], "
-                                                               "name[%s] vendor_id[%04x] product_id[%04x]\n",
+                                                               "name[%s] vendor_id[%04x] product_id[%04x]",
                                                                device_type, id, io_direction, state, name, vendor_id, product_id);
                                        }
                                } while (dret == MM_ERROR_NONE);
@@ -1357,36 +1357,36 @@ static void interpret (char *cmd)
                                        dret = MM_ERROR_NONE;
                                        dret = mm_sound_get_prev_device (device_list, &device_h);
                                        if (dret) {
-                                               debug_error("failed to mm_sound_get_prev_device(), dret[0x%x]\n", dret);
+                                               debug_error("failed to mm_sound_get_prev_device(), dret[0x%x]", dret);
                                        } else {
                                                ret = mm_sound_get_device_type(device_h, &device_type);
                                                if (ret) {
-                                                       debug_error("failed to mm_sound_get_device_type()\n");
+                                                       debug_error("failed to mm_sound_get_device_type()");
                                                }
                                                ret = mm_sound_get_device_io_direction(device_h, &io_direction);
                                                if (ret) {
-                                                       debug_error("failed to mm_sound_get_device_io_direction()\n");
+                                                       debug_error("failed to mm_sound_get_device_io_direction()");
                                                }
                                                ret = mm_sound_get_device_state(device_h, &state);
                                                if (ret) {
-                                                       debug_error("failed to mm_sound_get_device_state()\n");
+                                                       debug_error("failed to mm_sound_get_device_state()");
                                                }
                                                ret = mm_sound_get_device_id(device_h, &id);
                                                if (ret) {
-                                                       debug_error("failed to mm_sound_get_device_id()\n");
+                                                       debug_error("failed to mm_sound_get_device_id()");
                                                }
                                                ret = mm_sound_get_device_name(device_h, &name);
                                                if (ret) {
-                                                       debug_error("failed to mm_sound_get_device_name()\n");
+                                                       debug_error("failed to mm_sound_get_device_name()");
                                                }
                                                ret = mm_sound_get_device_vendor_id(device_h, &vendor_id);
                                                if (ret)
-                                                       debug_error("failed to mm_sound_get_device_vendor_id()\n");
+                                                       debug_error("failed to mm_sound_get_device_vendor_id()");
                                                ret = mm_sound_get_device_product_id(device_h, &product_id);
                                                if (ret)
-                                                       debug_error("failed to mm_sound_get_device_product_id()\n");
+                                                       debug_error("failed to mm_sound_get_device_product_id()");
                                                debug_log("*** --- [PREV DEVICE] type[%d], id[%d], io_direction[%d], state[%d], "
-                                                               "name[%s] vendor_id[%04x] product_id[%04x]\n",
+                                                               "name[%s] vendor_id[%04x] product_id[%04x]",
                                                                device_type, id, io_direction, state, name, vendor_id, product_id);
                                        }
                                } while (dret == MM_ERROR_NONE);