diff options
author | Wim Taymans <wtaymans@redhat.com> | 2020-08-07 10:47:18 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2020-08-07 10:47:18 +0200 |
commit | f4e8ebab51f1647df4c221662f01c03760e94da9 (patch) | |
tree | 4baa630225ff1ddc0aca40dba81b13639878d1b2 | |
parent | 44e74c599f2a2e387728ac1a06cf6942273c4d41 (diff) |
improve debug and error messages
-rw-r--r-- | spa/plugins/audioconvert/audioadapter.c | 4 | ||||
-rw-r--r-- | src/modules/module-client-node/remote-node.c | 26 | ||||
-rw-r--r-- | src/pipewire/context.c | 6 | ||||
-rw-r--r-- | src/pipewire/impl-link.c | 2 |
4 files changed, 29 insertions, 9 deletions
diff --git a/spa/plugins/audioconvert/audioadapter.c b/spa/plugins/audioconvert/audioadapter.c index 6a777bdf..ad36d5f2 100644 --- a/spa/plugins/audioconvert/audioadapter.c +++ b/spa/plugins/audioconvert/audioadapter.c @@ -250,7 +250,7 @@ static int negotiate_buffers(struct impl *this) struct spa_data *datas; uint32_t follower_flags, conv_flags; - spa_log_debug(this->log, "%p: %d", this, this->n_buffers); + spa_log_debug(this->log, NAME" %p: %d", this, this->n_buffers); if (this->n_buffers > 0) return 0; @@ -452,7 +452,7 @@ static int negotiate_format(struct impl *this) spa_pod_builder_init(&b, buffer, sizeof(buffer)); - spa_log_debug(this->log, NAME "%p: negiotiate", this); + spa_log_debug(this->log, NAME " %p: negiotiate", this); state = 0; format = NULL; diff --git a/src/modules/module-client-node/remote-node.c b/src/modules/module-client-node/remote-node.c index fb479511..ae6730ae 100644 --- a/src/modules/module-client-node/remote-node.c +++ b/src/modules/module-client-node/remote-node.c @@ -401,7 +401,23 @@ client_node_set_param(void *object, uint32_t id, uint32_t flags, const struct spa_pod *param) { struct node_data *data = object; - return spa_node_set_param(data->node->node, id, flags, param); + struct pw_proxy *proxy = (struct pw_proxy*)data->client_node; + int res; + + pw_log_debug("node %p: set_param %s:", proxy, + spa_debug_type_find_name(spa_type_param, id)); + + res = spa_node_set_param(data->node->node, id, flags, param); + + if (res < 0) { + pw_log_error("node %p: set_param %s (%d) %p: %s", proxy, + spa_debug_type_find_name(spa_type_param, id), + id, param, spa_strerror(res)); + pw_proxy_errorf(proxy, res, "node_set_param(%s) failed: %s", + spa_debug_type_find_name(spa_type_param, id), + spa_strerror(res)); + } + return res; } static int @@ -559,7 +575,8 @@ client_node_port_set_param(void *object, goto error_exit; } - pw_log_debug("port %p: set param %d %p", port, id, param); + pw_log_debug("port %p: set_param %s %p", port, + spa_debug_type_find_name(spa_type_param, id), param); res = pw_impl_port_set_param(port, id, flags, param); if (res < 0) @@ -572,12 +589,13 @@ client_node_port_set_param(void *object, clear_buffers(data, mix); } } - return res; error_exit: pw_log_error("port %p: set_param %d %p: %s", port, id, param, spa_strerror(res)); - pw_proxy_errorf(proxy, res, "port_set_param: %s", spa_strerror(res)); + pw_proxy_errorf(proxy, res, "port_set_param(%s) failed: %s", + spa_debug_type_find_name(spa_type_param, id), + spa_strerror(res)); return res; } diff --git a/src/pipewire/context.c b/src/pipewire/context.c index 4e53d198..a1c6412e 100644 --- a/src/pipewire/context.c +++ b/src/pipewire/context.c @@ -905,7 +905,7 @@ int pw_context_recalc_graph(struct pw_context *context, const char *reason) fallback = n; spa_list_for_each(s, &n->follower_list, follower_link) { - pw_log_debug(NAME" %p: driver %p: follower %p %s: %d", + pw_log_debug(NAME" %p: driver %p: follower %p %s: active:%d", context, n, s, s->name, s->active); if (s != n && s->active) { /* if the driving node has active followers, it @@ -930,8 +930,8 @@ int pw_context_recalc_graph(struct pw_context *context, const char *reason) if (!n->visited) { struct pw_impl_node *t; - pw_log_debug(NAME" %p: unassigned node %p: '%s' %d %d", context, - n, n->name, n->active, n->want_driver); + pw_log_debug(NAME" %p: unassigned node %p: '%s' active:%d want_driver:%d", + context, n, n->name, n->active, n->want_driver); t = n->active && n->want_driver ? target : NULL; diff --git a/src/pipewire/impl-link.c b/src/pipewire/impl-link.c index 1db6c0bf..7bdfa382 100644 --- a/src/pipewire/impl-link.c +++ b/src/pipewire/impl-link.c @@ -1218,6 +1218,8 @@ int pw_impl_link_register(struct pw_impl_link *link, pw_global_add_listener(link->global, &link->global_listener, &global_events, link); pw_global_register(link->global); + pw_log_debug(NAME" %p: output_active:%d input_active:%d", link, + input_node->active, output_node->active); if (input_node->active && output_node->active) pw_impl_link_prepare(link); |