{
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);
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();
}
/* focus Server Starts!!!*/
- debug_warning("focus_server [%d] start \n", getpid());
+ debug_warning("focus_server [%d] start ", getpid());
signal(SIGPIPE, SIG_IGN); //ignore SIGPIPE
#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();
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.
_mainloop_run();
}
- debug_warning("focus_server [%d] terminating \n", getpid());
+ debug_warning("focus_server [%d] terminating ", getpid());
if (serveropt.startserver) {
MMSoundMgrFocusDbusFini();
_signal_finalize();
- debug_warning("focus_server [%d] exit ----------------- END \n", getpid());
+ debug_warning("focus_server [%d] exit ----------------- END ", getpid());
return 0;
}
#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); \
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] &&
}
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);
}
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
/* 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);
/**************************************
*
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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) {
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;
}
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;
}
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;
}
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);
}
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;
}
_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;
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);
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;
}
* 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;
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;
}
}
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;
}
}
/* 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;
}
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;
}
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);
}
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);
}
}
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;
}
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;
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;
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);
}
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, ¶m_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;
}
}
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, ¶m_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);
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;
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;
}
char ret_buf[MAX_ERROR_LEN] = {'\0',};
if (data == NULL) {
- debug_error("invalid data\n");
+ debug_error("invalid data");
pthread_exit(NULL);
}
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);
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));
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;
}
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;
}
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;
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__ */
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 { \
case 0: \
break; \
default: \
- debug_error("mutex lock failed\n"); \
+ debug_error("mutex lock failed"); \
return; \
}
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 { \
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) \
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;
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;
/* 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;
}
/* 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;
}
/* 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));
/* 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));
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;
}
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;
}
err = mm_sound_client_play_sound_with_stream_info(¶m, 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;
{
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;
}
/* 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;
}
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;
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;
}
}
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");
{
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;
}
{
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;
}
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) {
* |<-- 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();
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);
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)
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);
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;
/* 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;
}
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 */
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;
}
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);
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);
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);
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");
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;
}
}
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;
}
}
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) {
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();
}
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;
}
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) {
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)",
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;
}
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");
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);
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
}
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");
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);
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
}
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;
}
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);
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);
}
*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);
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();
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);
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);
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;
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;
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;
}
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);
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);
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;
}
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);
}
}
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;
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);
}
}
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;
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);
}
}
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;
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;
}
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;
}
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;
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;
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;
}
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;
}
{
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;
}
{
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;
}
{
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;
}
{
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;
}
{
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;
}
{
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;
}
{
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;
}
bool _is_on = false;
if(!device || !is_on) {
- debug_error("invalid argument\n");
+ debug_error("invalid argument");
return MM_ERROR_INVALID_ARGUMENT;
}
}
}
- 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;
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; \
} \
} \
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();
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();
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();
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();
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();
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);
}
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();
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();
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();
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();
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();
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();
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();
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();
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;
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;
}
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();
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();
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();
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();
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;
}
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;
}
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;
}
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;
}
}
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;
}
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;
}
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;
}
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;
/* 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;
}
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 */
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 */
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;
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;
}
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 {
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;
}
}
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;
}
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:
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) {
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;
}
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
#include <stdio.h>
#include <string.h>
#include <pthread.h>
+#include <unistd.h>
#include <mm_error.h>
#include <mm_types.h>
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);
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;
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;
}
_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);
}
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;
}
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
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) {
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;
}
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;
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);
}
}
/*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;
}
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
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;
}
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
}
/*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;
}
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;
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
{
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;
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;
}
int err = MM_ERROR_NONE;
int slotid;
- debug_enter("(pid : [%d])\n", pid);
+ debug_enter("(pid : [%d])", pid);
SLOT_LOCK();
cleanup:
SLOT_UNLOCK();
- debug_leave("(err : 0x%08X)\n", err);
+ debug_leave("(err : 0x%08X)", err);
return err;
}
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();
#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())
}
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 */
ret = MMSoundMgrCodecPlay(codechandle, ¶m);
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;
}
ret = MMSoundMgrCodecStop(handle);
if (ret != MM_ERROR_NONE) {
- debug_error("Fail to stop sound\n");
+ debug_error("Fail to stop sound");
return ret;
}
ret = MMSoundMgrCodecClearFocus(pid);
if (ret != MM_ERROR_NONE) {
- debug_error("Fail to clear focus\n");
+ debug_error("Fail to clear focus");
return ret;
}
ret = MMSoundMgrCodecPlayWithStreamInfo(codechandle, ¶m);
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;
}
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, ¶m);
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;
}
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, ¶m);
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;
}
}
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;
}
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();
}
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)
*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;
}
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)
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;
}
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;
}
/* 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;
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;
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);
{
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;
}
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) {
}
/* Sound Server Starts!!!*/
- debug_warning("sound_server [%d] start \n", getpid());
+ debug_warning("sound_server [%d] start ", getpid());
signal(SIGPIPE, SIG_IGN); //ignore SIGPIPE
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();
MMSoundMgrDbusFini();
}
- debug_warning("sound_server [%d] exit ----------------- END \n", getpid());
+ debug_warning("sound_server [%d] exit ----------------- END ", getpid());
return 0;
}
static void __DummyWork(void *param)
{
- debug_msg("thread index = %d\n", (int)param);
+ debug_msg("thread index = %d", (int)param);
sleep(1);
}
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());
/* 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);
}
debug_enter();
if (g_pool == NULL) {
- debug_error("No thread pool initialized....\n");
+ debug_error("No thread pool initialized....");
return MM_ERROR_SOUND_INTERNAL;
}
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;
}
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;
}
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;
}
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;
}
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;
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;
}
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);
}
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;
}
{
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;
}
}
if(sample == NULL) {
- debug_error("Sample buffer is not allocated\n");
+ debug_error("Sample buffer is not allocated");
return NULL;
}
*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;
{
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*/
{
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;
}
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;
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");
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);
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);
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);
if (toneInfo->stop_cb)
toneInfo->stop_cb(toneInfo->cb_param);
- debug_leave("\n");
+ debug_leave();
}
static
{
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;
}
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;
}
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;
intf->Stop = MMSoundPlugCodecToneStop;
intf->SetThreadPool = MMSoundPlugCodecToneSetThreadPool;
- debug_leave("\n");
+ debug_leave();
return MM_ERROR_NONE;
}
{
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)
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)
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
_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)
_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)
_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
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);
}
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) {
{
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;
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);
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) {
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);
}
}
}
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);
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) {
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);
}
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);
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) {
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);
}
}
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)
{
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);
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");
}
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;
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))
{
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);
}
}
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;
}
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
} 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);
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);