summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound
diff options
context:
space:
mode:
authorcg <cg@FreeBSD.org>2003-07-07 17:40:02 +0000
committercg <cg@FreeBSD.org>2003-07-07 17:40:02 +0000
commitf2c29b61f1863b25b4962bab19cc37d0e3b84121 (patch)
tree9460b37b7d1afd5756ac9e1d98b63e5c3a6de4c6 /sys/dev/sound
parentac66c4d2c8aa1e8b3104a507f9ee3a028d2214dc (diff)
downloadFreeBSD-src-f2c29b61f1863b25b4962bab19cc37d0e3b84121.zip
FreeBSD-src-f2c29b61f1863b25b4962bab19cc37d0e3b84121.tar.gz
* add a function to display a complete feeder chain on the console, for
debugging. * set the parent of non-format feeders, so that sndstat doesn't miss out things like feeder_rate. MFC: 1 week
Diffstat (limited to 'sys/dev/sound')
-rw-r--r--sys/dev/sound/pcm/feeder.c18
-rw-r--r--sys/dev/sound/pcm/feeder.h1
2 files changed, 18 insertions, 1 deletions
diff --git a/sys/dev/sound/pcm/feeder.c b/sys/dev/sound/pcm/feeder.c
index 0c2f784..2aa1e2a 100644
--- a/sys/dev/sound/pcm/feeder.c
+++ b/sys/dev/sound/pcm/feeder.c
@@ -194,11 +194,13 @@ chn_addfeeder(struct pcm_channel *c, struct feeder_class *fc, struct pcm_feederd
nf->source = c->feeder;
+ /* XXX we should use the lowest common denominator for align */
if (nf->align > 0)
c->align += nf->align;
else if (nf->align < 0 && c->align < -nf->align)
c->align = -nf->align;
-
+ if (c->feeder != NULL)
+ c->feeder->parent = nf;
c->feeder = nf;
return 0;
@@ -372,6 +374,20 @@ chn_fmtchain(struct pcm_channel *c, u_int32_t *to)
return (c->direction == PCMDIR_REC)? best : c->feeder->desc->out;
}
+void
+feeder_printchain(struct pcm_feeder *head)
+{
+ struct pcm_feeder *f;
+
+ printf("feeder chain (head @%p)\n", head);
+ f = head;
+ while (f != NULL) {
+ printf("%s/%d @ %p\n", f->class->name, f->desc->idx, f);
+ f = f->source;
+ }
+ printf("[end]\n\n");
+}
+
/*****************************************************************************/
static int
diff --git a/sys/dev/sound/pcm/feeder.h b/sys/dev/sound/pcm/feeder.h
index 9fb8ff7..10c3c67 100644
--- a/sys/dev/sound/pcm/feeder.h
+++ b/sys/dev/sound/pcm/feeder.h
@@ -57,6 +57,7 @@ u_int32_t chn_fmtchain(struct pcm_channel *c, u_int32_t *to);
int chn_addfeeder(struct pcm_channel *c, struct feeder_class *fc, struct pcm_feederdesc *desc);
int chn_removefeeder(struct pcm_channel *c);
struct pcm_feeder *chn_findfeeder(struct pcm_channel *c, u_int32_t type);
+void feeder_printchain(struct pcm_feeder *head);
#define FEEDER_DECLARE(feeder, palign, pdata) \
static struct feeder_class feeder ## _class = { \
OpenPOWER on IntegriCloud