Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
SND_HDA(4)		 BSD Kernel Interfaces Manual		    SND_HDA(4)

     snd_hda --	Intel High Definition Audio bridge device driver

     To	compile	this driver into the kernel, place the following lines in your
     kernel configuration file:

	   device sound
	   device snd_hda

     Alternatively, to load the	driver as a module at boot time, place the
     following line in loader.conf(5):


     The High Definition (HD) Audio specification was developed	by Intel as
     the logical successor of the old AC'97 specification and has several ad-
     vantages, such as higher bandwidth	which allows more channels and more
     detailed formats, support for several logical audio devices, and general
     purpose DMA channels.

     The snd_hda driver	is a HDA bus controller	driver and HDA codecs audio
     functions bridge driver that allows the generic audio driver, sound(4),
     to	be used	with this hardware.  Only audio	functions are supported	by
     snd_hda.  Modem and other possible	functions are not implemented.

     The snd_hda driver	supports hardware that conforms	with revision 1.0 of
     the Intel High Definition Audio specification and tries to	behave much
     like the Microsoft	Universal Audio	Architecture (UAA) draft (revision
     0.7b) for handling	audio devices.

     According to HDA and UAA specifications, depending	on the number of HDA
     buses and codecs present in system, their audio capabilities and BIOS
     provided configuration, the snd_hda driver	often provides several PCM au-
     dio devices.  For example,	one device for main rear 7.1 output and	in-
     puts, one device for independent headset connectors at front and one de-
     vice for SPDIF or HDMI audio input/output.	 The assignment	of audio in-
     puts and outputs may be tuned with	device.hints(5).  The driver's verbose
     boot messages provide a lot of information	about the operation of the
     driver and	present	audio setup.

     The default audio device may be tuned by setting the hw.snd.default_unit
     sysctl, as	described in sound(4), or explicitly specified in application

   Boot-time Configuration
     The following variables are available at boot-time	through	the
     device.hints(5) file:

	   hint.hdac.%d.config	Configures a range of possible options.	 Pos-
				sible values are: "dmapos", "eapdinv",
				"gpio0", "gpio1", "gpio2", "gpio3", "gpio4",
				"gpio5", "gpio6", "gpio7", "gpioflush",
				"ivref", "ivref50", "ivref80", "ivref100",
				"fixedrate", "forcestereo", "ovref",
				"ovref50", "ovref80", "ovref100", "senseinv",
				"softpcmvol", and "vref".  An option prefixed
				with "no", such	as "nofixedrate", will do the
				opposite and takes precedence.	Options	can be
				separated by whitespace	and commas.

				"GPIOs"	are a codec's General Purpose I/O pins
				which system integrators sometimes use to con-
				trol external muters, amplifiers and so	on.
				If you have no sound, or sound volume is not
				adequate, you may have to experiment a bit
				with the GPIO setup to find the	optimal	setup
				for your system.

				The "ivrefX" and "ovrefX" options control the
				voltage	used to	power external microphones.

	   hint.hdac.%d.msi	Controls MSI (Message Signaled Interrupts)

				Overrides codec	pin configuration set by BIOS.
				May be specified as a 32-bit hexadecimal value
				with a leading "0x", or	as a set of space-sep-
				arated "option=value" pairs.

     Pin configuration is the UAA driver's main	source of information about
     codec usage.  This	information is usually provided	by the codec manufac-
     turer and tuned by	system integrators for specific	system requirements.
     The snd_hda driver	allows users to	override it to fix integrator mistakes
     or	to use the available codec in alternative ways (for example to get
     stereo output and 2 inputs	instead	of a single 5.1	output).

     The following options are supported:

	   as	    Association	number.	 Associations are used to group	indi-
		    vidual pins	to form	a complex multi-pin device.  For exam-
		    ple, to group 4 connectors for 7.1 output, or to treat
		    several input connectors as	sources	for the	same input de-
		    vice.  Association numbers can be specified	as numeric
		    values from	0 to 15.  A value of 0 means disabled pin.  A
		    value of 15	is a set of independent	unassociated pins.
		    Each association includes only pins	of the same direction
		    (in/out) and is detected atomically	(all pins or none).  A
		    separate PCM audio device is created for every pair	of in-
		    put	and output associations.

	   seq	    Sequence number.  A	unique,	per-association	number used to
		    order pins inside the particular association.  Sequence
		    numbers can	be specified as	numeric	values from 0 to 15.

		    For	output assotiations sequence numbers encode speaker
		    pairs positions: 0 - Front,	1 - Center/LFE,	2 - Back, 3 -
		    Front Wide Center, 4 - Side.  Standard combinations	are:
		    (0)	- Stereo; (0, 2), (0, 4) - Quadro; (0, 1, 2), (0, 1,
		    4) - 5.1; (0, 1, 2,	4) - 7.1.

		    The	sequence number	15 has a special meaning for output
		    associations.  Output pins with this number	and device
		    type "Headphones" will duplicate (with automatic mute if
		    jack detection is supported) the first pin in that associ-

	   device   Device type.  Can be specified as a	number from 0 to 15 or
		    as a name: "Line-out", "Speaker", "Headphones," "CD",
		    "SPDIF-out", "Digital-out",	"Modem-line", "Modem-handset",
		    "Line-in", "AUX", "Mic", "Telephony", "SPDIF-in",
		    "Digital-in", "Res.E", or "Other".	The device type	also
		    describes the pin direction	(in/out).  For example,	"CD"
		    always means an input pin, while "Headphones" always means
		    an output.

	   conn	    Connection type.  Can be specified as a number from	0 to
		    3.	The connection type can	also be	specified as one of
		    the	special	names "Jack", "None", "Fixed", or "Both".
		    Pins with a	connection type	of "None" are disabled.

	   ctype    Connector physical type.  Can be specified as a number
		    from 0 to 15.  This	is a reference only value.  It is ig-
		    nored by the snd_hda driver.

	   color    Connector color.  Can be specified as a number from	0 to
		    15 or as one of the	names "Unknown", "Black", "Grey",
		    "Blue", "Green", "Red", "Orange", "Yellow",	"Purple",
		    "Pink", "Res.A", "Res.B", "Res.C", "Res.D",	"White", or
		    "Other".  This is a	reference only value.  It is ignored
		    by the snd_hda driver.

	   loc	    Connector physical location.  Can be specified as a	number
		    from 0 to 63.  This	is a reference only value.  It is ig-
		    nored by the snd_hda driver.

	   misc	    Misc bits.	Can be specified as a number from 0 to 15.
		    Bit	0 has a	special	meaning.  When set it means that jack
		    detection is not implemented in hardware.

   Runtime Configuration
     The following sysctl(8) variables are available in	addition to those
     available to all sound(4) devices:

	   dev.hdac.%d.polling	Enables	polling	mode.  In this mode the	driver
				operates by querying the device	state on timer
				ticks using callout(9) instead of interrupts.
				Polling	is disabled by default.	 Do not	enable
				it unless you are facing weird interrupt prob-
				lems or	if the device cannot generate inter-
				rupts at all.

				Controller/Jack	Sense polling interval (1-1000

	   dev.hdac.%d.pindump	Setting	this to	a non-zero value dumps the
				current	pin configuration, main	capabilities
				and jack sense status to console and syslog.

     Taking HP Compaq DX2300 with Realtek ALC888 HDA codec for example.	 This
     system has	two audio connectors on	a front	side, three audio connectors
     on	a rear side and	one internal speaker.  According to verbose driver
     output and	the codec datasheet, this codec	has five stereo	DACs and two
     stereo ADCs, all of them are routable to any codec	pin (external connec-
     tor).  All	codec pins are reversible (could be configured either as input
     or	output).

     So	high codec uniformity and flexibility allow driver to configure	it in
     many different ways, depending on requested pins usage decribed by	pins
     configuration.  The driver	reports	such default pin configuration when
     verbose messages enabled:

     hdac0: nid	20 0x01014020 as  2 seq	 0   Line-out  Jack jack 1 loc	1 color	  Green	misc 0
     hdac0: nid	21 0x99130110 as  1 seq	 0    Speaker Fixed jack 3 loc 25 color	Unknown	misc 1
     hdac0: nid	22 0x411111f0 as 15 seq	 0    Speaker  None jack 1 loc	1 color	  Black	misc 1
     hdac0: nid	23 0x411111f0 as 15 seq	 0    Speaker  None jack 1 loc	1 color	  Black	misc 1
     hdac0: nid	24 0x01a19830 as  3 seq	 0	  Mic  Jack jack 1 loc	1 color	   Pink	misc 8
     hdac0: nid	25 0x02a1983f as  3 seq	15	  Mic  Jack jack 1 loc	2 color	   Pink	misc 8
     hdac0: nid	26 0x01813031 as  3 seq	 1    Line-in  Jack jack 1 loc	1 color	   Blue	misc 0
     hdac0: nid	27 0x0221401f as  1 seq	15 Headphones  Jack jack 1 loc	2 color	  Green	misc 0
     hdac0: nid	28 0x411111f0 as 15 seq	 0    Speaker  None jack 1 loc	1 color	  Black	misc 1
     hdac0: nid	30 0x411111f0 as 15 seq	 0    Speaker  None jack 1 loc	1 color	  Black	misc 1
     hdac0: nid	31 0x411111f0 as 15 seq	 0    Speaker  None jack 1 loc	1 color	  Black	misc 1

     Here we can see, that the nodes with ID (nid) 25 and 27 are front panel
     connectors	(Jack, loc 2), nids 20,	24 and 26 are rear panel connectors
     (Jack, loc	1) and nid 21 is a built-in speaker (Fixed, loc	25).  Pins
     with nids 22, 23, 28, 30 and 31 will be disabled by driver	due to "None"
     connectivity. So the pin count and	description matches to connectors that
     we	have.

     Using association (as) and	sequence (seq) fields values pins are grouped
     into 3 associations:

     hdac0: Association	0 (1) out:
     hdac0:   Pin nid=21 seq=0
     hdac0:   Pin nid=27 seq=15
     hdac0: Association	1 (2) out:
     hdac0:   Pin nid=20 seq=0
     hdac0: Association	2 (3) in:
     hdac0:   Pin nid=24 seq=0
     hdac0:   Pin nid=26 seq=1
     hdac0:   Pin nid=25 seq=15

     Each pcm(4) device	uses two associations: one for playback	and one	for
     recording.	 Associations processed	and assigned to	pcm(4) devices in in-
     creasing numerical	order.	In this	case association #0 (1)	will become
     pcm0 device playback, using the internal speakers and Headphones jack
     with speaker automute on the headphones jack connection.  Association #1
     (2) will become pcm1 playback, using the Line-out jack.  Association #2
     (3) will become pcm0 recording, using the external	microphones and	the
     Line-in jack.

     The snd_hda driver	provides extensive verbose messages to diagnose	its
     operation logic and describe its current codec configuration.

     Using device.hints(5) it is possible to modify the	configuration of the
     existing pins, allowing a broad range of different	audio setups.  Here
     are a few examples	of some	setups possible	for this particular hardware:

   Example 1
     Setting the device.hints(5) options


     will swap line-out	and speaker functions.	So the pcm0 device will	play
     to	the line-out and headphones jacks. Line-out will be muted on the head-
     phones jack connection.  Recording	on pcm0	will go	from two external mi-
     crophones and line-in jacks.  pcm1	playback will go to the	internal

   Example 2
     Setting the device.hints(5) options

     hint.hdac.0.cad0.nid20.config="as=1 seq=15	device=Headphones"
     hint.hdac.0.cad0.nid27.config="as=2 seq=0"
     hint.hdac.0.cad0.nid25.config="as=4 seq=0"

     will split	the headphones and one of the microphones to a separate	de-
     vice.  The	pcm0 device will play to the internal speaker and to the line-
     out jack, with speaker automute on	the line-out jack connection.  Record-
     ing on pcm0 will use input	from one external microphone and the line-in
     jacks.  The pcm1 device will be completely	dedicated to a headset (head-
     phones and	mic) connected to the front connectors.

   Example 3
     Setting the device.hints(5) options

     hint.hdac.0.cad0.nid20.config="as=1 seq=0"
     hint.hdac.0.cad0.nid26.config="as=2 seq=0"
     hint.hdac.0.cad0.nid27.config="as=3 seq=0"
     hint.hdac.0.cad0.nid25.config="as=4 seq=0"
     hint.hdac.0.cad0.nid24.config="as=5 seq=0 device=Line-out"
     hint.hdac.0.cad0.nid21.config="as=6 seq=0"

     will give 4 independent devices: pcm0 (line-out and line-in), pcm1
     (headphones and mic), pcm2	(additional line-out via retasked rear mic
     jack), and	pcm3 (internal speaker).

   Example 4
     Setting the device.hints(5) options

     hint.hdac.0.cad0.nid20.config="as=1 seq=0"
     hint.hdac.0.cad0.nid24.config="as=1 seq=1 device=Line-out"
     hint.hdac.0.cad0.nid26.config="as=1 seq=2 device=Line-out"
     hint.hdac.0.cad0.nid21.config="as=2 seq=0"

     will give 2 devices: pcm0 for 5.1 playback	via 3 rear connectors (line-
     out and retasked mic and line-in) and headset (headphones and mic)	at
     front connectors.	pcm1 for internal speaker playback.  On	headphones
     connection	rear connectors	will be	muted.

     Depending on codec	configuration, these controls and signal sources could
     be	reported to sound(4):

	   vol	    overall output level (volume)

	   rec	    overall recording level

	   igain    input-to-output monitoring loopback	level

	   ogain    external amplifier control

	   pcm	    PCM	playback

	   mix	    input mix

	   mic	    first external or second internal microphone input

	   monitor  first internal or second external microphone input

	   line, line1,	line2, line3
		    analog (line) inputs

	   dig1, dig2, dig3
		    digital (S/PDIF, HDMI or DisplayPort) inputs

	   cd	    CD input

	   speaker  PC speaker input

	   phin, phout,	radio. video
		    other random inputs

     Controls have different precision.	Some could be just an on/off triggers.
     Most of controls use logarithmic scale.

     The snd_hda driver	supports many Intel HDA	compatible audio chipsets in-
     cluding the following:

     o	 ATI SB450
     o	 ATI SB600
     o	 Intel 631x/632xESB
     o	 Intel 82801F (ICH6)
     o	 Intel 82801G (ICH7)
     o	 Intel 82801H (ICH8)
     o	 Intel 82801I (ICH9)
     o	 Intel 82801J (ICH10)
     o	 Intel US15W (SCH)
     o	 nVidia	MCP51
     o	 nVidia	MCP55
     o	 nVidia	MCP61A
     o	 nVidia	MCP61B
     o	 nVidia	MCP63
     o	 nVidia	MCP65A
     o	 nVidia	MCP65B
     o	 nVidia	MCP67A
     o	 nVidia	MCP67B
     o	 nVidia	MCP68
     o	 nVidia	MCP69
     o	 nVidia	MCP73
     o	 nVidia	MCP78
     o	 nVidia	MCP79
     o	 nVidia	MCP89
     o	 SiS 966
     o	 VIA VT8251/8237A

     The following and many other codecs have been verified to work:

     o	 Analog	Devices	AD1981HD
     o	 Analog	Devices	AD1983
     o	 Analog	Devices	AD1984
     o	 Analog	Devices	AD1986A
     o	 Analog	Devices	AD1988
     o	 Analog	Devices	AD1988B
     o	 CMedia	CMI9880
     o	 Conexant CX20549 (Venice)
     o	 Conexant CX20551 (Waikiki)
     o	 Conexant CX20561 (Hermosa)
     o	 Realtek ALC260
     o	 Realtek ALC262
     o	 Realtek ALC268
     o	 Realtek ALC660
     o	 Realtek ALC861
     o	 Realtek ALC861VD
     o	 Realtek ALC880
     o	 Realtek ALC882
     o	 Realtek ALC883
     o	 Realtek ALC885
     o	 Realtek ALC888
     o	 Realtek ALC889
     o	 Sigmatel STAC9205
     o	 Sigmatel STAC9220
     o	 Sigmatel STAC9220D / 9223D
     o	 Sigmatel STAC9221
     o	 Sigmatel STAC9221D
     o	 Sigmatel STAC9227D
     o	 Sigmatel STAC9227X
     o	 Sigmatel STAC9228D
     o	 Sigmatel STAC9228X
     o	 Sigmatel STAC9229D
     o	 Sigmatel STAC9229X
     o	 Sigmatel STAC9230D
     o	 Sigmatel STAC9230X
     o	 Sigmatel STAC9271D
     o	 Sigmatel STAC9872AK
     o	 VIA VT1708
     o	 VIA VT1708B
     o	 VIA VT1709

     sound(4), snd_ich(4), device.hints(5), loader.conf(5), sysctl(8)

     The snd_hda device	driver first appeared in FreeBSD 6.3.

     The snd_hda driver	was written by Stephane	E. Potvin
     <>, Ariff Abdullah <> and Alexander
     Motin <>.  This manual page	was written by Joel Dahl
     <>, Alexander Motin <> and Giorgos
     Keramidas <>.

     A few Hardware/OEM	vendors	tend to	screw up BIOS settings,	thus rendering
     the snd_hda driver	useless, which usually results in a state where	the
     snd_hda driver seems to attach and	work, but without any sound. Some of
     that cases	can be solved by tuning	loader.conf variables. But before try-
     ing to fix	problem	that way, make sure that problem is really exists and
     the PCM audio device you are using	really corresponds to expected audio

     Some vendors use non-standardized General Purpose I/O (GPIO) pins of
     codec to control external amplifiers. In some cases setting proper	combi-
     nation of GPIO bits may be	needed to make sound work on specific device.

     HDMI and DisplayPort audio	may also require support from video driver.

BSD			       January 22, 2010				   BSD


Want to link to this manual page? Use this URL:

home | help