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;
|
struct data *data = userdata;
|
||||||
|
|
||||||
if (data->verbose)
|
|
||||||
printf("core done\n");
|
|
||||||
|
|
||||||
/* if we're listing targets just exist */
|
/* if we're listing targets just exist */
|
||||||
if (data->sync == seq && data->list_targets) {
|
if (data->sync == seq && data->list_targets) {
|
||||||
data->targets_listed = true;
|
data->targets_listed = true;
|
||||||
|
|
@ -850,7 +847,7 @@ on_state_changed(void *userdata, enum pw_stream_state old,
|
||||||
SPA_PROP_volume, 1, &data->volume,
|
SPA_PROP_volume, 1, &data->volume,
|
||||||
0);
|
0);
|
||||||
if (data->verbose)
|
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");
|
ret == 0 ? "success" : "FAILED");
|
||||||
|
|
||||||
data->volume_is_set = true;
|
data->volume_is_set = true;
|
||||||
|
|
@ -892,7 +889,8 @@ on_param_changed(void *userdata, uint32_t id, const struct spa_pod *param)
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (data->verbose)
|
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)
|
if (id != SPA_PARAM_Format || param == NULL)
|
||||||
return;
|
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);
|
data->stride = data->dsf.layout.channels * SPA_ABS(data->dsf.layout.interleave);
|
||||||
|
|
||||||
if (data->verbose) {
|
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.channels,
|
||||||
data->dsf.layout.lsb ? "lsb" : "msb",
|
data->dsf.layout.lsb ? "lsb" : "msb",
|
||||||
data->dsf.layout.interleave);
|
data->dsf.layout.interleave);
|
||||||
|
|
@ -1010,7 +1008,7 @@ static void do_print_delay(void *userdata, uint64_t expirations)
|
||||||
struct data *data = userdata;
|
struct data *data = userdata;
|
||||||
struct pw_time time;
|
struct pw_time time;
|
||||||
pw_stream_get_time(data->stream, &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.now,
|
||||||
time.rate.num, time.rate.denom,
|
time.rate.num, time.rate.denom,
|
||||||
time.ticks, time.delay, time.queued);
|
time.ticks, time.delay, time.queued);
|
||||||
|
|
@ -1216,12 +1214,12 @@ static int setup_midifile(struct data *data)
|
||||||
data->mode == mode_playback ? "r" : "w",
|
data->mode == mode_playback ? "r" : "w",
|
||||||
&data->midi.info);
|
&data->midi.info);
|
||||||
if (data->midi.file == NULL) {
|
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;
|
return -errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data->verbose)
|
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->filename,
|
||||||
data->midi.info.format, data->midi.info.ntracks,
|
data->midi.info.format, data->midi.info.ntracks,
|
||||||
data->midi.info.division);
|
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);
|
data->dsf.file = dsf_file_open(data->filename, "r", &data->dsf.info);
|
||||||
if (data->dsf.file == NULL) {
|
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;
|
return -errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data->verbose)
|
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->filename,
|
||||||
data->dsf.info.channels, data->dsf.info.rate,
|
data->dsf.info.channels, data->dsf.info.rate,
|
||||||
data->dsf.info.samples,
|
data->dsf.info.samples,
|
||||||
|
|
@ -1360,16 +1358,16 @@ static int setup_sndfile(struct data *data)
|
||||||
data->mode == mode_playback ? SFM_READ : SFM_WRITE,
|
data->mode == mode_playback ? SFM_READ : SFM_WRITE,
|
||||||
&info);
|
&info);
|
||||||
if (!data->file) {
|
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));
|
data->filename, sf_strerror(NULL));
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data->verbose)
|
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);
|
data->filename, info.format, info.channels, info.samplerate);
|
||||||
if (data->channels > 0 && info.channels != data->channels) {
|
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);
|
data->channels, info.channels);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
@ -1393,7 +1391,7 @@ static int setup_sndfile(struct data *data)
|
||||||
def = true;
|
def = true;
|
||||||
}
|
}
|
||||||
if (data->verbose) {
|
if (data->verbose) {
|
||||||
printf("using %s channel map: ", def ? "default" : "file");
|
printf("sndfile: using %s channel map: ", def ? "default" : "file");
|
||||||
channelmap_print(&data->channelmap);
|
channelmap_print(&data->channelmap);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
@ -1456,7 +1454,7 @@ static int setup_sndfile(struct data *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data->verbose)
|
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,
|
data->rate, data->channels,
|
||||||
sf_fmt_to_str(info.format),
|
sf_fmt_to_str(info.format),
|
||||||
data->samplesize,
|
data->samplesize,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue