The branch main has been updated by christos:

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

commit 59d7865d3c20e86b3c42096f4a8c06a5e2eebd29
Author:     Christos Margiolis <[email protected]>
AuthorDate: 2025-11-10 16:15:36 +0000
Commit:     Christos Margiolis <[email protected]>
CommitDate: 2025-11-10 16:15:36 +0000

    sound: Clarify userland/vchan relationship in sndstat feeder chain
    
    When vchans are enabled, the primary channels do not interact with
    userland, but with the vchans.
    
    With vchans enabled:
    
    $ sndctl feederchain
    dsp0.play.0.feederchain=[vchans -> [...] -> hardware]
    dsp0.record.0.feederchain=[hardware -> [...] -> vchans]
    
    With vchans disabled:
    
    $ sndctl feederchain
    dsp0.play.0.feederchain=[userland ->  [...] -> hardware]
    dsp0.record.0.feederchain=[hardware -> [...] -> userland]
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D53504
---
 sys/dev/sound/pcm/sndstat.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c
index 51d0fb3bb686..1a5bccd718b5 100644
--- a/sys/dev/sound/pcm/sndstat.c
+++ b/sys/dev/sound/pcm/sndstat.c
@@ -524,7 +524,8 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t 
**dip)
                            c->parentchannel->name : "userland");
                } else {
                        sbuf_printf(&sb, "[%s", (c->direction == PCMDIR_REC) ?
-                           "hardware" : "userland");
+                           "hardware" :
+                           ((d->flags & SD_F_PVCHANS) ? "vchans" : 
"userland"));
                }
                sbuf_printf(&sb, " -> ");
                f = c->feeder;
@@ -561,7 +562,8 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t 
**dip)
                            "userland" : c->parentchannel->name);
                } else {
                        sbuf_printf(&sb, "%s]", (c->direction == PCMDIR_REC) ?
-                           "userland" : "hardware");
+                           ((d->flags & SD_F_RVCHANS) ? "vchans" : "userland") 
:
+                           "hardware");
                }
 
                CHN_UNLOCK(c);
@@ -1320,7 +1322,8 @@ sndstat_prepare_pcm(struct sbuf *s, device_t dev, int 
verbose)
                            c->parentchannel->name : "userland");
                } else {
                        sbuf_printf(s, "\t{%s}", (c->direction == PCMDIR_REC) ?
-                           "hardware" : "userland");
+                           "hardware" :
+                           ((d->flags & SD_F_PVCHANS) ? "vchans" : 
"userland"));
                }
                sbuf_printf(s, " -> ");
                f = c->feeder;
@@ -1358,7 +1361,8 @@ sndstat_prepare_pcm(struct sbuf *s, device_t dev, int 
verbose)
                            "userland" : c->parentchannel->name);
                } else {
                        sbuf_printf(s, "{%s}", (c->direction == PCMDIR_REC) ?
-                           "userland" : "hardware");
+                           ((d->flags & SD_F_RVCHANS) ? "vchans" : "userland") 
:
+                           "hardware");
                }
 
                CHN_UNLOCK(c);

Reply via email to