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;
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 {
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++;
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);
}
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);
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
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;
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;
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);
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);
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) {
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;
}
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;
}
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) {
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;
}
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;
}
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) {
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");
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;
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);
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 {
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");
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)) {
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");
}
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");
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);
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);
}
}
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);
}
}
}
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);
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;
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;
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);
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);
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");
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;
}
}
} 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;
}
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);
}
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);
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);
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);
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;
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;
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;
.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))
}
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");
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)) {
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;
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);
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)))
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;
}
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);
}
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);
pa_assert(dm);
pa_assert(status);
+ pa_log_info("BT SCO get status %d", dm->bt_sco_status);
*status = dm->bt_sco_status;
return;
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;
}
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;
}
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;
}
}
}
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;
}
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;
}
}
}
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;
}
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);
pa_assert(dm);
pa_assert(PA_REFCNT_VALUE(dm) > 0);
+ pa_log_info("pa_device_manager_ref");
PA_REFCNT_INC(dm);
return 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;