Deleted Added
full compact
pcm.4 (119893) pcm.4 (122741)
1.\"
2.\" Copyright (c) 1998, Luigi Rizzo
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

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
24.\" SUCH DAMAGE.
25.\"
1.\"
2.\" Copyright (c) 1998, Luigi Rizzo
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

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
24.\" SUCH DAMAGE.
25.\"
26.\" $FreeBSD: head/share/man/man4/pcm.4 119893 2003-09-08 19:57:22Z ru $
26.\" $FreeBSD: head/share/man/man4/pcm.4 122741 2003-11-15 06:08:57Z trhodes $
27.\"
27.\"
28.Dd June 3, 1998
28.Dd November 14, 2003
29.Dt PCM 4
30.Os
31.Sh NAME
32.Nm pcm ,
33.Nm snd
29.Dt PCM 4
30.Os
31.Sh NAME
32.Nm pcm ,
33.Nm snd
34.Nd FreeBSD PCM audio device driver
34.Nd FreeBSD PCM audio device infrastructure
35.Sh SYNOPSIS
36For a card with bridge driver support, and a PnP card:
37.Cd "device pcm"
38.Pp
39For a card without bridge driver support, and a non-PnP card,
40the following lines may be required in
41.Pa /boot/device.hints :
42.Cd hint.pcm.0.at="isa"
43.Cd hint.pcm.0.irq="5"
44.Cd hint.pcm.0.drq="1"
45.Cd hint.pcm.0.flags="0x0"
46.Sh DESCRIPTION
47The
48.Nm
35.Sh SYNOPSIS
36For a card with bridge driver support, and a PnP card:
37.Cd "device pcm"
38.Pp
39For a card without bridge driver support, and a non-PnP card,
40the following lines may be required in
41.Pa /boot/device.hints :
42.Cd hint.pcm.0.at="isa"
43.Cd hint.pcm.0.irq="5"
44.Cd hint.pcm.0.drq="1"
45.Cd hint.pcm.0.flags="0x0"
46.Sh DESCRIPTION
47The
48.Nm
49driver provides support for PCM audio play and capture.
50This driver
51also supports various PCI and WSS/MSS compatible ISA sound cards, and
52AC97 mixer.
49driver provides support for
50.Tn PCM
51audio play and capture.
52This driver also supports various
53.Tn PCI ,
54.Tn WSS/MSS
55compatible,
56.Tn ISA
57sound cards, and AC97 mixer.
58Once the
59.Nm
60driver attaches, supported devices provide audio record and
61playback channels.
62The
63.Fx
64sound system provides dynamic mixing
65.Dq VCHAN
66and rate conversion
67.Dq soft formats .
53True full duplex operation is available on most cards.
54.Pp
68True full duplex operation is available on most cards.
69.Pp
55If your sound card is supported by a bridge driver,
70If the sound card is supported by a bridge driver, the
56.Nm
71.Nm
57driver works
58in conjunction with the bridge driver.
72driver works in conjunction with the bridge driver.
59.Pp
60Apart from the usual parameters, the flags field is used to specify
73.Pp
74Apart from the usual parameters, the flags field is used to specify
61the secondary DMA channel (generally used for capture in full duplex
62cards). Flags are set to 0 for cards not using a secondary DMA
75the secondary
76.Tn DMA
77channel (generally used for capture in full duplex cards).
78Flags are set to 0 for cards not using a secondary
79.Tn DMA
63channel, or to 0x10 + C to specify channel C.
64.Pp
80channel, or to 0x10 + C to specify channel C.
81.Pp
65The driver works best with WSS/MSS cards, which have a very clean
82The driver works best with
83.Tn WSS/MSS
84cards, which have a very clean
66architecture and an orthogonal set of features.
67They also happen to be
68among the cheapest audio cards on the market.
69.Pp
70The driver does its best to recognize the installed hardware and drive
85architecture and an orthogonal set of features.
86They also happen to be
87among the cheapest audio cards on the market.
88.Pp
89The driver does its best to recognize the installed hardware and drive
71it correctly, so that you don't have to give too many details in
90it correctly so the user is not required to add several lines in
72.Pa /boot/device.hints .
91.Pa /boot/device.hints .
73For PCI and ISA PnP cards this is actually easy
92For
93.Tn PCI
94and
95.Tn ISA
96.Tn PnP
97cards this is actually easy
74since they identify themselves.
98since they identify themselves.
75For legacy ISA cards, the driver looks
76for MSS cards at addresses 0x530 and 0x604 (obviously, unless overridden
99For legacy
100.Tn ISA
101cards, the driver looks for
102.Tn MSS
103cards at addresses 0x530 and 0x604 (unless overridden
77in
78.Pa /boot/device.hints ) .
104in
105.Pa /boot/device.hints ) .
79.Sh IOCTL
80The driver supports most of the Voxware ioctls(), and most
81applications work unmodified (including popular mpeg players and linux
82binaries). A few
83differences exist (the most important one is the ability to use
84memory-mapped access to the audio buffers). As a consequence, some
85applications may need to be recompiled with a slightly modified
86audio module.
106.Ss Boot Variables
107In general, the module
108.Pa snd_foo
109corresponds to device foo and can be
110loaded by the boot loader via
111.Pa boot/loader.conf
112or from the command line using the
113.Xr kldload 8
114utility.
115Options which can be specified in
116.Pa /boot/loader.conf
117include:
118.Bl -tag -width snd_emu10k1_load -offset indent
119.It Va snd_driver_load
120.Pq Dq NO
121If set to
122.Dq YES ,
123this option loads all available drivers.
124.It Va snd_emu10k1_load
125.Pq Dq NO
126If set to
127.Dq YES ,
128Only the SoundBlaster 5.1 driver and dependent modules will be loaded.
129.It Va snd_foo_load
130.Pq Dq NO
131If set to
132.Dq YES ,
133load driver for card/chipset foo.
134.El
135.Ss VCHANS
136Each device can optionally support more playback channels
137that physical hardware provides by using
138.Dq virtual channels
139or
140.Tn VCHANs .
141.Tn VCHAN
142options can be configured via the
143.Xr sysctl 8
144interface but can only be manipulated while the device is inactive.
145.Ss Runtime Configuration
146The following
147.Xr sysctl 8
148tunables are available:
149.Bl -tag -width ".It Va hw.snd.report_soft_formats" -offset indent
150.It Va hw.snd.pcm%d.buffersize
151Configure the amount of
152.Tn DMA
153bufferspace available for a device.
154.It Va hw.snd.targetirqrate
155Set the default block size such that continuous
156playback will achieve this
157.Tn IRQ
158rate.
159This value can be tuned to improve application performance.
160Increase this value when the sound lags and decrease
161it if sound stutters or breaks up.
162.It Va hw.snd.unit
163When using
164.Xr devfs 5 ,
165the default device for
166.Pa /dev/dsp .
167Equivalent to a symlink from
168.Pa /dev/dsp
169to
170.Pa /dev/dsp${hw.snd.unit} .
171.It Va hw.snd.report_soft_formats
172Controls the internal format conversion if it is
173available transparently to the application software.
174When disabled or not available, the application will
175only be able to select formats the device natively supports.
176.It Va hw.snd.verbose
177Level of verbosity for the
178.Pa /dev/sndstat
179device.
180Higher values include more output and the highest level,
181three, should be used when reported problems.
182Other options include:
1830 - Installed devices and their allocated bus resources.
1841 - The number of playback, record, virtual channels, and
185flags per device.
1862 - Channel information per device including the channel's
187current format, speed, and pseudo device statistics such as
188buffer overruns and buffer underruns.
1893 - File names and versions of the currently sound loaded modules.
190.It Va hw.snd.maxautovchans
191Global
192.Tn VCHAN
193setting that only affects devices that have only one playback channel.
194The sound system will dynamically create up this many
195.Tn VCHANs .
196Set to
197.Dq 0
198if no
199.Tn VCHANS
200are desired.
201.It Va hw.snd.pcm%d.vchans
202The current number of
203.Tn VCHANs
204allocated per device.
205This can be set to preallocate a certain number of
206.Tn VCHANs .
207Setting this value to
208.Dq 0
209will disable
210.Tn VCHANs
211for this device.
212.El
213.Ss Recording Channels
214On devices that have more than one recording source (ie: mic and line),
215there is a corresponding
216.Pa /dev/dspr%d.%d
217device.
218.Ss Statistics
219Channel statistics are only kept while the device is open.
220So with situations involving overruns and underruns, consider the output
221while the errant application is open and running.
222.Ss IOCTL Support
223The driver supports most of the
224.Tn OSS
225.Fn ioctl
226functions, and most applications work unmodified.
227A few differences exist, while memory mapped playback is
228supported natively and in Linux emulation, memory mapped recording is
229not due to
230.Tn VM
231system design.
232As a consequence, some applications may need to be recompiled
233with a slightly modified audio module.
87See
88.In sys/soundcard.h
234See
235.In sys/soundcard.h
89for a complete list of the supported ioctls.
90.Sh SUPPORTED CARDS
236for a complete list of the supported
237.Fn ioctl
238functions.
239.Ss SUPPORTED CARDS
91Below we include a list of supported codecs/cards.
92If your sound card
93is not listed here, it may be supported by a bridge driver.
94.Bl -tag -width 2m
95.It CS4237, CS4236, CS4232, CS4231 (ISA)
96All these cards work perfectly in full duplex using the MSS mode.
97This chipset is used, among others, on the A/Open AW35 and AW32, on
98some Intel motherboards, and (the CS4231) on some non-PnP cards.

