diff options
| author | Cameron Grant <cg@FreeBSD.org> | 2001-12-21 22:34:01 +0000 |
|---|---|---|
| committer | Cameron Grant <cg@FreeBSD.org> | 2001-12-21 22:34:01 +0000 |
| commit | b83a42d36f51ccf56f5bfb30793f545a1e531b39 (patch) | |
| tree | abb6ae6921d172d12f8cb82df27fb87306bea616 | |
| parent | 7a60bd5c285405361079cd78494e667c8f0965a2 (diff) | |
Notes
| -rw-r--r-- | sys/dev/sound/pcm/channel.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index c3a3eb92a453..4fc5f0705c97 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -147,6 +147,7 @@ chn_dmaupdate(struct pcm_channel *c) KASSERT(sndbuf_getsize(b) > 0, ("bufsize == 0")); CHN_LOCKASSERT(c); + old = sndbuf_gethwptr(b); hwptr = chn_getptr(c); delta = (sndbuf_getsize(b) + hwptr - old) % sndbuf_getsize(b); @@ -191,8 +192,6 @@ chn_wrupdate(struct pcm_channel *c) } -static int irqc = 0; - int chn_wrfeed(struct pcm_channel *c) { @@ -207,16 +206,17 @@ chn_wrfeed(struct pcm_channel *c) sndbuf_dump(bs, "bs", 0x02); }) + if (c->flags & CHN_F_MAPPED) + sndbuf_acquire(bs, NULL, sndbuf_getfree(bs)); + amt = sndbuf_getfree(b); if (sndbuf_getready(bs) < amt) c->xruns++; + ret = (amt > 0)? sndbuf_feed(bs, b, c, c->feeder, amt) : ENOSPC; if (ret == 0 && sndbuf_getfree(b) < amt) chn_wakeup(c); -/* - if (!(irqc & 63) || (ret != 0)) - sndbuf_dump(b, "b:wrfeed", 0x03); -*/ + return ret; } @@ -226,7 +226,6 @@ chn_wrintr(struct pcm_channel *c) int ret; CHN_LOCKASSERT(c); - irqc++; /* update pointers in primary buffer */ chn_dmaupdate(c); /* ...and feed from secondary to primary */ |
