1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
|
.\"-
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2024-2025 The FreeBSD Foundation
.\"
.\" Portions of this software were developed by Christos Margiolis
.\" <christos@FreeBSD.org> under sponsorship from the FreeBSD Foundation.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd December 2, 2025
.Dt SNDCTL 8
.Os
.Sh NAME
.Nm sndctl
.Nd list and modify soundcard properties
.Sh SYNOPSIS
.Nm
.Op Fl -libxo
.Op Fl f Ar device
.Op Fl hov
.Op Ar control Ns Oo = Ns Ar value Oc Ar ...
.Sh DESCRIPTION
The
.Nm
utility is used to set and display sound card properties, using a
control-driven interface, in order to filter and/or set specific properties.
.Pp
The options are as follows:
.Bl -tag -width "-f device"
.It Fl -libxo
Generate output via
.Xr libxo 3
in a selection of different human and machine readable formats.
See
.Xr xo_options 7
for details on command line arguments.
.It Fl f Ar device
Choose a specific audio device
.Pq see Sx FILES .
Userland devices (e.g those registered by
.Xr virtual_oss 8
can also be selected.
.It Fl h
Print a help message.
.It Fl o
Print values in a format suitable for use inside scripts.
.It Fl v
Run in verbose mode.
This option will print all of the device's channel properties.
.El
.Pp
The device controls are as follows:
.Bl -column xxxxxxxxxxxxxxx xxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxx -offset indent
.It Sy Name Ta Sy Type Ta Sy Read/Write Ta Sy Action
.It name Ta String Ta Read Ta Device name
.It desc Ta String Ta Read Ta Device description
.It status Ta String Ta Read Ta Device status
.It devnode Ta String Ta Read Ta Device node
.It from_user Ta Boolean Ta Read Ta Userland device
.It unit Ta Number Ta Read Ta Device unit
.It caps Ta String Ta Read Ta Device OSS capabitilies
.It bitperfect Ta Boolean Ta Read/Write Ta Bit-perfect mode enabled
.It autoconv Ta Boolean Ta Read/Write Ta Auto-conversions enabled
.It realtime Ta Boolean Ta Read/Write Ta Real-time mode enabled
.It play Ta Group Ta Read Ta Playback properties
.It play.format Ta String Ta Read/Write Ta Playback format
.It play.rate Ta Number Ta Read/Write Ta Playback sample rate
.It play.vchans Ta Boolean Ta Read/Write Ta Playback VCHANs (virtual channels) enabled
.It play.min_rate Ta Number Ta Read Ta Minimum playback sample rate
.It play.max_rate Ta Number Ta Read Ta Maximum playback sample rate
.It play.min_chans Ta Number Ta Read Ta Natively supported minimum playback sample channels
.It play.max_chans Ta Number Ta Read Ta Natively supported maximum playback sample channels
.It play.formats Ta String Ta Read Ta Natively supported playback formats
.It rec Ta Group Ta Read Ta Recording properties
.It rec.format Ta String Ta Read/Write Ta Recording format
.It rec.rate Ta Number Ta Read/Write Ta Recording sample rate
.It rec.vchans Ta Boolean Ta Read/Write Ta Recording VCHANs (virtual channels) enabled
.It rec.min_rate Ta Number Ta Read Ta Minimum recording sample rate
.It rec.max_rate Ta Number Ta Read Ta Maximum recording sample rate
.It rec.min_chans Ta Number Ta Read Ta Natively supported minimum recording sample channels
.It rec.max_chans Ta Number Ta Read Ta Natively supported maximum recording sample channels
.It rec.formats Ta String Ta Read Ta Natively supported recording formats
.El
.Pp
The
.Pa play.format ,
.Pa play.rate ,
.Pa rec.format and
.Pa rec.rate
controls will be read-only if VCHANs are disabled.
.Pp
The device channel controls are as follows:
.Bl -column xxxxxxxxxxxxxxx xxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxx -offset indent
.It Sy Name Ta Sy Type Ta Sy Read/Write Ta Sy Action
.It name Ta String Ta Read Ta Channel name
.It parentchan Ta String Ta Read Ta Parent (primary) channel name
.It unit Ta Number Ta Read Ta Channel unit
.It caps Ta String Ta Read Ta Channel OSS capabilities
.It latency Ta Number Ta Read Ta Channel latency
.It format Ta String Ta Read Ta Channel format
.It rate Ta Number Ta Read Ta Channel sample rate
.It pid Ta Number Ta Read Ta PID of process consuming channel
.It proc Ta String Ta Read Ta Name of process consuming channel
.It interrupts Ta Number Ta Read Ta Number of interrupts since channel was opened
.It xruns Ta Number Ta Read Ta Number of playback underruns/recoring overruns
.It feedcount Ta Number Ta Read Ta Number of bytes fed to channel
.It volume Ta Volume Ta Read Ta Channel left-right volume in normalized form (0.00 to 1.00).
.It hwbuf Ta Group Ta Read Ta Hardware buffer properties
.It hwbuf.format Ta String Ta Read Ta Hardware buffer format
.It hwbuf.rate Ta String Ta Read Ta Hardware buffer sample rate
.It hwbuf.size_bytes Ta Number Ta Read Ta Hardware buffer size in bytes
.It hwbuf.size_frames Ta Number Ta Read Ta Hardware buffer size in frames
.It hwbuf.blksz Ta Number Ta Read Ta Hardware buffer block size
.It hwbuf.blkcnt Ta Number Ta Read Ta Hardware buffer block count
.It hwbuf.free Ta Number Ta Read Ta Hardware buffer free space in bytes
.It hwbuf.ready Ta Number Ta Read Ta Hardware buffer ready space in bytes
.It swbuf Ta Group Ta Read Ta Software buffer properties
.It swbuf.format Ta String Ta Read Ta Software buffer format
.It swbuf.rate Ta String Ta Read Ta Software buffer sample rate
.It swbuf.size_bytes Ta Number Ta Read Ta Software buffer size in bytes
.It swbuf.size_frames Ta Number Ta Read Ta Software buffer size in frames
.It swbuf.blksz Ta Number Ta Read Ta Software buffer block size
.It swbuf.blkcnt Ta Number Ta Read Ta Software buffer block count
.It swbuf.free Ta Number Ta Read Ta Software buffer free space in bytes
.It swbuf.ready Ta Number Ta Read Ta Software buffer ready space in bytes
.It feederchain Ta String Ta Read Ta Channel feeder chain
.El
.Sh FILES
.Bl -tag -width /dev/dspX -compact
.It Pa /dev/dsp
The default audio device.
.It Pa /dev/dspX
The audio device file, where X is the unit of the device, for example
.Ar /dev/dsp0 .
.El
.Sh EXAMPLES
Disable auto-conversions and enable realtime mode to get as low latencies as
possible:
.Bd -literal -offset indent
$ sndctl autoconv=0 realtime=1
.Ed
.Pp
Set the playback sample format to 2-channel signed 24-bit low endian, and sample
rate to 48000 Hz:
.Bd -literal -offset indent
$ sndctl play.format=s24le:2.0 play.rate=48000
.Ed
.Pp
List the PIDs and process names of all channels for
.Pa /dev/dsp1 :
.Bd -literal -offset indent
$ sndctl -f /dev/dsp1 pid proc
.Ed
.Pp
Dump
.Pa /dev/dsp0
information to a file and retrieve back later:
.Bd -literal -offset indent
$ sndctl -f /dev/dsp0 -o > info
\&...
$ sndctl -f /dev/dsp0 `cat info`
.Ed
.Sh SEE ALSO
.Xr sndstat 4 ,
.Xr sound 4 ,
.Xr xo_options 7 ,
.Xr mixer 8 ,
.Xr sysctl 8
.Sh AUTHORS
The
.Nm
utility was implemented by
.An Christos Margiolis Aq Mt christos@FreeBSD.org
under sponsorship from the
.Fx
Foundation.
|