34#ifdef HAVE_KERNEL_OPTION_HEADERS
61 err = sysctl_handle_int(oidp, &
val, 0,
req);
62 if (err != 0 ||
req->newptr == NULL)
72 CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, 0,
sizeof(
int),
74 "buffering latency (0=low ... 10=high)");
84 err = sysctl_handle_int(oidp, &
val, 0,
req);
85 if (err != 0 ||
req->newptr == NULL)
95 CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, 0,
sizeof(
int),
97 "buffering latency profile (0=aggressive 1=safe)");
107 err = sysctl_handle_int(oidp, &
val, 0,
req);
108 if (err != 0 ||
req->newptr == NULL)
118 CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, 0,
sizeof(
int),
120 "interrupt timeout (1 - 10) seconds");
161 err = sysctl_handle_int(oidp, &
val, 0,
req);
162 if (err != 0 ||
req->newptr == NULL)
173 CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, 0,
sizeof(
int),
175 "0db relative level");
183 err = sysctl_handle_int(oidp, &
val, 0,
req);
184 if (err != 0 ||
req->newptr == NULL ||
val == 0)
193 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0,
sizeof(
int),
195 "reset volume on all channels");
201 &
chn_usefrags, 0,
"prefer setfragments() over setblocksize()");
204 "append (0-1000) millisecond trailing buffer delay on each sync");
245 panic(
"%s(): Invalid direction=%d", __func__,
dir);
249 cv_init(&
c->
cv,
"pcmchn");
292 return ((delta < c->lw) ? 0 : 1);
345 c->
flags &= ~CHN_F_SLEEPING;
359 unsigned int delta, old, hwptr,
amt;
381 device_printf(
c->
dev,
"WARNING: %s DMA completion "
382 "too fast/slow ! hwptr=%u, old=%u "
383 "delta=%u amt=%u ready=%u free=%u\n",
396 unsigned int amt, want, wasfree;
407 amt = min(wasfree, want);
463 int ret, timeout, sz, t, p;
470 while (ret == 0 &&
buf->uio_resid > 0) {
478 while (ret == 0 && sz > 0) {
483 ret = uiomove(off, t,
buf);
511 device_printf(
c->
dev,
"%s(): %s: "
512 "play interrupt timeout, channel dead\n",
514 }
else if (ret == ERESTART || ret == EINTR)
593 int ret, timeout, sz, t, p;
608 while (ret == 0 &&
buf->uio_resid > 0) {
616 while (ret == 0 && sz > 0) {
621 ret = uiomove(off, t,
buf);
634 device_printf(
c->
dev,
"%s(): %s: "
635 "record interrupt timeout, channel dead\n",
637 }
else if (ret == ERESTART || ret == EINTR)
708 device_printf(
c->
dev,
"%s(): %s (%s) threshold "
729 device_printf(
c->
dev,
730 "%s(): %s starting! (%s/%s) "
731 "(ready=%d force=%d i=%d j=%d "
732 "intrtimeout=%u latency=%dms)\n",
769 int ret,
count, hcount, minflush, resid, residp, syncdelay,
blksz;
809 ((syncdelay > 1000) ? 1000 : syncdelay)) / 1000;
817 minflush -= threshold;
824 device_printf(
c->
dev,
825 "%s(): WARNING: blksz < 1 ! maxsize=%d [%d/%d/%d]\n",
838 device_printf(
c->
dev,
"%s(): [begin] timeout=%d count=%d "
844 while (
count > 0 && (resid > 0 || minflush > 0)) {
846 if (ret == ERESTART || ret == EINTR) {
849 }
else if (ret == 0 || ret == EAGAIN) {
851 if (resid == residp) {
854 device_printf(
c->
dev,
855 "%s(): [stalled] timeout=%d "
856 "count=%d hcount=%d "
857 "resid=%d minflush=%d\n",
859 hcount, resid, minflush);
860 }
else if (resid < residp &&
count < hcount) {
863 device_printf(
c->
dev,
864 "%s((): [resume] timeout=%d "
865 "count=%d hcount=%d "
866 "resid=%d minflush=%d\n",
868 hcount, resid, minflush);
871 threshold = min(minflush,
876 minflush -= threshold;
882 c->
flags &= ~CHN_F_CLOSING;
886 device_printf(
c->
dev,
887 "%s(): timeout=%d count=%d hcount=%d resid=%d residp=%d "
888 "minflush=%d ret=%d\n",
938 c->
flags &= ~CHN_F_TRIGGERED;
946 c->
flags &= ~CHN_F_ABORTING;
968 DEB(printf(
"chn_flush: c->flags 0x%08x\n",
c->
flags));
972 c->
flags &= ~CHN_F_TRIGGERED;
977 c->
flags &= ~CHN_F_CLOSING;
986 for (i = 0; fmtlist[i] != 0; i++) {
987 if (
fmt == fmtlist[i] ||
1000 {
"alaw", NULL, NULL, AFMT_A_LAW },
1001 {
"mulaw", NULL, NULL, AFMT_MU_LAW },
1002 {
"u8",
"8", NULL, AFMT_U8 },
1003 {
"s8", NULL, NULL, AFMT_S8 },
1004#if BYTE_ORDER == LITTLE_ENDIAN
1005 {
"s16le",
"s16",
"16", AFMT_S16_LE },
1006 {
"s16be", NULL, NULL, AFMT_S16_BE },
1008 {
"s16le", NULL, NULL, AFMT_S16_LE },
1009 {
"s16be",
"s16",
"16", AFMT_S16_BE },
1011 {
"u16le", NULL, NULL, AFMT_U16_LE },
1012 {
"u16be", NULL, NULL, AFMT_U16_BE },
1013 {
"s24le", NULL, NULL, AFMT_S24_LE },
1014 {
"s24be", NULL, NULL, AFMT_S24_BE },
1015 {
"u24le", NULL, NULL, AFMT_U24_LE },
1016 {
"u24be", NULL, NULL, AFMT_U24_BE },
1017#if BYTE_ORDER == LITTLE_ENDIAN
1018 {
"s32le",
"s32",
"32", AFMT_S32_LE },
1019 {
"s32be", NULL, NULL, AFMT_S32_BE },
1021 {
"s32le", NULL, NULL, AFMT_S32_LE },
1022 {
"s32be",
"s32",
"32", AFMT_S32_BE },
1024 {
"u32le", NULL, NULL, AFMT_U32_LE },
1025 {
"u32be", NULL, NULL, AFMT_U32_BE },
1026 {
"ac3", NULL, NULL, AFMT_AC3 },
1027 { NULL, NULL, NULL, 0 }
1039 memset(b1, 0,
sizeof(b1));
1040 memset(b2, 0,
sizeof(b2));
1042 i = sscanf(
req,
"%5[^:]:%6s", b1, b2);
1045 if (strlen(
req) != strlen(b1))
1047 strlcpy(b2,
"2.0",
sizeof(b2));
1048 }
else if (i == 2) {
1049 if (strlen(
req) != (strlen(b1) + 1 + strlen(b2)))
1054 i = sscanf(b2,
"%d.%d", &ch, &ext);
1057 if (strcasecmp(b2,
"mono") == 0) {
1060 }
else if (strcasecmp(b2,
"stereo") == 0) {
1063 }
else if (strcasecmp(b2,
"quad") == 0) {
1068 }
else if (i == 1) {
1072 }
else if (i == 2) {
1080 for (i = 0;
afmt_tab[i].name != NULL; i++) {
1117 for (i = 0;
afmt_tab[i].name != NULL; i++) {
1121 snprintf(
buf,
len,
"%s:%d.%d",
1144 if (
r == 0 &&
fmt != 0 &&
spd != 0) {
1149 if (
r == 0 &&
fmt != 0)
1151 if (
r == 0 &&
spd != 0)
1256 bs->
shadbuf = malloc(bs->
sl, M_DEVBUF, M_NOWAIT);
1351 (
"%s(): invalid volume matrix c=%p vc=%d vt=%d val=%d",
1352 __func__,
c, vc, vt,
val));
1371 }
else if (vc & 1) {
1392 (
"%s(): invalid volume matrix c=%p vc=%d vt=%d",
1393 __func__,
c, vc, vt));
1425 (
"%s(): invalid mute matrix c=%p vc=%d vt=%d mute=%d",
1426 __func__,
c, vc, vt, mute));
1442 }
else if (vc & 1) {
1461 (
"%s(): invalid mute matrix c=%p vc=%d vt=%d",
1462 __func__,
c, vc, vt));
1465 return (
c->
muted[vc][vt]);
1472 KASSERT(
c != NULL, (
"%s(): NULL channel", __func__));
1485 KASSERT(
c != NULL &&
m != NULL,
1486 (
"%s(): NULL channel or matrix", __func__));
1505 KASSERT(
c != NULL &&
map != NULL,
1506 (
"%s(): NULL channel or map", __func__));
1521 KASSERT(
c != NULL &&
map != NULL,
1522 (
"%s(): NULL channel or map", __func__));
1536#define SND_CHN_OSS_FRONT (SND_CHN_T_MASK_FL | SND_CHN_T_MASK_FR)
1537#define SND_CHN_OSS_SURR (SND_CHN_T_MASK_SL | SND_CHN_T_MASK_SR)
1538#define SND_CHN_OSS_CENTER_LFE (SND_CHN_T_MASK_FC | SND_CHN_T_MASK_LF)
1539#define SND_CHN_OSS_REAR (SND_CHN_T_MASK_BL | SND_CHN_T_MASK_BR)
1548 KASSERT(
c != NULL && retmask != NULL,
1549 (
"%s(): NULL channel or retmask", __func__));
1553 if (
caps == NULL ||
caps->fmtlist == NULL)
1556 for (i = 0;
caps->fmtlist[i] != 0; i++) {
1559 *retmask |= DSP_BIND_SPDIF;
1566 *retmask |= DSP_BIND_FRONT;
1568 *retmask |= DSP_BIND_SURR;
1570 *retmask |= DSP_BIND_CENTER_LFE;
1572 *retmask |= DSP_BIND_REAR;
1577 *retmask |= DSP_BIND_FRONT | DSP_BIND_SURR |
1578 DSP_BIND_CENTER_LFE | DSP_BIND_REAR;
1589 (
"%s(): invalid reset c=%p vc=%d", __func__,
c, vc));
1609 ret = 1 << (ret - 1);
1625 if (ret > v && (ret >> 1) > 0 && (ret >> 1) >= ((v * 3) >> 2))
1628 tmp = ret - (ret % round);
1629 while (tmp < 16 || tmp < round) {
1631 tmp = ret - (ret % round);
1709#define CHN_LATENCY_PBLKCNT_REF \
1710 {{1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 1}, \
1711 {1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 1}}
1712#define CHN_LATENCY_PBUFSZ_REF \
1713 {{7, 9, 12, 13, 14, 15, 15, 15, 15, 15, 16}, \
1714 {11, 12, 13, 14, 15, 16, 16, 16, 16, 16, 17}}
1716#define CHN_LATENCY_RBLKCNT_REF \
1717 {{9, 8, 7, 6, 5, 5, 4, 3, 2, 1, 1}, \
1718 {9, 8, 7, 6, 5, 5, 4, 3, 2, 1, 1}}
1719#define CHN_LATENCY_RBUFSZ_REF \
1720 {{14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16}, \
1721 {15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 17}}
1723#define CHN_LATENCY_DATA_REF 192000
1727 u_int32_t
max,
int *rblksz,
int *rblkcnt)
1741 bps < 1 || datarate < 1 ||
1745 if (rblkcnt != NULL)
1747 printf(
"%s(): FAILED dir=%d latency=%d bps=%d "
1748 "datarate=%u max=%u\n",
1749 __func__,
dir, latency, bps, datarate,
max);
1756 blkcnt = pblkcnts[lprofile][latency];
1757 bufsz = pbufszs[lprofile][latency];
1759 blkcnt = rblkcnts[lprofile][latency];
1760 bufsz = rbufszs[lprofile][latency];
1771 if (rblkcnt != NULL)
1782 int sblksz, sblkcnt, hblksz, hblkcnt,
limit = 0, nsblksz, nsblkcnt;
1791 if (latency == -1) {
1794 }
else if (latency == -2) {
1818 c->
flags &= ~CHN_F_HAS_SIZE;
1846 limit = (pb != NULL) ?
1849 limit = (pb != NULL) ?
1886 hblksz, hblkcnt) != 0)
1899 }
while (nsblkcnt >= 2 &&
1900 nsblksz * nsblkcnt >= sblksz * sblkcnt);
1914 while (
limit > 0 && (sblksz * sblkcnt) >
limit) {
1921 while ((sblksz * sblkcnt) <
limit)
1937 device_printf(
c->
dev,
"%s(): Failed: %d %d\n",
1938 __func__, sblkcnt, sblksz);
1961 device_printf(
c->
dev,
"%s(): %s (%s) timeout=%u "
1962 "b[%d/%d/%d] bs[%d/%d/%d] limit=%d\n",
1994 uint32_t hwspeed, delta;
2034 uint32_t oldformat, oldspeed,
format;
2050 device_printf(
c->
dev,
2051 "%s(): Setting speed %d failed, "
2052 "falling back to %d\n",
2053 __func__,
speed, oldspeed);
2063 uint32_t oldformat, oldspeed,
speed;
2079 device_printf(
c->
dev,
2080 "%s(): Format change 0x%08x failed, "
2081 "falling back to 0x%08x\n",
2082 __func__,
format, oldformat);
2099 if (d == NULL ||
m == NULL)
2113 if (
parent != SOUND_MIXER_NONE)
2116 pvol = 100 | (100 << 8);
2119 vol = 100 | (100 << 8);
2124 device_printf(
c->
dev,
2125 "Soft PCM Volume: Failed to read pcm "
2127 vol = 100 | (100 << 8);
2131 device_printf(
c->
dev,
2132 "Soft PCM Volume: Failed to read parent "
2134 pvol = 100 | (100 << 8);
2137 left = ((vol & 0x7f) * (pvol & 0x7f)) / 100;
2138 right = (((vol >> 8) & 0x7f) * ((pvol >> 8) & 0x7f)) / 100;
2146 int treble, bass,
state;
2149 treble =
mix_get(
m, SOUND_MIXER_TREBLE);
2150 bass =
mix_get(
m, SOUND_MIXER_BASS);
2156 treble = ((treble & 0x7f) +
2157 ((treble >> 8) & 0x7f)) >> 1;
2162 bass = ((bass & 0x7f) + ((bass >> 8) & 0x7f)) >> 1;
2167 device_printf(
c->
dev,
2168 "EQ: Failed to set treble -- %d\n",
2171 device_printf(
c->
dev,
2172 "EQ: Failed to set bass -- %d\n",
2175 device_printf(
c->
dev,
2176 "EQ: Failed to set preamp -- %d\n",
2185 device_printf(
c->
dev,
2186 "EQ: Failed to set state -- %d\n",
state);
2218 device_printf(
c->
dev,
2219 "%s() %s: calling go=0x%08x , "
2220 "prev=0x%08x\n", __func__,
c->
name,
go,
2235 device_printf(
c->
dev,
2236 "%s() %s: calling go=0x%08x , "
2237 "prev=0x%08x\n", __func__,
c->
name,
go,
2306 uint32_t bestformat, bestspeed, besthwformat, *vchanformat, *vchanrate;
2308 int dirty, err, run, nrun;
2362 flags &= ~CHN_N_TRIGGER;
2376 bestformat = *vchanformat;
2377 bestspeed = *vchanrate;
2394 bestspeed = ch->
speed;
2402 bestspeed = ch->
speed;
2407 if (besthwformat != 0)
2408 bestformat = besthwformat;
2421 if (ch->
speed > bestspeed) {
2422 bestspeed = ch->
speed;
2434 bestformat = besthwformat;
2438 bestformat = besthwformat;
2443 if (bestformat == 0)
2456 bestspeed = CHANNEL_SETSPEED(
c->
methods,
2460 if (err == 0 && dirty) {
2475 if (nrun && run && dirty) {
2496 *vchanformat = bestformat;
2497 *vchanrate = bestspeed;
2502 bestformat = *vchanformat;
2503 bestspeed = *vchanrate;
2531 KASSERT(
rates != NULL, (
"rates is null"));
2564 if (
c->
sm != NULL) {
2569 KASSERT(sg != NULL, (
"syncmember has null parent"));
2574 if (SLIST_EMPTY(&sg->members)) {
2584#ifdef OSSV4_EXPERIMENT
struct sb16props amt[SOUND_MIXER_NRDEVICES]
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.
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.
unsigned int sndbuf_getblkcnt(struct snd_dbuf *b)
unsigned int sndbuf_getalign(struct snd_dbuf *b)
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)
int sndbuf_remalloc(struct snd_dbuf *b, unsigned int blkcnt, unsigned int blksz)
unsigned int sndbuf_getfreeptr(struct snd_dbuf *b)
int sndbuf_setfmt(struct snd_dbuf *b, u_int32_t fmt)
void sndbuf_updateprevtotal(struct snd_dbuf *b)
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_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_free(struct snd_dbuf *b)
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)
void * sndbuf_getbufofs(struct snd_dbuf *b, unsigned int ofs)
u_int64_t sndbuf_getprevtotal(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)
void sndbuf_sethwptr(struct snd_dbuf *b, unsigned int ptr)
static u_int32_t snd_xbytes(u_int32_t v, u_int32_t from, u_int32_t to)
int chn_reset(struct pcm_channel *c, uint32_t fmt, uint32_t spd)
void chn_vpc_reset(struct pcm_channel *c, int vc, int force)
int chn_setvolume(struct pcm_channel *c, int left, int right)
int chn_syncdestroy(struct pcm_channel *c)
Remove channel from a sync group, if there is one.
MTX_SYSINIT(pcm_syncgroup, &snd_pcm_syncgroups_mtx, "PCM channel sync group lock", MTX_DEF)
static u_int32_t round_blksz(u_int32_t v, int round)
int chn_flush(struct pcm_channel *c)
static void chn_wrintr(struct pcm_channel *c)
int chn_kill(struct pcm_channel *c)
#define CHN_LATENCY_RBUFSZ_REF
static u_int32_t round_pow2(u_int32_t v)
int chn_trigger(struct pcm_channel *c, int go)
int chn_read(struct pcm_channel *c, struct uio *buf)
int chn_setmute_matrix(struct pcm_channel *c, int vc, int vt, int mute)
int chn_setspeed(struct pcm_channel *c, uint32_t speed)
int chn_setmatrix(struct pcm_channel *c, struct pcmchan_matrix *m)
uint32_t snd_str2afmt(const char *req)
static void chn_pollreset(struct pcm_channel *c)
static void chn_vpc_proc(int reset, int db)
int chn_setvolume_multi(struct pcm_channel *c, int vc, int left, int right, int center)
static void chn_rdintr(struct pcm_channel *c)
int chn_oss_setorder(struct pcm_channel *c, unsigned long long *map)
static int chn_resizebuf(struct pcm_channel *c, int latency, int blkcnt, int blksz)
static int chn_vpc_autoreset
int chn_poll(struct pcm_channel *c, int ev, struct thread *td)
static int chn_sleep(struct pcm_channel *c, int timeout)
int chn_setlatency(struct pcm_channel *c, int latency)
uint32_t snd_afmt2str(uint32_t afmt, char *buf, size_t len)
struct pcmchan_matrix * chn_getmatrix(struct pcm_channel *c)
struct pcmchan_caps * chn_getcaps(struct pcm_channel *c)
int chn_notify(struct pcm_channel *c, u_int32_t flags)
static int chn_polltrigger(struct pcm_channel *c)
Determine channel is ready for I/O.
#define CHN_LATENCY_PBLKCNT_REF
int chn_abort(struct pcm_channel *c)
static void chn_wrfeed(struct pcm_channel *c)
SND_DECLARE_FILE("$FreeBSD$")
void chn_intr_locked(struct pcm_channel *c)
#define SND_CHN_OSS_FRONT
int chn_setformat(struct pcm_channel *c, uint32_t format)
static void chn_lockdestroy(struct pcm_channel *c)
static int chn_calclatency(int dir, int latency, int bps, u_int32_t datarate, u_int32_t max, int *rblksz, int *rblkcnt)
#define CHN_LATENCY_DATA_REF
int chn_getvolume_matrix(struct pcm_channel *c, int vc, int vt)
#define CHN_LATENCY_PBUFSZ_REF
static void chn_rdfeed(struct pcm_channel *c)
int chn_oss_getorder(struct pcm_channel *c, unsigned long long *map)
static const struct @25 afmt_tab[]
int chn_init(struct pcm_channel *c, void *devinfo, int dir, int direction)
int snd_fmtvalid(uint32_t fmt, uint32_t *fmtlist)
static int sysctl_hw_snd_latency(SYSCTL_HANDLER_ARGS)
int chn_setblocksize(struct pcm_channel *c, int blkcnt, int blksz)
int chn_getrates(struct pcm_channel *c, int **rates)
Fetch array of supported discrete sample rates.
int chn_oss_getmask(struct pcm_channel *c, uint32_t *retmask)
static void chn_wakeup(struct pcm_channel *c)
void chn_resetbuf(struct pcm_channel *c)
static void chn_lockinit(struct pcm_channel *c, int dir)
int chn_sync(struct pcm_channel *c, int threshold)
static int sysctl_hw_snd_timeout(SYSCTL_HANDLER_ARGS)
int chn_getmute_matrix(struct pcm_channel *c, int vc, int vt)
struct pcm_synclist snd_pcm_syncgroups
syncgroups' master list
void chn_intr(struct pcm_channel *c)
int chn_write(struct pcm_channel *c, struct uio *buf)
u_int32_t chn_getformats(struct pcm_channel *c)
#define CHN_LATENCY_RBLKCNT_REF
int chn_setparam(struct pcm_channel *c, uint32_t format, uint32_t speed)
int chn_setvolume_matrix(struct pcm_channel *c, int vc, int vt, int val)
SYSCTL_PROC(_hw_snd, OID_AUTO, latency, CTLTYPE_INT|CTLFLAG_RWTUN|CTLFLAG_MPSAFE, 0, sizeof(int), sysctl_hw_snd_latency, "I", "buffering latency (0=low ... 10=high)")
static int sysctl_hw_snd_latency_profile(SYSCTL_HANDLER_ARGS)
#define SND_CHN_OSS_CENTER_LFE
void chn_syncstate(struct pcm_channel *c)
u_int32_t chn_start(struct pcm_channel *c, int force)
int chn_getptr(struct pcm_channel *c)
Queries sound driver for sample-aligned hardware buffer pointer index.
static int sysctl_hw_snd_vpc_0db(SYSCTL_HANDLER_ARGS)
static int sysctl_hw_snd_vpc_reset(SYSCTL_HANDLER_ARGS)
static int chn_vol_0db_pcm
struct mtx snd_pcm_syncgroups_mtx
Channel sync group lock.
static unsigned int chn_dmaupdate(struct pcm_channel *c)
int chn_setmute_multi(struct pcm_channel *c, int vc, int mute)
SYSCTL_INT(_hw_snd, OID_AUTO, report_soft_formats, CTLFLAG_RW, &report_soft_formats, 0, "report software-emulated formats")
#define PCM_SG_LOCKASSERT(arg)
#define CHN_LATENCY_PROFILE_MAX
#define PCMDIR_PLAY_VIRTUAL
#define CHN_F_PASSTHROUGH
#define CHN_F_VCHAN_ADAPTIVE
#define CHN_LATENCY_DEFAULT
#define CHN_BITPERFECT(c)
#define CHN_LATENCY_PROFILE_DEFAULT
#define CHN_INSERT_HEAD(x, y, z)
#define CHN_FOREACH(x, y, z)
#define CHN_LOCKASSERT(c)
#define PCMDIR_REC_VIRTUAL
#define CHN_REMOVE(x, y, z)
#define CHN_SETVOLUME(...)
#define CHN_F_VCHAN_DYNAMIC
#define CHN_2NDBUFMAXSIZE
#define CHN_BUF_PARENT(x, y)
#define PCMTRIG_COMMON(x)
struct pcmchan_matrix * m
struct feeder_class * feeder_getclass(struct pcm_feederdesc *desc)
struct pcm_feeder * chn_findfeeder(struct pcm_channel *c, u_int32_t type)
u_int32_t snd_fmtbest(u_int32_t fmt, u_int32_t *fmts)
int chn_addfeeder(struct pcm_channel *c, struct feeder_class *fc, struct pcm_feederdesc *desc)
int chn_removefeeder(struct pcm_channel *c)
struct pcmchan_matrix * feeder_matrix_id_map(int)
int feeder_matrix_oss_get_channel_order(struct pcmchan_matrix *, unsigned long long *)
int feeder_matrix_oss_set_channel_order(struct pcmchan_matrix *, unsigned long long *)
int feeder_chain(struct pcm_channel *)
#define SND_CHN_MATRIX_1_0
#define SND_CHN_RIGHT_MASK
#define SND_VOL_CALC_VAL(x, y, z)
#define SND_CHN_T_VOL_0DB
#define SND_CHN_MATRIX_PCMCHANNEL
#define SND_VOL_0DB_MASTER
#define SND_CHN_LEFT_MASK
u_int32_t mix_getparent(struct snd_mixer *m, u_int32_t dev)
int mix_get(struct snd_mixer *m, u_int dev)
#define RANGE(var, low, high)
void sndbuf_dmabounce(struct snd_dbuf *b)
void * snd_mtxcreate(const char *desc, const char *type)
uint32_t pcm_getflags(device_t dev)
void snd_mtxfree(void *m)
#define AFMT_EXTCHANNEL_MAX
#define AFMT_PASSTHROUGH_EXTCHANNEL
#define AFMT_PASSTHROUGH_RATE
#define AFMT_PASSTHROUGH_CHANNEL
#define SND_FORMAT(f, c, e)
#define DSP_DEFAULT_SPEED
#define AFMT_EXTCHANNEL(v)
#define PCM_REGISTERED(x)
struct pcmchan_syncmember * sm
struct pcm_channel::@28 channels
struct pcm_channel::@27 children
struct pcm_channel::@27::@29 busy
struct snd_dbuf * bufhard
struct snd_dbuf * bufsoft
struct pcm_channel * parentchannel
struct pcm_feeder * feeder
int8_t muted[SND_VOL_C_MAX][SND_CHN_T_VOL_MAX]
int16_t volume[SND_VOL_C_MAX][SND_CHN_T_VOL_MAX]
struct pcmchan_matrix matrix
struct snddev_info * parentsnddev
struct pcmchan_matrix::@26 map[SND_CHN_T_MAX+1]
Specifies an audio device sync group.
Specifies a container for members of a sync group.
struct pcmchan_syncgroup * parent
char name[SNDBUF_NAMELEN]
struct snddev_info::@49 channels
int vchan_sync(struct pcm_channel *c)
#define VCHAN_SYNC_REQUIRED(c)