sound: Make sndstat PVCHAN and RVCHAN nvlist parameters bool

Prior to 02d4eeabfd ("sound: Allocate vchans on-demand"), the
play.vchans and rec.vchans sysctls corresponded to the value of
d->pvchancount and d->rvchancount respectively, which is also what we
are exporting through SNDST_DSPS_SOUND4_PVCHAN and
SNDST_DSPS_SOUND4_RVCHAN respectively. Since that commit, the sysctls
mentioned have been modified to show whether play/rec vchans are enabled
or not. Modify the sndstat nvlist parameters accordingly.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D49980
This commit is contained in:
Christos Margiolis
2025-04-25 18:55:16 +02:00
parent 5fa183f028
commit 0c0bb4c140
2 changed files with 8 additions and 6 deletions
+4 -4
View File
@@ -76,10 +76,10 @@ dsps (NVLIST ARRAY): 1
unit (NUMBER): 0
status (STRING): on hdaa0
bitperfect (BOOL): FALSE
pvchan (NUMBER): 1
pvchan (BOOL): TRUE
pvchanrate (NUMBER): 48000
pvchanformat (NUMBER): 0x00000010
rvchan (NUMBER): 0
rvchan (BOOL): TRUE
rvchanrate (NUMBER): 48000
rvchanformat (NUMBER): 0x00000010
channel_info (NVLIST_ARRAY): 1
@@ -181,13 +181,13 @@ Usually reports the driver the device is attached on.
.It Dv bitperfect
Whether the sound card has bit-perfect mode enabled.
.It Dv pvchan
Number of playback virtual channels.
Playback virtual channels enabled.
.It Dv pvchanrate
Playback virtual channel sample rate.
.It Dv pvchanformat
Playback virtual channel format.
.It Dv rvchan
Number of recording virtual channels.
Recording virtual channels enabled.
.It Dv rvchanrate
Recording virtual channel sample rate.
.It Dv rvchanformat
+4 -2
View File
@@ -440,12 +440,14 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip)
nvlist_add_string(sound4di, SNDST_DSPS_SOUND4_STATUS, d->status);
nvlist_add_bool(
sound4di, SNDST_DSPS_SOUND4_BITPERFECT, d->flags & SD_F_BITPERFECT);
nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_PVCHAN, d->pvchancount);
nvlist_add_bool(sound4di, SNDST_DSPS_SOUND4_PVCHAN,
d->flags & SD_F_PVCHANS);
nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_PVCHANRATE,
d->pvchanrate);
nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_PVCHANFORMAT,
d->pvchanformat);
nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_RVCHAN, d->rvchancount);
nvlist_add_bool(sound4di, SNDST_DSPS_SOUND4_RVCHAN,
d->flags & SD_F_RVCHANS);
nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_RVCHANRATE,
d->rvchanrate);
nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_RVCHANFORMAT,