2005-06-28 13:21:03 +04:00
|
|
|
.\" $NetBSD: audio.4,v 1.63 2005/06/28 09:21:03 kent Exp $
|
1996-02-28 01:39:39 +03:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
|
1995-11-12 23:14:23 +03:00
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
1996-02-28 01:39:39 +03:00
|
|
|
.\" This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
.\" by John T. Kohl.
|
|
|
|
.\"
|
1995-11-12 23:14:23 +03:00
|
|
|
.\" 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.
|
1996-02-28 01:39:39 +03:00
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by the NetBSD
|
|
|
|
.\" Foundation, Inc. and its contributors.
|
|
|
|
.\" 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
|
|
.\" contributors may be used to endorse or promote products derived
|
|
|
|
.\" from this software without specific prior written permission.
|
1995-11-12 23:14:23 +03:00
|
|
|
.\"
|
1996-02-28 01:39:39 +03:00
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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
|
1998-04-30 12:50:03 +04:00
|
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
1997-10-09 01:59:52 +04:00
|
|
|
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
1996-02-28 01:39:39 +03:00
|
|
|
.\" 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
|
1995-11-12 23:14:23 +03:00
|
|
|
.\" POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
2005-06-28 12:42:32 +04:00
|
|
|
.Dd June 28, 2005
|
1995-11-12 23:14:23 +03:00
|
|
|
.Dt AUDIO 4
|
1999-03-16 04:19:14 +03:00
|
|
|
.Os
|
1995-11-12 23:14:23 +03:00
|
|
|
.Sh NAME
|
|
|
|
.Nm audio
|
1997-03-11 08:29:03 +03:00
|
|
|
.Nd device-independent audio driver layer
|
1995-11-12 23:14:23 +03:00
|
|
|
.Sh SYNOPSIS
|
2003-04-16 17:34:34 +04:00
|
|
|
.In sys/types.h
|
|
|
|
.In sys/audioio.h
|
1995-11-12 23:14:23 +03:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
1997-03-11 08:29:03 +03:00
|
|
|
.Nm
|
1998-04-30 12:50:03 +04:00
|
|
|
driver provides support for various audio peripherals.
|
|
|
|
It provides a uniform programming interface layer above different
|
|
|
|
underlying audio hardware drivers.
|
|
|
|
The audio layer provides full-duplex operation if the
|
1995-11-12 23:14:23 +03:00
|
|
|
underlying hardware configuration supports it.
|
|
|
|
.Pp
|
1997-08-19 01:33:33 +04:00
|
|
|
There are four device files available for audio operation:
|
1995-11-12 23:14:23 +03:00
|
|
|
.Pa /dev/audio ,
|
|
|
|
.Pa /dev/sound ,
|
1997-08-19 01:33:33 +04:00
|
|
|
.Pa /dev/audioctl ,
|
1995-11-12 23:14:23 +03:00
|
|
|
and
|
|
|
|
.Pa /dev/mixer .
|
2003-06-11 08:41:17 +04:00
|
|
|
.Pp
|
1995-11-12 23:14:23 +03:00
|
|
|
.Pa /dev/audio
|
|
|
|
and
|
|
|
|
.Pa /dev/sound
|
|
|
|
are used for recording or playback of digital samples.
|
2003-06-11 08:41:17 +04:00
|
|
|
.Pp
|
1995-11-12 23:14:23 +03:00
|
|
|
.Pa /dev/mixer
|
|
|
|
is used to manipulate volume, recording source, or other audio mixer
|
|
|
|
functions.
|
2003-06-11 08:41:17 +04:00
|
|
|
.Pp
|
1997-08-19 01:33:33 +04:00
|
|
|
.Pa /dev/audioctl
|
|
|
|
accepts the same
|
|
|
|
.Xr ioctl 2
|
|
|
|
operations as
|
|
|
|
.Pa /dev/sound ,
|
1998-04-30 12:50:03 +04:00
|
|
|
but no other operations.
|
2003-06-11 08:41:17 +04:00
|
|
|
.Pp
|
1998-04-30 12:50:03 +04:00
|
|
|
In contrast to
|
1997-08-19 01:33:33 +04:00
|
|
|
.Pa /dev/sound
|
|
|
|
which has the exclusive open property
|
|
|
|
.Pa /dev/audioctl
|
|
|
|
can be opened at any time and can be used to manipulate the audio device
|
|
|
|
while it is in use.
|
1995-11-12 23:14:23 +03:00
|
|
|
.Sh SAMPLING DEVICES
|
|
|
|
When
|
|
|
|
.Pa /dev/audio
|
|
|
|
is opened, it automatically directs the underlying driver to manipulate
|
2003-04-06 22:20:07 +04:00
|
|
|
monaural 8-bit mu-law samples.
|
1998-04-30 12:50:03 +04:00
|
|
|
In addition, if it is opened read-only
|
1995-11-12 23:14:23 +03:00
|
|
|
(write-only) the device is set to half-duplex record (play) mode with
|
|
|
|
recording (playing) unpaused and playing (recording) paused.
|
|
|
|
When
|
|
|
|
.Pa /dev/sound
|
|
|
|
is opened, it maintains the previous audio sample mode and
|
1998-04-30 12:50:03 +04:00
|
|
|
record/playback mode.
|
|
|
|
In all other respects
|
1995-11-12 23:14:23 +03:00
|
|
|
.Pa /dev/audio
|
|
|
|
and
|
|
|
|
.Pa /dev/sound
|
|
|
|
are identical.
|
|
|
|
.Pp
|
|
|
|
Only one process may hold open a sampling device at a given time
|
|
|
|
(although file descriptors may be shared between processes once the
|
|
|
|
first open completes).
|
|
|
|
.Pp
|
|
|
|
On a half-duplex device, writes while recording is in progress will be
|
1998-04-30 12:50:03 +04:00
|
|
|
immediately discarded.
|
|
|
|
Similarly, reads while playback is in progress
|
1995-11-12 23:14:23 +03:00
|
|
|
will be filled with silence but delayed to return at the current
|
1998-04-30 12:50:03 +04:00
|
|
|
sampling rate.
|
|
|
|
If both playback and recording are requested on a half-duplex
|
1995-11-12 23:14:23 +03:00
|
|
|
device, playback mode takes precedence and recordings will get silence.
|
2003-06-11 08:41:17 +04:00
|
|
|
.Pp
|
1995-11-12 23:14:23 +03:00
|
|
|
On a full-duplex device, reads and writes may operate
|
|
|
|
concurrently without interference.
|
1998-04-30 12:50:03 +04:00
|
|
|
If a full-duplex capable audio device is opened for both reading and writing
|
|
|
|
it will start in half-duplex play mode; full-duplex mode has to be set
|
2001-06-12 18:54:19 +04:00
|
|
|
explicitly.
|
2003-06-11 08:41:17 +04:00
|
|
|
.Pp
|
1995-11-12 23:14:23 +03:00
|
|
|
On either type of device, if the playback mode is paused then silence is
|
|
|
|
played instead of the provided samples, and if recording is paused then
|
|
|
|
the process blocks in
|
|
|
|
.Xr read 2
|
|
|
|
until recording is unpaused.
|
|
|
|
.Pp
|
|
|
|
If a writing process does not call
|
|
|
|
.Xr write 2
|
1997-07-28 04:23:10 +04:00
|
|
|
frequently enough to provide samples at the pace the hardware
|
|
|
|
consumes them silence is inserted.
|
1998-04-30 12:50:03 +04:00
|
|
|
If the
|
|
|
|
.Dv AUMODE_PLAY_ALL
|
|
|
|
mode is not set the writing process must
|
1997-07-28 04:23:10 +04:00
|
|
|
provide enough data via
|
2002-03-13 03:18:40 +03:00
|
|
|
subsequent write calls to
|
|
|
|
.Dq catch up
|
|
|
|
in time to the current audio
|
1995-11-12 23:14:23 +03:00
|
|
|
block before any more process-provided samples will be played.
|
|
|
|
If a reading process does not call
|
|
|
|
.Xr read 2
|
|
|
|
frequently enough, it will simply miss samples.
|
|
|
|
.Pp
|
1997-07-28 04:23:10 +04:00
|
|
|
The audio device is normally accessed with
|
|
|
|
.Xr read 2
|
|
|
|
or
|
|
|
|
.Xr write 2
|
|
|
|
calls, but it can also be mapped into user memory with
|
1998-04-30 12:50:03 +04:00
|
|
|
.Xr mmap 2
|
1997-07-31 02:40:43 +04:00
|
|
|
(when supported by the device).
|
1997-07-28 04:23:10 +04:00
|
|
|
Once the device has been mapped it can no longer be accessed
|
|
|
|
by read or write; all access is by reading and writing to
|
1998-04-30 12:50:03 +04:00
|
|
|
the mapped memory.
|
|
|
|
The device appears as a block of memory
|
1997-07-28 04:23:10 +04:00
|
|
|
of size
|
|
|
|
.Va buffersize
|
1998-04-30 12:50:03 +04:00
|
|
|
(as available via
|
1999-03-07 01:40:08 +03:00
|
|
|
.Dv AUDIO_GETINFO ) .
|
1997-07-28 04:23:10 +04:00
|
|
|
The device driver will continuously move data from this buffer
|
1998-04-30 12:50:03 +04:00
|
|
|
from/to the audio hardware, wrapping around at the end of the buffer.
|
|
|
|
To find out where the hardware is currently accessing data in the buffer the
|
1997-07-28 04:23:10 +04:00
|
|
|
.Dv AUDIO_GETIOFFS
|
|
|
|
and
|
|
|
|
.Dv AUDIO_GETOOFFS
|
|
|
|
calls can be used.
|
|
|
|
The playing and recording buffers are distinct and must be
|
|
|
|
mapped separately if both are to be used.
|
|
|
|
Only encodings that are not emulated (i.e. where
|
|
|
|
.Dv AUDIO_ENCODINGFLAG_EMULATED
|
|
|
|
is not set) work properly for a mapped device.
|
|
|
|
.Pp
|
1997-10-20 12:22:42 +04:00
|
|
|
The audio device, like most devices, can be used in
|
2001-09-11 21:39:00 +04:00
|
|
|
.Va select ,
|
2002-02-02 14:07:36 +03:00
|
|
|
can be set in non-blocking mode and can be set (with a
|
2002-02-02 14:11:20 +03:00
|
|
|
.Dv FIOASYNC
|
2002-02-02 14:07:36 +03:00
|
|
|
ioctl) to send a
|
1997-10-20 12:22:42 +04:00
|
|
|
.Dv SIGIO
|
|
|
|
when I/O is possible.
|
|
|
|
The mixer device can be set to generate a
|
|
|
|
.Dv SIGIO
|
|
|
|
whenever a mixer value is changed.
|
|
|
|
.Pp
|
1995-11-12 23:14:23 +03:00
|
|
|
The following
|
|
|
|
.Xr ioctl 2
|
|
|
|
commands are supported on the sample devices:
|
1997-03-11 08:29:03 +03:00
|
|
|
.Pp
|
2000-05-13 19:20:35 +04:00
|
|
|
.Bl -tag -width indent
|
1995-11-12 23:14:23 +03:00
|
|
|
.It Dv AUDIO_FLUSH
|
|
|
|
This command stops all playback and recording, clears all queued
|
|
|
|
buffers, resets error counters, and restarts recording and playback as
|
|
|
|
appropriate for the current sampling mode.
|
|
|
|
.It Dv AUDIO_RERROR (int)
|
|
|
|
This command fetches the count of dropped input samples into its integer
|
1998-04-30 12:50:03 +04:00
|
|
|
argument.
|
|
|
|
There is no information regarding when in the sample stream
|
1995-11-12 23:14:23 +03:00
|
|
|
they were dropped.
|
|
|
|
.It Dv AUDIO_WSEEK (int)
|
1999-10-28 13:53:22 +04:00
|
|
|
This command fetches the count of samples that are queued ahead of the
|
1995-11-12 23:14:23 +03:00
|
|
|
first sample in the most recent sample block written into its integer argument.
|
|
|
|
.It Dv AUDIO_DRAIN
|
|
|
|
This command suspends the calling process until all queued playback
|
|
|
|
samples have been played by the hardware.
|
|
|
|
.It Dv AUDIO_GETDEV (audio_device_t)
|
|
|
|
This command fetches the current hardware device information into the
|
|
|
|
audio_device_t argument.
|
|
|
|
.Bd -literal
|
|
|
|
typedef struct audio_device {
|
|
|
|
char name[MAX_AUDIO_DEV_LEN];
|
|
|
|
char version[MAX_AUDIO_DEV_LEN];
|
|
|
|
char config[MAX_AUDIO_DEV_LEN];
|
|
|
|
} audio_device_t;
|
|
|
|
.Ed
|
1997-10-20 12:22:42 +04:00
|
|
|
.It Dv AUDIO_GETFD (int)
|
|
|
|
The command returns the current setting of the full duplex mode.
|
1995-11-12 23:14:23 +03:00
|
|
|
.It Dv AUDIO_GETENC (audio_encoding_t)
|
1997-03-11 08:29:03 +03:00
|
|
|
This command is used iteratively to fetch sample encoding names and
|
|
|
|
format_ids into the input/output audio_encoding_t argument.
|
1995-11-12 23:14:23 +03:00
|
|
|
.Bd -literal
|
|
|
|
typedef struct audio_encoding {
|
1997-10-20 12:22:42 +04:00
|
|
|
int index; /* input: nth encoding */
|
1997-05-07 23:24:25 +04:00
|
|
|
char name[MAX_AUDIO_DEV_LEN]; /* name of encoding */
|
|
|
|
int encoding; /* value for encoding parameter */
|
|
|
|
int precision; /* value for precision parameter */
|
|
|
|
int flags;
|
|
|
|
#define AUDIO_ENCODINGFLAG_EMULATED 1 /* software emulation mode */
|
1995-11-12 23:14:23 +03:00
|
|
|
} audio_encoding_t;
|
|
|
|
.Ed
|
2001-09-11 21:39:00 +04:00
|
|
|
.Pp
|
1997-03-11 08:29:03 +03:00
|
|
|
To query
|
1997-10-20 12:22:42 +04:00
|
|
|
all the supported encodings, start with an index field of 0 and
|
1995-11-12 23:14:23 +03:00
|
|
|
continue with successive encodings (1, 2, ...) until the command returns
|
|
|
|
an error.
|
|
|
|
.It Dv AUDIO_SETFD (int)
|
|
|
|
This command sets the device into full-duplex operation if its integer
|
|
|
|
argument has a non-zero value, or into half-duplex operation if it
|
1998-04-30 12:50:03 +04:00
|
|
|
contains a zero value.
|
|
|
|
If the device does not support full-duplex
|
1995-11-12 23:14:23 +03:00
|
|
|
operation, attempting to set full-duplex mode returns an error.
|
1997-07-28 04:23:10 +04:00
|
|
|
.It Dv AUDIO_GETPROPS (int)
|
1998-04-30 12:50:03 +04:00
|
|
|
This command gets a bit set of hardware properties.
|
|
|
|
If the hardware
|
1997-10-20 12:22:42 +04:00
|
|
|
has a certain property the corresponding bit is set, otherwise it is not.
|
1997-07-28 04:23:10 +04:00
|
|
|
The properties can have the following values:
|
2001-09-11 21:39:00 +04:00
|
|
|
.Pp
|
2000-05-13 19:20:35 +04:00
|
|
|
.Bl -tag -width AUDIO_PROP_INDEPENDENT -compact
|
1997-07-28 04:23:10 +04:00
|
|
|
.It Dv AUDIO_PROP_FULLDUPLEX
|
|
|
|
the device admits full duplex operation.
|
|
|
|
.It Dv AUDIO_PROP_MMAP
|
|
|
|
the device can be used with
|
|
|
|
.Xr mmap 2 .
|
1997-08-25 02:44:16 +04:00
|
|
|
.It Dv AUDIO_PROP_INDEPENDENT
|
1997-10-06 20:00:55 +04:00
|
|
|
the device can set the playing and recording encoding parameters
|
1997-08-25 02:44:16 +04:00
|
|
|
independently.
|
1997-07-28 04:23:10 +04:00
|
|
|
.El
|
|
|
|
.It Dv AUDIO_GETIOFFS (audio_offset_t)
|
|
|
|
.It Dv AUDIO_GETOOFFS (audio_offset_t)
|
|
|
|
This command fetches the current offset in the input(output) buffer where
|
2002-02-02 14:07:36 +03:00
|
|
|
the audio hardware's DMA engine will be putting(getting) data.
|
1998-04-30 12:50:03 +04:00
|
|
|
It mostly useful when the device
|
1997-07-28 04:23:10 +04:00
|
|
|
buffer is available in user space via the
|
|
|
|
.Xr mmap 2
|
|
|
|
call.
|
|
|
|
The information is returned in the audio_offset structure.
|
|
|
|
.Bd -literal
|
|
|
|
typedef struct audio_offset {
|
|
|
|
u_int samples; /* Total number of bytes transferred */
|
|
|
|
u_int deltablks; /* Blocks transferred since last checked */
|
|
|
|
u_int offset; /* Physical transfer offset in buffer */
|
|
|
|
} audio_offset_t;
|
|
|
|
.Ed
|
1995-11-12 23:14:23 +03:00
|
|
|
.It Dv AUDIO_GETINFO (audio_info_t)
|
|
|
|
.It Dv AUDIO_SETINFO (audio_info_t)
|
|
|
|
Get or set audio information as encoded in the audio_info structure.
|
|
|
|
.Bd -literal
|
|
|
|
typedef struct audio_info {
|
1997-07-28 04:23:10 +04:00
|
|
|
struct audio_prinfo play; /* info for play (output) side */
|
|
|
|
struct audio_prinfo record; /* info for record (input) side */
|
2002-02-02 14:07:36 +03:00
|
|
|
u_int monitor_gain; /* input to output mix */
|
1995-11-12 23:14:23 +03:00
|
|
|
/* BSD extensions */
|
1997-05-07 23:24:25 +04:00
|
|
|
u_int blocksize; /* H/W read/write block size */
|
1995-11-12 23:14:23 +03:00
|
|
|
u_int hiwat; /* output high water mark */
|
|
|
|
u_int lowat; /* output low water mark */
|
1997-10-20 12:22:42 +04:00
|
|
|
u_int _ispare1;
|
1995-11-12 23:14:23 +03:00
|
|
|
u_int mode; /* current device mode */
|
|
|
|
#define AUMODE_PLAY 0x01
|
|
|
|
#define AUMODE_RECORD 0x02
|
1997-07-28 04:23:10 +04:00
|
|
|
#define AUMODE_PLAY_ALL 0x04 /* do not do real-time correction */
|
2004-01-26 21:17:08 +03:00
|
|
|
} audio_info_t;
|
1995-11-12 23:14:23 +03:00
|
|
|
.Ed
|
1997-03-11 08:29:03 +03:00
|
|
|
.Pp
|
|
|
|
When setting the current state with
|
|
|
|
.Dv AUDIO_SETINFO ,
|
|
|
|
the audio_info structure should first be initialized with
|
2003-06-26 14:14:07 +04:00
|
|
|
.Dv AUDIO_INITINFO Po \*[Am]info Pc
|
1998-04-30 12:50:03 +04:00
|
|
|
and then the particular values to be changed should be set.
|
|
|
|
This allows the audio driver to only set those things that you wish
|
|
|
|
to change and eliminates the need to query the device with
|
1997-03-11 08:29:03 +03:00
|
|
|
.Dv AUDIO_GETINFO
|
|
|
|
first.
|
1995-11-12 23:14:23 +03:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Va mode
|
1997-03-11 08:29:03 +03:00
|
|
|
field should be set to
|
|
|
|
.Dv AUMODE_PLAY ,
|
|
|
|
.Dv AUMODE_RECORD ,
|
|
|
|
.Dv AUMODE_PLAY_ALL ,
|
|
|
|
or a bitwise OR combination of the three.
|
1997-07-28 04:23:10 +04:00
|
|
|
Only full-duplex audio devices support
|
1997-03-11 08:29:03 +03:00
|
|
|
simultaneous record and playback.
|
1995-11-12 23:14:23 +03:00
|
|
|
.Pp
|
|
|
|
.Va hiwat
|
|
|
|
and
|
|
|
|
.Va lowat
|
1998-04-30 12:50:03 +04:00
|
|
|
are used to control write behavior.
|
|
|
|
Writes to the audio devices will queue up blocks until the high-water
|
|
|
|
mark is reached, at which point any more write calls will block
|
|
|
|
until the queue is drained to the low-water mark.
|
1995-11-12 23:14:23 +03:00
|
|
|
.Va hiwat
|
|
|
|
and
|
|
|
|
.Va lowat
|
1998-04-30 12:50:03 +04:00
|
|
|
set those high- and low-water marks (in audio blocks).
|
|
|
|
The default for
|
1997-10-20 12:22:42 +04:00
|
|
|
.Va hiwat
|
|
|
|
is the maximum value and for
|
|
|
|
.Va lowat
|
1998-04-30 12:50:03 +04:00
|
|
|
75 % of
|
1997-08-08 04:04:38 +04:00
|
|
|
.Va hiwat .
|
1997-07-28 04:23:10 +04:00
|
|
|
.Pp
|
1995-11-12 23:14:23 +03:00
|
|
|
.Va blocksize
|
1998-04-30 12:50:03 +04:00
|
|
|
sets the current audio blocksize.
|
|
|
|
The generic audio driver layer and the hardware driver have the
|
|
|
|
opportunity to adjust this block size to get it within
|
|
|
|
implementation-required limits.
|
|
|
|
Upon return from an
|
1997-03-11 08:29:03 +03:00
|
|
|
.Dv AUDIO_SETINFO
|
|
|
|
call, the actual blocksize set is returned in this field.
|
1998-04-30 12:50:03 +04:00
|
|
|
Normally the
|
1997-08-08 04:04:38 +04:00
|
|
|
.Va blocksize
|
|
|
|
is calculated to correspond to 50ms of sound and it is recalculated
|
|
|
|
when the encoding parameter changes, but if the
|
|
|
|
.Va blocksize
|
2004-05-12 02:42:47 +04:00
|
|
|
is set explicitly this value becomes sticky, i.e., it remains
|
1998-04-30 12:50:03 +04:00
|
|
|
even when the encoding is changed.
|
2001-06-12 18:54:19 +04:00
|
|
|
The stickiness can be cleared by reopening the device or setting the
|
1997-08-19 03:21:33 +04:00
|
|
|
.Va blocksize
|
|
|
|
to 0.
|
1995-11-12 23:14:23 +03:00
|
|
|
.Bd -literal
|
|
|
|
struct audio_prinfo {
|
|
|
|
u_int sample_rate; /* sample rate in samples/s */
|
|
|
|
u_int channels; /* number of channels, usually 1 or 2 */
|
|
|
|
u_int precision; /* number of bits/sample */
|
2002-02-02 14:07:36 +03:00
|
|
|
u_int encoding; /* data encoding (AUDIO_ENCODING_* below) */
|
1995-11-12 23:14:23 +03:00
|
|
|
u_int gain; /* volume level */
|
|
|
|
u_int port; /* selected I/O port */
|
|
|
|
u_long seek; /* BSD extension */
|
1997-10-19 11:40:26 +04:00
|
|
|
u_int avail_ports; /* available I/O ports */
|
|
|
|
u_int buffer_size; /* total size audio buffer */
|
|
|
|
u_int _ispare[1];
|
1995-11-12 23:14:23 +03:00
|
|
|
/* Current state of device: */
|
|
|
|
u_int samples; /* number of samples */
|
|
|
|
u_int eof; /* End Of File (zero-size writes) counter */
|
|
|
|
u_char pause; /* non-zero if paused, zero to resume */
|
2001-06-12 18:54:19 +04:00
|
|
|
u_char error; /* non-zero if underflow/overflow occurred */
|
1995-11-12 23:14:23 +03:00
|
|
|
u_char waiting; /* non-zero if another process hangs in open */
|
1997-10-19 11:40:26 +04:00
|
|
|
u_char balance; /* stereo channel balance */
|
|
|
|
u_char cspare[2];
|
1995-11-12 23:14:23 +03:00
|
|
|
u_char open; /* non-zero if currently open */
|
|
|
|
u_char active; /* non-zero if I/O is currently active */
|
|
|
|
};
|
|
|
|
.Ed
|
|
|
|
.Pp
|
1997-08-25 02:44:16 +04:00
|
|
|
Note: many hardware audio drivers require identical playback and
|
1998-04-30 12:50:03 +04:00
|
|
|
recording sample rates, sample encodings, and channel counts.
|
|
|
|
The playing information is always set last and will prevail on such hardware.
|
1997-08-25 02:44:16 +04:00
|
|
|
If the hardware can handle different settings the
|
1997-10-19 11:40:26 +04:00
|
|
|
.Dv AUDIO_PROP_INDEPENDENT
|
1997-08-25 02:44:16 +04:00
|
|
|
property is set.
|
1995-11-12 23:14:23 +03:00
|
|
|
.Pp
|
1997-05-07 23:24:25 +04:00
|
|
|
The encoding parameter can have the following values:
|
2001-09-11 21:39:00 +04:00
|
|
|
.Pp
|
2000-05-13 19:20:35 +04:00
|
|
|
.Bl -tag -width AUDIO_ENCODING_SLINEAR_BE -compact
|
1997-05-07 23:24:25 +04:00
|
|
|
.It Dv AUDIO_ENCODING_ULAW
|
2003-04-06 22:20:07 +04:00
|
|
|
mu-law encoding, 8 bits/sample
|
1997-05-07 23:24:25 +04:00
|
|
|
.It Dv AUDIO_ENCODING_ALAW
|
2003-04-06 22:20:07 +04:00
|
|
|
A-law encoding, 8 bits/sample
|
1997-07-28 04:23:10 +04:00
|
|
|
.It Dv AUDIO_ENCODING_SLINEAR
|
1997-05-07 23:24:25 +04:00
|
|
|
two's complement signed linear encoding with the platform byte order
|
|
|
|
.It Dv AUDIO_ENCODING_ULINEAR
|
|
|
|
unsigned linear encoding with the platform byte order
|
|
|
|
.It Dv AUDIO_ENCODING_ADPCM
|
|
|
|
ADPCM encoding, 8 bits/sample
|
1997-07-28 04:23:10 +04:00
|
|
|
.It Dv AUDIO_ENCODING_SLINEAR_LE
|
1997-05-07 23:24:25 +04:00
|
|
|
two's complement signed linear encoding with little endian byte order
|
1997-07-28 04:23:10 +04:00
|
|
|
.It Dv AUDIO_ENCODING_SLINEAR_BE
|
1997-05-07 23:24:25 +04:00
|
|
|
two's complement signed linear encoding with big endian byte order
|
|
|
|
.It Dv AUDIO_ENCODING_ULINEAR_LE
|
|
|
|
unsigned linear encoding with little endian byte order
|
|
|
|
.It Dv AUDIO_ENCODING_ULINEAR_BE
|
1999-07-24 19:06:57 +04:00
|
|
|
unsigned linear encoding with big endian byte order
|
1997-05-07 23:24:25 +04:00
|
|
|
.El
|
|
|
|
.Pp
|
1998-04-30 12:50:03 +04:00
|
|
|
The
|
1997-10-19 11:40:26 +04:00
|
|
|
.Va gain ,
|
|
|
|
.Va port
|
|
|
|
and
|
|
|
|
.Va balance
|
|
|
|
settings provide simple shortcuts to the richer mixer
|
1998-04-30 12:50:03 +04:00
|
|
|
interface described below.
|
|
|
|
The gain should be in the range
|
|
|
|
.Bq Dv AUDIO_MIN_GAIN , Dv AUDIO_MAX_GAIN
|
1997-10-20 12:22:42 +04:00
|
|
|
and the balance in the range
|
|
|
|
.Bq Dv AUDIO_LEFT_BALANCE , Dv AUDIO_RIGHT_BALANCE
|
2000-03-14 01:37:10 +03:00
|
|
|
with the normal setting at
|
1997-10-20 12:22:42 +04:00
|
|
|
.Dv AUDIO_MID_BALANCE .
|
2001-09-11 21:39:00 +04:00
|
|
|
.Pp
|
2000-05-13 19:20:35 +04:00
|
|
|
The input port should be a combination of:
|
2001-09-11 21:39:00 +04:00
|
|
|
.Pp
|
2000-05-13 19:20:35 +04:00
|
|
|
.Bl -tag -width AUDIO_MICROPHONE -compact
|
1997-10-19 11:40:26 +04:00
|
|
|
.It Dv AUDIO_MICROPHONE
|
|
|
|
to select microphone input.
|
|
|
|
.It Dv AUDIO_LINE_IN
|
|
|
|
to select line input.
|
|
|
|
.It Dv AUDIO_CD
|
|
|
|
to select CD input.
|
|
|
|
.El
|
2001-09-11 21:39:00 +04:00
|
|
|
.Pp
|
2000-05-13 19:20:35 +04:00
|
|
|
The output port should be a combination of:
|
2001-09-11 21:39:00 +04:00
|
|
|
.Pp
|
2000-05-13 19:20:35 +04:00
|
|
|
.Bl -tag -width AUDIO_HEADPHONE -compact
|
1997-10-19 11:40:26 +04:00
|
|
|
.It Dv AUDIO_SPEAKER
|
1999-06-16 18:24:11 +04:00
|
|
|
to select speaker output.
|
1997-10-19 11:40:26 +04:00
|
|
|
.It Dv AUDIO_HEADPHONE
|
|
|
|
to select headphone output.
|
|
|
|
.It Dv AUDIO_LINE_OUT
|
|
|
|
to select line output.
|
|
|
|
.El
|
2001-09-11 21:39:00 +04:00
|
|
|
.Pp
|
1997-10-20 12:22:42 +04:00
|
|
|
The available ports can be found in
|
|
|
|
.Va avail_ports .
|
|
|
|
.Pp
|
|
|
|
.Va buffer_size
|
1998-04-30 12:50:03 +04:00
|
|
|
is the total size of the audio buffer.
|
|
|
|
The buffer size divided by the
|
1997-10-20 12:22:42 +04:00
|
|
|
.Va blocksize
|
|
|
|
gives the maximum value for
|
|
|
|
.Va hiwat .
|
|
|
|
Currently the
|
|
|
|
.Va buffer_size
|
|
|
|
can only be read and not set.
|
1995-11-12 23:14:23 +03:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Va seek
|
|
|
|
and
|
|
|
|
.Va samples
|
1997-03-11 08:29:03 +03:00
|
|
|
fields are only used for
|
|
|
|
.Dv AUDIO_GETINFO .
|
1995-11-12 23:14:23 +03:00
|
|
|
.Va seek
|
|
|
|
represents the count of
|
|
|
|
samples pending;
|
|
|
|
.Va samples
|
1997-07-28 04:23:10 +04:00
|
|
|
represents the total number of bytes recorded or played, less those
|
1995-11-12 23:14:23 +03:00
|
|
|
that were dropped due to inadequate consumption/production rates.
|
|
|
|
.Pp
|
|
|
|
.Va pause
|
|
|
|
returns the current pause/unpause state for recording or playback.
|
1997-03-11 08:29:03 +03:00
|
|
|
For
|
|
|
|
.Dv AUDIO_SETINFO ,
|
|
|
|
if the pause value is specified it will either pause
|
1995-11-12 23:14:23 +03:00
|
|
|
or unpause the particular direction.
|
|
|
|
.El
|
|
|
|
.Sh MIXER DEVICE
|
|
|
|
The mixer device,
|
|
|
|
.Pa /dev/mixer ,
|
|
|
|
may be manipulated with
|
1998-04-30 12:50:03 +04:00
|
|
|
.Xr ioctl 2
|
1995-11-12 23:14:23 +03:00
|
|
|
but does not support
|
|
|
|
.Xr read 2
|
|
|
|
or
|
|
|
|
.Xr write 2 .
|
|
|
|
It supports the following
|
|
|
|
.Xr ioctl 2
|
|
|
|
commands:
|
2000-05-13 19:20:35 +04:00
|
|
|
.Bl -tag -width indent
|
1995-11-12 23:14:23 +03:00
|
|
|
.It Dv AUDIO_GETDEV (audio_device_t)
|
|
|
|
This command is the same as described above for the sampling devices.
|
|
|
|
.It Dv AUDIO_MIXER_READ (mixer_ctrl_t)
|
|
|
|
.It Dv AUDIO_MIXER_WRITE (mixer_ctrl_t)
|
2000-05-13 19:20:35 +04:00
|
|
|
These commands read the current mixer state or set new mixer state for
|
|
|
|
the specified device
|
|
|
|
.Va dev .
|
|
|
|
.Va type
|
|
|
|
identifies which type of value is supplied in the
|
|
|
|
.Va mixer_ctrl_t
|
|
|
|
argument.
|
1995-11-12 23:14:23 +03:00
|
|
|
.Bd -literal
|
1997-10-20 12:22:42 +04:00
|
|
|
#define AUDIO_MIXER_CLASS 0
|
|
|
|
#define AUDIO_MIXER_ENUM 1
|
|
|
|
#define AUDIO_MIXER_SET 2
|
|
|
|
#define AUDIO_MIXER_VALUE 3
|
1995-11-12 23:14:23 +03:00
|
|
|
typedef struct mixer_ctrl {
|
|
|
|
int dev; /* input: nth device */
|
|
|
|
int type;
|
|
|
|
union {
|
|
|
|
int ord; /* enum */
|
|
|
|
int mask; /* set */
|
|
|
|
mixer_level_t value; /* value */
|
|
|
|
} un;
|
|
|
|
} mixer_ctrl_t;
|
2000-05-13 19:20:35 +04:00
|
|
|
|
1998-05-28 21:27:15 +04:00
|
|
|
#define AUDIO_MIN_GAIN 0
|
|
|
|
#define AUDIO_MAX_GAIN 255
|
|
|
|
typedef struct mixer_level {
|
|
|
|
int num_channels;
|
|
|
|
u_char level[8]; /* [num_channels] */
|
|
|
|
} mixer_level_t;
|
|
|
|
#define AUDIO_MIXER_LEVEL_MONO 0
|
|
|
|
#define AUDIO_MIXER_LEVEL_LEFT 0
|
|
|
|
#define AUDIO_MIXER_LEVEL_RIGHT 1
|
1995-11-12 23:14:23 +03:00
|
|
|
.Ed
|
2001-09-11 21:39:00 +04:00
|
|
|
.Pp
|
1995-11-12 23:14:23 +03:00
|
|
|
For a mixer value, the
|
|
|
|
.Va value
|
2004-05-12 02:42:47 +04:00
|
|
|
field specifies both the number of channels and the values for each
|
|
|
|
channel.
|
1998-04-30 12:50:03 +04:00
|
|
|
If the channel count does not match the current channel count, the
|
|
|
|
attempt to change the setting may fail (depending on the hardware
|
|
|
|
device driver implementation).
|
1995-11-12 23:14:23 +03:00
|
|
|
For an enumeration value, the
|
|
|
|
.Va ord
|
|
|
|
field should be set to one of the possible values as returned by a prior
|
1997-03-11 08:29:03 +03:00
|
|
|
.Dv AUDIO_MIXER_DEVINFO
|
1998-04-30 12:50:03 +04:00
|
|
|
command.
|
|
|
|
The type
|
1997-03-11 08:29:03 +03:00
|
|
|
.Dv AUDIO_MIXER_CLASS
|
|
|
|
is only used for classifying particular mixer device
|
|
|
|
types and is not used for
|
|
|
|
.Dv AUDIO_MIXER_READ
|
|
|
|
or
|
|
|
|
.Dv AUDIO_MIXER_WRITE .
|
1995-11-12 23:14:23 +03:00
|
|
|
.It Dv AUDIO_MIXER_DEVINFO (mixer_devinfo_t)
|
|
|
|
This command is used iteratively to fetch audio mixer device information
|
1998-04-30 12:50:03 +04:00
|
|
|
into the input/output mixer_devinfo_t argument.
|
2002-02-02 14:07:36 +03:00
|
|
|
To query all the supported devices, start with an index field of
|
|
|
|
0 and continue with successive devices (1, 2, ...) until the
|
1998-04-30 12:50:03 +04:00
|
|
|
command returns an error.
|
1995-11-12 23:14:23 +03:00
|
|
|
.Bd -literal
|
|
|
|
typedef struct mixer_devinfo {
|
|
|
|
int index; /* input: nth mixer device */
|
|
|
|
audio_mixer_name_t label;
|
|
|
|
int type;
|
|
|
|
int mixer_class;
|
|
|
|
int next, prev;
|
|
|
|
#define AUDIO_MIXER_LAST -1
|
|
|
|
union {
|
|
|
|
struct audio_mixer_enum {
|
|
|
|
int num_mem;
|
|
|
|
struct {
|
|
|
|
audio_mixer_name_t label;
|
|
|
|
int ord;
|
|
|
|
} member[32];
|
|
|
|
} e;
|
|
|
|
struct audio_mixer_set {
|
|
|
|
int num_mem;
|
|
|
|
struct {
|
|
|
|
audio_mixer_name_t label;
|
|
|
|
int mask;
|
|
|
|
} member[32];
|
|
|
|
} s;
|
|
|
|
struct audio_mixer_value {
|
|
|
|
audio_mixer_name_t units;
|
|
|
|
int num_channels;
|
2002-02-02 14:07:36 +03:00
|
|
|
int delta;
|
1995-11-12 23:14:23 +03:00
|
|
|
} v;
|
|
|
|
} un;
|
|
|
|
} mixer_devinfo_t;
|
|
|
|
.Ed
|
2001-09-11 21:39:00 +04:00
|
|
|
.Pp
|
1998-04-30 12:50:03 +04:00
|
|
|
The
|
1995-11-12 23:14:23 +03:00
|
|
|
.Va label
|
1998-04-30 12:50:03 +04:00
|
|
|
field identifies the name of this particular mixer control.
|
|
|
|
The
|
|
|
|
.Va index
|
1995-11-12 23:14:23 +03:00
|
|
|
field may be used as the
|
|
|
|
.Va dev
|
1997-03-11 08:29:03 +03:00
|
|
|
field in
|
|
|
|
.Dv AUDIO_MIXER_READ
|
|
|
|
and
|
|
|
|
.Dv AUDIO_MIXER_WRITE
|
1998-04-30 12:50:03 +04:00
|
|
|
commands.
|
|
|
|
The
|
1995-11-12 23:14:23 +03:00
|
|
|
.Va type
|
|
|
|
field identifies the type of this mixer control.
|
|
|
|
Enumeration types are typically used for on/off style controls (e.g. a
|
|
|
|
mute control) or for input/output device selection (e.g. select
|
|
|
|
recording input source from CD, line in, or microphone).
|
1997-10-20 12:22:42 +04:00
|
|
|
Set types are similar to enumeration types but any combination
|
|
|
|
of the mask bits can be used.
|
1995-11-12 23:14:23 +03:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Va mixer_class
|
1998-04-30 12:50:03 +04:00
|
|
|
field identifies what class of control this is.
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
The
|
|
|
|
.Pq arbitrary
|
|
|
|
value set by the hardware driver may be determined by examining the
|
|
|
|
.Va mixer_class
|
|
|
|
field of the class itself,
|
|
|
|
a mixer of type
|
|
|
|
.Dv AUDIO_MIXER_CLASS .
|
|
|
|
For example, a mixer controlling the input gain on the line in circuit
|
|
|
|
would have a
|
|
|
|
.Va mixer_class
|
|
|
|
that matches an input class device with the name
|
2002-03-13 03:18:40 +03:00
|
|
|
.Dq inputs
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
.Dv ( AudioCinputs ) ,
|
|
|
|
and would have a
|
|
|
|
.Va label
|
|
|
|
of
|
|
|
|
.Dq line
|
|
|
|
.Dv ( AudioNline ) .
|
1995-11-12 23:14:23 +03:00
|
|
|
Mixer controls which control audio circuitry for a particular audio
|
|
|
|
source (e.g. line-in, CD in, DAC output) are collected under the input class,
|
|
|
|
while those which control all audio sources (e.g. master volume,
|
|
|
|
equalization controls) are under the output class.
|
Fix a couple of long-standing bugs in the volume control(s) part of the
audio device interface:
1) When attempting to match the appropriate mixer control, we weren't
checking the class label, but only the second level label, so for
devices that had both an "inputs.cd" and a "record.cd", for example,
we could never do the right thing except by chance. For this reason,
evidently, all the record masters were labeled (by the underlying
drivers) either "record.record" or "record.volume", to distinguish
from "outputs.master". We'll now accept "record.master", and document
that as the the new preferred way.
2) More importantly, the model was deficient. Selecting a port on many
chips completely disables most of the level controls, which doesn't play
nice with other applications which are trying to use the interface. Now,
selecting a port simply sets which mixer input control shall be changed,
setting state in the audio layer. In other words, the "mixerout" port
is really selected all the time, enabling the final stage mixer, and
setting "gain" sets the level of the appropriate input. It should be
possible for separate applications to each control the mic, dac, and cd
inputs at the same time using this interface, simply by reiterating their
port selections with each change, but applications that don't bother to
do that aren't any worse off than they were before.
The user is expected to set the master output with another application,
dedicated to that task. Though it is now meaningful to select "no port"
with the audio device interface, to manipulate the master output, there's
no particular reason for an audio device consumer to do that. (I added
the capability in order to restore the initial state of the audio device,
for testing purposes. It might also be useful to users of broken binary-
only applications.)
Observe that the mixer device interface (and so, "mixerctl") still
retains all capabilities, including the ability to set the actual input
port on the chip, overriding the level controls. No change is being made
to the mixer device interface. The mixer device simply presents all the
controls on the chip, with no attempt at abstraction, so there are no
bugs there.
The upshot is, that applications that have been trying to use the audio
device interface to change the volume, such as mplayer, now "just work".
I've tested these changes extensively with "eso" and "eap" since first
proposing them on tech-kern last January, and somewhat with "esm" and a
few others. This closes both PR kern/10221, and PR kern/17159.
2004-01-31 03:07:56 +03:00
|
|
|
Hardware devices capable of recording typically also have a record class,
|
|
|
|
for controls that only affect recording,
|
|
|
|
and also a monitor class.
|
1995-11-12 23:14:23 +03:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Va next
|
|
|
|
and
|
|
|
|
.Va prev
|
|
|
|
may be used by the hardware device driver to provide hints for the next
|
|
|
|
and previous devices in a related set (for example, the line in level
|
2002-03-13 03:18:40 +03:00
|
|
|
control would have the line in mute as its
|
|
|
|
.Dq next
|
|
|
|
value).
|
1998-04-30 12:50:03 +04:00
|
|
|
If there is no relevant next or previous value,
|
1997-03-11 08:29:03 +03:00
|
|
|
.Dv AUDIO_MIXER_LAST
|
|
|
|
is specified.
|
1995-11-12 23:14:23 +03:00
|
|
|
.Pp
|
1998-04-30 12:50:03 +04:00
|
|
|
For
|
1997-03-11 08:29:03 +03:00
|
|
|
.Dv AUDIO_MIXER_ENUM
|
|
|
|
mixer control types,
|
1998-04-30 12:50:03 +04:00
|
|
|
the enumeration values and their corresponding names are filled in.
|
|
|
|
For example, a mute control would return appropriate values paired with
|
2002-03-13 03:55:02 +03:00
|
|
|
.Dv AudioNon
|
|
|
|
and
|
|
|
|
.Dv AudioNoff .
|
1997-03-11 08:29:03 +03:00
|
|
|
For
|
|
|
|
.Dv AUDIO_MIXER_VALUE
|
1997-10-20 12:22:42 +04:00
|
|
|
and
|
|
|
|
.Dv AUDIO_MIXER_SET
|
1997-03-11 08:29:03 +03:00
|
|
|
mixer control types, the channel count is
|
1995-11-12 23:14:23 +03:00
|
|
|
returned; the units name specifies what the level controls (typical
|
2002-03-13 03:55:02 +03:00
|
|
|
values are
|
|
|
|
.Dv AudioNvolume ,
|
|
|
|
.Dv AudioNtreble ,
|
|
|
|
.Dv AudioNbass ) .
|
1995-11-12 23:14:23 +03:00
|
|
|
.\" For AUDIO_MIXER_SET mixer control types, what is what?
|
|
|
|
.El
|
|
|
|
.Pp
|
2002-02-22 06:03:54 +03:00
|
|
|
By convention, all the mixer devices can be distinguished from other
|
2002-03-13 03:55:02 +03:00
|
|
|
mixer controls because they use a name from one of the
|
|
|
|
.Dv AudioC*
|
|
|
|
string values.
|
1997-03-11 08:29:03 +03:00
|
|
|
.Sh FILES
|
1997-10-16 21:41:22 +04:00
|
|
|
.Bl -tag -width /dev/audioctl -compact
|
1997-03-11 08:29:03 +03:00
|
|
|
.It Pa /dev/audio
|
1997-10-16 21:41:22 +04:00
|
|
|
.It Pa /dev/audioctl
|
1997-03-11 08:29:03 +03:00
|
|
|
.It Pa /dev/sound
|
|
|
|
.It Pa /dev/mixer
|
|
|
|
.El
|
1995-11-12 23:14:23 +03:00
|
|
|
.Sh SEE ALSO
|
1998-05-09 16:10:31 +04:00
|
|
|
.Xr audioctl 1 ,
|
2001-09-11 21:39:00 +04:00
|
|
|
.Xr mixerctl 1 ,
|
1997-10-16 21:41:22 +04:00
|
|
|
.Xr ioctl 2 ,
|
2001-09-11 21:39:00 +04:00
|
|
|
.Xr ossaudio 3 ,
|
2003-06-11 08:41:17 +04:00
|
|
|
.Xr midi 4 ,
|
|
|
|
.Xr radio 4
|
|
|
|
.Ss ISA bus
|
1998-12-08 17:15:27 +03:00
|
|
|
.Xr aria 4 ,
|
|
|
|
.Xr ess 4 ,
|
1995-11-12 23:14:23 +03:00
|
|
|
.Xr gus 4 ,
|
1997-10-06 20:00:55 +04:00
|
|
|
.Xr guspnp 4 ,
|
1995-11-12 23:14:23 +03:00
|
|
|
.Xr pas 4 ,
|
|
|
|
.Xr sb 4 ,
|
1998-12-08 17:15:27 +03:00
|
|
|
.Xr wss 4 ,
|
2001-09-11 21:39:00 +04:00
|
|
|
.Xr ym 4
|
2003-06-11 08:41:17 +04:00
|
|
|
.Ss PCI bus
|
2004-10-10 20:39:36 +04:00
|
|
|
.Xr auacer 4 ,
|
2002-02-02 14:07:36 +03:00
|
|
|
.Xr auich 4 ,
|
2005-06-28 13:21:03 +04:00
|
|
|
.Xr auixp 4 ,
|
2003-06-11 08:41:17 +04:00
|
|
|
.Xr autri 4 ,
|
2000-03-31 09:49:59 +04:00
|
|
|
.Xr auvia 4 ,
|
2005-06-28 13:21:03 +04:00
|
|
|
.Xr azalia 4 ,
|
2000-03-06 21:49:11 +03:00
|
|
|
.Xr clcs 4 ,
|
2001-01-22 04:28:53 +03:00
|
|
|
.Xr clct 4 ,
|
2000-05-01 03:51:51 +04:00
|
|
|
.Xr cmpci 4 ,
|
1998-12-08 17:15:27 +03:00
|
|
|
.Xr eap 4 ,
|
2001-10-23 02:23:44 +04:00
|
|
|
.Xr emuxki 4 ,
|
2002-01-23 23:58:20 +03:00
|
|
|
.Xr esa 4 ,
|
2001-01-08 23:12:51 +03:00
|
|
|
.Xr esm 4 ,
|
1999-07-12 19:20:54 +04:00
|
|
|
.Xr eso 4 ,
|
2000-03-31 09:49:59 +04:00
|
|
|
.Xr fms 4 ,
|
2002-02-02 14:07:36 +03:00
|
|
|
.Xr neo 4 ,
|
2001-03-30 18:34:27 +04:00
|
|
|
.Xr sv 4 ,
|
2001-09-11 21:39:00 +04:00
|
|
|
.Xr yds 4
|
2003-06-11 08:41:17 +04:00
|
|
|
.Ss PCMCIA
|
2001-09-29 23:39:51 +04:00
|
|
|
.Xr esl 4
|
2003-06-11 08:41:17 +04:00
|
|
|
.Ss TURBOchannel
|
2002-02-02 14:07:36 +03:00
|
|
|
.Xr bba 4
|
2003-06-11 08:41:17 +04:00
|
|
|
.Ss USB
|
2001-09-11 21:39:00 +04:00
|
|
|
.Xr uaudio 4
|
1995-11-12 23:14:23 +03:00
|
|
|
.Sh BUGS
|
1997-07-28 04:23:10 +04:00
|
|
|
If the device is used in
|
|
|
|
.Xr mmap 2
|
|
|
|
it is currently always mapped for writing (playing) due to
|
|
|
|
VM system weirdness.
|