e2ef2df5914f0eacb1945f2fcd710030c8c8a9c5
[platform/core/multimedia/libmm-sound.git] / mm_sound_client.c
1 /*
2  * libmm-sound
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Seungbae Shin <seungbae.shin@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #include <stdlib.h>
23 #include <string.h>
24 #include <sys/shm.h>
25 #include <sys/mman.h>
26 #include <sys/stat.h>
27 #include <fcntl.h>
28 #include <sys/msg.h>
29 #include <assert.h>
30 #include <errno.h>
31
32 #include <pthread.h>
33 #include <semaphore.h>
34
35 #include <mm_error.h>
36 #include <mm_debug.h>
37 //#include <glib.h>
38
39 #include "include/mm_sound.h"
40 #include "include/mm_sound_msg.h"
41 #include "include/mm_sound_client.h"
42 #include "include/mm_sound_client_dbus.h"
43 #include "include/mm_sound_common.h"
44 #include "include/mm_sound_device.h"
45 #ifdef USE_FOCUS
46 #include "include/mm_sound_focus.h"
47 #endif
48
49 #include <mm_session.h>
50 #include <mm_session_private.h>
51
52 #define __DIRECT_CALLBACK__
53 //#define __GIDLE_CALLBACK__
54
55 #include <glib.h>
56 #if defined(__GSOURCE_CALLBACK__)
57 #include <sys/poll.h>
58 #endif
59
60 #define CLIENT_HANDLE_MAX 256
61
62 /* global variables for device list */
63 //static GList *g_device_list = NULL;
64 static mm_sound_device_list_t g_device_list_t;
65 static pthread_mutex_t g_device_list_mutex = PTHREAD_MUTEX_INITIALIZER;
66 static pthread_mutex_t g_id_mutex = PTHREAD_MUTEX_INITIALIZER;
67
68 guint g_focus_signal_handle = 0;
69
70 int mm_sound_client_initialize(void)
71 {
72         int ret = MM_ERROR_NONE;
73         debug_fenter();
74
75         mm_sound_client_dbus_initialize();
76
77         debug_fleave();
78         return ret;
79 }
80
81 int mm_sound_client_finalize(void)
82 {
83         int ret = MM_ERROR_NONE;
84
85         debug_fenter();
86
87         ret = mm_sound_client_dbus_finalize();
88
89         debug_fleave();
90         return ret;
91 }
92
93 int mm_sound_client_is_route_available(mm_sound_route route, bool *is_available)
94 {
95         int ret = MM_ERROR_NONE;
96         debug_fenter();
97
98         ret = mm_sound_client_dbus_is_route_available(route, is_available);
99
100         debug_fleave();
101         return ret;
102
103 }
104
105 int mm_sound_client_foreach_available_route_cb(mm_sound_available_route_cb available_route_cb, void *user_data)
106 {
107         int ret = MM_ERROR_NONE;
108         debug_fenter();
109
110         ret = mm_sound_client_dbus_foreach_available_route_cb(available_route_cb, user_data);
111
112         debug_fleave();
113         return ret;
114 }
115
116 int mm_sound_client_set_active_route(mm_sound_route route, bool need_broadcast)
117 {
118         int ret = MM_ERROR_NONE;
119         debug_fenter();
120
121         ret = mm_sound_client_dbus_set_active_route(route, need_broadcast);
122
123         debug_fleave();
124         return ret;
125
126 }
127
128 int mm_sound_client_set_active_route_auto(void)
129 {
130         int ret = MM_ERROR_NONE;
131         debug_fenter();
132
133         ret = mm_sound_client_dbus_set_active_route_auto();
134
135         debug_fleave();
136         return ret;
137
138 }
139
140 int mm_sound_client_get_active_device(mm_sound_device_in *device_in, mm_sound_device_out *device_out)
141 {
142
143         int ret = MM_ERROR_NONE;
144         debug_fenter();
145
146         ret = mm_sound_client_dbus_get_active_device(device_in, device_out);
147
148         debug_fleave();
149         return ret;
150 }
151
152 int mm_sound_client_add_active_device_changed_callback(const char *name, mm_sound_active_device_changed_cb func, void* user_data)
153 {
154         int ret = MM_ERROR_NONE;
155         debug_fenter();
156
157         ret = mm_sound_client_dbus_add_active_device_changed_callback(name, func, user_data);
158
159         debug_fleave();
160         return ret;
161 }
162
163 int mm_sound_client_remove_active_device_changed_callback(const char *name)
164 {
165         int ret = MM_ERROR_NONE;
166         debug_fenter();
167
168         ret = mm_sound_client_dbus_remove_active_device_changed_callback(name);
169
170         debug_fleave();
171         return ret;
172 }
173 int mm_sound_client_add_available_route_changed_callback(mm_sound_available_route_changed_cb func, void* user_data)
174 {
175         int ret = MM_ERROR_NONE;
176         debug_fenter();
177
178         ret = mm_sound_client_dbus_add_available_route_changed_callback(func, user_data);
179
180         debug_fleave();
181         return ret;
182 }
183
184 int mm_sound_client_remove_available_route_changed_callback(void)
185 {
186         int ret = MM_ERROR_NONE;
187         debug_fenter();
188
189         ret = mm_sound_client_dbus_remove_available_route_changed_callback();
190
191         debug_fleave();
192         return ret;
193 }
194
195 int mm_sound_client_set_sound_path_for_active_device(mm_sound_device_out device_out, mm_sound_device_in device_in)
196 {
197         int ret = MM_ERROR_NONE;
198         debug_fenter();
199
200         ret = mm_sound_client_dbus_set_sound_path_for_active_device(device_out, device_in);
201
202         debug_fleave();
203         return ret;
204 }
205
206 void mm_sound_convert_volume_type_to_stream_type(int volume_type, char *stream_type)
207 {
208         switch (volume_type) {
209         case VOLUME_TYPE_SYSTEM:
210                 strncpy(stream_type, "system", MM_SOUND_STREAM_TYPE_LEN);
211                 break;
212         case VOLUME_TYPE_NOTIFICATION:
213                 strncpy(stream_type, "notification", MM_SOUND_STREAM_TYPE_LEN);
214                 break;
215         case VOLUME_TYPE_ALARM:
216                 strncpy(stream_type, "alarm", MM_SOUND_STREAM_TYPE_LEN);
217                 break;
218         case VOLUME_TYPE_RINGTONE:
219                 strncpy(stream_type, "ringtone-voip", MM_SOUND_STREAM_TYPE_LEN);
220                 break;
221         case VOLUME_TYPE_MEDIA:
222                 strncpy(stream_type, "media", MM_SOUND_STREAM_TYPE_LEN);
223                 break;
224         case VOLUME_TYPE_CALL:
225                 strncpy(stream_type, "system", MM_SOUND_STREAM_TYPE_LEN);
226                 break;
227         case VOLUME_TYPE_VOIP:
228                 strncpy(stream_type, "voip", MM_SOUND_STREAM_TYPE_LEN);
229                 break;
230         case VOLUME_TYPE_VOICE:
231                 strncpy(stream_type, "voice-recognition", MM_SOUND_STREAM_TYPE_LEN);
232                 break;
233         default:
234                 strncpy(stream_type, "media", MM_SOUND_STREAM_TYPE_LEN);
235                 break;
236         }
237
238         debug_error("volume type (%d) converted to stream type (%s)", volume_type, stream_type);
239
240 }
241
242 /*****************************************************************************************
243                             DBUS SUPPORTED FUNCTIONS
244 ******************************************************************************************/
245
246 void _mm_sound_client_focus_signal_callback(mm_sound_signal_name_t signal, int value, void *user_data)
247 {
248         int ret = MM_ERROR_NONE;
249
250         debug_fenter();
251         debug_error("focus signal received, value = %d", value);
252
253         if (value == 1) {
254                 ret = mm_sound_client_dbus_clear_focus(getpid());
255                 if (ret)
256                         debug_error("clear focus failed ret = 0x%x", ret);
257                 mm_sound_unsubscribe_signal(g_focus_signal_handle);
258                 g_focus_signal_handle = 0;
259         }
260 }
261
262 int mm_sound_client_play_tone(int number, int volume_config, double volume, int time, int *handle, bool enable_session)
263 {
264         int ret = MM_ERROR_NONE;
265 //       int instance = -1;     /* instance is unique to communicate with server : client message queue filter type */
266         int volume_type = MM_SOUND_VOLUME_CONFIG_TYPE(volume_config);
267         char stream_type[MM_SOUND_STREAM_TYPE_LEN] = {0, };
268
269          debug_fenter();
270
271         /* read session information */
272         int session_type = MM_SESSION_TYPE_MEDIA;
273         int session_options = 0;
274         int is_focus_registered = 0;
275
276         ret = mm_sound_get_signal_value(MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, &is_focus_registered);
277         if (ret) {
278                 debug_error("mm_sound_get_signal_value failed [0x%x]", ret);
279                 return MM_ERROR_POLICY_INTERNAL;
280         }
281
282         if (is_focus_registered)
283                 enable_session = false;
284
285         if (enable_session)
286         {
287                 if (MM_ERROR_NONE != _mm_session_util_read_information(-1, &session_type, &session_options))
288                 {
289                         debug_warning("[Client] Read Session Information failed. use default \"media\" type\n");
290                         session_type = MM_SESSION_TYPE_MEDIA;
291
292                         if(MM_ERROR_NONE != mm_session_init(session_type))
293                         {
294                                 debug_critical("[Client] MMSessionInit() failed\n");
295                                 return MM_ERROR_POLICY_INTERNAL;
296                         }
297                 }
298         }
299
300          // instance = getpid();
301          //debug_log("[Client] pid for client ::: [%d]\n", instance);
302
303          /* Send msg */
304          debug_msg("[Client] Input number : %d\n", number);
305          /* Send req memory */
306
307         mm_sound_convert_volume_type_to_stream_type(volume_type, stream_type);
308         ret = mm_sound_client_dbus_play_tone(number, time, volume, volume_config,
309                                         session_type, session_options, getpid(), enable_session, handle, stream_type, -1);
310
311         if (enable_session && !g_focus_signal_handle) {
312                 ret = mm_sound_subscribe_signal(MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, &g_focus_signal_handle, _mm_sound_client_focus_signal_callback, NULL);
313                 if (ret) {
314                         debug_error("mm_sound_subscribe_signal failed [0x%x]", ret);
315                         return MM_ERROR_POLICY_INTERNAL;
316                 }
317         }
318
319         debug_fleave();
320         return ret;
321 }
322
323 int mm_sound_client_play_tone_with_stream_info(int tone, char *stream_type, int stream_id, double volume, int duration, int *handle)
324 {
325         int ret = MM_ERROR_NONE;
326
327         debug_fenter();
328
329         ret = mm_sound_client_dbus_play_tone_with_stream_info(getpid(), tone, stream_type, stream_id, volume, duration, handle);
330
331         debug_fleave();
332         return ret;
333 }
334
335 int mm_sound_client_play_sound(MMSoundPlayParam *param, int tone, int *handle)
336 {
337         int ret = MM_ERROR_NONE;
338         int session_type = MM_SESSION_TYPE_MEDIA;
339         int session_options = 0;
340         int is_focus_registered = 0;
341 //      int instance = -1;      /* instance is unique to communicate with server : client message queue filter type */
342         int volume_type = MM_SOUND_VOLUME_CONFIG_TYPE(param->volume_config);
343         char stream_type[MM_SOUND_STREAM_TYPE_LEN] = {0, };
344
345         debug_fenter();
346
347         /* read session information */
348
349         ret = mm_sound_get_signal_value(MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, &is_focus_registered);
350         if (ret) {
351                 debug_error("mm_sound_get_signal_value failed [0x%x]", ret);
352                 return MM_ERROR_POLICY_INTERNAL;
353         }
354
355         if (is_focus_registered)
356                 param->skip_session = true;
357
358         if (param->skip_session == false) {
359                 if(MM_ERROR_NONE != _mm_session_util_read_information(-1, &session_type, &session_options))
360                 {
361                         debug_warning("[Client] Read MMSession Type failed. use default \"media\" type\n");
362                         session_type = MM_SESSION_TYPE_MEDIA;
363
364                         if(MM_ERROR_NONE != mm_session_init(session_type))
365                         {
366                                 debug_critical("[Client] MMSessionInit() failed\n");
367                                 return MM_ERROR_POLICY_INTERNAL;
368                         }
369                 }
370         }
371
372 //      instance = getpid();
373 //      debug_msg("[Client] pid for client ::: [%d]\n", instance);
374
375         /* Send msg */
376         if ((param->mem_ptr && param->mem_size))
377         {
378                 // Play memory, deprecated
379                 return MM_ERROR_INVALID_ARGUMENT;
380         }
381
382         mm_sound_convert_volume_type_to_stream_type(volume_type, stream_type);
383         ret = mm_sound_client_dbus_play_sound(param->filename, tone, param->loop, param->volume, param->volume_config,
384                                          param->priority, session_type, session_options, getpid(), param->handle_route,
385                                          !param->skip_session, handle, stream_type, -1);
386         if (ret != MM_ERROR_NONE) {
387                 debug_error("Play Sound Failed");
388                 goto failed;
389         }
390         if (param->callback) {
391                 ret = mm_sound_client_dbus_add_play_sound_end_callback(*handle, param->callback, param->data);
392                 if (ret != MM_ERROR_NONE) {
393                         debug_error("Add callback for play sound(%d) Failed", *handle);
394                 }
395         }
396         if (!param->skip_session && !g_focus_signal_handle) {
397                 ret = mm_sound_subscribe_signal(MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, &g_focus_signal_handle, _mm_sound_client_focus_signal_callback, NULL);
398                 if (ret) {
399                         debug_error("mm_sound_subscribe_signal failed [0x%x]", ret);
400                         return MM_ERROR_POLICY_INTERNAL;
401                 }
402         }
403
404 failed:
405
406         debug_fleave();
407         return ret;
408 }
409
410 int mm_sound_client_play_sound_with_stream_info(MMSoundPlayParam *param, int *handle, char* stream_type, int stream_id)
411 {
412         int ret = MM_ERROR_NONE;
413
414         ret = mm_sound_client_dbus_play_sound_with_stream_info(param->filename, param->loop, param->volume,
415                                          param->priority, getpid(), param->handle_route, handle, stream_type, stream_id);
416         if (ret != MM_ERROR_NONE) {
417                 debug_error("Play Sound Failed");
418                 goto failed;
419         }
420         if (param->callback) {
421                 ret = mm_sound_client_dbus_add_play_sound_end_callback(*handle, param->callback, param->data);
422                 if (ret != MM_ERROR_NONE) {
423                         debug_error("Add callback for play sound(%d) Failed", *handle);
424                 }
425         }
426
427 failed:
428
429         debug_fleave();
430         return ret;
431
432 }
433
434 int mm_sound_client_stop_sound(int handle)
435 {
436         int ret = MM_ERROR_NONE;
437         debug_fenter();
438
439         if (handle < 0 || handle > CLIENT_HANDLE_MAX) {
440                 ret = MM_ERROR_INVALID_ARGUMENT;
441                 return ret;
442         }
443
444         ret = mm_sound_client_dbus_stop_sound(handle);
445
446         debug_fleave();
447         return ret;
448 }
449
450 static int _mm_sound_client_device_list_clear ()
451 {
452         int ret = MM_ERROR_NONE;
453
454         MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN(&g_device_list_mutex, MM_ERROR_SOUND_INTERNAL);
455
456         if (g_device_list_t.list) {
457                 g_list_free_full(g_device_list_t.list, g_free);
458                 g_device_list_t.list = NULL;
459         }
460
461         MMSOUND_LEAVE_CRITICAL_SECTION(&g_device_list_mutex);
462
463         return ret;
464 }
465
466 static int _mm_sound_client_device_list_dump (GList *device_list)
467 {
468         int ret = MM_ERROR_NONE;
469         GList *list = NULL;
470         mm_sound_device_t *device_node = NULL;
471         int count = 0;
472         if (!device_list) {
473                 debug_error("Device list NULL, cannot dump list");
474                 return MM_ERROR_SOUND_INTERNAL;
475         }
476
477         debug_log("======================== device list : start ==========================\n");
478         for (list = device_list; list != NULL; list = list->next) {
479                 device_node = (mm_sound_device_t *)list->data;
480                 if (device_node) {
481                         debug_log(" list idx[%d]: type[%17s], id[%02d], io_direction[%d], state[%d], name[%s]\n",
482                                                 count++, device_node->type, device_node->id, device_node->io_direction, device_node->state, device_node->name);
483                 }
484         }
485         debug_log("======================== device list : end ============================\n");
486
487         return ret;
488 }
489
490 int mm_sound_client_get_current_connected_device_list(int device_flags, mm_sound_device_list_t **device_list)
491 {
492         int ret = MM_ERROR_NONE;
493         debug_fenter();
494
495         ret = _mm_sound_client_device_list_clear();
496         if (ret) {
497                 debug_error("[Client] failed to __mm_sound_client_device_list_clear(), ret[0x%x]\n", ret);
498                 return ret;
499         }
500
501         if ((ret = mm_sound_client_dbus_get_current_connected_device_list(device_flags, &g_device_list_t.list)) != MM_ERROR_NONE) {
502                 debug_error("[Client] failed to get current connected device list with dbus, ret[0x%x]", ret);
503                 goto failed;
504         }
505         if (!g_device_list_t.list) {
506                 debug_error("Got device list null");
507                 ret = MM_ERROR_SOUND_NO_DATA;
508                 goto failed;
509         }
510 //              g_device_list_t.list = g_device_list;
511         _mm_sound_client_device_list_dump(g_device_list_t.list);
512         *device_list = &g_device_list_t;
513
514 failed:
515         debug_fleave();
516         return ret;
517 }
518
519 int mm_sound_client_add_device_connected_callback(int device_flags, mm_sound_device_connected_cb func, void* user_data)
520 {
521         int ret = MM_ERROR_NONE;
522
523         debug_fenter();
524
525         ret = mm_sound_client_dbus_add_device_connected_callback(device_flags, func, user_data);
526
527         debug_fleave();
528         return ret;
529
530 }
531
532 int mm_sound_client_remove_device_connected_callback(void)
533 {
534         int ret = MM_ERROR_NONE;
535         debug_fenter();
536
537         ret = mm_sound_client_dbus_remove_device_connected_callback();
538
539         debug_fleave();
540         return ret;
541 }
542
543 int mm_sound_client_add_device_info_changed_callback(int device_flags, mm_sound_device_info_changed_cb func, void* user_data)
544 {
545         int ret = MM_ERROR_NONE;
546
547         debug_fenter();
548
549         ret = mm_sound_client_dbus_add_device_info_changed_callback(device_flags, func, user_data);
550
551         debug_fleave();
552         return ret;
553 }
554
555 int mm_sound_client_remove_device_info_changed_callback(void)
556 {
557         int ret = MM_ERROR_NONE;
558         debug_fenter();
559
560         ret =  mm_sound_client_dbus_remove_device_info_changed_callback();
561
562         debug_fleave();
563         return ret;
564
565 }
566 int mm_sound_client_is_bt_a2dp_on (bool *connected, char** bt_name)
567 {
568         int ret = MM_ERROR_NONE;
569
570         debug_fenter();
571
572         ret = mm_sound_client_dbus_is_bt_a2dp_on(connected, bt_name);
573
574         debug_fleave();
575         return ret;
576 }
577
578 int mm_sound_client_set_volume_by_type(const int volume_type, const unsigned int volume_level)
579 {
580         int ret = MM_ERROR_NONE;
581
582         debug_fenter();
583
584         ret = mm_sound_client_dbus_set_volume_by_type(volume_type, volume_level);
585
586         debug_fleave();
587         return ret;
588 }
589
590 int mm_sound_client_add_volume_changed_callback(mm_sound_volume_changed_cb func, void* user_data)
591 {
592         int ret = MM_ERROR_NONE;
593
594         debug_fenter();
595
596         ret = mm_sound_client_dbus_add_volume_changed_callback(func, user_data);
597
598         debug_fleave();
599         return ret;
600 }
601
602 int mm_sound_client_remove_volume_changed_callback(void)
603 {
604         int ret = MM_ERROR_NONE;
605         debug_fenter();
606
607         ret = mm_sound_client_dbus_remove_volume_changed_callback();
608
609         debug_fleave();
610         return ret;
611 }
612
613
614 int mm_sound_client_get_audio_path(mm_sound_device_in *device_in, mm_sound_device_out *device_out)
615 {
616         int ret = MM_ERROR_NONE;
617
618         debug_fenter();
619
620         ret = mm_sound_client_dbus_get_audio_path(device_in, device_out);
621
622         debug_fleave();
623
624         return ret;
625 }
626
627
628 #ifdef USE_FOCUS
629 int mm_sound_client_get_uniq_id(int *id)
630 {
631         static int uniq_id = 0;
632         int ret = MM_ERROR_NONE;
633
634         MMSOUND_ENTER_CRITICAL_SECTION_WITH_RETURN(&g_id_mutex, MM_ERROR_SOUND_INTERNAL);
635         debug_fenter();
636
637         if (!id)
638                 ret = MM_ERROR_INVALID_ARGUMENT;
639         else
640                 *id = ++uniq_id;
641
642         debug_fleave();
643         MMSOUND_LEAVE_CRITICAL_SECTION(&g_id_mutex);
644
645         return ret;
646 }
647
648 int mm_sound_client_register_focus(int id, const char *stream_type, mm_sound_focus_changed_cb callback, void* user_data)
649 {
650         int ret = MM_ERROR_NONE;
651         debug_fenter();
652
653         ret = mm_sound_client_dbus_register_focus(id, stream_type, callback, user_data);
654
655         debug_fleave();
656         return ret;
657 }
658
659 int mm_sound_client_unregister_focus(int id)
660 {
661         int ret = MM_ERROR_NONE;
662         debug_fenter();
663
664         ret = mm_sound_client_dbus_unregister_focus(id);
665
666         debug_fleave();
667         return ret;
668 }
669
670 int mm_sound_client_acquire_focus(int id, mm_sound_focus_type_e type, const char *option)
671 {
672         int ret = MM_ERROR_NONE;
673         debug_fenter();
674
675         ret = mm_sound_client_dbus_acquire_focus(id, type, option);
676
677         debug_fleave();
678         return ret;
679 }
680
681 int mm_sound_client_release_focus(int id, mm_sound_focus_type_e type, const char *option)
682 {
683         int ret = MM_ERROR_NONE;
684         debug_fenter();
685
686         mm_sound_client_dbus_release_focus(id, type, option);
687
688         debug_fleave();
689         return ret;
690 }
691
692 int mm_sound_client_set_focus_watch_callback(mm_sound_focus_type_e focus_type, mm_sound_focus_changed_watch_cb callback, void* user_data, int *id)
693 {
694         int ret = MM_ERROR_NONE;
695         debug_fenter();
696
697         mm_sound_client_dbus_set_focus_watch_callback(focus_type, callback, user_data, id);
698
699         debug_fleave();
700         return ret;
701 }
702
703 int mm_sound_client_unset_focus_watch_callback(int id)
704 {
705         int ret = MM_ERROR_NONE;
706         debug_fenter();
707
708         ret = mm_sound_client_dbus_unset_focus_watch_callback(id);
709
710         debug_fleave();
711         return ret;
712 }
713 #endif
714
715
716 int mm_sound_client_add_test_callback(mm_sound_test_cb func, void* user_data)
717 {
718         int ret = MM_ERROR_NONE;
719
720         debug_fenter();
721
722         ret = mm_sound_client_dbus_add_test_callback(func, user_data);
723
724         debug_fleave();
725         return ret;
726 }
727
728 int mm_sound_client_remove_test_callback(void)
729 {
730         int ret = MM_ERROR_NONE;
731         debug_fenter();
732
733         ret = mm_sound_client_dbus_remove_test_callback();
734
735         debug_fleave();
736         return ret;
737 }
738
739
740 int mm_sound_client_test(int a, int b, int* getv)
741 {
742         int ret = MM_ERROR_NONE;
743
744         debug_fenter();
745
746         ret = mm_sound_client_dbus_test(a, b, getv);
747         debug_log("%d * %d -> result : %d", a, b, *getv);
748
749         debug_fleave();
750
751         return ret;
752 }