diff options
author | Cameron Grant <cg@FreeBSD.org> | 2002-01-23 06:02:15 +0000 |
---|---|---|
committer | Cameron Grant <cg@FreeBSD.org> | 2002-01-23 06:02:15 +0000 |
commit | 4c68642adb4ce578c5b756c9eca0f9a7473568ac (patch) | |
tree | 1223fb0ff5c6bcec64210ea5f10cfd0c99bec345 | |
parent | 4e60be34739e644ff788d0882d60efb5f2c8fc61 (diff) | |
download | src-4c68642adb4ce578c5b756c9eca0f9a7473568ac.tar.gz src-4c68642adb4ce578c5b756c9eca0f9a7473568ac.zip |
improve sndstat output of feederchains so it can be understood without
reading the feeder sourcecode
Notes
Notes:
svn path=/head/; revision=89691
-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 215e28843019..94065bcff5b8 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 |