1.\" $NetBSD: ym.4,v 1.14 2002/03/10 13:57:12 itohy Exp $ 2.\" 3.\" Copyright (c) 1999 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" 6.\" This code is derived from software contributed to The NetBSD Foundation 7.\" by Lennart Augustsson. 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.\" 3. All advertising materials mentioning features or use of this software 18.\" must display the following acknowledgement: 19.\" This product includes software developed by the NetBSD 20.\" Foundation, Inc. and its contributors. 21.\" 4. Neither the name of The NetBSD Foundation nor the names of its 22.\" contributors may be used to endorse or promote products derived 23.\" from this software without specific prior written permission. 24.\" 25.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 26.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 27.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 28.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 29.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 30.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 31.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35.\" POSSIBILITY OF SUCH DAMAGE. 36.\" 37.Dd May 20, 1998 38.Dt YM 4 39.Os 40.Sh NAME 41.Nm ym 42.Nd Yamaha OPL3-SA2 and OPL3-SA3 audio device driver 43.Sh SYNOPSIS 44.Cd "ym* at isapnp?" 45.Cd "ym* at pnpbios? index ?" 46.Cd "audio* at ym?" 47.Cd "mpu* at ym?" 48.Cd "opl* at ym?" 49.Sh DESCRIPTION 50The 51.Nm 52driver provides support for 53Yamaha YMF711 (OPL3-SA2) and YMF715x (OPL3-SA3) sound devices. 54.Pp 55The OPL3-SAx device has 56WSS compatible full-duplex 16bit CODEC, 57OPL3 FM synthesizer, and 58MPU401 compatible MIDI I/O port interface. 59Additionally, OPL3-SA3 has built-in 60.Sq 3D Enhanced 61equalizer. 62.Pp 63The joystick interface is handled by the 64.Xr joy 4 65driver. 66.Sh MIXER DEVICE 67The mixer device of 68.Nm 69driver can be accessed by 70.Xr mixerctl 1 71command. 72The layout is shown below. 73.Bd -literal 74 dac ------------------------\*[Lt]----- ----------------- 75midi(OPL3/ZV)-\*[Gt]-+----------------------------+-\*[Gt]|inputs.midi | 76cd -\*[Gt]------+-*--------------------------+-\*[Gt]|inputs.cd | 77line -\*[Gt]----*-+-+--------------------------+-\*[Gt]|inputs.line | 78speaker -\*[Gt]----+-+-+--------------------------+-\*[Gt]|inputs.speaker | 79mic -\*[Gt]--*-+-+-+--------------------------+-\*[Gt]|inputs.mic | 80 v v v v monitor.monitor | | | 81 --------------- ------- | ------- | | | 82 |record.record|-\*[Gt]| A/D |----\*[Gt]| D/A |-*-\*[Gt]|inputs.dac |analog 83 | | |conv.|-- -\*[Gt]|conv.| | |output 84 --------------- ------- | | ------- | outputs.master|--\*[Gt] 85 wave v | wave | equalization.*| 86 recording playback ----------------- 87.Ed 88.Pp 89Note that the 90.Sq Dv inputs.dac 91is twice as sensitive as other 92.Sq Dv inputs 93volume variables. 94.Pp 95The hardware volume changes the 96.Sq Dv outputs.master 97value. 98.Pp 99If an external input source is unmuted by setting corresponding 100.Sq Dv inputs.*.mute 101variable to 102.Sq Dv off , 103the device is never put in global power down or power save mode. 104This is because if the device is in global power down or power save mode, 105the output is automatically muted. 106.Pp 107All the external input sources (CD playback, line input, speaker, and MIC) 108are muted by default. 109.Pp 110The 111.Sq Dv equalization.* 112variables does not exists on OPL3-SA2. 113The 114.Sq equalization.treble 115and 116.Sq equalization.bass 117are enhancement only, and any values below the center position (128) 118don't take any effect. 119.Sh POWER MANAGEMENT 120The 121.Nm 122driver is capable of power management on the OPL3-SAx devices. 123The following modes can be selected by setting 124.Sq Dv power.save 125variable of 126.Xr mixerctl 1 127to 128.Sq Dv powerdown , 129.Sq Dv powersave , 130and 131.Sq Dv nosave 132respectively. 133.Pp 134.Bl -tag -width indent -compact 135.It Global power-down mode 136When a subpart of the device is unused, the part is power-down after 137a timeout period (specified by 138.Sq Dv power.save.timeout 139variable of 140.Xr mixerctl 1 141in seconds). 142When all the subparts of the device are unused, 143and all the external input sources are muted, 144the driver puts the device in 145.Sq Global Power Down 146mode. 147.Pp 148On the global power down mode, the power consumption is minimized 149(10\(*mA (SA3) or 200\(*mA (SA2) typ.), 150.\" Note: \(*m is Greek mu 151but the click noise on power up/down the device is rather loud. 152.Bf Em 153This mode should not be used with headphones or hi\-fi audio systems, 154or your ears or the systems may be damaged. 155.Ef 156.It Power save mode 157When a subpart of the device is unused, the part is powered-down after 158a timeout period (specified by 159.Sq Dv power.save.timeout 160variable of 161.Xr mixerctl 1 162in seconds). 163When all the subparts of the device are unused, 164and all the external input sources are muted, 165the driver put the device in 166.Sq Power Save 167mode. 168.Pp 169In power save mode, the power consumption is reduced (5mA typ.). 170The click noise on power up/down of the device is very small, 171but this operation requires muting/unmuting the device, which make some noise. 172In order to reduce the noise, setting the master volume at the small value 173is effective. 174.It "No power-save mode" 175Once the device is powered-up, it remains on after the use of the device. 176Once a subpart of the device is powered-up, it shall not be power-down. 177This mode minimizes click noises on power switching, 178but maximizes power consumption (30-100mA). 179.Pp 180On suspending, the device is put into power-save state. 181.El 182.Sh SEE ALSO 183.Xr mixerctl 1 , 184.Xr apm 4 , 185.Xr audio 4 , 186.Xr isapnp 4 , 187.Xr joy 4 , 188.Xr midi 4 , 189.Xr mpu 4 , 190.Xr opl 4 , 191.Xr pnpbios 4 192.Sh HISTORY 193The 194.Nm 195device driver appeared in 196.Nx 1.4 . 197.Sh BUGS 198Although the parameters of the device are saved and restored on 199.Xr apm 4 200suspend/resume, the DMA state is not restored. 201That is, if the system suspends during playback, 202this is not continued after suspend/resume cycle. 203.Pp 204The joystick port is not under power management. 205If a 206.Xr joy 4 207device is configured, 208the device will never be put in global power down or power save mode. 209.Pp 210The external devices, such as Zoomed Video port, OPL4-ML/2, modem, and CD-ROM 211are not supported. 212