2 .\" Copyright (c) 1998, Luigi Rizzo
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 PCM audio device infrastructure
39 To compile this driver into the kernel, place the following line in your
40 kernel configuration file:
41 .Bd -ragged -offset indent
45 Non-PnP sound cards require the following lines in
47 .Bd -literal -offset indent
51 hint.pcm.0.flags="0x0"
55 Note: There exists some ambiguity in the naming at the moment
56 .Pq Nm sound , pcm , snd .
57 It will be resolved soon by renaming
61 and doing associated changes.
66 driver provides support for
68 audio play and capture.
69 This driver also supports various
74 sound cards, AC97 mixer and High Definition Audio.
77 driver attaches, supported devices provide audio record and
81 sound system provides dynamic mixing
85 True full duplex operation is available on most sound cards.
87 If the sound card is supported by a bridge driver, the
89 driver works in conjunction with the bridge driver.
91 Apart from the usual parameters, the flags field is used to specify
94 channel (generally used for capture in full duplex cards).
95 Flags are set to 0 for cards not using a secondary
97 channel, or to 0x10 + C to specify channel C.
99 The driver does its best to recognize the installed hardware and drive
100 it correctly so the user is not required to add several lines in
101 .Pa /boot/device.hints .
107 cards this is actually easy
108 since they identify themselves.
111 cards, the driver looks for
113 cards at addresses 0x530 and 0x604 (unless overridden
115 .Pa /boot/device.hints ) .
117 In general, the module
126 or from the command line using the
129 Options which can be specified in
130 .Pa /boot/loader.conf
132 .Bl -tag -width ".Va snd_emu10k1_load" -offset indent
133 .It Va snd_driver_load
137 this option loads all available drivers.
138 .It Va snd_emu10k1_load
142 only the SoundBlaster 5.1 driver and dependent modules will be loaded.
147 load driver for card/chipset foo.
150 To define default values for the different mixer channels,
151 set the channel to the preferred value using hints, e.g.:
152 .Va hint.pcm.0.line Ns = Ns Qq Li 0 .
153 This will mute the input channel per default.
155 Each device can optionally support more playback channels
156 than physical hardware provides by using
161 options can be configured via the
163 interface but can only be manipulated while the device is inactive.
164 .Ss Runtime Configuration
165 There are a number of
169 tunables are global settings and
172 .Bl -tag -width ".Va hw.snd.report_soft_formats" -offset indent
173 .It Va hw.snd.latency_profile
174 Define sets of buffering latency conversion tables for the
177 A value of 0 will use a low and aggressive latency profile which can result
178 in possible underruns if the application cannot keep up with a rapid irq
179 rate, especially during high workload.
180 The default value is 1, which is considered a moderate/safe latency profile.
181 .It Va hw.snd.latency
182 Configure the buffering latency.
183 Only affects applications that do not explicitly request
184 blocksize / fragments.
185 This tunable provides finer granularity than the
186 .Va hw.snd.latency_profile
188 Possible values range between 0 (lowest latency) and 10 (highest latency).
189 .It Va hw.snd.report_soft_formats
190 Controls the internal format conversion if it is
191 available transparently to the application software.
192 When disabled or not available, the application will
193 only be able to select formats the device natively supports.
194 .It Va hw.snd.feeder_rate_round
195 Sample rate rounding threshold, to avoid large prime division at the
197 All requested sample rates will be rounded to the nearest threshold value.
198 Possible values range between 0 (disabled) and 500.
200 .It Va hw.snd.feeder_rate_max
201 Maximum allowable sample rate.
202 .It Va hw.snd.feeder_rate_min
203 Minimum allowable sample rate.
204 .It Va hw.snd.verbose
205 Level of verbosity for the
208 Higher values include more output and the highest level,
209 four, should be used when reporting problems.
210 Other options include:
213 Installed devices and their allocated bus resources.
215 The number of playback, record, virtual channels, and
218 Channel information per device including the channel's
219 current format, speed, and pseudo device statistics such as
220 buffer overruns and buffer underruns.
222 File names and versions of the currently loaded sound modules.
224 Various messages intended for debugging.
226 .It Va hw.snd.maxautovchans
229 setting that only affects devices with only one playback channel available.
230 The sound system will dynamically create up this many
237 Maximum value is 255.
238 .It Va hw.snd.default_unit
239 Default sound card for systems with multiple sound cards.
242 the default device for
244 Equivalent to a symlink from
247 .Pa /dev/dsp Ns Va ${hw.snd.default_unit} .
248 .It Va dev.pcm.%d.vchans
249 The current number of
251 allocated per device.
252 This can be set to preallocate a certain number of
254 Setting this value to
259 .It Va dev.pcm.%d.vchanrate
260 Sample rate speed for
263 All playback paths will be converted to this sample rate before the mixing
265 .It Va dev.pcm.%d.vchanformat
269 All playback paths will be converted to this format before the mixing
271 .It Va dev.pcm.%d.polling
272 Experimental polling mode support where the driver operates by querying the
273 device state on each tick using a
276 Disabled by default and currently only available for a few device drivers.
278 .Ss Recording Channels
279 On devices that have more than one recording source (ie: mic and line),
280 there is a corresponding
284 Channel statistics are only kept while the device is open.
285 So with situations involving overruns and underruns, consider the output
286 while the errant application is open and running.
288 The driver supports most of the
291 functions, and most applications work unmodified.
292 A few differences exist, while memory mapped playback is
293 supported natively and in
295 emulation, memory mapped recording is
299 As a consequence, some applications may need to be recompiled
300 with a slightly modified audio module.
303 for a complete list of the supported
309 drivers may create the following
312 .Bl -tag -width ".Pa /dev/audio%d.%d" -compact
313 .It Pa /dev/audio%d.%d
314 Sparc-compatible audio device.
316 Digitized voice device.
317 .It Pa /dev/dspW%d.%d
320 but 16 bits per sample.
321 .It Pa /dev/dsp%d.p%d
323 .It Pa /dev/dsp%d.r%d
325 .It Pa /dev/dsp%d.v%d
330 status, including all channels and drivers.
333 The first number in the device node
334 represents the unit number of the
342 Additional messages are sometimes recorded when the
343 device is probed and attached, these messages can be viewed with the
348 .It pcm%d:play:%d:dsp%d.p%d: play interrupt timeout, channel dead
349 The hardware does not generate interrupts to serve incoming (play)
350 or outgoing (record) data.
351 .It unsupported subdevice XX
352 A device node is not created properly.
383 .Xr snd_via82c686 4 ,
393 .%O "http://www.opensound.com/pguide/oss.pdf"
398 device driver first appeared in
409 The API evolved from the VOXWARE
410 standard which later became OSS standard.
413 .An Luigi Rizzo Aq luigi@iet.unipi.it
416 device driver and this manual page.
417 .An Cameron Grant Aq gandalf@vilnya.demon.co.uk
418 later revised the device driver for
420 .An Seigo Tanimura Aq tanimura@r.dl.itc.u-tokyo.ac.jp
421 revised this manual page.
422 It was then rewritten for
425 Some features of your sound card (e.g., global volume control) might not
426 be supported on all devices.