Update code for sound focus 53/86653/4 accepted/tizen/common/20160907.154718 accepted/tizen/ivi/20160908.044213 accepted/tizen/mobile/20160908.043708 accepted/tizen/tv/20160908.043954 accepted/tizen/wearable/20160908.044107 submit/tizen/20160907.074000
authorJeongmo Yang <jm80.yang@samsung.com>
Fri, 2 Sep 2016 07:17:45 +0000 (16:17 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Mon, 5 Sep 2016 06:31:53 +0000 (15:31 +0900)
There is no action if read session is failed,
but, sound focus watch callback should be set in that case.
So, add code for it and modify some code for sound focus operation.

[Version] 0.10.72
[Profile] Common
[Issue Type] Bug fix
[Dependency module] N/A
[Dependency commit] N/A
[Test] [M(T) - Boot=(OK), sdb=(OK), Home=(OK), Touch=(OK), Version=tizen-mobile_20160830.2]

Change-Id: Ib1953fcec84b332e12b8b814fb0d4afbff5cd88f
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
packaging/libmm-camcorder.spec
src/include/mm_camcorder_internal.h
src/mm_camcorder_attribute.c
src/mm_camcorder_internal.c

index bb58968..a4376c4 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-camcorder
 Summary:    Camera and recorder library
-Version:    0.10.71
+Version:    0.10.72
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index bac3b28..53353e5 100644 (file)
@@ -34,6 +34,8 @@
 #include <mm_attrs.h>
 #include <mm_attrs_private.h>
 #include <mm_message.h>
+#include <mm_session.h>
+#include <mm_session_private.h>
 #include <mm_sound_focus.h>
 #include <vconf.h>
 #include <gst/video/video-format.h>
@@ -743,6 +745,7 @@ typedef struct mmf_camcorder {
        int sound_focus_register;                               /**< Use sound focus internally */
        int sound_focus_id;                                     /**< id for sound focus */
        int sound_focus_watch_id;                               /**< id for sound focus watch */
+       unsigned int sound_focus_subscribe_id;                  /**< subscribe id for sound focus signal */
        int interrupt_code;                                     /**< Interrupt code */
        int acquired_focus;                                     /**< Current acquired focus */
        int session_type;                                       /**< Session type */
@@ -1260,8 +1263,9 @@ void __mmcamcorder_force_stop(mmf_camcorder_t *hcamcorder);
 void _mmcamcorder_sound_focus_cb(int id, mm_sound_focus_type_e focus_type,
        mm_sound_focus_state_e focus_state, const char *reason_for_change,
        const char *additional_info, void *user_data);
-void _mmcamcorder_sound_focus_watch_cb(mm_sound_focus_type_e focus_type, mm_sound_focus_state_e focus_state,
+void _mmcamcorder_sound_focus_watch_cb(int id, mm_sound_focus_type_e focus_type, mm_sound_focus_state_e focus_state,
        const char *reason_for_change, const char *additional_info, void *user_data);
+void _mmcamcorder_sound_signal_callback(mm_sound_signal_name_t signal, int value, void *user_data);
 
 /* device policy manager */
 void _mmcamcorder_dpm_camera_policy_changed_cb(const char *name, const char *value, void *user_data);
index e679985..a541925 100644 (file)
@@ -4522,41 +4522,64 @@ bool _mmcamcorder_commit_pid_for_sound_focus(MMHandleType handle, int attr_idx,
 
        new_pid = value->value.i_val;
 
-       _mmcam_dbg_log("Commit : pid %d, current sound_focus_register %d, sound_focus_id %d",
-               new_pid, hcamcorder->sound_focus_register, hcamcorder->sound_focus_id);
+       _mmcam_dbg_log("Commit : pid %d, current focus id %d, subscribe id %u",
+               new_pid, hcamcorder->sound_focus_id, hcamcorder->sound_focus_subscribe_id);
 
-       /* unregister sound focus before set new one */
-       if (hcamcorder->sound_focus_register && hcamcorder->sound_focus_id > 0) {
-               if (MM_ERROR_NONE != mm_sound_unregister_focus(hcamcorder->sound_focus_id)) {
-                       _mmcam_dbg_err("mm_sound_unregister_focus[id %d] failed", hcamcorder->sound_focus_id);
+       /* unregister sound focus and unsubscribe sound signal before set new one */
+       if (hcamcorder->sound_focus_id > 0) {
+               mm_sound_unregister_focus(hcamcorder->sound_focus_id);
+               _mmcam_dbg_log("unregister sound focus done");
+               hcamcorder->sound_focus_id = 0;
+       }
+
+       if (hcamcorder->sound_focus_subscribe_id > 0) {
+               mm_sound_unsubscribe_signal(hcamcorder->sound_focus_subscribe_id);
+               _mmcam_dbg_log("unsubscribe sound signal done");
+               hcamcorder->sound_focus_subscribe_id = 0;
+       }
+
+       ret = _mm_session_util_read_information(new_pid, &hcamcorder->session_type, &hcamcorder->session_flags);
+       if (ret == MM_ERROR_NONE) {
+               if (hcamcorder->session_type == MM_SESSION_TYPE_REPLACED_BY_STREAM) {
+                       hcamcorder->sound_focus_register = FALSE;
+                       _mmcam_dbg_warn("no need to use sound focus internally");
                } else {
-                       _mmcam_dbg_log("mm_sound_unregister_focus[id %d] done", hcamcorder->sound_focus_id);
+                       ret = mm_sound_focus_get_id(&hcamcorder->sound_focus_id);
+                       if (ret != MM_ERROR_NONE) {
+                               _mmcam_dbg_err("mm_sound_focus_get_id failed");
+                               hcamcorder->error_code = MM_ERROR_POLICY_BLOCKED;
+                               return FALSE;
+                       }
+
+                       ret = mm_sound_register_focus_for_session(hcamcorder->sound_focus_id,
+                               new_pid, "media", _mmcamcorder_sound_focus_cb, hcamcorder);
+                       if (ret != MM_ERROR_NONE) {
+                               _mmcam_dbg_err("mm_sound_register_focus_for_session failed 0x%x", ret);
+                               hcamcorder->sound_focus_id = 0;
+                               hcamcorder->error_code = MM_ERROR_POLICY_BLOCKED;
+                               return FALSE;
+                       }
+
+                       hcamcorder->sound_focus_register = TRUE;
+
+                       _mmcam_dbg_log("mm_sound_register_focus_for_session done - id %d, session type %d, flags 0x%x",
+                               hcamcorder->sound_focus_id, hcamcorder->session_type, hcamcorder->session_flags);
                }
        } else {
-               _mmcam_dbg_log("no need to unregister sound focus");
-       }
+               hcamcorder->session_type = 0;
+               hcamcorder->session_flags = 0;
+               hcamcorder->sound_focus_register = TRUE;
 
-       /* register sound focus */
-       if (hcamcorder->sound_focus_register) {
-               hcamcorder->sound_focus_id = 0;
-               if (MM_ERROR_NONE != mm_sound_focus_get_id(&hcamcorder->sound_focus_id)) {
-                       _mmcam_dbg_err("mm_sound_focus_get_uniq failed");
-                       hcamcorder->error_code = MM_ERROR_POLICY_BLOCKED;
-                       return FALSE;
-               }
+               _mmcam_dbg_warn("read session info failed. sound focus watch cb will be set.");
 
-               ret = mm_sound_register_focus_for_session(hcamcorder->sound_focus_id,
-                       new_pid, "media", _mmcamcorder_sound_focus_cb, hcamcorder);
+               ret = mm_sound_subscribe_signal_for_daemon(MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS,
+                       new_pid, &hcamcorder->sound_focus_subscribe_id,
+                       (mm_sound_signal_callback)_mmcamcorder_sound_signal_callback, (void*)hcamcorder);
                if (ret != MM_ERROR_NONE) {
-                       _mmcam_dbg_err("mm_sound_register_focus failed");
+                       _mmcam_dbg_err("subscribe sound signal failed [0x%x]", ret);
                        hcamcorder->error_code = MM_ERROR_POLICY_BLOCKED;
                        return FALSE;
                }
-
-               _mmcam_dbg_log("mm_sound_register_focus done - id %d, session type %d, flags 0x%x",
-                       hcamcorder->sound_focus_id, hcamcorder->session_type, hcamcorder->session_flags);
-       } else {
-               _mmcam_dbg_log("no need to register sound focus");
        }
 
        return TRUE;
index c6f48b1..18bec76 100644 (file)
@@ -39,8 +39,6 @@
 #include <asm/types.h>
 
 #include <system_info.h>
-#include <mm_session.h>
-#include <mm_session_private.h>
 
 #ifdef _MMCAMCORDER_MURPHY_SUPPORT
 #include <murphy/common/glib-glue.h>
@@ -183,31 +181,6 @@ int _mmcamcorder_create(MMHandleType *handle, MMCamPreset *info)
        hcamcorder->device_type = info->videodev_type;
        _mmcam_dbg_warn("Device Type : %d", hcamcorder->device_type);
 
-       if (MM_ERROR_NONE == _mm_session_util_read_information(-1, &hcamcorder->session_type, &hcamcorder->session_flags)) {
-               _mmcam_dbg_log("use sound focus function.");
-               hcamcorder->sound_focus_register = TRUE;
-
-               if (MM_ERROR_NONE != mm_sound_focus_get_id(&hcamcorder->sound_focus_id)) {
-                       _mmcam_dbg_err("mm_sound_focus_get_uniq failed");
-                       ret = MM_ERROR_POLICY_BLOCKED;
-                       goto _ERR_DEFAULT_VALUE_INIT;
-               }
-
-               ret = mm_sound_register_focus_for_session(hcamcorder->sound_focus_id,
-                       getpid(), "media", _mmcamcorder_sound_focus_cb, hcamcorder);
-               if (ret != MM_ERROR_NONE) {
-                       _mmcam_dbg_err("mm_sound_register_focus failed");
-                       ret = MM_ERROR_POLICY_BLOCKED;
-                       goto _ERR_DEFAULT_VALUE_INIT;
-               }
-
-               _mmcam_dbg_log("mm_sound_register_focus done - id %d, session type %d, flags 0x%x",
-                       hcamcorder->sound_focus_id, hcamcorder->session_type, hcamcorder->session_flags);
-       } else {
-               _mmcam_dbg_log("_mm_session_util_read_information failed. skip sound focus function.");
-               hcamcorder->sound_focus_register = FALSE;
-       }
-
        /* Get Camera Configure information from Camcorder INI file */
        ret = _mmcamcorder_conf_get_info((MMHandleType)hcamcorder, CONFIGURE_TYPE_MAIN, CONFIGURE_MAIN_FILE, &hcamcorder->conf_main);
        if (ret != MM_ERROR_NONE) {
@@ -545,18 +518,6 @@ _ERR_DEFAULT_VALUE_INIT:
        _mmcamcorder_resource_manager_deinit(&hcamcorder->resource_manager);
 #endif /* _MMCAMCORDER_MURPHY_SUPPORT */
 
-       /* unregister sound focus */
-       if (hcamcorder->sound_focus_register && hcamcorder->sound_focus_id > 0) {
-               if (MM_ERROR_NONE != mm_sound_unregister_focus(hcamcorder->sound_focus_id)) {
-                       _mmcam_dbg_err("mm_sound_unregister_focus[id %d] failed", hcamcorder->sound_focus_id);
-               } else {
-                       _mmcam_dbg_log("mm_sound_unregister_focus[id %d] done", hcamcorder->sound_focus_id);
-               }
-       } else {
-               _mmcam_dbg_warn("no need to unregister sound focus[%d, id %d]",
-                       hcamcorder->sound_focus_register, hcamcorder->sound_focus_id);
-       }
-
        /* release DPM related handle */
        if (hcamcorder->dpm_handle) {
                _mmcam_dbg_log("release DPM handle %p, camera changed cb id %d",
@@ -744,19 +705,29 @@ int _mmcamcorder_destroy(MMHandleType handle)
        /* Remove messages which are not called yet */
        _mmcamcorder_remove_message_all(handle);
 
-       /* unregister sound focus */
-       if (hcamcorder->sound_focus_register && hcamcorder->sound_focus_id > 0) {
-               if (mm_sound_unregister_focus(hcamcorder->sound_focus_id) != MM_ERROR_NONE) {
-                       _mmcam_dbg_err("mm_sound_unregister_focus[id %d] failed",
-                               hcamcorder->sound_focus_id);
-               } else {
-                       _mmcam_dbg_log("mm_sound_unregister_focus[id %d] done",
-                       hcamcorder->sound_focus_id);
-               }
-       } else {
-               _mmcam_dbg_log("no need to unregister sound focus.[%d, id %d]",
-                       hcamcorder->sound_focus_register, hcamcorder->sound_focus_id);
+       /* unset remained watch cb */
+       if (hcamcorder->sound_focus_watch_id > 0) {
+               mm_sound_unset_focus_watch_callback(hcamcorder->sound_focus_watch_id);
+               _mmcam_dbg_warn("unset sound focus watch cb [id %d] done", hcamcorder->sound_focus_watch_id);
+               hcamcorder->sound_focus_watch_id = 0;
        }
+
+       /* unregister sound focus and unsubscribe sound signal */
+       _mmcam_dbg_log("sound focus id %d, sound signal subscribe id %u",
+               hcamcorder->sound_focus_id, hcamcorder->sound_focus_subscribe_id);
+
+       if (hcamcorder->sound_focus_id > 0) {
+               mm_sound_unregister_focus(hcamcorder->sound_focus_id);
+               _mmcam_dbg_log("unregister sound focus done");
+               hcamcorder->sound_focus_id = 0;
+       }
+
+       if (hcamcorder->sound_focus_subscribe_id > 0) {
+               mm_sound_unsubscribe_signal(hcamcorder->sound_focus_subscribe_id);
+               _mmcam_dbg_log("unsubscribe sound signal done");
+               hcamcorder->sound_focus_subscribe_id = 0;
+       }
+
 #ifdef _MMCAMCORDER_RM_SUPPORT
        if (hcamcorder->rm_handle != 0) {
                iret = rm_unregister(hcamcorder->rm_handle);
@@ -899,20 +870,7 @@ int _mmcamcorder_realize(MMHandleType handle)
 
        /* sound focus */
        if (hcamcorder->sound_focus_register) {
-               mm_camcorder_get_attributes(handle, NULL,
-                       MMCAM_PID_FOR_SOUND_FOCUS, &pid_for_sound_focus,
-                       NULL);
-
-               if (pid_for_sound_focus == 0) {
-                       pid_for_sound_focus = getpid();
-                       _mmcam_dbg_warn("pid for sound focus is not set, use my pid %d", pid_for_sound_focus);
-               }
-
                /* acquire sound focus or set sound focus watch callback */
-               hcamcorder->acquired_focus = 0;
-               hcamcorder->sound_focus_watch_id = 0;
-
-               /* check session flags */
                if (hcamcorder->session_flags & MM_SESSION_OPTION_PAUSE_OTHERS) {
                        /* acquire sound focus */
                        _mmcam_dbg_log("PAUSE_OTHERS - acquire sound focus");
@@ -921,7 +879,6 @@ int _mmcamcorder_realize(MMHandleType handle)
                        if (ret_sound != MM_ERROR_NONE) {
                                _mmcam_dbg_err("mm_sound_acquire_focus failed [0x%x]", ret_sound);
 
-                               /* TODO: MM_ERROR_POLICY_BLOCKED_BY_CALL, MM_ERROR_POLICY_BLOCKED_BY_ALARM*/
                                ret = MM_ERROR_POLICY_BLOCKED;
                                goto _ERR_CAMCORDER_CMD_PRECON_AFTER_LOCK;
                        }
@@ -931,7 +888,23 @@ int _mmcamcorder_realize(MMHandleType handle)
                        /* do nothing */
                        _mmcam_dbg_log("SESSION_UNINTERRUPTIBLE - do nothing for sound focus");
                } else {
+                       /* unset remained watch cb */
+                       if (hcamcorder->sound_focus_watch_id > 0) {
+                               mm_sound_unset_focus_watch_callback(hcamcorder->sound_focus_watch_id);
+                               _mmcam_dbg_warn("unset sound focus watch cb [id %d] done", hcamcorder->sound_focus_watch_id);
+                               hcamcorder->sound_focus_watch_id = 0;
+                       }
+
                        /* set sound focus watch callback */
+                       mm_camcorder_get_attributes(handle, NULL,
+                               MMCAM_PID_FOR_SOUND_FOCUS, &pid_for_sound_focus,
+                               NULL);
+
+                       if (pid_for_sound_focus == 0) {
+                               pid_for_sound_focus = getpid();
+                               _mmcam_dbg_warn("pid for sound focus is not set, use my pid %d", pid_for_sound_focus);
+                       }
+
                        _mmcam_dbg_log("ETC - set sound focus watch callback - pid %d", pid_for_sound_focus);
 
                        ret_sound = mm_sound_set_focus_watch_callback_for_session(pid_for_sound_focus,
@@ -942,7 +915,6 @@ int _mmcamcorder_realize(MMHandleType handle)
                        if (ret_sound != MM_ERROR_NONE) {
                                _mmcam_dbg_err("mm_sound_set_focus_watch_callback failed [0x%x]", ret_sound);
 
-                               /* TODO: MM_ERROR_POLICY_BLOCKED_BY_CALL, MM_ERROR_POLICY_BLOCKED_BY_ALARM*/
                                ret = MM_ERROR_POLICY_BLOCKED;
                                goto _ERR_CAMCORDER_CMD_PRECON_AFTER_LOCK;
                        }
@@ -1247,23 +1219,18 @@ _ERR_CAMCORDER_CMD:
 _ERR_CAMCORDER_CMD_PRECON_AFTER_LOCK:
        _MMCAMCORDER_UNLOCK_CMD(hcamcorder);
 
-       if (hcamcorder->sound_focus_register) {
-               if (hcamcorder->sound_focus_watch_id > 0) {
-                       if (mm_sound_unset_focus_watch_callback(hcamcorder->sound_focus_watch_id) != MM_ERROR_NONE) {
-                               _mmcam_dbg_warn("mm_sound_unset_focus_watch_callback[id %d] failed", hcamcorder->sound_focus_watch_id);
-                       } else {
-                               _mmcam_dbg_warn("mm_sound_unset_focus_watch_callback[id %d] done", hcamcorder->sound_focus_watch_id);
-                       }
-               }
+       if (hcamcorder->sound_focus_watch_id > 0) {
+               mm_sound_unset_focus_watch_callback(hcamcorder->sound_focus_watch_id);
+               _mmcam_dbg_warn("unset sound focus watch cb [id %d] done", hcamcorder->sound_focus_watch_id);
+               hcamcorder->sound_focus_watch_id = 0;
+       }
 
-               if (hcamcorder->acquired_focus > 0) {
-                               if (mm_sound_release_focus(0, hcamcorder->acquired_focus, NULL) != MM_ERROR_NONE) {
-                                       _mmcam_dbg_err("mm_sound_release_focus[focus %d] failed", hcamcorder->acquired_focus);
-                               } else {
-                                       _mmcam_dbg_err("mm_sound_release_focus[focus %d] done", hcamcorder->acquired_focus);
-                               }
-               }
+       if (hcamcorder->acquired_focus > 0) {
+               mm_sound_release_focus(0, hcamcorder->acquired_focus, NULL);
+               _mmcam_dbg_warn("release sound focus [focus %d] done", hcamcorder->acquired_focus);
+               hcamcorder->acquired_focus = 0;
        }
+
 #ifdef _MMCAMCORDER_RM_SUPPORT
        if (hcamcorder->rm_handle) {
                if (hcamcorder->returned_devices.allocated_num > 0) {
@@ -1392,36 +1359,26 @@ int _mmcamcorder_unrealize(MMHandleType handle)
                hcamcorder->sound_focus_register, hcamcorder->session_flags, hcamcorder->state_change_by_system);
 
        /* release sound focus or unset sound focus watch callback */
-       if (hcamcorder->sound_focus_register) {
-               int ret_sound = MM_ERROR_NONE;
+       _mmcam_dbg_log("by_system %d, flag 0x%x, acquired_focus %d, focus_id %d, watch_id %d",
+               hcamcorder->state_change_by_system, hcamcorder->session_flags, hcamcorder->acquired_focus,
+               hcamcorder->sound_focus_id, hcamcorder->sound_focus_watch_id);
 
-               _mmcam_dbg_log("state_change_by_system %d, session flag 0x%x, acquired_focus %d, sound_focus_id %d, sound_focus_watch_id %d",
-                       hcamcorder->state_change_by_system, hcamcorder->session_flags, hcamcorder->acquired_focus,
-                       hcamcorder->sound_focus_id, hcamcorder->sound_focus_watch_id);
-
-               if (hcamcorder->state_change_by_system != _MMCAMCORDER_STATE_CHANGE_BY_FOCUS &&
-                   hcamcorder->sound_focus_watch_id > 0) {
-                       ret_sound = mm_sound_unset_focus_watch_callback(hcamcorder->sound_focus_watch_id);
-                       if (ret_sound != MM_ERROR_NONE) {
-                               _mmcam_dbg_warn("mm_sound_unset_focus_watch_callback failed [0x%x]", ret_sound);
-                       } else {
-                               _mmcam_dbg_warn("mm_sound_unset_focus_watch_callback done");
-                       }
-               } else {
-                       _mmcam_dbg_warn("no need to unset watch callback.[state_change_by_system %d, sound_focus_watch_id %d]",
-                               hcamcorder->state_change_by_system, hcamcorder->sound_focus_watch_id);
+       if (hcamcorder->state_change_by_system != _MMCAMCORDER_STATE_CHANGE_BY_FOCUS) {
+               if (hcamcorder->sound_focus_watch_id > 0) {
+                       mm_sound_unset_focus_watch_callback(hcamcorder->sound_focus_watch_id);
+                       _mmcam_dbg_warn("unset sound focus watch cb [id %d] done", hcamcorder->sound_focus_watch_id);
+                       hcamcorder->sound_focus_watch_id = 0;
                }
 
                if (hcamcorder->acquired_focus > 0) {
-                       ret_sound = mm_sound_release_focus(0, hcamcorder->acquired_focus, NULL);
-                       if (ret_sound != MM_ERROR_NONE) {
-                               _mmcam_dbg_warn("mm_sound_release_focus failed [0x%x]", ret_sound);
-                       } else {
-                               _mmcam_dbg_log("mm_sound_release_focus done");
-                       }
-               } else {
-                       _mmcam_dbg_warn("no need to release focus - current acquired focus %d", hcamcorder->acquired_focus);
+                       mm_sound_release_focus(0, hcamcorder->acquired_focus, NULL);
+                       _mmcam_dbg_warn("release sound focus [focus %d] done", hcamcorder->acquired_focus);
+                       hcamcorder->acquired_focus = 0;
                }
+       } else {
+               _mmcam_dbg_warn("state change by focus. so, no need to unset watch callback");
+               /* acquired focus will be released automatically */
+               hcamcorder->acquired_focus = 0;
        }
 
        _MMCAMCORDER_UNLOCK_CMD(hcamcorder);
@@ -3346,7 +3303,36 @@ void _mmcamcorder_sound_focus_cb(int id, mm_sound_focus_type_e focus_type,
 }
 
 
-void _mmcamcorder_sound_focus_watch_cb(mm_sound_focus_type_e focus_type, mm_sound_focus_state_e focus_state,
+void _mmcamcorder_sound_signal_callback(mm_sound_signal_name_t signal, int value, void *user_data)
+{
+       mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(user_data);
+
+       mmf_return_if_fail(hcamcorder);
+
+       _mmcam_dbg_log("sound signal %d - value %d", signal, value);
+
+       _MMCAMCORDER_LOCK_ASM(hcamcorder);
+
+       if (signal == MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS && value == 1) {
+               _mmcam_dbg_log("watch cb id %d", hcamcorder->sound_focus_watch_id);
+
+               /* unregister watch callback */
+               if (hcamcorder->sound_focus_watch_id > 0) {
+                       mm_sound_unset_focus_watch_callback(hcamcorder->sound_focus_watch_id);
+                       _mmcam_dbg_log("unset watch cb done");
+                       hcamcorder->sound_focus_watch_id = 0;
+               }
+       }
+
+       _MMCAMCORDER_UNLOCK_ASM(hcamcorder);
+
+       _mmcam_dbg_warn("done");
+
+       return;
+}
+
+
+void _mmcamcorder_sound_focus_watch_cb(int id, mm_sound_focus_type_e focus_type, mm_sound_focus_state_e focus_state,
        const char *reason_for_change, const char *additional_info, void *user_data)
 {
        mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(user_data);
@@ -3361,8 +3347,8 @@ void _mmcamcorder_sound_focus_watch_cb(mm_sound_focus_type_e focus_type, mm_soun
                return;
        }
 
-       _mmcam_dbg_log("sound focus watch callback : focus state %d, reason %s",
-               focus_state, reason_for_change ? reason_for_change : "N/A");
+       _mmcam_dbg_log("sound focus watch callback : id %d, focus state %d, reason %s",
+               id, focus_state, reason_for_change ? reason_for_change : "N/A");
 
        if (hcamcorder->session_flags & MM_SESSION_OPTION_UNINTERRUPTIBLE) {
                _mmcam_dbg_warn("session flag is UNINTERRUPTIBLE. do nothing.");