--- 18 unchanged lines hidden (view full) ---

117Creative Labs SoundBlaster PCI is supported as well.
118.It ESS Solo-1/1E (PCI)
119.It NeoMagic 256AV/ZX (PCI)
120.El
121.Sh FILES
122The following commonly used symbolic links to real device nodes
123should be present:
124.Pp
240Below we include a list of supported codecs/cards.
241If your sound card
242is not listed here, it may be supported by a bridge driver.
243.Bl -tag -width 2m
244.It CS4237, CS4236, CS4232, CS4231 (ISA)
245All these cards work perfectly in full duplex using the MSS mode.
246This chipset is used, among others, on the A/Open AW35 and AW32, on
247some Intel motherboards, and (the CS4231) on some non-PnP cards.

--- 18 unchanged lines hidden (view full) ---

266Creative Labs SoundBlaster PCI is supported as well.
267.It ESS Solo-1/1E (PCI)
268.It NeoMagic 256AV/ZX (PCI)
269.El
270.Sh FILES
271The following commonly used symbolic links to real device nodes
272should be present:
273.Pp
125.Bl -tag -width /dev/sequencer -compact
126.It Pa /dev/audio
127Sparc-compatible audio device
128.It Pa /dev/dsp
129Digitized voice device
130.It Pa /dev/dspW
274.Bl -tag -width "/dev/dspr%d.%dXXX" -compact
275.It Pa /dev/audio%d.%d
276Sparc-compatible audio device.
277.It Pa /dev/dsp%d.%d
278Digitized voice device.
279.It Pa /dev/dspW%d.%d
131Like
132.Pa /dev/dsp ,
280Like
281.Pa /dev/dsp ,
133but 16 bits per sample
134.It Pa /dev/midi
135Raw midi access device
136.It Pa /dev/mixer
137Control port mixer device
138.It Pa /dev/music
139Level 2 sequencer interface
140.It Pa /dev/sequencer
141Sequencer device
142.It Pa /dev/pss
143Programmable device interface
282but 16 bits per sample.
283.It Pa /dev/dspr%d.%d
284Should be connected to a record codec.
285.It Pa /dev/sndstat
286Current
287.Nm
288status, including all channels and drivers.
144.El
145.Pp
146Each symbolic link refers to a device node of the same name,
147but with a unit number appended.
148The unit number for each device matches the unit number of the
149device probed at boot time.
150Device probe messages can be examined with the
151.Xr dmesg 8
152utility.
289.El
290.Pp
291Each symbolic link refers to a device node of the same name,
292but with a unit number appended.
293The unit number for each device matches the unit number of the
294device probed at boot time.
295Device probe messages can be examined with the
296.Xr dmesg 8
297utility.
153.Sh DIAGNOSTICS AND TROUBLESHOOTING
298.Sh DIAGNOSTICS
154.Bl -tag -width 2m
155.It ac97: dac not ready
156AC97 codec is not likely to be accompanied with the sound card.
157.It unsupported subdevice XX
158A device node is not created properly.
159.El
160.Sh BUGS
161Some features of your cards (e.g. global volume control) might not
162be supported on all devices.
163.Sh HISTORY
164The
165.Nm
166device driver first appeared in
299.Bl -tag -width 2m
300.It ac97: dac not ready
301AC97 codec is not likely to be accompanied with the sound card.
302.It unsupported subdevice XX
303A device node is not created properly.
304.El
305.Sh BUGS
306Some features of your cards (e.g. global volume control) might not
307be supported on all devices.
308.Sh HISTORY
309The
310.Nm
311device driver first appeared in
167.Fx 2.2.6 ,
312.Fx 2.2.6 written by Luigi Rizzo.
313It was later
168rewritten in
314rewritten in
169.Fx 4.0 .
315.Fx 4.0 by Cameron Grant.
316The API evolved from the VOXWARE
317standard which later became OSS standard.
170.Sh SEE ALSO
171.Xr csa 4 ,
172.Xr gusc 4 ,
173.Xr sbc 4 ,
318.Sh SEE ALSO
319.Xr csa 4 ,
320.Xr gusc 4 ,
321.Xr sbc 4 ,
174.Xr devfs 5
322.Xr devfs 5 ,
323.Xr loader.conf 5 ,
324.Xr dmesg 8 ,
325.Xr kldload 8 ,
326.Xr sysctl 8
327.Rs
328.%T "The OSS API"
329.%O "http://www.opensound.com/pguide/oss.pdf"
330.Re
175.Sh AUTHORS
331.Sh AUTHORS
332.An -nosplit
176.An Luigi Rizzo Aq luigi@iet.unipi.it
177initially wrote the
178.Nm
179device driver and this manual page.
180.An Cameron Grant Aq gandalf@vilnya.demon.co.uk
333.An Luigi Rizzo Aq luigi@iet.unipi.it
334initially wrote the
335.Nm
336device driver and this manual page.
337.An Cameron Grant Aq gandalf@vilnya.demon.co.uk
181totally revised the device driver.
338later revised the device driver for
339.Fx 4.0 .
182.An Seigo Tanimura Aq tanimura@r.dl.itc.u-tokyo.ac.jp
183revised this manual page.
340.An Seigo Tanimura Aq tanimura@r.dl.itc.u-tokyo.ac.jp
341revised this manual page.
342It was then rewritten for
343.Fx 5.2 .