Lines Matching defs:bs
270 struct snd_dbuf *bs = c->bufsoft;
276 if (sndbuf_getprevtotal(bs) < c->lw)
279 delta = sndbuf_gettotal(bs) - sndbuf_getprevtotal(bs);
282 delta = sndbuf_getfree(bs);
284 delta = sndbuf_getready(bs);
301 struct snd_dbuf *bs;
306 bs = c->bufsoft;
309 if (SEL_WAITING(sndbuf_getsel(bs)) && chn_polltrigger(c))
310 selwakeuppri(sndbuf_getsel(bs), PRIBIO);
390 struct snd_dbuf *bs = c->bufsoft;
396 sndbuf_acquire(bs, NULL, sndbuf_getfree(bs));
400 imax(0, sndbuf_xbytes(sndbuf_getsize(bs), bs, b) -
404 sndbuf_feed(bs, b, c, c->feeder, amt);
456 struct snd_dbuf *bs = c->bufsoft;
466 sz = min(buf->uio_resid, sndbuf_getfree(bs));
474 p = sndbuf_getfreeptr(bs);
475 t = min(sz, sndbuf_getsize(bs) - p);
476 off = sndbuf_getbufofs(bs, p);
481 sndbuf_acquire(bs, NULL, t);
524 struct snd_dbuf *bs = c->bufsoft;
530 sndbuf_dispose(bs, NULL, sndbuf_getready(bs));
532 amt = sndbuf_getfree(bs);
534 sndbuf_feed(b, bs, c, c->feeder, amt);
542 if (sndbuf_getready(bs) > 0)
586 struct snd_dbuf *bs = c->bufsoft;
604 sz = min(buf->uio_resid, sndbuf_getready(bs));
612 p = sndbuf_getreadyptr(bs);
613 t = min(sz, sndbuf_getsize(bs) - p);
614 off = sndbuf_getbufofs(bs, p);
619 sndbuf_dispose(bs, NULL, t);
673 struct snd_dbuf *bs = c->bufsoft;
688 i = sndbuf_getfree(bs);
691 if (sndbuf_getfree(bs) == 0) {
698 i = sndbuf_xbytes(sndbuf_getready(bs), bs, pb);
722 sndbuf_xbytes(sndbuf_getsize(bs), bs, b));
748 struct snd_dbuf *bs = c->bufsoft;
752 sndbuf_reset(bs);
763 struct snd_dbuf *b, *bs;
772 bs = c->bufsoft;
775 (threshold < 1 && sndbuf_getready(bs) < 1))
780 if (threshold > 0 || sndbuf_getready(bs) > 0) {
790 minflush = threshold + sndbuf_xbytes(sndbuf_getready(b), b, bs);
794 if (syncdelay < 0 && (threshold > 0 || sndbuf_getready(bs) > 0))
795 minflush += sndbuf_xbytes(sndbuf_getsize(b), b, bs);
803 minflush += (sndbuf_getalign(bs) * sndbuf_getspd(bs) *
806 minflush -= minflush % sndbuf_getalign(bs);
809 threshold = min(minflush, sndbuf_getfree(bs));
810 sndbuf_clear(bs, threshold);
811 sndbuf_acquire(bs, NULL, threshold);
815 resid = sndbuf_getready(bs);
828 count = sndbuf_xbytes(minflush + resid, bs, b) / blksz;
845 resid = sndbuf_getready(bs);
865 if (minflush > 0 && sndbuf_getfree(bs) > 0) {
867 sndbuf_getfree(bs));
868 sndbuf_clear(bs, threshold);
869 sndbuf_acquire(bs, NULL, threshold);
870 resid = sndbuf_getready(bs);
894 struct snd_dbuf *bs = c->bufsoft;
910 selrecord(td, sndbuf_getsel(bs));
926 struct snd_dbuf *bs = c->bufsoft;
939 missing = sndbuf_getready(bs);
1161 struct snd_dbuf *b, *bs;
1170 bs = NULL;
1182 bs = sndbuf_create(c->dev, c->name, "secondary", c);
1183 if (bs == NULL)
1201 sndbuf_setup(bs, NULL, 0);
1204 c->bufsoft = bs;
1239 sndbuf_setfmt(bs, c->format);
1240 sndbuf_setspd(bs, c->speed);
1248 bs->sl = sndbuf_getmaxsize(bs);
1249 bs->shadbuf = malloc(bs->sl, M_DEVBUF, M_NOWAIT);
1250 if (bs->shadbuf == NULL) {
1263 if (bs)
1264 sndbuf_destroy(bs);
1281 struct snd_dbuf *bs = c->bufsoft;
1292 sndbuf_destroy(bs);
1705 struct snd_dbuf *b, *bs, *pb;
1728 bs = c->bufsoft;
1732 (blksz < 16 || blksz < sndbuf_getalign(bs) || blkcnt < 2 ||
1736 chn_calclatency(c->direction, latency, sndbuf_getalign(bs),
1737 sndbuf_getalign(bs) * sndbuf_getspd(bs), CHN_2NDBUFMAXSIZE,
1744 blksz = sndbuf_getblksz(bs);
1745 blkcnt = sndbuf_getblkcnt(bs);
1758 sblksz = round_blksz(blksz, sndbuf_getalign(bs));
1771 sndbuf_xbytes(sndbuf_getsize(pb), pb, bs) : 0;
1774 sndbuf_xbytes(sndbuf_getblksz(pb), pb, bs) * 2 : 0;
1779 hblksz = round_blksz(sndbuf_xbytes(sblksz, bs, b),
1781 hblkcnt = round_pow2(sndbuf_getblkcnt(bs));
1817 sndbuf_xbytes(sndbuf_getblksz(b), b, bs),
1818 sndbuf_getalign(bs));
1831 limit = sndbuf_xbytes(sndbuf_getblksz(b), b, bs) * 2;
1855 sblksz -= sblksz % sndbuf_getalign(bs);
1857 if (sndbuf_getblkcnt(bs) != sblkcnt || sndbuf_getblksz(bs) != sblksz ||
1858 sndbuf_getsize(bs) != (sblkcnt * sblksz)) {
1859 ret = sndbuf_remalloc(bs, sblkcnt, sblksz);
1870 c->timeout = ((u_int64_t)hz * sndbuf_getsize(bs)) /
1871 ((u_int64_t)sndbuf_getspd(bs) * sndbuf_getalign(bs));
1881 c->lw = sndbuf_getblksz(bs);
1886 "b[%d/%d/%d] bs[%d/%d/%d] limit=%d\n",
1892 sndbuf_getsize(bs), sndbuf_getblksz(bs),
1893 sndbuf_getblkcnt(bs), limit);