improve logging

Remove some harmless warnings from the log
Remove some excessive info logging
This commit is contained in:
Wim Taymans 2020-02-21 11:09:34 +01:00
parent a528189d26
commit d8bac82e72
11 changed files with 24 additions and 25 deletions

View file

@ -28,7 +28,7 @@ static int spa_alsa_open(struct state *state)
CHECK(snd_output_stdio_attach(&state->output, stderr, 0), "attach failed");
spa_log_info(state->log, NAME"%p: ALSA device open '%s' %s", state, props->device,
spa_log_info(state->log, NAME" %p: ALSA device open '%s' %s", state, props->device,
state->stream == SND_PCM_STREAM_CAPTURE ? "capture" : "playback");
CHECK(snd_pcm_open(&state->hndl,
props->device,
@ -71,7 +71,7 @@ int spa_alsa_close(struct state *state)
if (!state->opened)
return 0;
spa_log_info(state->log, NAME"%p: Device '%s' closing", state, state->props.device);
spa_log_info(state->log, NAME" %p: Device '%s' closing", state, state->props.device);
CHECK(snd_pcm_close(state->hndl), "close failed");
spa_system_close(state->data_system, state->timerfd);

View file

@ -195,6 +195,7 @@ static int impl_node_send_command(void *object, const struct spa_command *comman
return res;
break;
case SPA_NODE_COMMAND_Pause:
case SPA_NODE_COMMAND_Suspend:
if ((res = spa_alsa_seq_pause(this)) < 0)
return res;
break;

View file

@ -245,7 +245,7 @@ static int setup_convert(struct impl *this,
emit_params_changed(this);
spa_log_info(this->log, NAME " %p: got channelmix features %08x:%08x identity:%d",
spa_log_debug(this->log, NAME " %p: got channelmix features %08x:%08x identity:%d",
this, this->cpu_flags, this->mix.cpu_flags,
this->mix.identity);

View file

@ -194,7 +194,7 @@ static int setup_convert(struct impl *this)
if ((res = convert_init(&this->conv)) < 0)
return res;
spa_log_info(this->log, NAME " %p: got converter features %08x:%08x", this,
spa_log_debug(this->log, NAME " %p: got converter features %08x:%08x", this,
this->cpu_flags, this->conv.cpu_flags);
this->is_passthrough = this->conv.is_passthrough;

View file

@ -594,7 +594,7 @@ static int setup_convert(struct impl *this)
if ((res = convert_init(&this->conv)) < 0)
return res;
spa_log_info(this->log, NAME " %p: got converter features %08x:%08x", this,
spa_log_debug(this->log, NAME " %p: got converter features %08x:%08x", this,
this->cpu_flags, this->conv.cpu_flags);
this->is_passthrough = src_fmt == dst_fmt;

View file

@ -582,7 +582,7 @@ static int setup_convert(struct impl *this)
if ((res = convert_init(&this->conv)) < 0)
return res;
spa_log_info(this->log, NAME " %p: got converter features %08x:%08x", this,
spa_log_debug(this->log, NAME " %p: got converter features %08x:%08x", this,
this->cpu_flags, this->conv.cpu_flags);
this->is_passthrough &= this->conv.is_passthrough;

View file

@ -128,10 +128,10 @@ context_check_access(void *data, struct pw_impl_client *client)
}
if (pid < 0) {
pw_log_info("no trusted pid found, assuming not sandboxed\n");
pw_log_info("client %p: no trusted pid found, assuming not sandboxed", client);
goto granted;
} else {
pw_log_info("client has trusted pid %d", pid);
pw_log_info("client %p has trusted pid %d", client, pid);
}
if (impl->properties && (str = pw_properties_get(impl->properties, "blacklisted")) != NULL) {

View file

@ -322,7 +322,7 @@ static int impl_node_set_param(void *object, uint32_t id, uint32_t flags,
spa_return_val_if_fail(this != NULL, -EINVAL);
if (this->resource == NULL)
return -EIO;
return param == NULL ? 0 : -EIO;
return pw_client_node_resource_set_param(this->resource, id, flags, param);
}
@ -357,7 +357,7 @@ static int impl_node_set_io(void *object, uint32_t id, void *data, size_t size)
}
if (this->resource == NULL)
return -EIO;
return data == NULL ? 0 : -EIO;
return pw_client_node_resource_set_io(this->resource,
id,
@ -626,8 +626,7 @@ impl_node_port_set_param(void *object,
}
}
if (this->resource == NULL)
return -EIO;
return param == NULL ? 0 : -EIO;
return pw_client_node_resource_port_set_param(this->resource,
direction, port_id,
@ -677,7 +676,7 @@ static int do_port_set_io(struct impl *impl,
}
if (this->resource == NULL)
return -EIO;
return data == NULL ? 0 : -EIO;
return pw_client_node_resource_port_set_io(this->resource,
direction, port_id,
@ -740,7 +739,7 @@ do_port_use_buffers(struct impl *impl,
mix->n_buffers = n_buffers;
if (this->resource == NULL)
return -EIO;
return n_buffers == 0 ? 0 : -EIO;
for (i = 0; i < n_buffers; i++) {
struct buffer *b = &mix->buffers[i];
@ -1404,7 +1403,7 @@ static int impl_mix_port_set_io(void *object,
mix = pw_map_lookup(&port->mix_port_map, mix_id);
if (mix == NULL)
return -EIO;
return -EINVAL;
if (id == SPA_IO_Buffers) {
if (data && size >= sizeof(struct spa_io_buffers))

View file

@ -145,7 +145,7 @@ static void *connection_ensure_size(struct pw_protocol_native_connection *conn,
errno = -res;
return NULL;
}
pw_log_warn("connection %p: resize buffer to %zd %zd %zd",
pw_log_debug("connection %p: resize buffer to %zd %zd %zd",
conn, buf->buffer_size, size, buf->buffer_maxsize);
}
return (uint8_t *) buf->buffer_data + buf->buffer_size;

View file

@ -829,7 +829,6 @@ int pw_context_recalc_graph(struct pw_context *context)
* to an active master */
spa_list_for_each(n, &context->node_list, link) {
if (!n->visited) {
pw_log_debug(NAME" %p: unassigned node %p: '%s' %d %d", context,
n, n->name, n->active, n->want_driver);
@ -856,11 +855,11 @@ int pw_context_recalc_graph(struct pw_context *context)
if (n->rt.position && n->quantum_current != n->rt.position->clock.duration)
n->rt.position->clock.duration = n->quantum_current;
pw_log_info(NAME" %p: master %p quantum:%u '%s'", context, n,
pw_log_debug(NAME" %p: master %p quantum:%u '%s'", context, n,
n->quantum_current, n->name);
spa_list_for_each(s, &n->follower_list, follower_link)
pw_log_info(NAME" %p: follower %p: active:%d '%s'",
pw_log_debug(NAME" %p: follower %p: active:%d '%s'",
context, s, s->active, s->name);
}
return 0;

View file

@ -340,7 +340,7 @@ static int suspend_node(struct pw_impl_node *this)
res = spa_node_send_command(this->node,
&SPA_NODE_COMMAND_INIT(SPA_NODE_COMMAND_Suspend));
if (res < 0)
if (res < 0 && res != -EIO)
pw_log_warn(NAME" %p: suspend node error %s", this, spa_strerror(res));
node_update_state(this, PW_NODE_STATE_SUSPENDED, NULL);
@ -666,7 +666,7 @@ int pw_impl_node_set_driver(struct pw_impl_node *node, struct pw_impl_node *driv
remove_segment_master(old, node->info.id);
node->master = node->driver && driver == node;
pw_log_info(NAME" %p: driver %p master:%u", node, driver, node->master);
pw_log_info(NAME" %p: driver %p (%s) master:%u", node, driver, driver->name, node->master);
node->driver_node = driver;
@ -709,7 +709,8 @@ static void check_properties(struct pw_impl_node *node)
pw_log_info(NAME" %p: priority master %d", node, node->priority_master);
}
if ((str = pw_properties_get(node->properties, PW_KEY_NODE_NAME))) {
if ((str = pw_properties_get(node->properties, PW_KEY_NODE_NAME)) &&
(node->name == NULL || strcmp(str, node->name) != 0)) {
free(node->name);
node->name = strdup(str);
pw_log_info(NAME" %p: name '%s'", node, node->name);
@ -743,14 +744,13 @@ static void check_properties(struct pw_impl_node *node)
if ((str = pw_properties_get(node->properties, PW_KEY_NODE_LATENCY))) {
uint32_t num, denom;
pw_log_info(NAME" %p: latency '%s'", node, str);
if (sscanf(str, "%u/%u", &num, &denom) == 2 && denom != 0) {
uint32_t quantum_size;
quantum_size = flp2((num * 48000 / denom));
pw_log_info(NAME" %p: quantum %d", node, quantum_size);
quantum_size = flp2((num * node->context->defaults.clock_rate / denom));
if (quantum_size != node->quantum_size) {
pw_log_info(NAME" %p: latency '%s' quantum %d", node, str, quantum_size);
node->quantum_size = quantum_size;
do_recalc |= node->active;
}