mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pw-cat: improve output
This commit is contained in:
parent
1f2c4cc8dc
commit
46d1328e1c
1 changed files with 14 additions and 16 deletions
|
|
@ -656,9 +656,6 @@ static void on_core_done(void *userdata, uint32_t id, int seq)
|
|||
{
|
||||
struct data *data = userdata;
|
||||
|
||||
if (data->verbose)
|
||||
printf("core done\n");
|
||||
|
||||
/* if we're listing targets just exist */
|
||||
if (data->sync == seq && data->list_targets) {
|
||||
data->targets_listed = true;
|
||||
|
|
@ -850,7 +847,7 @@ on_state_changed(void *userdata, enum pw_stream_state old,
|
|||
SPA_PROP_volume, 1, &data->volume,
|
||||
0);
|
||||
if (data->verbose)
|
||||
printf("set stream volume to %.3f - %s\n", data->volume,
|
||||
printf("stream set volume to %.3f - %s\n", data->volume,
|
||||
ret == 0 ? "success" : "FAILED");
|
||||
|
||||
data->volume_is_set = true;
|
||||
|
|
@ -892,7 +889,8 @@ on_param_changed(void *userdata, uint32_t id, const struct spa_pod *param)
|
|||
int err;
|
||||
|
||||
if (data->verbose)
|
||||
printf("stream param change: id=%"PRIu32"\n", id);
|
||||
printf("stream param change: %s\n",
|
||||
spa_debug_type_find_name(spa_type_param, id));
|
||||
|
||||
if (id != SPA_PARAM_Format || param == NULL)
|
||||
return;
|
||||
|
|
@ -914,7 +912,7 @@ on_param_changed(void *userdata, uint32_t id, const struct spa_pod *param)
|
|||
data->stride = data->dsf.layout.channels * SPA_ABS(data->dsf.layout.interleave);
|
||||
|
||||
if (data->verbose) {
|
||||
printf("DSD out: channels:%d bitorder:%s interleave:%d\n",
|
||||
printf("DSD: channels:%d bitorder:%s interleave:%d\n",
|
||||
data->dsf.layout.channels,
|
||||
data->dsf.layout.lsb ? "lsb" : "msb",
|
||||
data->dsf.layout.interleave);
|
||||
|
|
@ -1010,7 +1008,7 @@ static void do_print_delay(void *userdata, uint64_t expirations)
|
|||
struct data *data = userdata;
|
||||
struct pw_time time;
|
||||
pw_stream_get_time(data->stream, &time);
|
||||
printf("now=%"PRIi64" rate=%u/%u ticks=%"PRIu64" delay=%"PRIi64" queued=%"PRIu64"\n",
|
||||
printf("stream time: now:%"PRIi64" rate:%u/%u ticks:%"PRIu64" delay:%"PRIi64" queued:%"PRIu64"\n",
|
||||
time.now,
|
||||
time.rate.num, time.rate.denom,
|
||||
time.ticks, time.delay, time.queued);
|
||||
|
|
@ -1216,12 +1214,12 @@ static int setup_midifile(struct data *data)
|
|||
data->mode == mode_playback ? "r" : "w",
|
||||
&data->midi.info);
|
||||
if (data->midi.file == NULL) {
|
||||
fprintf(stderr, "error: can't read midi file '%s': %m\n", data->filename);
|
||||
fprintf(stderr, "midifile: can't read midi file '%s': %m\n", data->filename);
|
||||
return -errno;
|
||||
}
|
||||
|
||||
if (data->verbose)
|
||||
printf("opened file \"%s\" format %08x ntracks:%d div:%d\n",
|
||||
printf("midifile: opened file \"%s\" format %08x ntracks:%d div:%d\n",
|
||||
data->filename,
|
||||
data->midi.info.format, data->midi.info.ntracks,
|
||||
data->midi.info.division);
|
||||
|
|
@ -1258,12 +1256,12 @@ static int setup_dsffile(struct data *data)
|
|||
|
||||
data->dsf.file = dsf_file_open(data->filename, "r", &data->dsf.info);
|
||||
if (data->dsf.file == NULL) {
|
||||
fprintf(stderr, "error: can't read dsf file '%s': %m\n", data->filename);
|
||||
fprintf(stderr, "dsffile: can't read dsf file '%s': %m\n", data->filename);
|
||||
return -errno;
|
||||
}
|
||||
|
||||
if (data->verbose)
|
||||
printf("opened file \"%s\" channels:%d rate:%d samples:%"PRIu64" bitorder:%s\n",
|
||||
printf("dsffile: opened file \"%s\" channels:%d rate:%d samples:%"PRIu64" bitorder:%s\n",
|
||||
data->filename,
|
||||
data->dsf.info.channels, data->dsf.info.rate,
|
||||
data->dsf.info.samples,
|
||||
|
|
@ -1360,16 +1358,16 @@ static int setup_sndfile(struct data *data)
|
|||
data->mode == mode_playback ? SFM_READ : SFM_WRITE,
|
||||
&info);
|
||||
if (!data->file) {
|
||||
fprintf(stderr, "error: failed to open audio file \"%s\": %s\n",
|
||||
fprintf(stderr, "sndfile: failed to open audio file \"%s\": %s\n",
|
||||
data->filename, sf_strerror(NULL));
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
if (data->verbose)
|
||||
printf("opened file \"%s\" format %08x channels:%d rate:%d\n",
|
||||
printf("sndfile: opened file \"%s\" format %08x channels:%d rate:%d\n",
|
||||
data->filename, info.format, info.channels, info.samplerate);
|
||||
if (data->channels > 0 && info.channels != data->channels) {
|
||||
printf("given channels (%u) don't match file channels (%d)\n",
|
||||
fprintf(stderr, "sndfile: given channels (%u) don't match file channels (%d)\n",
|
||||
data->channels, info.channels);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -1393,7 +1391,7 @@ static int setup_sndfile(struct data *data)
|
|||
def = true;
|
||||
}
|
||||
if (data->verbose) {
|
||||
printf("using %s channel map: ", def ? "default" : "file");
|
||||
printf("sndfile: using %s channel map: ", def ? "default" : "file");
|
||||
channelmap_print(&data->channelmap);
|
||||
printf("\n");
|
||||
}
|
||||
|
|
@ -1456,7 +1454,7 @@ static int setup_sndfile(struct data *data)
|
|||
}
|
||||
|
||||
if (data->verbose)
|
||||
printf("rate=%u channels=%u fmt=%s samplesize=%u stride=%u latency=%u (%.3fs)\n",
|
||||
printf("PCM: rate=%u channels=%u fmt=%s samplesize=%u stride=%u latency=%u (%.3fs)\n",
|
||||
data->rate, data->channels,
|
||||
sf_fmt_to_str(info.format),
|
||||
data->samplesize,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue