fix a bug with cat >/dev/{dsp,dspW,audio} hanging
This commit is contained in:
parent
9a6860ba7d
commit
4375d22913
@ -268,7 +268,7 @@ chn_write(pcm_channel *c, struct uio *buf)
|
|||||||
return EBUSY;
|
return EBUSY;
|
||||||
}
|
}
|
||||||
c->flags |= CHN_F_WRITING;
|
c->flags |= CHN_F_WRITING;
|
||||||
while (buf->uio_resid >= DMA_ALIGN_THRESHOLD) {
|
while (buf->uio_resid > 0) {
|
||||||
s = spltty();
|
s = spltty();
|
||||||
chn_dmaupdate(c);
|
chn_dmaupdate(c);
|
||||||
splx(s);
|
splx(s);
|
||||||
@ -284,6 +284,7 @@ chn_write(pcm_channel *c, struct uio *buf)
|
|||||||
/* ensure we always have a whole number of samples */
|
/* ensure we always have a whole number of samples */
|
||||||
l = min(b->fl, b->bufsize - b->fp) & DMA_ALIGN_MASK;
|
l = min(b->fl, b->bufsize - b->fp) & DMA_ALIGN_MASK;
|
||||||
w = c->feeder->feed(c->feeder, b->buf + b->fp, l, buf);
|
w = c->feeder->feed(c->feeder, b->buf + b->fp, l, buf);
|
||||||
|
if (w == 0) panic("no feed");
|
||||||
s = spltty();
|
s = spltty();
|
||||||
b->rl += w;
|
b->rl += w;
|
||||||
b->fl -= w;
|
b->fl -= w;
|
||||||
|
@ -268,7 +268,7 @@ chn_write(pcm_channel *c, struct uio *buf)
|
|||||||
return EBUSY;
|
return EBUSY;
|
||||||
}
|
}
|
||||||
c->flags |= CHN_F_WRITING;
|
c->flags |= CHN_F_WRITING;
|
||||||
while (buf->uio_resid >= DMA_ALIGN_THRESHOLD) {
|
while (buf->uio_resid > 0) {
|
||||||
s = spltty();
|
s = spltty();
|
||||||
chn_dmaupdate(c);
|
chn_dmaupdate(c);
|
||||||
splx(s);
|
splx(s);
|
||||||
@ -284,6 +284,7 @@ chn_write(pcm_channel *c, struct uio *buf)
|
|||||||
/* ensure we always have a whole number of samples */
|
/* ensure we always have a whole number of samples */
|
||||||
l = min(b->fl, b->bufsize - b->fp) & DMA_ALIGN_MASK;
|
l = min(b->fl, b->bufsize - b->fp) & DMA_ALIGN_MASK;
|
||||||
w = c->feeder->feed(c->feeder, b->buf + b->fp, l, buf);
|
w = c->feeder->feed(c->feeder, b->buf + b->fp, l, buf);
|
||||||
|
if (w == 0) panic("no feed");
|
||||||
s = spltty();
|
s = spltty();
|
||||||
b->rl += w;
|
b->rl += w;
|
||||||
b->fl -= w;
|
b->fl -= w;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user