git: f2372d936d7f - stable/14 - sound: Fix VCHANs' starting and ending points in feeder chain
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 04 Aug 2024 12:09:40 UTC
The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=f2372d936d7f57b52af85dde10c977fd49cbd52d commit f2372d936d7f57b52af85dde10c977fd49cbd52d Author: Christos Margiolis <christos@FreeBSD.org> AuthorDate: 2024-08-02 12:53:16 +0000 Commit: Christos Margiolis <christos@FreeBSD.org> CommitDate: 2024-08-04 12:09:35 +0000 sound: Fix VCHANs' starting and ending points in feeder chain sndstat(4) falsely reports "hardware" as the starting point of recording, and ending point of playback VCHANs. Recording VCHANs get their input from the primary recording channel, and playback VCHANs send their input to the primary playback channel. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D46177 (cherry picked from commit b58d9db4d77a6f42ac7cf3cdb2af2443666033e2) --- sys/dev/sound/pcm/sndstat.c | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index f09fa7139884..4fac6a97a3f0 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -517,8 +517,13 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) nvlist_add_number(cdi, SNDST_DSPS_SOUND4_CHAN_SWBUF_READY, sndbuf_getready(c->bufsoft)); - sbuf_printf(&sb, "[%s", - (c->direction == PCMDIR_REC) ? "hardware" : "userland"); + if (c->parentchannel != NULL) { + sbuf_printf(&sb, "[%s", (c->direction == PCMDIR_REC) ? + c->parentchannel->name : "userland"); + } else { + sbuf_printf(&sb, "[%s", (c->direction == PCMDIR_REC) ? + "hardware" : "userland"); + } sbuf_printf(&sb, " -> "); f = c->feeder; while (f->source != NULL) @@ -550,8 +555,13 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) sbuf_printf(&sb, " -> "); f = f->parent; } - sbuf_printf(&sb, "%s]", - (c->direction == PCMDIR_REC) ? "userland" : "hardware"); + if (c->parentchannel != NULL) { + sbuf_printf(&sb, "%s]", (c->direction == PCMDIR_REC) ? + "userland" : c->parentchannel->name); + } else { + sbuf_printf(&sb, "%s]", (c->direction == PCMDIR_REC) ? + "userland" : "hardware"); + } CHN_UNLOCK(c); @@ -1306,8 +1316,13 @@ sndstat_prepare_pcm(struct sbuf *s, device_t dev, int verbose) sbuf_printf(s, "channel flags=0x%b", c->flags, CHN_F_BITS); sbuf_printf(s, "\n\t"); - sbuf_printf(s, "{%s}", - (c->direction == PCMDIR_REC) ? "hardware" : "userland"); + if (c->parentchannel != NULL) { + sbuf_printf(s, "{%s}", (c->direction == PCMDIR_REC) ? + c->parentchannel->name : "userland"); + } else { + sbuf_printf(s, "{%s}", (c->direction == PCMDIR_REC) ? + "hardware" : "userland"); + } sbuf_printf(s, " -> "); f = c->feeder; while (f->source != NULL) @@ -1339,8 +1354,13 @@ sndstat_prepare_pcm(struct sbuf *s, device_t dev, int verbose) sbuf_printf(s, " -> "); f = f->parent; } - sbuf_printf(s, "{%s}", - (c->direction == PCMDIR_REC) ? "userland" : "hardware"); + if (c->parentchannel != NULL) { + sbuf_printf(s, "{%s}", (c->direction == PCMDIR_REC) ? + "userland" : c->parentchannel->name); + } else { + sbuf_printf(s, "{%s}", (c->direction == PCMDIR_REC) ? + "userland" : "hardware"); + } CHN_UNLOCK(c); }