xref: /freebsd/share/man/man4/snd_hda.4 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
104b96d88SAlexander Motin.\" Copyright (c) 2006-2008 Joel Dahl <joel@FreeBSD.org>
204b96d88SAlexander Motin.\" Copyright (c) 2008 Alexander Motin <mav@FreeBSD.org>
3d96143bdSJoel Dahl.\" All rights reserved.
4d96143bdSJoel Dahl.\"
5d96143bdSJoel Dahl.\" Redistribution and use in source and binary forms, with or without
6d96143bdSJoel Dahl.\" modification, are permitted provided that the following conditions
7d96143bdSJoel Dahl.\" are met:
8d96143bdSJoel Dahl.\" 1. Redistributions of source code must retain the above copyright
9d96143bdSJoel Dahl.\"    notice, this list of conditions and the following disclaimer.
10d96143bdSJoel Dahl.\" 2. Redistributions in binary form must reproduce the above copyright
11d96143bdSJoel Dahl.\"    notice, this list of conditions and the following disclaimer in the
12d96143bdSJoel Dahl.\"    documentation and/or other materials provided with the distribution.
13d96143bdSJoel Dahl.\"
14d96143bdSJoel Dahl.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15d96143bdSJoel Dahl.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16d96143bdSJoel Dahl.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17d96143bdSJoel Dahl.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18d96143bdSJoel Dahl.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19d96143bdSJoel Dahl.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20d96143bdSJoel Dahl.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21d96143bdSJoel Dahl.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22d96143bdSJoel Dahl.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23d96143bdSJoel Dahl.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24d96143bdSJoel Dahl.\" SUCH DAMAGE.
25d96143bdSJoel Dahl.\"
26fceeeec7SSean Bruno.Dd July 16, 2019
27d96143bdSJoel Dahl.Dt SND_HDA 4
28d96143bdSJoel Dahl.Os
29d96143bdSJoel Dahl.Sh NAME
30d96143bdSJoel Dahl.Nm snd_hda
31d96143bdSJoel Dahl.Nd "Intel High Definition Audio bridge device driver"
32d96143bdSJoel Dahl.Sh SYNOPSIS
33d96143bdSJoel DahlTo compile this driver into the kernel, place the following lines in your
34d96143bdSJoel Dahlkernel configuration file:
35d96143bdSJoel Dahl.Bd -ragged -offset indent
36d96143bdSJoel Dahl.Cd "device sound"
37d96143bdSJoel Dahl.Cd "device snd_hda"
38d96143bdSJoel Dahl.Ed
39d96143bdSJoel Dahl.Pp
40d96143bdSJoel DahlAlternatively, to load the driver as a module at boot time, place the
41d96143bdSJoel Dahlfollowing line in
42d96143bdSJoel Dahl.Xr loader.conf 5 :
43d96143bdSJoel Dahl.Bd -literal -offset indent
44d96143bdSJoel Dahlsnd_hda_load="YES"
45d96143bdSJoel Dahl.Ed
46d96143bdSJoel Dahl.Sh DESCRIPTION
4704b96d88SAlexander MotinThe High Definition (HD) Audio specification was developed by Intel as the
4804b96d88SAlexander Motinlogical successor of the old AC'97 specification and has several advantages,
4904b96d88SAlexander Motinsuch as higher bandwidth which allows more channels and more detailed formats,
5004b96d88SAlexander Motinsupport for several logical audio devices, and general purpose DMA channels.
5104b96d88SAlexander Motin.Pp
52d96143bdSJoel DahlThe
53d96143bdSJoel Dahl.Nm
547c6b05d2SAlexander Motindriver includes HDA bus controller driver (hdac), HDA codec driver (hdacc)
557c6b05d2SAlexander Motinand HDA codecs audio functions bridge driver (hdaa) that allows
567c6b05d2SAlexander Motinthe generic audio driver,
57d96143bdSJoel Dahl.Xr sound 4 ,
5804b96d88SAlexander Motinto be used with this hardware.
59a3ffa4e0SAlexander MotinOnly audio functions are supported by
608ab00b38SAlexander Motin.Nm .
618fd5093cSAlexander MotinModem and other possible functions are not implemented.
6204b96d88SAlexander Motin.Pp
63d96143bdSJoel DahlThe
64d96143bdSJoel Dahl.Nm
65d96143bdSJoel Dahldriver supports hardware that conforms with revision 1.0 of the Intel High
66d96143bdSJoel DahlDefinition Audio specification and tries to behave much like the Microsoft
67d96143bdSJoel DahlUniversal Audio Architecture (UAA) draft (revision 0.7b) for handling audio
68d96143bdSJoel Dahldevices.
6904b96d88SAlexander Motin.Pp
70a3ffa4e0SAlexander MotinAccording to HDA and UAA specifications, depending on the number of HDA buses
7104b96d88SAlexander Motinand codecs present in system, their audio capabilities and BIOS provided
72c43aea0fSJoel Dahlconfiguration, the
73d96143bdSJoel Dahl.Nm
74c43aea0fSJoel Dahldriver often provides several PCM audio devices.
75c43aea0fSJoel DahlFor example, one device for main rear 7.1 output and inputs, one device
76c43aea0fSJoel Dahlfor independent headset connectors at front and one device for SPDIF or
77c43aea0fSJoel DahlHDMI audio input/output.
78a3ffa4e0SAlexander MotinThe assignment of audio inputs and outputs may be tuned with
797c6b05d2SAlexander Motin.Xr device.hints 5
807c6b05d2SAlexander Motinor
817c6b05d2SAlexander Motin.Xr sysctl 8 .
82a3ffa4e0SAlexander MotinThe driver's verbose boot messages provide a lot of information about
83a3ffa4e0SAlexander Motinthe operation of the driver and present audio setup.
8472874768SAlexander Motin.Pp
85a3ffa4e0SAlexander MotinThe default audio device may be tuned by setting the
86a3ffa4e0SAlexander Motin.Ar hw.snd.default_unit
87a3ffa4e0SAlexander Motinsysctl, as described in
88a3ffa4e0SAlexander Motin.Xr sound 4 ,
898ab00b38SAlexander Motinor explicitly specified in application settings.
909a6e76e6SJoel Dahl.Ss Boot-time Configuration
919a6e76e6SJoel DahlThe following variables are available at boot-time through the
929a6e76e6SJoel Dahl.Xr device.hints 5
939a6e76e6SJoel Dahlfile:
9404b96d88SAlexander Motin.Bl -tag -width ".Va hint.hdac.%d.config"-offset indent
9504b96d88SAlexander Motin.It Va hint.hdac.%d.config
967c6b05d2SAlexander MotinConfigures a range of possible controller options.
979a6e76e6SJoel DahlPossible values are:
987c6b05d2SAlexander Motin.Dq Li 64bit ,
998f7dda1bSJoel Dahl.Dq Li dmapos ,
1007c6b05d2SAlexander Motin.Dq Li msi .
1017c6b05d2SAlexander MotinAn option prefixed with
1027c6b05d2SAlexander Motin.Dq Li no ,
1037c6b05d2SAlexander Motinsuch as
1047c6b05d2SAlexander Motin.Dq Li nomsi ,
1057c6b05d2SAlexander Motinwill do the opposite and takes precedence.
1067c6b05d2SAlexander MotinOptions can be separated by whitespace and commas.
1077c6b05d2SAlexander Motin.It Va hint.hdac.%d.msi
1087c6b05d2SAlexander MotinControls MSI (Message Signaled Interrupts) support.
1097c6b05d2SAlexander Motin.It Va hint.hdac.%d.cad%d.nid%d.config
1107c6b05d2SAlexander MotinSame as
1117c6b05d2SAlexander Motin.Va hint.hdaa.%d.nid%d.config
1127c6b05d2SAlexander Motin.It Va hint.hdaa.%d.config
1137c6b05d2SAlexander MotinConfigures a range of possible audio function options.
1147c6b05d2SAlexander MotinPossible values are:
1158f7dda1bSJoel Dahl.Dq Li eapdinv ,
1168f7dda1bSJoel Dahl.Dq Li ivref ,
1178f7dda1bSJoel Dahl.Dq Li ivref50 ,
1188f7dda1bSJoel Dahl.Dq Li ivref80 ,
1198f7dda1bSJoel Dahl.Dq Li ivref100 ,
1209a6e76e6SJoel Dahl.Dq Li fixedrate ,
1219a6e76e6SJoel Dahl.Dq Li forcestereo ,
1228f7dda1bSJoel Dahl.Dq Li ovref ,
1238f7dda1bSJoel Dahl.Dq Li ovref50 ,
1248f7dda1bSJoel Dahl.Dq Li ovref80 ,
1258f7dda1bSJoel Dahl.Dq Li ovref100 ,
12604b96d88SAlexander Motin.Dq Li senseinv ,
1279a6e76e6SJoel Dahl.Dq Li softpcmvol ,
1289a6e76e6SJoel Dahland
1299a6e76e6SJoel Dahl.Dq Li vref .
1309a6e76e6SJoel DahlAn option prefixed with
1319a6e76e6SJoel Dahl.Dq Li no ,
1329a6e76e6SJoel Dahlsuch as
133f1f23451SJoel Dahl.Dq Li nofixedrate ,
1349a6e76e6SJoel Dahlwill do the opposite and takes precedence.
1359a6e76e6SJoel DahlOptions can be separated by whitespace and commas.
136329fe200SAlexander Motin.Pp
1377c6b05d2SAlexander MotinThe
1387c6b05d2SAlexander Motin.Dq Li eapdinv
1397c6b05d2SAlexander Motinoption inverts External Amplifier Power Down signal.
1407c6b05d2SAlexander MotinThe
1417c6b05d2SAlexander Motin.Dq Li fixedrate
1427c6b05d2SAlexander Motindenies all sampling rates except 48KHz.
1437c6b05d2SAlexander MotinThe
1447c6b05d2SAlexander Motin.Dq Li forcestereo
1457c6b05d2SAlexander Motindenies mono playback/recording.
1467c6b05d2SAlexander MotinThe
1477c6b05d2SAlexander Motin.Dq Li senseinv
1487c6b05d2SAlexander Motinoption inverts jack sensing logic.
1497c6b05d2SAlexander MotinThe
1507c6b05d2SAlexander Motin.Dq Li ivref Ns Ar X
1517c6b05d2SAlexander Motinand
1527c6b05d2SAlexander Motin.Dq Li ovref Ns Ar X
1537c6b05d2SAlexander Motinoptions control the voltage used to power external microphones.
154fceeeec7SSean Bruno.It Va dev.hdaa.%d.init_clear
155fceeeec7SSean BrunoZero out the pin widget config setup by the system.
156*24cf089aSEd MasteSome systems seem to have unusable audio devices if the pin widget
157fceeeec7SSean Brunoconfiguration is cleared.
158fceeeec7SSean BrunoSet this value to 0 to accept the default configuration values setup by the
159fceeeec7SSean BrunoBIOS.
1607c6b05d2SAlexander Motin.It Va hint.hdaa.%d.gpio_config
1617c6b05d2SAlexander MotinOverrides audio function GPIO pins configuration set by BIOS.
1627c6b05d2SAlexander MotinMay be specified as a set of space-separated
1637c6b05d2SAlexander Motin.Dq Ar num Ns = Ns Ar value
1647c6b05d2SAlexander Motinpairs, where
1657c6b05d2SAlexander Motin.Ar num
1667c6b05d2SAlexander Motinis GPIO line number, and
1677c6b05d2SAlexander Motin.Ar value
1687c6b05d2SAlexander Motinis one of:
1697c6b05d2SAlexander Motin.Dq Li keep ,
1707c6b05d2SAlexander Motin.Dq Li set ,
1717c6b05d2SAlexander Motin.Dq Li clear ,
1727c6b05d2SAlexander Motin.Dq Li disable
1737c6b05d2SAlexander Motinand
1747c6b05d2SAlexander Motin.Dq Li input .
1757c6b05d2SAlexander Motin.Pp
176a3ffa4e0SAlexander Motin.Dq Li GPIO Ns s
177a3ffa4e0SAlexander Motinare a codec's General Purpose I/O pins which system integrators sometimes
17804b96d88SAlexander Motinuse to control external muters, amplifiers and so on.
179a3ffa4e0SAlexander MotinIf you have no sound, or sound volume is not adequate, you may have to
180a3ffa4e0SAlexander Motinexperiment a bit with the GPIO setup to find the optimal setup for your
181a3ffa4e0SAlexander Motinsystem.
1827c6b05d2SAlexander Motin.It Va hint.hdaa.%d.nid%d.config
1837c6b05d2SAlexander MotinOverrides audio function pin configuration set by BIOS.
184a3ffa4e0SAlexander MotinMay be specified as a 32-bit hexadecimal value with a leading
185a3ffa4e0SAlexander Motin.Dq 0x ,
186a3ffa4e0SAlexander Motinor as a set of space-separated
187a3ffa4e0SAlexander Motin.Dq Ar option Ns = Ns Ar value
188a3ffa4e0SAlexander Motinpairs.
189d9360bbfSAlexander Motin.It Va hint.pcm.%d.rec.autosrc
190d9360bbfSAlexander MotinControls automatic recording source feature:
1917e3de069SJoel Dahl.Bl -tag -width 2n -compact
192d9360bbfSAlexander Motin.It 0
193d9360bbfSAlexander Motindisabled,
194d9360bbfSAlexander Motin.It 1
195d9360bbfSAlexander Motinonce on attach,
196d9360bbfSAlexander Motin.It 2
197d9360bbfSAlexander Motinenabled.
198d9360bbfSAlexander Motin.El
199d9360bbfSAlexander MotinWhen enabled, driver will automatically set recording source of the mixer to
200d9360bbfSAlexander Motinconnected input using jack presence detection statuses.
20104b96d88SAlexander Motin.El
20204b96d88SAlexander Motin.Pp
20304b96d88SAlexander MotinPin configuration is the UAA driver's main source of information about codec
20404b96d88SAlexander Motinusage.
20504b96d88SAlexander MotinThis information is usually provided by the codec manufacturer and tuned
20604b96d88SAlexander Motinby system integrators for specific system requirements.
20704b96d88SAlexander MotinThe
20804b96d88SAlexander Motin.Nm
209a3ffa4e0SAlexander Motindriver allows users to override it to fix integrator mistakes or to use the
210a3ffa4e0SAlexander Motinavailable codec in alternative ways (for example to get stereo output and 2
211a3ffa4e0SAlexander Motininputs instead of a single 5.1 output).
212a3ffa4e0SAlexander Motin.Pp
213a3ffa4e0SAlexander MotinThe following options are supported:
21404b96d88SAlexander Motin.Bl -tag -width ".Va device=" -offset indent
21504b96d88SAlexander Motin.It Va as
21604b96d88SAlexander MotinAssociation number.
217a3ffa4e0SAlexander MotinAssociations are used to group individual pins to form a complex multi-pin
21804b96d88SAlexander Motindevice.
2197c6b05d2SAlexander MotinFor example, to group 4 connectors for 7.1 input/output, or to treat several
22004b96d88SAlexander Motininput connectors as sources for the same input device.
221a3ffa4e0SAlexander MotinAssociation numbers can be specified as numeric values from 0 to 15.
222a3ffa4e0SAlexander MotinA value of 0 means disabled pin.
223a3ffa4e0SAlexander MotinA value of 15 is a set of independent unassociated pins.
224a3ffa4e0SAlexander MotinEach association includes only pins of the same direction (in/out) and is
225a3ffa4e0SAlexander Motindetected atomically (all pins or none).
226a3ffa4e0SAlexander MotinA separate PCM audio device is created for every pair of input and
227a3ffa4e0SAlexander Motinoutput associations.
22804b96d88SAlexander Motin.It Va seq
22904b96d88SAlexander MotinSequence number.
230a3ffa4e0SAlexander MotinA unique, per-association number used to order pins inside the
231a3ffa4e0SAlexander Motinparticular association.
232a3ffa4e0SAlexander MotinSequence numbers can be specified as numeric values from 0 to 15.
233a3ffa4e0SAlexander Motin.Pp
234a3ffa4e0SAlexander MotinThe sequence number 15 has a special meaning for output associations.
235a3ffa4e0SAlexander MotinOutput pins with this number and device type
236a3ffa4e0SAlexander Motin.Dq Ar Headphones
237a3ffa4e0SAlexander Motinwill duplicate (with automatic mute if jack detection is supported) the
238a3ffa4e0SAlexander Motinfirst pin in that association.
2397c6b05d2SAlexander Motin.Pp
2407c6b05d2SAlexander MotinThe sequence numbers 14 and 15 has a special meaning for input associations.
2417c6b05d2SAlexander MotinTheir presence in association defines it as multiplexed or mixed respectively.
24250d922a0SGlen BarberIf none of them are present and there are more than one pin in association,
2437c6b05d2SAlexander Motinthe association will provide multichannel input.
2447c6b05d2SAlexander Motin.Pp
24550d922a0SGlen BarberFor multichannel input/output associations sequence numbers encode
2467c6b05d2SAlexander Motinchannel pairs positions:
2477c6b05d2SAlexander Motin0 - Front, 1 - Center/LFE, 2 - Back, 3 - Front Wide Center, 4 - Side.
2487c6b05d2SAlexander MotinStandard combinations are: (0) - Stereo; (0, 2), (0, 4) - Quadro;
2497c6b05d2SAlexander Motin(0, 1, 2), (0, 1, 4) - 5.1; (0, 1, 2, 4) - 7.1.
25004b96d88SAlexander Motin.It Va device
25104b96d88SAlexander MotinDevice type.
25204b96d88SAlexander MotinCan be specified as a number from 0 to 15 or as a name:
25304b96d88SAlexander Motin.Dq Li Line-out ,
25404b96d88SAlexander Motin.Dq Li Speaker ,
25504b96d88SAlexander Motin.Dq Li Headphones,
25604b96d88SAlexander Motin.Dq Li CD ,
25704b96d88SAlexander Motin.Dq Li SPDIF-out ,
25804b96d88SAlexander Motin.Dq Li Digital-out ,
25904b96d88SAlexander Motin.Dq Li Modem-line ,
26004b96d88SAlexander Motin.Dq Li Modem-handset ,
26104b96d88SAlexander Motin.Dq Li Line-in ,
26204b96d88SAlexander Motin.Dq Li AUX ,
26304b96d88SAlexander Motin.Dq Li Mic ,
26404b96d88SAlexander Motin.Dq Li Telephony ,
26504b96d88SAlexander Motin.Dq Li SPDIF-in ,
26604b96d88SAlexander Motin.Dq Li Digital-in ,
26704b96d88SAlexander Motin.Dq Li Res.E ,
26804b96d88SAlexander Motinor
26904b96d88SAlexander Motin.Dq Li Other .
27004b96d88SAlexander MotinThe device type also describes the pin direction (in/out).
27104b96d88SAlexander MotinFor example,
27204b96d88SAlexander Motin.Dq Li CD
273a3ffa4e0SAlexander Motinalways means an input pin, while
27404b96d88SAlexander Motin.Dq Li Headphones
275a3ffa4e0SAlexander Motinalways means an output.
27604b96d88SAlexander Motin.It Va conn
27704b96d88SAlexander MotinConnection type.
278a3ffa4e0SAlexander MotinCan be specified as a number from 0 to 3.
279a3ffa4e0SAlexander MotinThe connection type can also be specified as one of the special names
28004b96d88SAlexander Motin.Dq Li Jack ,
28104b96d88SAlexander Motin.Dq Li None ,
28204b96d88SAlexander Motin.Dq Li Fixed ,
28304b96d88SAlexander Motinor
28404b96d88SAlexander Motin.Dq Li Both .
285a3ffa4e0SAlexander MotinPins with a connection type of
28604b96d88SAlexander Motin.Dq Li None
287a3ffa4e0SAlexander Motinare disabled.
28804b96d88SAlexander Motin.It Va ctype
28904b96d88SAlexander MotinConnector physical type.
29004b96d88SAlexander MotinCan be specified as a number from 0 to 15.
291a3ffa4e0SAlexander MotinThis is a reference only value.
292a3ffa4e0SAlexander MotinIt is ignored by the
293a3ffa4e0SAlexander Motin.Nm
294a3ffa4e0SAlexander Motindriver.
29504b96d88SAlexander Motin.It Va color
29604b96d88SAlexander MotinConnector color.
297a3ffa4e0SAlexander MotinCan be specified as a number from 0 to 15 or as one of the names
29804b96d88SAlexander Motin.Dq Li Unknown ,
29904b96d88SAlexander Motin.Dq Li Black ,
30004b96d88SAlexander Motin.Dq Li Grey ,
30104b96d88SAlexander Motin.Dq Li Blue ,
30204b96d88SAlexander Motin.Dq Li Green ,
30304b96d88SAlexander Motin.Dq Li Red ,
30404b96d88SAlexander Motin.Dq Li Orange ,
30504b96d88SAlexander Motin.Dq Li Yellow ,
30604b96d88SAlexander Motin.Dq Li Purple ,
30704b96d88SAlexander Motin.Dq Li Pink ,
30804b96d88SAlexander Motin.Dq Li Res.A ,
30904b96d88SAlexander Motin.Dq Li Res.B ,
31004b96d88SAlexander Motin.Dq Li Res.C ,
31104b96d88SAlexander Motin.Dq Li Res.D ,
31204b96d88SAlexander Motin.Dq Li White ,
31304b96d88SAlexander Motinor
31404b96d88SAlexander Motin.Dq Li Other .
315a3ffa4e0SAlexander MotinThis is a reference only value.
316a3ffa4e0SAlexander MotinIt is ignored by the
317a3ffa4e0SAlexander Motin.Nm
318a3ffa4e0SAlexander Motindriver.
31904b96d88SAlexander Motin.It Va loc
32004b96d88SAlexander MotinConnector physical location.
32104b96d88SAlexander MotinCan be specified as a number from 0 to 63.
322a3ffa4e0SAlexander MotinThis is a reference only value.
323a3ffa4e0SAlexander MotinIt is ignored by the
324a3ffa4e0SAlexander Motin.Nm
325a3ffa4e0SAlexander Motindriver.
32604b96d88SAlexander Motin.It Va misc
32704b96d88SAlexander MotinMisc bits.
32804b96d88SAlexander MotinCan be specified as a number from 0 to 15.
32925972509SEdward Tomasz NapieralaBit 0 has a special meaning.
33025972509SEdward Tomasz NapieralaWhen set it means that jack detection is not implemented in hardware.
3319a6e76e6SJoel Dahl.El
3324a418e5bSJoel Dahl.Ss Runtime Configuration
3334a418e5bSJoel DahlThe following
3344a418e5bSJoel Dahl.Xr sysctl 8
3354a418e5bSJoel Dahlvariables are available in addition to those available to all
3364a418e5bSJoel Dahl.Xr sound 4
3374a418e5bSJoel Dahldevices:
3387c6b05d2SAlexander Motin.Bl -tag -width ".Va dev.hdaa.%d.nid%d_original" -offset indent
3397c6b05d2SAlexander Motin.It Va dev.hdac.%d.pindump
3407c6b05d2SAlexander MotinSetting this to a non-zero value dumps the current pin configuration, main
3417c6b05d2SAlexander Motincapabilities and jack sense status of all audio functions on the controller
3427c6b05d2SAlexander Motinto console and syslog.
34304b96d88SAlexander Motin.It Va dev.hdac.%d.polling
344a3ffa4e0SAlexander MotinEnables polling mode.
345a3ffa4e0SAlexander MotinIn this mode the driver operates by querying the device state on timer
346a3ffa4e0SAlexander Motinticks using
34704b96d88SAlexander Motin.Xr callout 9
34804b96d88SAlexander Motininstead of interrupts.
3494a418e5bSJoel DahlPolling is disabled by default.
3504a418e5bSJoel DahlDo not enable it unless you are facing weird interrupt problems or if the
3514a418e5bSJoel Dahldevice cannot generate interrupts at all.
3527c6b05d2SAlexander Motin.It Va dev.hdaa.%d.config
3537c6b05d2SAlexander MotinRun-time equivalent of the
3547c6b05d2SAlexander Motin.Va hint.hdaa.%d.config
3557c6b05d2SAlexander Motintunable.
3567c6b05d2SAlexander Motin.It Va dev.hdaa.%d.gpi_state
3577c6b05d2SAlexander MotinCurrent state of GPI lines.
3587c6b05d2SAlexander Motin.It Va dev.hdaa.%d.gpio_state
3597c6b05d2SAlexander MotinCurrent state of GPIO lines.
3607c6b05d2SAlexander Motin.It Va dev.hdaa.%d.gpio_config
3617c6b05d2SAlexander MotinRun-time equivalent of the
3627c6b05d2SAlexander Motin.Va hint.hdaa.%d.gpio.config
3637c6b05d2SAlexander Motintunable.
3647c6b05d2SAlexander Motin.It Va dev.hdaa.%d.gpo_state
3657c6b05d2SAlexander MotinCurrent state of GPO lines.
3667c6b05d2SAlexander Motin.It Va dev.hdaa.%d.nid%d_config
3677c6b05d2SAlexander MotinRun-time equivalent of the
3687c6b05d2SAlexander Motin.Va hint.hdaa.%d.nid%d.config
3697c6b05d2SAlexander Motintunable.
3707c6b05d2SAlexander Motin.It Va dev.hdaa.%d.nid%d_original
3717c6b05d2SAlexander MotinOriginal pin configuration written by BIOS.
3727c6b05d2SAlexander Motin.It Va dev.hdaa.%d.reconfig
3737c6b05d2SAlexander MotinSetting this to a non-zero value makes driver to destroy existing pcm devices
3747c6b05d2SAlexander Motinand process new pins configuration set via
3757c6b05d2SAlexander Motin.Va dev.hdaa.%d.nid%d_config .
376d9360bbfSAlexander Motin.It Va dev.pcm.%d.play.32bit , dev.pcm.%d.rec.32bit
377d9360bbfSAlexander MotinHDA controller uses 32bit representation for all samples of more then 16 bits.
378d9360bbfSAlexander MotinThese variables allow to specify how many bits of these 32 should be
379d9360bbfSAlexander Motinused by CODEC.
380d9360bbfSAlexander MotinDepending on codec capabilities, possible values are 20, 24 and 32 bit.
381d9360bbfSAlexander MotinThe default value is 24.
382d9360bbfSAlexander Motin.It Va dev.pcm.%d.rec.autosrc
383d9360bbfSAlexander MotinRun-time equivalent of the
384d9360bbfSAlexander Motin.Va hint.pcm.%d.rec.autosrc
385d9360bbfSAlexander Motintunable.
3864a418e5bSJoel Dahl.El
38749c93197SAlexander Motin.Sh EXAMPLES
388a3ffa4e0SAlexander MotinTaking HP Compaq DX2300 with Realtek ALC888 HDA codec for example.
389a3ffa4e0SAlexander MotinThis system has two audio connectors on a front side, three audio connectors
390a3ffa4e0SAlexander Motinon a rear side and one internal speaker.
391a3ffa4e0SAlexander MotinAccording to verbose driver output and the codec datasheet,
392a3ffa4e0SAlexander Motinthis codec has five stereo DACs and two stereo ADCs, all of them are routable to
393a3ffa4e0SAlexander Motinany codec pin (external connector).
394a3ffa4e0SAlexander MotinAll codec pins are reversible (could be configured either as input or output).
39549c93197SAlexander Motin.Pp
396edd4902fSAlexander MotinSo high codec uniformity and flexibility allow driver to configure it in many
397b06cfd40SJoel Dahldifferent ways, depending on requested pins usage described by pins configuration.
398be0d073bSAlexander MotinThe driver reports such default pin configuration when verbose messages enabled:
39949c93197SAlexander Motin.Bd -literal
4007c6b05d2SAlexander Motinhdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
4017c6b05d2SAlexander Motinhdaa0: 20 01014020 2  0  Line-out      Jack  1/8     Rear       Green   0
4027c6b05d2SAlexander Motinhdaa0: 21 99130110 1  0  Speaker       Fixed ATAPI   Onboard    Unknown 1
4037c6b05d2SAlexander Motinhdaa0: 22 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
4047c6b05d2SAlexander Motinhdaa0: 23 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
4057c6b05d2SAlexander Motinhdaa0: 24 01a19830 3  0  Mic           Jack  1/8     Rear       Pink    8
4067c6b05d2SAlexander Motinhdaa0: 25 02a1983f 3  15 Mic           Jack  1/8     Front      Pink    8
4077c6b05d2SAlexander Motinhdaa0: 26 01813031 3  1  Line-in       Jack  1/8     Rear       Blue    0
4087c6b05d2SAlexander Motinhdaa0: 27 0221401f 1  15 Headphones    Jack  1/8     Front      Green   0
4097c6b05d2SAlexander Motinhdaa0: 28 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
4107c6b05d2SAlexander Motinhdaa0: 30 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
4117c6b05d2SAlexander Motinhdaa0: 31 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
41249c93197SAlexander Motin.Ed
41349c93197SAlexander Motin.Pp
414be0d073bSAlexander MotinHere we can see, that the nodes with ID (nid) 25 and 27 are front panel
4157c6b05d2SAlexander Motinconnectors (Jack, Front), nids 20, 24 and 26 are rear panel connectors
4167c6b05d2SAlexander Motin(Jack, Rear) and nid 21 is a built-in speaker (Fixed, Onboard).
417edd4902fSAlexander MotinPins with nids 22, 23, 28, 30 and 31 will be disabled by driver due to "None"
41825972509SEdward Tomasz Napieralaconnectivity.
41925972509SEdward Tomasz NapieralaSo the pin count and description matches to connectors that we have.
420edd4902fSAlexander Motin.Pp
421edd4902fSAlexander MotinUsing association (as) and sequence (seq) fields values pins are grouped into
422edd4902fSAlexander Motin3 associations:
42349c93197SAlexander Motin.Bd -literal
4247c6b05d2SAlexander Motinhdaa0: Association 0 (1) out:
4257c6b05d2SAlexander Motinhdaa0:   Pin nid=21 seq=0
4267c6b05d2SAlexander Motinhdaa0:   Pin nid=27 seq=15
4277c6b05d2SAlexander Motinhdaa0: Association 1 (2) out:
4287c6b05d2SAlexander Motinhdaa0:   Pin nid=20 seq=0
4297c6b05d2SAlexander Motinhdaa0: Association 2 (3) in:
4307c6b05d2SAlexander Motinhdaa0:   Pin nid=24 seq=0
4317c6b05d2SAlexander Motinhdaa0:   Pin nid=26 seq=1
4327c6b05d2SAlexander Motinhdaa0:   Pin nid=25 seq=15
43349c93197SAlexander Motin.Ed
43449c93197SAlexander Motin.Pp
435a3ffa4e0SAlexander MotinEach
436a3ffa4e0SAlexander Motin.Xr pcm 4
437a3ffa4e0SAlexander Motindevice uses two associations: one for playback and one for recording.
438a3ffa4e0SAlexander MotinAssociations processed and assigned to
439a3ffa4e0SAlexander Motin.Xr pcm 4
440a3ffa4e0SAlexander Motindevices in increasing numerical order.
441a3ffa4e0SAlexander MotinIn this case association #0 (1) will become
442a3ffa4e0SAlexander Motin.Li pcm0
443a3ffa4e0SAlexander Motindevice playback, using the internal speakers and
444a3ffa4e0SAlexander Motin.Ar Headphones
445a3ffa4e0SAlexander Motinjack with speaker automute on the headphones jack connection.
446a3ffa4e0SAlexander MotinAssociation #1 (2) will become
447a3ffa4e0SAlexander Motin.Li pcm1
448a3ffa4e0SAlexander Motinplayback, using the
449a3ffa4e0SAlexander Motin.Ar Line-out
450a3ffa4e0SAlexander Motinjack.
451a3ffa4e0SAlexander MotinAssociation #2 (3) will become
452a3ffa4e0SAlexander Motin.Li pcm0
453a3ffa4e0SAlexander Motinrecording, using the external microphones and the
454a3ffa4e0SAlexander Motin.Ar Line-in
455a3ffa4e0SAlexander Motinjack.
456edd4902fSAlexander Motin.Pp
457a3ffa4e0SAlexander MotinThe
458a3ffa4e0SAlexander Motin.Nm
459a3ffa4e0SAlexander Motindriver provides extensive verbose messages to diagnose its operation
460a3ffa4e0SAlexander Motinlogic and describe its current codec configuration.
461edd4902fSAlexander Motin.Pp
462a3ffa4e0SAlexander MotinUsing
463a3ffa4e0SAlexander Motin.Xr device.hints 5
464a3ffa4e0SAlexander Motinit is possible to modify the configuration of the existing pins,
465a3ffa4e0SAlexander Motinallowing a broad range of different audio setups.
466a3ffa4e0SAlexander MotinHere are a few examples of some setups possible for this particular
467a3ffa4e0SAlexander Motinhardware:
46849c93197SAlexander Motin.Ss Example 1
469a3ffa4e0SAlexander MotinSetting the
470a3ffa4e0SAlexander Motin.Xr device.hints 5
471a3ffa4e0SAlexander Motinoptions
47249c93197SAlexander Motin.Bd -literal
47349c93197SAlexander Motinhint.hdac.0.cad0.nid20.config="as=1"
47449c93197SAlexander Motinhint.hdac.0.cad0.nid21.config="as=2"
47549c93197SAlexander Motin.Ed
47649c93197SAlexander Motin.Pp
477a3ffa4e0SAlexander Motinwill swap line-out and speaker functions.
478a3ffa4e0SAlexander MotinSo the
479a3ffa4e0SAlexander Motin.Li pcm0
48025972509SEdward Tomasz Napieraladevice will play to the line-out and headphones jacks.
48125972509SEdward Tomasz NapieralaLine-out will be muted on the headphones jack connection.
482a3ffa4e0SAlexander MotinRecording on
483a3ffa4e0SAlexander Motin.Li pcm0
484a3ffa4e0SAlexander Motinwill go from two external microphones and line-in jacks.
485a3ffa4e0SAlexander Motin.Li pcm1
486a3ffa4e0SAlexander Motinplayback will go to the internal speaker.
48749c93197SAlexander Motin.Ss Example 2
488a3ffa4e0SAlexander MotinSetting the
489a3ffa4e0SAlexander Motin.Xr device.hints 5
490a3ffa4e0SAlexander Motinoptions
49149c93197SAlexander Motin.Bd -literal
49249c93197SAlexander Motinhint.hdac.0.cad0.nid20.config="as=1 seq=15 device=Headphones"
49349c93197SAlexander Motinhint.hdac.0.cad0.nid27.config="as=2 seq=0"
49449c93197SAlexander Motinhint.hdac.0.cad0.nid25.config="as=4 seq=0"
49549c93197SAlexander Motin.Ed
49649c93197SAlexander Motin.Pp
497a3ffa4e0SAlexander Motinwill split the headphones and one of the microphones to a separate device.
498a3ffa4e0SAlexander MotinThe
499a3ffa4e0SAlexander Motin.Li pcm0
500a3ffa4e0SAlexander Motindevice will play to the internal speaker and to the line-out jack, with
501a3ffa4e0SAlexander Motinspeaker automute on the line-out jack connection.
502a3ffa4e0SAlexander MotinRecording on
503a3ffa4e0SAlexander Motin.Li pcm0
504a3ffa4e0SAlexander Motinwill use input from one external microphone and the line-in jacks.
505a3ffa4e0SAlexander MotinThe
506a3ffa4e0SAlexander Motin.Li pcm1
507a3ffa4e0SAlexander Motindevice will be completely dedicated to a headset (headphones and mic)
508a3ffa4e0SAlexander Motinconnected to the front connectors.
50949c93197SAlexander Motin.Ss Example 3
510a3ffa4e0SAlexander MotinSetting the
511a3ffa4e0SAlexander Motin.Xr device.hints 5
512a3ffa4e0SAlexander Motinoptions
51349c93197SAlexander Motin.Bd -literal
51449c93197SAlexander Motinhint.hdac.0.cad0.nid20.config="as=1 seq=0"
51549c93197SAlexander Motinhint.hdac.0.cad0.nid26.config="as=2 seq=0"
51649c93197SAlexander Motinhint.hdac.0.cad0.nid27.config="as=3 seq=0"
51749c93197SAlexander Motinhint.hdac.0.cad0.nid25.config="as=4 seq=0"
51849c93197SAlexander Motinhint.hdac.0.cad0.nid24.config="as=5 seq=0 device=Line-out"
51949c93197SAlexander Motinhint.hdac.0.cad0.nid21.config="as=6 seq=0"
52049c93197SAlexander Motin.Ed
52149c93197SAlexander Motin.Pp
522a3ffa4e0SAlexander Motinwill give 4 independent devices:
523a3ffa4e0SAlexander Motin.Li pcm0
524a3ffa4e0SAlexander Motin.Pq line-out and line-in ,
525a3ffa4e0SAlexander Motin.Li pcm1
526a3ffa4e0SAlexander Motin.Pq headphones and mic ,
527a3ffa4e0SAlexander Motin.Li pcm2
528a3ffa4e0SAlexander Motin.Pq additional line-out via retasked rear mic jack ,
529a3ffa4e0SAlexander Motinand
530a3ffa4e0SAlexander Motin.Li pcm3
531a3ffa4e0SAlexander Motin.Pq internal speaker .
53249c93197SAlexander Motin.Ss Example 4
533a3ffa4e0SAlexander MotinSetting the
534a3ffa4e0SAlexander Motin.Xr device.hints 5
535a3ffa4e0SAlexander Motinoptions
53649c93197SAlexander Motin.Bd -literal
53749c93197SAlexander Motinhint.hdac.0.cad0.nid20.config="as=1 seq=0"
53849c93197SAlexander Motinhint.hdac.0.cad0.nid24.config="as=1 seq=1 device=Line-out"
53949c93197SAlexander Motinhint.hdac.0.cad0.nid26.config="as=1 seq=2 device=Line-out"
54049c93197SAlexander Motinhint.hdac.0.cad0.nid21.config="as=2 seq=0"
54149c93197SAlexander Motin.Ed
54249c93197SAlexander Motin.Pp
543a3ffa4e0SAlexander Motinwill give 2 devices:
544a3ffa4e0SAlexander Motin.Li pcm0
545a3ffa4e0SAlexander Motinfor 5.1 playback via 3 rear connectors (line-out and retasked
546a3ffa4e0SAlexander Motinmic and line-in) and headset (headphones and mic) at front connectors.
547a3ffa4e0SAlexander Motin.Li pcm1
548a3ffa4e0SAlexander Motinfor internal speaker playback.
549a3ffa4e0SAlexander MotinOn headphones connection rear connectors will be muted.
5504c3bf245SAlexander Motin.Sh MIXER CONTROLS
5514c3bf245SAlexander MotinDepending on codec configuration, these controls and signal sources could be
5524c3bf245SAlexander Motinreported to
5534c3bf245SAlexander Motin.Xr sound 4 :
5544c3bf245SAlexander Motin.Bl -tag -width ".Va speaker" -offset indent
5554c3bf245SAlexander Motin.It Va vol
5564c3bf245SAlexander Motinoverall output level (volume)
5574c3bf245SAlexander Motin.It Va rec
5584c3bf245SAlexander Motinoverall recording level
5594c3bf245SAlexander Motin.It Va igain
5604c3bf245SAlexander Motininput-to-output monitoring loopback level
5614c3bf245SAlexander Motin.It Va ogain
5624c3bf245SAlexander Motinexternal amplifier control
5634c3bf245SAlexander Motin.It Va pcm
5644c3bf245SAlexander MotinPCM playback
5654c3bf245SAlexander Motin.It Va mix
5664c3bf245SAlexander Motininput mix
5674c3bf245SAlexander Motin.It Va mic
5684c3bf245SAlexander Motinfirst external or second internal microphone input
5694c3bf245SAlexander Motin.It Va monitor
5704c3bf245SAlexander Motinfirst internal or second external microphone input
5714c3bf245SAlexander Motin.It Va line , Va line1 , Va line2 , Va line3
5724c3bf245SAlexander Motinanalog (line) inputs
5734c3bf245SAlexander Motin.It Va dig1 , Va dig2 , Va dig3
5744c3bf245SAlexander Motindigital (S/PDIF, HDMI or DisplayPort) inputs
5754c3bf245SAlexander Motin.It Va cd
5764c3bf245SAlexander MotinCD input
5774c3bf245SAlexander Motin.It Va speaker
5784c3bf245SAlexander MotinPC speaker input
5793968c5c5SBenjamin Kaduk.It Va phin , Va phout , Va radio , Va video
5804c3bf245SAlexander Motinother random inputs
5814c3bf245SAlexander Motin.El
5824c3bf245SAlexander Motin.Pp
58325972509SEdward Tomasz NapieralaControls have different precision.
58425972509SEdward Tomasz NapieralaSome could be just an on/off triggers.
5854c3bf245SAlexander MotinMost of controls use logarithmic scale.
586d96143bdSJoel Dahl.Sh HARDWARE
587d96143bdSJoel DahlThe
588d96143bdSJoel Dahl.Nm
5897c6b05d2SAlexander Motindriver supports controllers having PCI class 4 (multimedia) and
5907c6b05d2SAlexander Motinsubclass 3 (HDA), compatible with Intel HDA specification.
591d96143bdSJoel Dahl.Pp
5927c6b05d2SAlexander MotinThe
5937c6b05d2SAlexander Motin.Nm
59450d922a0SGlen Barberdriver supports more than two hundred different controllers and CODECs.
5957c6b05d2SAlexander MotinThere is no sense to list all of them here, as in most cases specific CODEC
5967c6b05d2SAlexander Motinconfiguration and wiring are more important then type of the CODEC itself.
597d96143bdSJoel Dahl.Sh SEE ALSO
598600b9155SAlexander Motin.Xr snd_ich 4 ,
5990b3504fdSChristian Brueffer.Xr sound 4 ,
6009a6e76e6SJoel Dahl.Xr device.hints 5 ,
6019a6e76e6SJoel Dahl.Xr loader.conf 5 ,
6029a6e76e6SJoel Dahl.Xr sysctl 8
603d96143bdSJoel Dahl.Sh HISTORY
604d96143bdSJoel DahlThe
605d96143bdSJoel Dahl.Nm
606d96143bdSJoel Dahldevice driver first appeared in
60759e2f69aSGabor Kovesdan.Fx 6.3 .
608d96143bdSJoel Dahl.Sh AUTHORS
609d96143bdSJoel Dahl.An -nosplit
610d96143bdSJoel DahlThe
611d96143bdSJoel Dahl.Nm
612d96143bdSJoel Dahldriver was written by
6136c899950SBaptiste Daroussin.An Stephane E. Potvin Aq Mt sepotvin@videotron.ca ,
6146c899950SBaptiste Daroussin.An Ariff Abdullah Aq Mt ariff@FreeBSD.org
615d96143bdSJoel Dahland
6166c899950SBaptiste Daroussin.An Alexander Motin Aq Mt mav@FreeBSD.org .
617d96143bdSJoel DahlThis manual page was written by
6186c899950SBaptiste Daroussin.An Joel Dahl Aq Mt joel@FreeBSD.org ,
6196c899950SBaptiste Daroussin.An Alexander Motin Aq Mt mav@FreeBSD.org
62004b96d88SAlexander Motinand
6216c899950SBaptiste Daroussin.An Giorgos Keramidas Aq Mt keramida@FreeBSD.org .
622d96143bdSJoel Dahl.Sh BUGS
6237c6b05d2SAlexander MotinSome Hardware/OEM vendors tend to screw up BIOS settings or use custom
6247c6b05d2SAlexander Motinunusual CODEC wiring that create problems to the driver.
6257c6b05d2SAlexander MotinThis may result in missing pcm devices, or a state where the
626d96143bdSJoel Dahl.Nm
627090f90cfSBenedict Reuschlingdriver seems to attach and work, but no sound is played.
628090f90cfSBenedict ReuschlingSome cases can be solved by tuning
629090f90cfSBenedict Reuschling.Pa loader.conf
630090f90cfSBenedict Reuschlingvariables.
6317c6b05d2SAlexander MotinBut before trying to fix problem that way, make sure that there really is
6327c6b05d2SAlexander Motina problem and that the PCM audio device in use really corresponds to the
6337c6b05d2SAlexander Motinexpected audio connector.
63449c93197SAlexander Motin.Pp
635090f90cfSBenedict ReuschlingSome vendors use non-standardized General Purpose I/O (GPIO) pins of the codec
636090f90cfSBenedict Reuschlingto control external amplifiers.
637090f90cfSBenedict ReuschlingIn some cases setting a combination of GPIO bits may be needed to make
638090f90cfSBenedict Reuschlingsound work on a specific device.
6398fd5093cSAlexander Motin.Pp
6408fd5093cSAlexander MotinHDMI and DisplayPort audio may also require support from video driver.
641