git: fdaee441eb5f - stable/15 - snd_dummy: advance pointers for both channels

From: Christos Margiolis <christos_at_FreeBSD.org>
Date: Sat, 04 Jul 2026 09:37:26 UTC
The branch stable/15 has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=fdaee441eb5f542c56606b87eaa54bfafac2f5a7

commit fdaee441eb5f542c56606b87eaa54bfafac2f5a7
Author:     Goran Mekić <meka@tilda.center>
AuthorDate: 2026-06-27 13:41:57 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2026-07-04 09:37:15 +0000

    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
    
    (cherry picked from commit 968e748c439a50ad0a1a4463f4753f58a2bdaf9f)
---
 sys/dev/sound/dummy.c | 7 +++----
 1 file 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);