31#define SND_DMA(b) (sndbuf_getflags((b)) & SNDBUF_F_DMA)
32#define SNDBUF_LOCKASSERT(b)
34#define SNDBUF_F_DMA 0x00000001
35#define SNDBUF_F_XRUN 0x00000002
36#define SNDBUF_F_RUNNING 0x00000004
37#define SNDBUF_F_MANAGED 0x00000008
39#define SNDBUF_NAMELEN 48
134#ifdef OSSV4_EXPERIMENT
135void sndbuf_getpeaks(
struct snd_dbuf *
b,
int *lp,
int *rp);
138static inline u_int32_t
146 return ((u_int64_t)v * to / from);
u_int32_t sndbuf_getflags(struct snd_dbuf *b)
int sndbuf_setup(struct snd_dbuf *b, void *buf, unsigned int size)
u_int64_t sndbuf_gettotal(struct snd_dbuf *b)
void sndbuf_clear(struct snd_dbuf *b, unsigned int length)
Zero out space in buffer free area.
u_int8_t sndbuf_zerodata(u_int32_t fmt)
unsigned int sndbuf_getspd(struct snd_dbuf *b)
int sndbuf_acquire(struct snd_dbuf *b, u_int8_t *from, unsigned int count)
Acquire buffer space to extend ready area.
int sndbuf_alloc(struct snd_dbuf *b, bus_dma_tag_t dmatag, int dmaflags, unsigned int size)
void * sndbuf_getbuf(struct snd_dbuf *b)
unsigned int sndbuf_getblkcnt(struct snd_dbuf *b)
int sndbuf_dmasetup(struct snd_dbuf *b, struct resource *drq)
bus_addr_t sndbuf_getbufaddr(struct snd_dbuf *buf)
unsigned int sndbuf_getalign(struct snd_dbuf *b)
void sndbuf_setblkcnt(struct snd_dbuf *b, unsigned int blkcnt)
void sndbuf_reset(struct snd_dbuf *b)
void sndbuf_setblksz(struct snd_dbuf *b, unsigned int blksz)
unsigned int sndbuf_getblksz(struct snd_dbuf *b)
void sndbuf_setspd(struct snd_dbuf *b, unsigned int spd)
void sndbuf_dmabounce(struct snd_dbuf *b)
void sndbuf_setxrun(struct snd_dbuf *b, unsigned int xrun)
u_int64_t sndbuf_getprevblocks(struct snd_dbuf *b)
int sndbuf_remalloc(struct snd_dbuf *b, unsigned int blkcnt, unsigned int blksz)
unsigned int sndbuf_getallocsize(struct snd_dbuf *b)
unsigned int sndbuf_getfreeptr(struct snd_dbuf *b)
void sndbuf_fillsilence(struct snd_dbuf *b)
Zap buffer contents, resetting "ready area" fields.
int sndbuf_setfmt(struct snd_dbuf *b, u_int32_t fmt)
void sndbuf_updateprevtotal(struct snd_dbuf *b)
void sndbuf_dma(struct snd_dbuf *b, int go)
void sndbuf_dump(struct snd_dbuf *b, char *s, u_int32_t what)
unsigned int sndbuf_getfree(struct snd_dbuf *b)
unsigned int sndbuf_getmaxsize(struct snd_dbuf *b)
void sndbuf_destroy(struct snd_dbuf *b)
u_int32_t sndbuf_getfmt(struct snd_dbuf *b)
unsigned int sndbuf_getxrun(struct snd_dbuf *b)
unsigned int sndbuf_xbytes(unsigned int v, struct snd_dbuf *from, struct snd_dbuf *to)
unsigned int sndbuf_getready(struct snd_dbuf *b)
unsigned int sndbuf_getsize(struct snd_dbuf *b)
void sndbuf_softreset(struct snd_dbuf *b)
Reset buffer w/o flushing statistics.
void sndbuf_free(struct snd_dbuf *b)
static u_int32_t snd_xbytes(u_int32_t v, u_int32_t from, u_int32_t to)
struct snd_dbuf * sndbuf_create(device_t dev, char *drv, char *desc, struct pcm_channel *channel)
void sndbuf_setrun(struct snd_dbuf *b, int go)
void sndbuf_fillsilence_rl(struct snd_dbuf *b, u_int rl)
struct selinfo * sndbuf_getsel(struct snd_dbuf *b)
unsigned int sndbuf_gethwptr(struct snd_dbuf *b)
unsigned int sndbuf_getbps(struct snd_dbuf *b)
void * sndbuf_getbufofs(struct snd_dbuf *b, unsigned int ofs)
void sndbuf_clearshadow(struct snd_dbuf *b)
Clear the shadow buffer by filling with samples equal to zero.
void sndbuf_setflags(struct snd_dbuf *b, u_int32_t flags, int on)
int sndbuf_dmaptr(struct snd_dbuf *b)
u_int64_t sndbuf_getprevtotal(struct snd_dbuf *b)
int sndbuf_resize(struct snd_dbuf *b, unsigned int blkcnt, unsigned int blksz)
unsigned int sndbuf_runsz(struct snd_dbuf *b)
u_int64_t sndbuf_getblocks(struct snd_dbuf *b)
int sndbuf_feed(struct snd_dbuf *from, struct snd_dbuf *to, struct pcm_channel *channel, struct pcm_feeder *feeder, unsigned int count)
int sndbuf_dispose(struct snd_dbuf *b, u_int8_t *to, unsigned int count)
Dispose samples from channel buffer, increasing size of ready area.
unsigned int sndbuf_getreadyptr(struct snd_dbuf *b)
int sndbuf_dmasetdir(struct snd_dbuf *b, int dir)
void sndbuf_sethwptr(struct snd_dbuf *b, unsigned int ptr)
volatile u_int64_t prev_total
char name[SNDBUF_NAMELEN]
struct pcm_channel * channel