1.\" $NetBSD: audiocfg.1,v 1.8 2021/04/07 09:58:58 nia Exp $ 2.\" 3.\" Copyright (c) 2010 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" 6.\" This code is derived from software contributed to The NetBSD Foundation 7.\" by Thomas Klausner. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28.\" POSSIBILITY OF SUCH DAMAGE. 29.\" 30.Dd April 7, 2021 31.Dt AUDIOCFG 1 32.Os 33.Sh NAME 34.Nm audiocfg 35.Nd configure default audio device 36.Sh SYNOPSIS 37.Nm 38.Cm list 39.Op Ar index 40.Nm 41.Cm default 42.Ar index 43.Nm 44.Cm set 45.Ar index 46.Ar direction 47.Ar encoding 48.Ar precision 49.Ar channels 50.Ar sample_rate 51.Nm 52.Cm test 53.Ar index 54.Sh DESCRIPTION 55The 56.Nm 57utility helps maintaining the audio and mixer device symlinks. 58.Pp 59Run with 60.Dq Cm list , 61it lists the available audio devices and shows the currently selected 62default audio device. 63.Pp 64Run with 65.Dq Cm set , 66it sets the hardware format. 67The 68.Ar direction 69is represented by either of 'p' (playback) or 'r' (record), or both of them. 70This indicates the direction you want to set. 71The remaining parameters 72.Ar encoding , 73.Ar precision , 74.Ar channels , 75and 76.Ar sample_rate 77indicate the hardware format you want to set. 78These parameters must be selected from the candidates displayed by 79.Nm 80.Cm list . 81.Pp 82Called with 83.Dq Cm test , 84it plays a tone of 2 seconds for each channel of the device with the index 85.Ar index . 86Called with 87.Dq Cm default , 88it sets the default audio device to the one with the index 89.Ar index . 90.Pp 91.Nm 92needs access to 93.Pa /dev/drvctl 94and write access to 95.Pa /dev 96(when used with 97.Dq Cm default ) 98to work. 99.Sh FILES 100.Bl -tag -width 10n 101.It Pa /dev/audio 102Symlink to default audio device. 103.It Pa /dev/audio[0-9]* 104Available audio devices. 105.It Pa /dev/audioctl 106Symlink to default audio control device. 107.It Pa /dev/audioctl[0-9]* 108Available audio control devices. 109.It Pa /dev/drvctl 110Used for finding the corresponding audio driver to an audio device. 111.It Pa /dev/mixer 112Symlink to default mixer device. 113.It Pa /dev/mixer[0-9]* 114Available mixer devices. 115.It Pa /dev/sound 116Symlink to default audio device (for the difference to 117.Pa /dev/audio , 118see 119.Xr audio 4 ) . 120.It Pa /dev/sound[0-9]* 121Available audio devices. 122.El 123.Sh EXAMPLES 124Configure audio device 0 for playing BluRay 5.1 surround sound: 125.Dl $ audiocfg set 0 p slinear_le 16 6 48000 126.Pp 127Configure audio device 0 for playing CD quality audio: 128.Dl $ audiocfg set 0 p slinear_le 16 2 44100 129.Sh SEE ALSO 130.Xr audioplay 1 , 131.Xr audiorecord 1 , 132.Xr audio 4 , 133.Xr drvctl 8 134.Sh HISTORY 135The 136.Nm 137utility first appeared in 138.Nx 6.0 . 139.Sh AUTHORS 140.An -nosplit 141The 142.Nm 143utility was originally written by 144.An Jared McNeill . 145This manual page was written by 146.An Thomas Klausner . 147