diff options
| author | Goran Mekić <meka@tilda.center> | 2026-06-27 13:41:57 +0000 |
|---|---|---|
| committer | Christos Margiolis <christos@FreeBSD.org> | 2026-06-27 13:41:57 +0000 |
| commit | 968e748c439a50ad0a1a4463f4753f58a2bdaf9f (patch) | |
| tree | 2dd6a57d019fa7f4445b3e05fcc1b0dd9b30ab43 | |
| parent | c263dd413ca0b43b4513e6e6dd8ed64c0eb9c3aa (diff) | |
snd_dummy: advance pointers for both channels
Previously only the play pointer advanced each tick; the record channel
refilled the whole buffer with silence and left the DMA pointer at 0.
Advance the record pointer by one block per tick and fill that block
with silence, so the DMA pointer changes and mmap kqueue consumers can
track progress.
MFC after: 1 week
Reviewed by: christos
Differential Revision: https://reviews.freebsd.org/D57834
| -rw-r--r-- | sys/dev/sound/dummy.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/sound/dummy.c b/sys/dev/sound/dummy.c index 91a198e3d9f6..7390ba9f467f 100644 --- a/sys/dev/sound/dummy.c +++ b/sys/dev/sound/dummy.c @@ -112,11 +112,10 @@ dummy_chan_io(void *arg) ch = &sc->chans[i]; if (!ch->run) continue; - if (ch->dir == PCMDIR_PLAY) { - ch->ptr += ch->buf->blksz; - ch->ptr %= ch->buf->bufsize; - } else + if (ch->dir == PCMDIR_REC) sndbuf_fillsilence(ch->buf); + ch->ptr += ch->buf->blksz; + ch->ptr %= ch->buf->bufsize; mtx_unlock(&sc->lock); chn_intr(ch->chan); mtx_lock(&sc->lock); |
