mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
improve debug
Improve log so that debug level 3 gives a reasonably readable overview of what is going on.
This commit is contained in:
parent
8ab67c5fa0
commit
aafd1e7298
33 changed files with 141 additions and 125 deletions
|
|
@ -227,16 +227,16 @@ static int set_profile(struct impl *this, uint32_t id)
|
|||
snd_ctl_t *ctl_hndl;
|
||||
int err;
|
||||
|
||||
spa_log_info(this->log, "open card %s", this->props.device);
|
||||
if ((err = snd_ctl_open(&ctl_hndl, this->props.device, 0)) < 0) {
|
||||
spa_log_error(this->log, "can't open control for card %s: %s",
|
||||
this->props.device, snd_strerror(err));
|
||||
return err;
|
||||
}
|
||||
spa_log_debug(this->log, "open card %s", this->props.device);
|
||||
if ((err = snd_ctl_open(&ctl_hndl, this->props.device, 0)) < 0) {
|
||||
spa_log_error(this->log, "can't open control for card %s: %s",
|
||||
this->props.device, snd_strerror(err));
|
||||
return err;
|
||||
}
|
||||
|
||||
err = activate_profile(this, ctl_hndl, id);
|
||||
|
||||
spa_log_info(this->log, "close card %s", this->props.device);
|
||||
spa_log_debug(this->log, "close card %s", this->props.device);
|
||||
snd_ctl_close(ctl_hndl);
|
||||
|
||||
return err;
|
||||
|
|
@ -253,12 +253,12 @@ static int emit_info(struct impl *this, bool full)
|
|||
struct spa_param_info params[2];
|
||||
char path[128];
|
||||
|
||||
spa_log_info(this->log, "open card %s", this->props.device);
|
||||
if ((err = snd_ctl_open(&ctl_hndl, this->props.device, 0)) < 0) {
|
||||
spa_log_error(this->log, "can't open control for card %s: %s",
|
||||
this->props.device, snd_strerror(err));
|
||||
return err;
|
||||
}
|
||||
spa_log_debug(this->log, "open card %s", this->props.device);
|
||||
if ((err = snd_ctl_open(&ctl_hndl, this->props.device, 0)) < 0) {
|
||||
spa_log_error(this->log, "can't open control for card %s: %s",
|
||||
this->props.device, snd_strerror(err));
|
||||
return err;
|
||||
}
|
||||
|
||||
snd_ctl_card_info_alloca(&info);
|
||||
if ((err = snd_ctl_card_info(ctl_hndl, info)) < 0) {
|
||||
|
|
@ -294,7 +294,7 @@ static int emit_info(struct impl *this, bool full)
|
|||
spa_device_emit_info(&this->hooks, &dinfo);
|
||||
|
||||
exit:
|
||||
spa_log_info(this->log, "close card %s", this->props.device);
|
||||
spa_log_debug(this->log, "close card %s", this->props.device);
|
||||
snd_ctl_close(ctl_hndl);
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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_debug(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_debug(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);
|
||||
|
|
@ -429,7 +429,7 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
spa_log_info(state->log, NAME" %p: Stream parameters are %iHz, %s, %i channels",
|
||||
spa_log_debug(state->log, NAME" %p: Stream parameters are %iHz, %s, %i channels",
|
||||
state, info->rate, snd_pcm_format_name(format), info->channels);
|
||||
CHECK(snd_pcm_hw_params_set_format(hndl, params, format), "set_format");
|
||||
|
||||
|
|
@ -470,9 +470,10 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_
|
|||
state->period_frames = period_size;
|
||||
periods = state->buffer_frames / state->period_frames;
|
||||
|
||||
spa_log_info(state->log, NAME" %p: buffer frames %lu, period frames %lu, periods %u, frame_size %zd",
|
||||
state, state->buffer_frames, state->period_frames,
|
||||
periods, state->frame_size);
|
||||
spa_log_info(state->log, NAME" %p: format:%s rate:%d channels:%d "
|
||||
"buffer frames %lu, period frames %lu, periods %u, frame_size %zd",
|
||||
state, snd_pcm_format_name(state->format), state->rate, state->channels,
|
||||
state->buffer_frames, state->period_frames, periods, state->frame_size);
|
||||
|
||||
/* write the parameters to device */
|
||||
CHECK(snd_pcm_hw_params(hndl, params), "set_hw_params");
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ static int seq_open(struct seq_state *state, struct seq_conn *conn)
|
|||
snd_seq_port_info_t *pinfo;
|
||||
int res;
|
||||
|
||||
spa_log_info(state->log, "%p: ALSA seq open '%s' duplex", state, props->device);
|
||||
spa_log_debug(state->log, "%p: ALSA seq open '%s' duplex", state, props->device);
|
||||
|
||||
if ((res = snd_seq_open(&conn->hndl,
|
||||
props->device,
|
||||
|
|
@ -111,7 +111,7 @@ error_exit_close:
|
|||
static int seq_close(struct seq_state *state, struct seq_conn *conn)
|
||||
{
|
||||
int res;
|
||||
spa_log_info(state->log, "%p: Device '%s' closing", state, state->props.device);
|
||||
spa_log_debug(state->log, "%p: Device '%s' closing", state, state->props.device);
|
||||
if ((res = snd_seq_close(conn->hndl)) < 0) {
|
||||
spa_log_warn(state->log, "close failed: %s", snd_strerror(res));
|
||||
}
|
||||
|
|
@ -407,13 +407,14 @@ int spa_alsa_seq_activate_port(struct seq_state *state, struct seq_port *port, b
|
|||
port->addr.client, port->addr.port, snd_strerror(res));
|
||||
active = false;
|
||||
}
|
||||
spa_log_info(state->log, "subscribe: %d.%d", port->addr.client, port->addr.port);
|
||||
} else {
|
||||
if ((res = snd_seq_unsubscribe_port(state->event.hndl, sub)) < 0) {
|
||||
spa_log_warn(state->log, "can't unsubscribe from %d:%d - %s",
|
||||
port->addr.client, port->addr.port, snd_strerror(res));
|
||||
}
|
||||
spa_log_info(state->log, "unsubscribe: %d.%d", port->addr.client, port->addr.port);
|
||||
}
|
||||
spa_log_info(state->log, "activate: %d.%d: %d", port->addr.client, port->addr.port, active);
|
||||
port->active = active;
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ static int emit_object_info(struct impl *this, uint32_t id, struct udev_device *
|
|||
|
||||
snprintf(path, sizeof(path), "hw:%d", atoi(str));
|
||||
|
||||
spa_log_info(this->log, "open card %s", path);
|
||||
spa_log_debug(this->log, "open card %s", path);
|
||||
|
||||
if ((res = snd_ctl_open(&ctl_hndl, path, 0)) < 0) {
|
||||
spa_log_error(this->log, "can't open control for card %s: %s",
|
||||
|
|
@ -210,7 +210,7 @@ static int emit_object_info(struct impl *this, uint32_t id, struct udev_device *
|
|||
pcm = -1;
|
||||
res = snd_ctl_pcm_next_device(ctl_hndl, &pcm);
|
||||
|
||||
spa_log_info(this->log, "close card %s", path);
|
||||
spa_log_debug(this->log, "close card %s", path);
|
||||
snd_ctl_close(ctl_hndl);
|
||||
|
||||
if (res < 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue