Modify device manager log 86/83286/5
authorMok Jeongho <jho.mok@samsung.com>
Thu, 4 Aug 2016 05:33:18 +0000 (14:33 +0900)
committerMok Jeongho <jho.mok@samsung.com>
Thu, 11 Aug 2016 01:53:57 +0000 (10:53 +0900)
[Version] 5.0.66
[Profile] Common
[Issue Type] Log enhancement

Change-Id: I72dad87226b001091fe8a7b10f70e8a6b96da975

packaging/pulseaudio-modules-tizen.spec
src/device-manager.c

index abe407f..c2ed66a 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          5.0.65
+Version:          5.0.66
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index 83b2b1e..05befca 100644 (file)
@@ -960,91 +960,137 @@ static dm_device* _device_manager_get_device_with_id(pa_idxset *device_list, uin
     return NULL;
 }
 
-static void dump_playback_device_list(pa_hashmap *playback_devices) {
+static char* get_playback_list_str(pa_hashmap *playback_devices) {
     pa_sink *sink = NULL;
     void *state = NULL;
     const char *role;
+    pa_strbuf *buf;
 
-    if (!playback_devices) {
-        return ;
-    }
+    if (!playback_devices || !pa_hashmap_size(playback_devices))
+        return NULL;
 
-    pa_log_debug("    playback device list");
-    if (pa_hashmap_size(playback_devices) == 0) {
-        pa_log_debug("        empty");
-        return;
-    }
-    PA_HASHMAP_FOREACH_KEY(sink, playback_devices, state, role) {
-        pa_log_debug("        %-13s -> %s", role, sink->name);
-    }
+    buf = pa_strbuf_new();
+    pa_strbuf_printf(buf, "    Playback device list\n");
+    PA_HASHMAP_FOREACH_KEY(sink, playback_devices, state, role)
+        pa_strbuf_printf(buf, "        %-13s -> %s\n", role, sink->name);
+
+    return pa_strbuf_tostring_free(buf);
 }
 
-static void dump_capture_device_list(pa_hashmap *capture_devices) {
+static char* get_capture_list_str(pa_hashmap *capture_devices) {
     pa_source *source = NULL;
     void *state = NULL;
     const char *role;
+    pa_strbuf *buf;
 
-    if (!capture_devices) {
-        return ;
-    }
+    if (!capture_devices || !pa_hashmap_size(capture_devices))
+        return NULL;
 
-    pa_log_debug("    capture device list");
-    if (pa_hashmap_size(capture_devices) == 0) {
-        pa_log_debug("        empty");
-        return;
-    }
-    PA_HASHMAP_FOREACH_KEY(source, capture_devices, state, role) {
-        pa_log_debug("        %-13s -> %s", role, source->name);
-    }
+    buf = pa_strbuf_new();
+    pa_strbuf_printf(buf, "    Capture device list\n");
+    PA_HASHMAP_FOREACH_KEY(source, capture_devices, state, role)
+        pa_strbuf_printf(buf, "        %-13s -> %s\n", role, source->name);
+
+    return pa_strbuf_tostring_free(buf);
 }
 
-static void dump_device_profile_info(dm_device_profile *profile_item) {
+/* Returned string must be freed */
+static char* get_device_profile_info_str(dm_device_profile *profile_item) {
+    pa_strbuf *buf;
+    char *playback_str, *capture_str;
     if (!profile_item)
-        return;
+        return NULL;
+
+    buf = pa_strbuf_new();
+    pa_strbuf_printf(buf, "    Profile      : %s\n", pa_strna(profile_item->profile));
+    pa_strbuf_printf(buf, "    Direction    : %s\n", device_direction_to_string(profile_item->direction));
+    pa_strbuf_printf(buf, "    Is activated : %s\n", pa_yes_no(COMPOUND_STATE(profile_item) == DM_DEVICE_STATE_ACTIVATED));
+    playback_str = get_playback_list_str(profile_item->playback_devices);
+    capture_str = get_capture_list_str(profile_item->capture_devices);
+
+    if (playback_str)
+        pa_strbuf_puts(buf, playback_str);
+    if (capture_str)
+        pa_strbuf_puts(buf, capture_str);
+
+    pa_xfree(playback_str);
+    pa_xfree(capture_str);
 
-    pa_log_debug("    profile   : %s", profile_item->profile);
-    pa_log_debug("    direction : %s", device_direction_to_string(profile_item->direction));
-    pa_log_debug("    activated : %s", COMPOUND_STATE(profile_item) == DM_DEVICE_STATE_ACTIVATED ? "activated" : "not activated");
-    dump_playback_device_list(profile_item->playback_devices);
-    dump_capture_device_list(profile_item->capture_devices);
+    return pa_strbuf_tostring_free(buf);
 }
 
-static void dump_device_info(dm_device *device_item) {
+static char* get_device_info_str(dm_device *device_item) {
+    pa_strbuf *buf;
     dm_device_profile *profile_item = NULL;
     uint32_t device_idx = 0;
+    char *profile_info;
 
-    if (!device_item)
-        return;
-    if (!device_item->profiles) {
-        pa_log_warn("empty device item");
-        return;
-    }
+    if (!device_item || !device_item->profiles)
+        return NULL;
 
-    pa_log_debug("  id             : %u", device_item->id);
-    pa_log_debug("  type           : %s", device_item->type);
-    pa_log_debug("  name           : %s", device_item->name);
-    pa_log_debug("  active-profile : %u", device_item->active_profile);
+    buf = pa_strbuf_new();
+    pa_strbuf_printf(buf, "[Device #%u]\n", device_item->id);
+    pa_strbuf_printf(buf, "  ID             : %u\n", device_item->id);
+    pa_strbuf_printf(buf, "  Type           : %s\n", device_item->type);
+    pa_strbuf_printf(buf, "  Name           : %s\n", device_item->name);
+    pa_strbuf_printf(buf, "  Active Profile : %u\n", device_item->active_profile);
     PA_IDXSET_FOREACH(profile_item, device_item->profiles, device_idx) {
-        pa_log_debug("  (Profile #%u)", device_idx);
-        dump_device_profile_info(profile_item);
+        pa_strbuf_printf(buf, "  (Profile #%u)\n", device_idx);
+        profile_info = get_device_profile_info_str(profile_item);
+        if (profile_info)
+            pa_strbuf_puts(buf, profile_info);
+        pa_xfree(profile_info);
     }
+
+    return pa_strbuf_tostring_free(buf);
 }
 
-static void dump_device_list(pa_device_manager *dm) {
+static char* get_device_list_str(pa_device_manager *dm) {
     dm_device *device_item = NULL;
     uint32_t device_idx = 0;
+    pa_strbuf *buf;
+    char *device_info;
+
+    if (!dm || !dm->device_list)
+        return NULL;
 
-    if (!dm || !dm->device_list) {
+    buf = pa_strbuf_new();
+    pa_strbuf_printf(buf, "=========== Device List ================\n");
+    PA_IDXSET_FOREACH(device_item, dm->device_list, device_idx) {
+        device_info = get_device_info_str(device_item);
+        if (device_info)
+            pa_strbuf_puts(buf, device_info);
+        pa_xfree(device_info);
+    }
+    pa_strbuf_printf(buf, "========================================\n");
+
+    return pa_strbuf_tostring_free(buf);
+}
+
+static void dump_device_info(dm_device *device_item, pa_log_level_t log_level) {
+    char *info;
+
+    if (!device_item)
         return;
+
+    if ((info = get_device_info_str(device_item))) {
+        pa_logl(log_level, "%s", info);
+        pa_xfree(info);
     }
+}
 
-    pa_log_debug("====== Device List Dump ======");
-    PA_IDXSET_FOREACH(device_item, dm->device_list, device_idx) {
-        pa_log_debug("[ Device #%u ]", device_item->id);
-        dump_device_info(device_item);
+static void dump_device_list_info(pa_device_manager *dm, pa_log_level_t log_level) {
+    char *info;
+
+    if (!dm || !dm->device_list)
+        return;
+
+    if ((info = get_device_list_str(dm))) {
+        pa_logl(log_level, "%s", info);
+        pa_xfree(info);
     }
-    pa_log_debug("===================================");
 }
+
 static bool pulse_device_class_is_sound(pa_proplist *prop) {
     const char *device_class = NULL;
 
@@ -1149,9 +1195,9 @@ static const char* build_params_to_load_device(const char *device_string, const
             return NULL;
         }
         args_buf = pa_strbuf_new();
-        pa_strbuf_printf(args_buf, "device=hw:%s ", alsa_device_name);
+        pa_strbuf_printf(args_buf, "device=hw:%s \n", alsa_device_name);
         if (params) {
-            pa_strbuf_printf(args_buf, "%s", params);
+            pa_strbuf_printf(args_buf, "%s\n", params);
         }
         strncpy(args, pa_strbuf_tostring_free(args_buf), DEVICE_PARAM_STRING_MAX);
     } else {
@@ -1478,7 +1524,7 @@ static dm_device* create_device_item(const char *device_type, const char *name,
     pa_assert(device_type);
     pa_assert(profile_item);
 
-    pa_log_debug("Create device item for %s", device_type);
+    pa_log_info("Create device item for %s", device_type);
 
     device_item = (dm_device *)pa_xmalloc(sizeof(dm_device));
     device_item->id = device_id_max_g++;
@@ -1512,7 +1558,7 @@ static void destroy_device_item(dm_device *device_item, pa_device_manager *dm) {
         return;
     }
 
-    pa_log_debug("Destroy device item which of type is %s", device_item->type);
+    pa_log_info("Destroy device item which of type is %s", device_item->type);
 
     device_item_free_func(device_item);
 }
@@ -1576,7 +1622,7 @@ static dm_device* destroy_device_profile(dm_device_profile *profile_item, pa_dev
 
     device_item = profile_item->device_item;
 
-    pa_log_debug("Destroy device profile item which of profile is %s", profile_item->profile);
+    pa_log_info("Destroy device profile item which of profile is %s", profile_item->profile);
 
     if (_device_item_get_size(device_item) == 1) {
         destroy_device_item(device_item, dm);
@@ -1900,7 +1946,7 @@ static dm_device_profile* handle_not_predefined_device_profile(void *pulse_devic
     dm_device_profile *profile_item = NULL;
     dm_device_direction_t direc;
 
-    pa_log_debug("Create device profile item %s", device_profile);
+    pa_log_info("Create device profile item %s", device_profile);
     if (pdt == PA_DEVICE_TYPE_SINK)
         direc = DM_DEVICE_DIRECTION_OUT;
     else
@@ -1940,7 +1986,7 @@ static dm_device* handle_not_predefined_device(pa_device_manager *dm, void *puls
     pa_assert(dm);
     pa_assert(pulse_device);
 
-    pa_log_debug("handle_not_predefined_device");
+    pa_log_info("handle_not_predefined_device");
 
     if (pdt == PA_DEVICE_TYPE_SINK)
        ((pa_sink*)pulse_device)->use_internal_codec = false;
@@ -2284,7 +2330,8 @@ static void handle_predefined_device_loaded(void *pulse_device, pa_device_type_t
     pa_assert(device_string);
     pa_assert(role);
 
-    pa_log_debug("Predefined device loaded, Type:%s, Class:%d, device_string:%s, role:%s", pdt == PA_DEVICE_TYPE_SINK ? "sink" : "source", device_class, device_string, role);
+    pa_log_info("Predefined device loaded, Type:%s, Class:%d, device_string:%s, role:%s",
+            pdt == PA_DEVICE_TYPE_SINK ? "sink" : "source", device_class, device_string, role);
 
     if (pdt == PA_DEVICE_TYPE_SINK)
        ((pa_sink*)pulse_device)->use_internal_codec = true;
@@ -2362,7 +2409,7 @@ static void handle_sink_unloaded(pa_sink *sink, pa_device_manager *dm) {
                 PA_HASHMAP_FOREACH_KEY(sink_iter, profile_item->playback_devices, state, role) {
                     if (sink_iter == sink) {
                         unsigned int profile_playback_size = 0, profile_capture_size = 0, item_size = 0;
-                        pa_log_debug("device '%s' have this sink", device_item->name);
+                        pa_log_info("device '%s' have this sink", device_item->name);
                         _device_profile_get_size(profile_item, &profile_playback_size, &profile_capture_size);
                         item_size = _device_item_get_size(device_item);
                         pa_log_debug("profile playback size : %u, capture size : %u, item size : %u", profile_playback_size, profile_capture_size, item_size);
@@ -2425,7 +2472,7 @@ static void handle_source_unloaded(pa_source *source, pa_device_manager *dm) {
                 PA_HASHMAP_FOREACH_KEY(source_iter, profile_item->capture_devices, state, role) {
                     if (source_iter == source) {
                         unsigned int profile_playback_size = 0, profile_capture_size = 0, item_size = 0;
-                        pa_log_debug("device '%s' have this source", device_item->name);
+                        pa_log_info("device '%s' have this source", device_item->name);
                         _device_profile_get_size(profile_item, &profile_playback_size, &profile_capture_size);
                         item_size = _device_item_get_size(device_item);
                         pa_log_debug("profile playback size : %u, capture size : %u, item size : %u", profile_playback_size, profile_capture_size, item_size);
@@ -2481,15 +2528,15 @@ static pa_hook_result_t sink_put_hook_callback(pa_core *c, pa_sink *sink, pa_dev
         return PA_HOOK_OK;
     }
 
-    pa_log_debug("========== Sink Put Hook Callback '%s'(%d) ==========", sink->name, sink->index);
+    pa_log_info("========== Sink Put Hook Callback '%s'(%d) ==========", sink->name, sink->index);
 
     device_class = pulse_device_get_class(sink, PA_DEVICE_TYPE_SINK);
-    pa_log_debug("Device Class '%s'", device_class_to_string(device_class));
+    pa_log_info("Device Class '%s'", device_class_to_string(device_class));
 
     if (!(device_string = pulse_device_get_device_string(sink, PA_DEVICE_TYPE_SINK))) {
         return PA_HOOK_OK;
     } else {
-        pa_log_debug("Device String '%s'", device_string);
+        pa_log_info("Device String '%s'", device_string);
     }
 
     if (device_class == DM_DEVICE_CLASS_BT) {
@@ -2512,7 +2559,7 @@ static pa_hook_result_t sink_put_hook_callback(pa_core *c, pa_sink *sink, pa_dev
         handle_not_predefined_device(dm, sink, PA_DEVICE_TYPE_SINK, device_class);
     }
 
-    dump_device_list(dm);
+    dump_device_list_info(dm, PA_LOG_INFO);
     return PA_HOOK_OK;
 }
 
@@ -2527,9 +2574,9 @@ static pa_hook_result_t sink_unlink_hook_callback(pa_core *c, pa_sink *sink, pa_
         return PA_HOOK_OK;
     }
 
-    pa_log_debug("=========== Sink unlink Hook Callback '%s'(%d) ==========", sink->name, sink->index);
+    pa_log_info("=========== Sink unlink Hook Callback '%s'(%d) ==========", sink->name, sink->index);
     handle_sink_unloaded(sink, dm);
-    dump_device_list(dm);
+    dump_device_list_info(dm, PA_LOG_INFO);
     return PA_HOOK_OK;
 }
 
@@ -2603,16 +2650,16 @@ static pa_hook_result_t source_put_hook_callback(pa_core *c, pa_source *source,
         return PA_HOOK_OK;
     }
 
-    pa_log_debug("========== Source Put Hook Callback '%s'(%d) ==========", source->name, source->index);
+    pa_log_info("========== Source Put Hook Callback '%s'(%d) ==========", source->name, source->index);
 
 
     device_class = pulse_device_get_class(source, PA_DEVICE_TYPE_SOURCE);
-    pa_log_debug("Device Class '%s'", device_class_to_string(device_class));
+    pa_log_info("Device Class '%s'", device_class_to_string(device_class));
 
     if (!(device_string = pulse_device_get_device_string(source, PA_DEVICE_TYPE_SOURCE))) {
         return PA_HOOK_OK;
     } else {
-        pa_log_debug("Device String '%s'", device_string);
+        pa_log_info("Device String '%s'", device_string);
     }
 
     if (device_class == DM_DEVICE_CLASS_BT) {
@@ -2635,7 +2682,7 @@ static pa_hook_result_t source_put_hook_callback(pa_core *c, pa_source *source,
         handle_not_predefined_device(dm, source, PA_DEVICE_TYPE_SOURCE, device_class);
     }
 
-    dump_device_list(dm);
+    dump_device_list_info(dm, PA_LOG_INFO);
     return PA_HOOK_OK;
 }
 
@@ -2650,9 +2697,9 @@ static pa_hook_result_t source_unlink_hook_callback(pa_core *c, pa_source *sourc
         return PA_HOOK_OK;
     }
 
-    pa_log_debug("========== Source unlink Hook Callback '%s'(%d) ==========", source->name, source->index);
+    pa_log_info("========== Source unlink Hook Callback '%s'(%d) ==========", source->name, source->index);
     handle_source_unloaded(source, dm);
-    dump_device_list(dm);
+    dump_device_list_info(dm, PA_LOG_INFO);
 
     return PA_HOOK_OK;
 }
@@ -2674,7 +2721,7 @@ static void* load_device(pa_core *c, pa_device_type_t pdt, const char *device_st
     pa_assert(device_string);
     pa_assert(device_params);
 
-    pa_log_debug("-------- load_%s_device : '%s' '%s' -------", pdt == PA_DEVICE_TYPE_SINK ? "playback" : "capture", device_string, device_params);
+    pa_log_info("Load %s Device : String'%s' Param'%s'", pdt == PA_DEVICE_TYPE_SINK ? "Playback" : "Capture", device_string, device_params);
 
     device_class = device_string_get_class(device_string);
     if (device_class <= DM_DEVICE_CLASS_NONE || device_class >= DM_DEVICE_CLASS_MAX) {
@@ -2806,7 +2853,7 @@ static pa_hashmap* parse_device_role_object(json_object *device_role_o) {
         if (!(params = json_object_get_string(params_o))) {
             pa_log_debug("There is no device params for role '%s'", device_role);
         }
-        pa_log_debug("[DEBUG_PARSE] role '%s' - params '%s'", device_role, params);
+        pa_log_info("- Role '%s' -> '%s'", device_role, params);
         if (device_role_is_valid(device_role)) {
             if (pa_hashmap_put(roles, (void *)device_role, (void *)params)) {
                 pa_log_error("put new role to hashmap faild");
@@ -2846,7 +2893,7 @@ static struct device_file_info* parse_device_file_object(json_object *device_fil
 
     if (json_object_object_get_ex(device_file_o, "device-string", &device_file_prop_o) && json_object_is_type(device_file_prop_o, json_type_string)) {
         if ((device_string = json_object_get_string(device_file_prop_o))) {
-            pa_log_debug("[DEBUG_PARSE] ---------------- Device File '%s' ----------------", device_string);
+            pa_log_info("[ Device File - %s ]", device_string);
         } else {
             pa_log_error("Get device-string failed");
             return NULL;
@@ -2922,7 +2969,7 @@ static struct device_file_map *parse_device_file_map() {
     json_object *o, *device_files_o;
     json_object *playback_devices_o = NULL, *capture_devices_o = NULL;
 
-    pa_log_debug("\n[DEBUG_PARSE] ==================== Parse device files ====================");
+    pa_log_info("\nParse device files");
 
     o = json_object_from_file(DEVICE_MAP_FILE);
 
@@ -2935,11 +2982,11 @@ static struct device_file_map *parse_device_file_map() {
 
     if (json_object_object_get_ex(o, DEVICE_FILE_OBJECT, &device_files_o) && json_object_is_type(device_files_o, json_type_object)) {
         if (json_object_object_get_ex(device_files_o, "playback-devices", &playback_devices_o)) {
-            pa_log_debug("[DEBUG_PARSE] ----------------- Playback Device Files ------------------");
+            pa_log_info("Playback Device Files");
             file_map->playback = parse_device_file_array_object(playback_devices_o);
         }
         if (json_object_object_get_ex(device_files_o, "capture-devices", &capture_devices_o)) {
-            pa_log_debug("[DEBUG_PARSE] ----------------- Capture Device Files ------------------");
+            pa_log_info("Capture Device Files");
             file_map->capture = parse_device_file_array_object(capture_devices_o);
         }
     } else {
@@ -2972,7 +3019,7 @@ static pa_hashmap* parse_device_role_map(json_object *device_role_map_o) {
         if (!(device_string = json_object_get_string(device_string_o))) {
             pa_log_debug("There is no device string for role '%s'", device_role);
         }
-        pa_log_debug("[DEBUG_PARSE] role '%s' - device_string '%s'", device_role, device_string);
+        pa_log_info("- Role '%s' -> '%s'", device_role, device_string);
         if (device_role_is_valid(device_role)) {
             if (pa_hashmap_put(roles, (void *)device_role, (void *)device_string)) {
                 pa_log_error("put new role to hashmap faild");
@@ -3012,7 +3059,7 @@ static pa_idxset* parse_device_type_infos() {
         return NULL;
     }
 
-    pa_log_debug("\n[DEBUG_PARSE] ==================== Parse device types ====================");
+    pa_log_info("\nParse device types");
     type_infos = pa_idxset_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
 
     if (json_object_object_get_ex(o, DEVICE_TYPE_OBJECT, &device_array_o) && json_object_is_type(device_array_o, json_type_array)) {
@@ -3029,7 +3076,7 @@ static pa_idxset* parse_device_type_infos() {
 
                 if (json_object_object_get_ex(device_o, "device-type", &device_prop_o) && json_object_is_type(device_prop_o, json_type_string)) {
                     device_type = json_object_get_string(device_prop_o);
-                    pa_log_debug("[DEBUG_PARSE] ---------------- Parse device '%s' ----------------", device_type);
+                    pa_log_info("[ Device - %s ]", device_type);
                     type_info->type = device_type;
                 } else {
                     pa_log_error("Get device type failed");
@@ -3037,7 +3084,7 @@ static pa_idxset* parse_device_type_infos() {
                 }
                 if (json_object_object_get_ex(device_o, "profile", &device_prop_o) && json_object_is_type(device_prop_o, json_type_string)) {
                     device_profile = json_object_get_string(device_prop_o);
-                    pa_log_debug("[DEBUG_PARSE] Profile: %s", device_profile);
+                    pa_log_info("Profile - %s", device_profile);
                     type_info->profile = device_profile;
                 } else {
                     pa_log_debug("no device-profile");
@@ -3046,7 +3093,7 @@ static pa_idxset* parse_device_type_infos() {
 
                 if (json_object_object_get_ex(device_o, DEVICE_TYPE_PROP_BUILTIN, &device_prop_o) && json_object_is_type(device_prop_o, json_type_boolean)) {
                     builtin = json_object_get_boolean(device_prop_o);
-                    pa_log_debug("[DEBUG_PARSE] builtin: %d", builtin);
+                    pa_log_debug("Builtin : %d", builtin);
                     type_info->builtin = builtin;
                 } else {
                     pa_log_error("Get device prop '%s' failed", DEVICE_TYPE_PROP_BUILTIN);
@@ -3062,7 +3109,7 @@ static pa_idxset* parse_device_type_infos() {
                     for (array_idx = 0; array_idx < array_len; array_idx++) {
                         if ((array_item_o = json_object_array_get_idx(device_prop_o, array_idx)) && json_object_is_type(array_item_o, json_type_string)) {
                             direction = json_object_get_string(array_item_o);
-                            pa_log_debug("[DEBUG_PARSE] direction : %s", direction);
+                            pa_log_debug("Direction : %s", direction);
                             type_info->direction[array_idx] = device_direction_to_int(direction);
                         }
                     }
@@ -3079,7 +3126,7 @@ static pa_idxset* parse_device_type_infos() {
                     for (array_idx = 0; array_idx < array_len; array_idx++) {
                         if ((array_item_o = json_object_array_get_idx(device_prop_o, array_idx)) && json_object_is_type(array_item_o, json_type_string)) {
                             avail_cond = json_object_get_string(array_item_o);
-                            pa_log_debug("[DEBUG_PARSE] avail-condition : %s", avail_cond);
+                            pa_log_debug("avail-condition : %s", avail_cond);
                             strncpy(type_info->avail_condition[array_idx], avail_cond, DEVICE_AVAIL_COND_STR_MAX);
                         }
                     }
@@ -3088,12 +3135,12 @@ static pa_idxset* parse_device_type_infos() {
                 }
 
                 if (json_object_object_get_ex(device_o, "playback-devices", &device_prop_o) && json_object_is_type(device_prop_o, json_type_object)) {
-                    pa_log_debug("[DEBUG_PARSE] ------ playback devices ------");
+                    pa_log_info("Playback Devices");
                     type_info->playback_devices = parse_device_role_map(device_prop_o);
                 }
 
                 if (json_object_object_get_ex(device_o, "capture-devices", &device_prop_o) && json_object_is_type(device_prop_o, json_type_object)) {
-                    pa_log_debug("[DEBUG_PARSE] ------ capture devices ------");
+                    pa_log_info("Capture Devices");
                     type_info->capture_devices = parse_device_role_map(device_prop_o);
                 }
                 pa_idxset_put(type_infos, type_info, NULL);
@@ -3129,7 +3176,7 @@ static int handle_device_connected(pa_device_manager *dm, const char *device_typ
     pa_assert(dm);
     pa_assert(dm->device_status);
 
-    pa_log_debug("Device %s connected, detected_type : %d", device_type, detected_type);
+    pa_log_info("Device %s connected, detected_type : %d", device_type, detected_type);
     if (!(status_info = _device_manager_get_status_info(dm->device_status, device_type, device_profile, identifier))) {
         pa_log_error("No device_status_info for %s.%s", device_type, device_profile);
         return -1;
@@ -3168,7 +3215,7 @@ static int handle_device_disconnected(pa_device_manager *dm, const char *device_
     pa_assert(dm);
     pa_assert(dm->device_status);
 
-    pa_log_debug("Device %s disconnected", device_type);
+    pa_log_info("Device %s disconnected", device_type);
     if (!(status_info = _device_manager_get_status_info(dm->device_status, device_type, device_profile, identifier))) {
         pa_log_error("No device_status_info for %s.%s", device_type, device_profile);
         return -1;
@@ -3202,7 +3249,8 @@ static int handle_device_status_changed(pa_device_manager *dm, const char *devic
     pa_assert(dm);
     pa_assert(device_type_is_valid(device_type));
 
-    pa_log_debug("Device Status Changed, type : '%s', profile : '%s', identifier : '%s', detected_status : %d", device_type, device_profile, identifier, detected_status);
+    pa_log_info("Device Status Changed, type : '%s', profile : '%s', identifier : '%s', detected_status : %d",
+            device_type, device_profile, identifier, detected_status);
     if (pa_streq(device_type, DEVICE_TYPE_AUDIO_JACK)) {
         if (detected_status == EARJACK_DISCONNECTED) {
             handle_device_disconnected(dm, device_type, device_profile, identifier);
@@ -3345,12 +3393,8 @@ static DBusHandlerResult dbus_filter_device_detect_handler(DBusConnection *c, DB
     if (dbus_message_get_type(s) != DBUS_MESSAGE_TYPE_SIGNAL)
         return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 
-    pa_log_info("Dbus device detect handler received msg");
-
-    pa_log_debug("path       : %s", dbus_message_get_path(s));
-    pa_log_debug("interface  : %s", dbus_message_get_interface(s));
-    pa_log_debug("member     : %s", dbus_message_get_member(s));
-    pa_log_debug("siganature : %s", dbus_message_get_signature(s));
+    pa_log_info("Device detect handler : Path(%s) Intf(%s) Member(%s) Signature(%s)",
+            dbus_message_get_path(s), dbus_message_get_interface(s), dbus_message_get_member(s), dbus_message_get_signature(s));
 
     dbus_error_init(&error);
 
@@ -3383,7 +3427,7 @@ static DBusHandlerResult dbus_filter_device_detect_handler(DBusConnection *c, DB
             goto fail;
         }
         dbus_message_iter_get_basic(&msg_iter, &property_name);
-        pa_log_debug("property name : %s", property_name);
+        pa_log_info("Changed Property name : %s", property_name);
 
         if (!dbus_message_iter_next(&msg_iter)) {
             pa_log_debug("Property value missing");
@@ -3402,7 +3446,7 @@ static DBusHandlerResult dbus_filter_device_detect_handler(DBusConnection *c, DB
             char *name;
             dbus_message_iter_get_basic(&variant_iter, &value);
             if (pa_streq(property_name, "Connected")) {
-                pa_log_debug("HFP Connection : %d", value);
+                pa_log_info("HFP Connection : %d", value);
                 if (value) {
                     method_call_bt_get_name(c, dbus_message_get_path(s), &name);
                     status = BT_SCO_CONNECTED;
@@ -3413,7 +3457,7 @@ static DBusHandlerResult dbus_filter_device_detect_handler(DBusConnection *c, DB
             }
         }
     } else {
-        pa_log_info("Unknown message, not handle it");
+        pa_log_debug("Unknown message, not handle it");
         dbus_error_free(&error);
         return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
     }
@@ -3437,7 +3481,7 @@ static int watch_signals(pa_device_manager *dm) {
 
     dbus_error_init(&error);
 
-    pa_log_debug("Watch Dbus signals");
+    pa_log_info("Watch Dbus signals");
 
     if (!dbus_connection_add_filter(pa_dbus_connection_get(dm->dbus_conn), dbus_filter_device_detect_handler, dm, NULL)) {
         pa_log_error("Unable to add D-Bus filter : %s: %s", error.name, error.message);
@@ -3456,7 +3500,7 @@ fail:
 }
 
 static void unwatch_signals(pa_device_manager *dm) {
-    pa_log_debug("Unwatch Dbus signals");
+    pa_log_info("Unwatch Dbus signals");
 
     pa_assert(dm);
     pa_assert(dm->dbus_conn);
@@ -3473,13 +3517,14 @@ static void send_device_connected_signal(uint32_t event_id, dm_device *device_it
     dbus_bool_t _connected = connected;
     dm_device_state_t compound_state;
     dbus_int32_t device_id;
+    const char *device_info_str;
 
     pa_assert(device_item);
     pa_assert(device_item->profiles);
     pa_assert(dm);
 
-    pa_log_debug("Send following device %s signal", connected ? "Connected" : "Disconnected");
-    dump_device_info(device_item);
+    pa_log_info("Send following device %s signal", connected ? "Connected" : "Disconnected");
+    dump_device_info(device_item, PA_LOG_INFO);
 
     pa_assert_se(signal_msg = dbus_message_new_signal(DBUS_OBJECT_DEVICE_MANAGER, DBUS_INTERFACE_DEVICE_MANAGER, "DeviceConnected"));
     dbus_message_iter_init_append(signal_msg, &msg_iter);
@@ -3511,13 +3556,14 @@ static void send_device_info_changed_signal(uint32_t event_id, dm_device *device
     dm_device_profile *profile_item;
     dm_device_state_t compound_state;
     dbus_int32_t device_id;
+    const char *device_info_str;
 
     pa_assert(device_item);
     pa_assert(device_item->profiles);
     pa_assert(dm);
 
-    pa_log_debug("Send folling device info changed signal");
-    dump_device_info(device_item);
+    pa_log_debug("Send following device info changed signal");
+    dump_device_info(device_item, PA_LOG_DEBUG);
 
     pa_assert_se(signal_msg = dbus_message_new_signal(DBUS_OBJECT_DEVICE_MANAGER, DBUS_INTERFACE_DEVICE_MANAGER, "DeviceInfoChanged"));
     dbus_message_iter_init_append(signal_msg, &msg_iter);
@@ -3770,7 +3816,7 @@ static void handle_get_connected_device_list(DBusConnection *conn, DBusMessage *
     pa_assert(msg);
     pa_assert(userdata);
 
-    pa_log_debug("Get connected device list");
+    pa_log_info("Get connected device list");
 
     dm = (pa_device_manager*) userdata;
 
@@ -3820,7 +3866,7 @@ static void handle_get_bt_a2dp_status(DBusConnection *conn, DBusMessage *msg, vo
     pa_assert(msg);
     pa_assert(userdata);
 
-    pa_log_debug("Get bt a2dp list");
+    pa_log_info("Get BT A2DP list");
 
     dm = (pa_device_manager*) userdata;
 
@@ -3940,7 +3986,7 @@ static DBusHandlerResult method_call_handler(DBusConnection *c, DBusMessage *m,
     interface = dbus_message_get_interface(m);
     member = dbus_message_get_member(m);
 
-    pa_log_debug("DeviceManager Method Call Handler : path=%s, interface=%s, member=%s", path, interface, member);
+    pa_log_info("DeviceManager Method Call Handler : path=%s, interface=%s, member=%s", path, interface, member);
 
     if (!pa_streq(path, DBUS_OBJECT_DEVICE_MANAGER))
         return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
@@ -3967,7 +4013,7 @@ static void endpoint_init(pa_device_manager *dm) {
         .message_function = method_call_handler,
     };
 
-    pa_log_debug("Device manager dbus endpoint init");
+    pa_log_info("Device manager dbus endpoint init");
 
     if (dm && dm->dbus_conn) {
         if (!dbus_connection_register_object_path(pa_dbus_connection_get(dm->dbus_conn), DBUS_OBJECT_DEVICE_MANAGER, &vtable_endpoint, dm))
@@ -3978,7 +4024,7 @@ static void endpoint_init(pa_device_manager *dm) {
 }
 
 static void endpoint_done(pa_device_manager *dm) {
-    pa_log_debug("Device manager dbus endpoint done");
+    pa_log_info("Device manager dbus endpoint done");
     if (dm && dm->dbus_conn) {
         if (!dbus_connection_unregister_object_path(pa_dbus_connection_get(dm->dbus_conn), DBUS_OBJECT_DEVICE_MANAGER))
             pa_log_error("Failed to unregister object path");
@@ -3992,7 +4038,7 @@ static void dbus_init(pa_device_manager *dm) {
     pa_dbus_connection *connection = NULL;
 
     pa_assert(dm);
-    pa_log_debug("Dbus init");
+    pa_log_info("Dbus init");
     dbus_error_init(&error);
 
     if (!(connection = pa_dbus_bus_get(dm->core, DBUS_BUS_SYSTEM, &error)) || dbus_error_is_set(&error)) {
@@ -4002,7 +4048,7 @@ static void dbus_init(pa_device_manager *dm) {
         pa_log_error("Unable to contact D-Bus system bus: %s: %s", error.name, error.message);
         goto fail;
     } else {
-        pa_log_debug("Got dbus connection");
+        pa_log_info("Got dbus connection");
     }
 
     dm->dbus_conn = connection;
@@ -4021,7 +4067,7 @@ fail:
 static void dbus_deinit(pa_device_manager *dm) {
     pa_assert(dm);
 
-    pa_log_debug("Dbus deinit");
+    pa_log_info("Dbus deinit");
 
     endpoint_done(dm);
     unwatch_signals(dm);
@@ -4060,7 +4106,7 @@ pa_sink* pa_device_manager_get_sink(dm_device *device_item, const char *role) {
     pa_assert(profile_item = _device_item_get_active_profile(device_item));
 
     if (!profile_item->playback_devices) {
-        pa_log_warn("No playback device in %s", device_item->name);
+        pa_log_debug("No playback device in %s", device_item->name);
         return NULL;
     }
     if ((sink = pa_hashmap_get(profile_item->playback_devices, role)))
@@ -4081,7 +4127,7 @@ pa_source* pa_device_manager_get_source(dm_device *device_item, const char *role
     pa_assert(profile_item = _device_item_get_active_profile(device_item));
 
     if (!profile_item->capture_devices) {
-        pa_log_warn("No capture device in %s", device_item->name);
+        pa_log_debug("No capture device in %s", device_item->name);
         return NULL;
     }
 
@@ -4113,7 +4159,7 @@ void pa_device_manager_set_device_state(dm_device *device_item, dm_device_direct
     pa_assert(device_item);
     pa_assert(profile_item = _device_item_get_active_profile(device_item));
 
-    pa_log_debug("pa_device_manager_set_device_state : %s.%s  direction %s -> %d", device_item->type, profile_item->profile, device_direction_to_string(direction), state);
+    pa_log_info("pa_device_manager_set_device_state : %s.%s  direction %s -> %d", device_item->type, profile_item->profile, device_direction_to_string(direction), state);
     _device_profile_set_state(profile_item, direction, state);
 }
 
@@ -4203,22 +4249,22 @@ int pa_device_manager_bt_sco_open(pa_device_manager *dm) {
     pa_assert(dm->dbus_conn);
 
     if (dm->bt_sco_status != DM_DEVICE_BT_SCO_STATUS_CONNECTED) {
-        pa_log_error("bt-sco not connected");
+        pa_log_error("BT SCO Not Connected");
         return -1;
     }
 
     if ((bt_device = _device_manager_get_device(dm->device_list, DEVICE_TYPE_BT)) == NULL) {
-        pa_log_error("no bt device");
+        pa_log_error("No BT Device");
         return -1;
     }
 
-    pa_log_debug("bt sco open start");
+    pa_log_info("BT SCO Open - Request to BT FW");
     if (method_call_bt_sco(pa_dbus_connection_get(dm->dbus_conn), true) < 0) {
         pa_log_error("Failed to bt sco on");
         return -1;
     }
+    pa_log_info("BT SCO Open - SUCCESS");
 
-    pa_log_debug("bt sco open end");
     dm->bt_sco_status = DM_DEVICE_BT_SCO_STATUS_OPENED;
     handle_device_connected(dm, DEVICE_TYPE_BT, DEVICE_PROFILE_BT_SCO, NULL, NULL, DEVICE_DETECTED_BT_SCO);
 
@@ -4229,6 +4275,7 @@ void pa_device_manager_bt_sco_get_status(pa_device_manager *dm, dm_device_bt_sco
     pa_assert(dm);
     pa_assert(status);
 
+    pa_log_info("BT SCO get status %d", dm->bt_sco_status);
     *status = dm->bt_sco_status;
 
     return;
@@ -4240,26 +4287,27 @@ int pa_device_manager_bt_sco_close(pa_device_manager *dm) {
     pa_assert(dm);
     pa_assert(dm->dbus_conn);
 
+
     if (dm->bt_sco_status != DM_DEVICE_BT_SCO_STATUS_OPENED) {
-        pa_log_error("bt-sco not opened");
+        pa_log_error("BT SCO Not Opened");
         return -1;
     }
 
     if ((bt_device = _device_manager_get_device(dm->device_list, DEVICE_TYPE_BT)) == NULL) {
-        pa_log_error("no bt device");
+        pa_log_error("No BT Device");
         return -1;
     }
 
-    pa_log_debug("bt sco close start");
+    pa_log_info("BT SCO Close - Request to BT FW");
     if (method_call_bt_sco(pa_dbus_connection_get(dm->dbus_conn), false) < 0) {
-        pa_log_error("Failed to bt sco close");
+        pa_log_error("Failed to BT SCO Close");
         return -1;
     }
+    pa_log_info("BT SCO Close - Success");
 
     dm->bt_sco_status = DM_DEVICE_BT_SCO_STATUS_CONNECTED;
     handle_device_disconnected(dm, DEVICE_TYPE_BT, DEVICE_PROFILE_BT_SCO, NULL);
 
-    pa_log_debug("bt sco close end");
 
     return 0;
 }
@@ -4268,14 +4316,14 @@ int pa_device_manager_bt_sco_get_property(pa_device_manager *dm, bool *is_wide_b
     pa_assert(dm);
     pa_assert(dm->dbus_conn);
 
-    pa_log_debug("bt sco get property start");
+    pa_log_info("BT SCO Get Property - Request to BT FW");
 
     if (method_call_bt_sco_get_property(pa_dbus_connection_get(dm->dbus_conn), is_wide_band, nrec) < 0) {
-        pa_log_error("Failed to get bt property");
+        pa_log_error("Failed to get BT SCO Property");
         return -1;
     }
 
-    pa_log_debug("bt sco get property end");
+    pa_log_info("BT SCO Get Property - Success, is wide band : %s, nrec : %s", pa_yes_no(is_wide_band), pa_yes_no(nrec));
 
     return 0;
 }
@@ -4292,12 +4340,12 @@ int pa_device_manager_load_sink(pa_device_manager *dm, const char *device_type,
     pa_assert(dm);
     pa_assert(dm->device_list);
 
-    pa_log_debug("load sink for '%s,%s'", device_type, role);
+    pa_log_info("Load Sink for '%s.%s.%s'", device_type, device_profile, role);
     PA_IDXSET_FOREACH(device_item, dm->device_list, device_idx) {
         if (pa_streq(device_type, device_item->type)) {
             if ((profile_item = _device_item_get_profile(device_item, device_profile))) {
                 if (pa_hashmap_get(profile_item->playback_devices, role)) {
-                    pa_log_warn("Proper sink for '%s:%s' already loaded", device_type, role);
+                    pa_log_warn("Proper sink for '%s.%s.%s' already loaded", device_type, device_profile, role);
                     return -1;
                 }
             }
@@ -4310,7 +4358,7 @@ int pa_device_manager_load_sink(pa_device_manager *dm, const char *device_type,
     }
 
     if (!(device_string = pa_hashmap_get(type_info->playback_devices, role))) {
-        pa_log_error("No device-string for '%s:%s'", device_type, role);
+        pa_log_error("No device-string for '%s.%s.%s'", device_type, device_profile, role);
         goto failed;
     }
 
@@ -4348,13 +4396,13 @@ int pa_device_manager_load_source(pa_device_manager *dm, const char *device_type
 
     pa_assert(dm);
 
-    pa_log_debug("load source for '%s,%s'", device_type, role);
+    pa_log_info("Load Source for '%s.%s.%s'", device_type, device_profile, role);
 
     PA_IDXSET_FOREACH(device_item, dm->device_list, device_idx) {
         if (pa_streq(device_type, device_item->type)) {
             if ((profile_item = _device_item_get_profile(device_item, device_profile))) {
                 if (pa_hashmap_get(profile_item->capture_devices, role)) {
-                    pa_log_warn("Proper source for '%s:%s' already loaded", device_type, role);
+                    pa_log_warn("Proper source for '%s.%s.%s' already loaded", device_type, device_profile, role);
                     return -1;
                 }
             }
@@ -4368,7 +4416,7 @@ int pa_device_manager_load_source(pa_device_manager *dm, const char *device_type
     }
 
     if (!(device_string = pa_hashmap_get(type_info->capture_devices, role))) {
-        pa_log_error("No device-string for '%s:%s'", device_type, role);
+        pa_log_error("No device-string for '%s.%s.%s'", device_type, device_profile, role);
         goto failed;
     }
 
@@ -4400,6 +4448,8 @@ pa_device_manager* pa_device_manager_get(pa_core *c) {
 
     pa_assert(c);
 
+    pa_log_info("pa_device_manager_get");
+
     if ((dm = pa_shared_get(c, SHARED_DEVICE_MANAGER)))
         return pa_device_manager_ref(dm);
 
@@ -4460,6 +4510,7 @@ pa_device_manager* pa_device_manager_ref(pa_device_manager *dm) {
     pa_assert(dm);
     pa_assert(PA_REFCNT_VALUE(dm) > 0);
 
+    pa_log_info("pa_device_manager_ref");
     PA_REFCNT_INC(dm);
 
     return dm;
@@ -4469,6 +4520,7 @@ void pa_device_manager_unref(pa_device_manager *dm) {
     pa_assert(dm);
     pa_assert(PA_REFCNT_VALUE(dm) > 0);
 
+    pa_log_info("pa_device_manager_unref");
     if (PA_REFCNT_DEC(dm) > 0)
         return;