diff options
author | cg <cg@FreeBSD.org> | 2002-01-23 06:02:15 +0000 |
---|---|---|
committer | cg <cg@FreeBSD.org> | 2002-01-23 06:02:15 +0000 |
commit | e75ea781e834d3e786a2a2a74645815201e5e959 (patch) | |
tree | 1223fb0ff5c6bcec64210ea5f10cfd0c99bec345 /sys/dev/sound/pcm/sound.c | |
parent | cf26ea42fd009af35fc31eb00100c30d6f19c6f7 (diff) | |
download | FreeBSD-src-e75ea781e834d3e786a2a2a74645815201e5e959.zip FreeBSD-src-e75ea781e834d3e786a2a2a74645815201e5e959.tar.gz |
improve sndstat output of feederchains so it can be understood without
reading the feeder sourcecode
Diffstat (limited to 'sys/dev/sound/pcm/sound.c')
-rw-r--r-- | sys/dev/sound/pcm/sound.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 215e288..94065bc 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -696,7 +696,6 @@ sndstat_prepare_pcm(struct sbuf *s, device_t dev, int verbose) struct snddev_channel *sce; struct pcm_channel *c; struct pcm_feeder *f; - char *fsep; int pc, rc, vc; if (verbose < 1) @@ -734,10 +733,17 @@ sndstat_prepare_pcm(struct sbuf *s, device_t dev, int verbose) sbuf_printf(s, "\n\t"); sbuf_printf(s, "%s[%s]: ", c->parentchannel? c->parentchannel->name : "", c->name); - sbuf_printf(s, "speed %d, format %08x, flags %08x", c->speed, c->format, c->flags); + sbuf_printf(s, "spd %d", c->speed); + if (c->speed != sndbuf_getspd(c->bufhard)) + sbuf_printf(s, "/%d", sndbuf_getspd(c->bufhard)); + sbuf_printf(s, ", fmt 0x%08x", c->format); + if (c->format != sndbuf_getfmt(c->bufhard)) + sbuf_printf(s, "/0x%08x", sndbuf_getfmt(c->bufhard)); + sbuf_printf(s, ", flags %08x", c->flags); if (c->pid != -1) sbuf_printf(s, ", pid %d", c->pid); sbuf_printf(s, "\n\t"); + if (c->bufhard != NULL && c->bufsoft != NULL) { sbuf_printf(s, "interrupts %d, ", c->interrupts); if (c->direction == PCMDIR_REC) @@ -748,21 +754,24 @@ sndstat_prepare_pcm(struct sbuf *s, device_t dev, int verbose) c->xruns, sndbuf_getready(c->bufsoft)); sbuf_printf(s, "\n\t"); } - fsep = (c->direction == PCMDIR_REC)? " -> " : " <- "; - sbuf_printf(s, "{hardware}%s", fsep); + + sbuf_printf(s, "{%s}", (c->direction == PCMDIR_REC)? "hardware" : "userland"); + sbuf_printf(s, " -> "); f = c->feeder; - while (f) { + while (f->source != NULL) + f = f->source; + while (f != NULL) { sbuf_printf(s, "%s", f->class->name); if (f->desc->type == FEEDER_FMT) - sbuf_printf(s, "(%08x%s%08x)", f->desc->out, fsep, f->desc->in); + sbuf_printf(s, "(0x%08x -> 0x%08x)", f->desc->in, f->desc->out); if (f->desc->type == FEEDER_RATE) - sbuf_printf(s, "(%d%s%d)", FEEDER_GET(f, FEEDRATE_DST), fsep, FEEDER_GET(f, FEEDRATE_SRC)); + sbuf_printf(s, "(%d -> %d)", FEEDER_GET(f, FEEDRATE_SRC), FEEDER_GET(f, FEEDRATE_DST)); if (f->desc->type == FEEDER_ROOT || f->desc->type == FEEDER_MIXER) - sbuf_printf(s, "(%08x)", f->desc->out); - sbuf_printf(s, "%s", fsep); - f = f->source; + sbuf_printf(s, "(0x%08x)", f->desc->out); + sbuf_printf(s, " -> "); + f = f->parent; } - sbuf_printf(s, "{userland}"); + sbuf_printf(s, "{%s}", (c->direction == PCMDIR_REC)? "userland" : "hardware"); } skipverbose: } else |