xref: /netbsd-src/usr.bin/audiocfg/audiocfg.1 (revision 35fbfbb85b1e40a71a76e29322fb9818f4231459)
1*35fbfbb8Snia.\"	$NetBSD: audiocfg.1,v 1.8 2021/04/07 09:58:58 nia Exp $
20b930dd7Swiz.\"
30b930dd7Swiz.\" Copyright (c) 2010 The NetBSD Foundation, Inc.
40b930dd7Swiz.\" All rights reserved.
50b930dd7Swiz.\"
60b930dd7Swiz.\" This code is derived from software contributed to The NetBSD Foundation
70b930dd7Swiz.\" by Thomas Klausner.
80b930dd7Swiz.\"
90b930dd7Swiz.\" Redistribution and use in source and binary forms, with or without
100b930dd7Swiz.\" modification, are permitted provided that the following conditions
110b930dd7Swiz.\" are met:
120b930dd7Swiz.\" 1. Redistributions of source code must retain the above copyright
130b930dd7Swiz.\"    notice, this list of conditions and the following disclaimer.
140b930dd7Swiz.\" 2. Redistributions in binary form must reproduce the above copyright
150b930dd7Swiz.\"    notice, this list of conditions and the following disclaimer in the
160b930dd7Swiz.\"    documentation and/or other materials provided with the distribution.
170b930dd7Swiz.\"
180b930dd7Swiz.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
190b930dd7Swiz.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
200b930dd7Swiz.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
210b930dd7Swiz.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
220b930dd7Swiz.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
230b930dd7Swiz.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
240b930dd7Swiz.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
250b930dd7Swiz.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
260b930dd7Swiz.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
270b930dd7Swiz.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
280b930dd7Swiz.\" POSSIBILITY OF SUCH DAMAGE.
290b930dd7Swiz.\"
30*35fbfbb8Snia.Dd April 7, 2021
310b930dd7Swiz.Dt AUDIOCFG 1
320b930dd7Swiz.Os
330b930dd7Swiz.Sh NAME
340b930dd7Swiz.Nm audiocfg
350b930dd7Swiz.Nd configure default audio device
360b930dd7Swiz.Sh SYNOPSIS
370b930dd7Swiz.Nm
38600e381dSwiz.Cm list
3904ea388fSisaki.Op Ar index
40600e381dSwiz.Nm
41600e381dSwiz.Cm default
42600e381dSwiz.Ar index
43600e381dSwiz.Nm
440b88ff99Sisaki.Cm set
450b88ff99Sisaki.Ar index
460b88ff99Sisaki.Ar direction
470b88ff99Sisaki.Ar encoding
480b88ff99Sisaki.Ar precision
490b88ff99Sisaki.Ar channels
500b88ff99Sisaki.Ar sample_rate
510b88ff99Sisaki.Nm
52600e381dSwiz.Cm test
53600e381dSwiz.Ar index
540b930dd7Swiz.Sh DESCRIPTION
550b930dd7SwizThe
560b930dd7Swiz.Nm
57bd524aa5Swizutility helps maintaining the audio and mixer device symlinks.
58600e381dSwiz.Pp
59600e381dSwizRun with
60600e381dSwiz.Dq Cm list ,
61600e381dSwizit lists the available audio devices and shows the currently selected
62600e381dSwizdefault audio device.
630b88ff99Sisaki.Pp
640b88ff99SisakiRun with
650b88ff99Sisaki.Dq Cm set ,
66adb7f5e6Swizit sets the hardware format.
670b88ff99SisakiThe
680b88ff99Sisaki.Ar direction
69adb7f5e6Swizis represented by either of 'p' (playback) or 'r' (record), or both of them.
70adb7f5e6SwizThis indicates the direction you want to set.
710b88ff99SisakiThe remaining parameters
720b88ff99Sisaki.Ar encoding ,
730b88ff99Sisaki.Ar precision ,
74adb7f5e6Swiz.Ar channels ,
750b88ff99Sisakiand
760b88ff99Sisaki.Ar sample_rate
77adb7f5e6Swizindicate the hardware format you want to set.
780b88ff99SisakiThese parameters must be selected from the candidates displayed by
790b88ff99Sisaki.Nm
800b88ff99Sisaki.Cm list .
810b88ff99Sisaki.Pp
82600e381dSwizCalled with
83600e381dSwiz.Dq Cm test ,
84600e381dSwizit plays a tone of 2 seconds for each channel of the device with the index
85600e381dSwiz.Ar index .
86600e381dSwizCalled with
87600e381dSwiz.Dq Cm default ,
88600e381dSwizit sets the default audio device to the one with the index
89600e381dSwiz.Ar index .
90600e381dSwiz.Pp
910b930dd7Swiz.Nm
920b930dd7Swizneeds access to
930b930dd7Swiz.Pa /dev/drvctl
940b930dd7Swizand write access to
950b930dd7Swiz.Pa /dev
96600e381dSwiz(when used with
97600e381dSwiz.Dq Cm default )
980b930dd7Swizto work.
990b930dd7Swiz.Sh FILES
1000b930dd7Swiz.Bl -tag -width 10n
1010b930dd7Swiz.It Pa /dev/audio
1020b930dd7SwizSymlink to default audio device.
1030b930dd7Swiz.It Pa /dev/audio[0-9]*
1040b930dd7SwizAvailable audio devices.
105bd524aa5Swiz.It Pa /dev/audioctl
106bd524aa5SwizSymlink to default audio control device.
107bd524aa5Swiz.It Pa /dev/audioctl[0-9]*
108bd524aa5SwizAvailable audio control devices.
1090b930dd7Swiz.It Pa /dev/drvctl
110600e381dSwizUsed for finding the corresponding audio driver to an audio device.
111bd524aa5Swiz.It Pa /dev/mixer
112bd524aa5SwizSymlink to default mixer device.
113bd524aa5Swiz.It Pa /dev/mixer[0-9]*
114bd524aa5SwizAvailable mixer devices.
115bd524aa5Swiz.It Pa /dev/sound
116bd524aa5SwizSymlink to default audio device (for the difference to
117bd524aa5Swiz.Pa /dev/audio ,
118bd524aa5Swizsee
119bd524aa5Swiz.Xr audio 4 ) .
120bd524aa5Swiz.It Pa /dev/sound[0-9]*
121bd524aa5SwizAvailable audio devices.
1220b930dd7Swiz.El
123*35fbfbb8Snia.Sh EXAMPLES
124*35fbfbb8SniaConfigure audio device 0 for playing BluRay 5.1 surround sound:
125*35fbfbb8Snia.Dl $ audiocfg set 0 p slinear_le 16 6 48000
126*35fbfbb8Snia.Pp
127*35fbfbb8SniaConfigure audio device 0 for playing CD quality audio:
128*35fbfbb8Snia.Dl $ audiocfg set 0 p slinear_le 16 2 44100
1290b930dd7Swiz.Sh SEE ALSO
1300b930dd7Swiz.Xr audioplay 1 ,
1310b930dd7Swiz.Xr audiorecord 1 ,
1320b930dd7Swiz.Xr audio 4 ,
1330b930dd7Swiz.Xr drvctl 8
134c58ad948Sdholland.Sh HISTORY
135c58ad948SdhollandThe
136c58ad948Sdholland.Nm
137c58ad948Sdhollandutility first appeared in
138c58ad948Sdholland.Nx 6.0 .
139c58ad948Sdholland.Sh AUTHORS
140c58ad948Sdholland.An -nosplit
141c58ad948SdhollandThe
142c58ad948Sdholland.Nm
143c58ad948Sdhollandutility was originally written by
144c58ad948Sdholland.An Jared McNeill .
145c58ad948SdhollandThis manual page was written by
146c58ad948Sdholland.An Thomas Klausner .
147