aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristos Margiolis <christos@FreeBSD.org>2025-11-10 16:15:36 +0000
committerChristos Margiolis <christos@FreeBSD.org>2025-11-10 16:15:36 +0000
commit59d7865d3c20e86b3c42096f4a8c06a5e2eebd29 (patch)
tree3afb62018ecc9d63eea844c5dd14463c1a918776
parentec0cd287f55f7ea93ff4ccfa4de0f70eca5fef75 (diff)
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
-rw-r--r--sys/dev/sound/pcm/sndstat.c12
1 files 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);