summaryrefslogtreecommitdiff
path: root/static/freebsd/man4/snd_hda.4 3.html
blob: bf9d6b35956eec0410c9d070da0bbb004122d3d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
<table class="head">
  <tr>
    <td class="head-ltitle">SND_HDA(4)</td>
    <td class="head-vol">Device Drivers Manual</td>
    <td class="head-rtitle">SND_HDA(4)</td>
  </tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">snd_hda</code> &#x2014; <span class="Nd">Intel
    High Definition Audio bridge device driver</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp">To compile this driver into the kernel, place the following lines
    in your kernel configuration file:</p>
<div class="Bd Pp Bd-indent"><code class="Cd">device sound</code>
<br/>
<code class="Cd">device snd_hda</code></div>
<p class="Pp">Alternatively, to load the driver as a module at boot time, place
    the following line in <a class="Xr">loader.conf(5)</a>:</p>
<div class="Bd Pp Bd-indent Li">
<pre>snd_hda_load=&quot;YES&quot;</pre>
</div>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">The High Definition (HD) Audio specification was developed by
    Intel as the logical successor of the old AC'97 specification and has
    several advantages, such as higher bandwidth which allows more channels and
    more detailed formats, support for several logical audio devices, and
    general purpose DMA channels.</p>
<p class="Pp">The <code class="Nm">snd_hda</code> driver includes HDA bus
    controller driver (hdac), HDA codec driver (hdacc) and HDA codecs audio
    functions bridge driver (hdaa) that allows the generic audio driver,
    <a class="Xr">sound(4)</a>, to be used with this hardware. Only audio
    functions are supported by <code class="Nm">snd_hda</code>. Modem and other
    possible functions are not implemented.</p>
<p class="Pp">The <code class="Nm">snd_hda</code> 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.</p>
<p class="Pp">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 <code class="Nm">snd_hda</code> driver often
    provides several PCM audio devices. For example, one device for main rear
    7.1 output and inputs, one device for independent headset connectors at
    front and one device for SPDIF or HDMI audio input/output. The assignment of
    audio inputs and outputs may be tuned with <a class="Xr">device.hints(5)</a>
    or <a class="Xr">sysctl(8)</a>. The driver's verbose boot messages provide a
    lot of information about the operation of the driver and present audio
    setup.</p>
<p class="Pp">The default audio device may be tuned by setting the
    <var class="Ar">hw.snd.default_unit</var> sysctl, as described in
    <a class="Xr">sound(4)</a>, or explicitly specified in application
  settings.</p>
<section class="Ss">
<h2 class="Ss" id="Boot-time_Configuration"><a class="permalink" href="#Boot-time_Configuration">Boot-time
  Configuration</a></h2>
<p class="Pp">The following variables are available at boot-time through the
    <a class="Xr">device.hints(5)</a> file:</p>
<div class="Bd-indent">
<dl class="Bl-tag">
  <dt id="hint.hdac._d.config"><var class="Va">hint.hdac.%d.config</var></dt>
  <dd>Configures a range of possible controller options. Possible values are:
      &#x201C;<code class="Li">64bit</code>&#x201D;,
      &#x201C;<code class="Li">dmapos</code>&#x201D;,
      &#x201C;<code class="Li">msi</code>&#x201D;. An option prefixed with
      &#x201C;<code class="Li">no</code>&#x201D;, such as
      &#x201C;<code class="Li">nomsi</code>&#x201D;, will do the opposite and
      takes precedence. Options can be separated by whitespace and commas.</dd>
  <dt id="hint.hdac._d.msi"><var class="Va">hint.hdac.%d.msi</var></dt>
  <dd>Controls MSI (Message Signaled Interrupts) support.</dd>
  <dt id="hint.hdac._d.cad_d.nid_d.config"><var class="Va">hint.hdac.%d.cad%d.nid%d.config</var></dt>
  <dd>Same as <var class="Va">hint.hdaa.%d.nid%d.config</var></dd>
  <dt id="hint.hdaa._d.config"><var class="Va">hint.hdaa.%d.config</var></dt>
  <dd>Configures a range of possible audio function options. Possible values
      are: &#x201C;<code class="Li">eapdinv</code>&#x201D;,
      &#x201C;<code class="Li">ivref</code>&#x201D;,
      &#x201C;<code class="Li">ivref50</code>&#x201D;,
      &#x201C;<code class="Li">ivref80</code>&#x201D;,
      &#x201C;<code class="Li">ivref100</code>&#x201D;,
      &#x201C;<code class="Li">fixedrate</code>&#x201D;,
      &#x201C;<code class="Li">forcestereo</code>&#x201D;,
      &#x201C;<code class="Li">ovref</code>&#x201D;,
      &#x201C;<code class="Li">ovref50</code>&#x201D;,
      &#x201C;<code class="Li">ovref80</code>&#x201D;,
      &#x201C;<code class="Li">ovref100</code>&#x201D;,
      &#x201C;<code class="Li">senseinv</code>&#x201D;,
      &#x201C;<code class="Li">softpcmvol</code>&#x201D;, and
      &#x201C;<code class="Li">vref</code>&#x201D;. An option prefixed with
      &#x201C;<code class="Li">no</code>&#x201D;, such as
      &#x201C;<code class="Li">nofixedrate</code>&#x201D;, will do the opposite
      and takes precedence. Options can be separated by whitespace and commas.
    <p class="Pp">The &#x201C;<code class="Li">eapdinv</code>&#x201D; option
        inverts External Amplifier Power Down signal. The
        &#x201C;<code class="Li">fixedrate</code>&#x201D; denies all sampling
        rates except 48KHz. The
        &#x201C;<code class="Li">forcestereo</code>&#x201D; denies mono
        playback/recording. The &#x201C;<code class="Li">senseinv</code>&#x201D;
        option inverts jack sensing logic. The
        &#x201C;<code class="Li">ivref</code><var class="Ar">X</var>&#x201D; and
        &#x201C;<code class="Li">ovref</code><var class="Ar">X</var>&#x201D;
        options control the voltage used to power external microphones.</p>
  </dd>
  <dt id="dev.hdaa._d.init_clear"><var class="Va">dev.hdaa.%d.init_clear</var></dt>
  <dd>Zero out the pin widget config setup by the system. Some systems seem to
      have unusable audio devices if the pin widget configuration is cleared.
      Set this value to 0 to accept the default configuration values setup by
      the BIOS.</dd>
  <dt id="hint.hdaa._d.gpio_config"><var class="Va">hint.hdaa.%d.gpio_config</var></dt>
  <dd>Overrides audio function GPIO pins configuration set by BIOS. May be
      specified as a set of space-separated
      &#x201C;<var class="Ar">num</var>=<var class="Ar">value</var>&#x201D;
      pairs, where <var class="Ar">num</var> is GPIO line number, and
      <var class="Ar">value</var> is one of:
      &#x201C;<code class="Li">keep</code>&#x201D;,
      &#x201C;<code class="Li">set</code>&#x201D;,
      &#x201C;<code class="Li">clear</code>&#x201D;,
      &#x201C;<code class="Li">disable</code>&#x201D; and
      &#x201C;<code class="Li">input</code>&#x201D;.
    <p class="Pp">&#x201C;<code class="Li">GPIO</code>s&#x201D; are a codec's
        General Purpose I/O pins which system integrators sometimes use to
        control 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.</p>
  </dd>
  <dt id="hint.hdaa._d.nid_d.config"><var class="Va">hint.hdaa.%d.nid%d.config</var></dt>
  <dd>Overrides audio function pin configuration set by BIOS. May be specified
      as a 32-bit hexadecimal value with a leading &#x201C;0x&#x201D;, or as a
      set of space-separated
      &#x201C;<var class="Ar">option</var>=<var class="Ar">value</var>&#x201D;
      pairs.</dd>
  <dt id="hint.pcm._d.rec.autosrc"><var class="Va">hint.pcm.%d.rec.autosrc</var></dt>
  <dd>Controls automatic recording source feature:
    <dl class="Bl-tag Bl-compact">
      <dt>0</dt>
      <dd>disabled,</dd>
      <dt>1</dt>
      <dd>once on attach,</dd>
      <dt>2</dt>
      <dd>enabled.</dd>
    </dl>
    When enabled, driver will automatically set recording source of the mixer to
      connected input using jack presence detection statuses.</dd>
</dl>
</div>
<p class="Pp">Pin configuration is the UAA driver's main source of information
    about codec usage. This information is usually provided by the codec
    manufacturer and tuned by system integrators for specific system
    requirements. The <code class="Nm">snd_hda</code> 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).</p>
<p class="Pp">The following options are supported:</p>
<div class="Bd-indent">
<dl class="Bl-tag">
  <dt id="as"><var class="Va">as</var></dt>
  <dd>Association number. Associations are used to group individual pins to form
      a complex multi-pin device. For example, to group 4 connectors for 7.1
      input/output, or to treat several input connectors as sources for the same
      input device. 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 input and output
      associations.</dd>
  <dt id="seq"><var class="Va">seq</var></dt>
  <dd>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.
    <p class="Pp">The sequence number 15 has a special meaning for output
        associations. Output pins with this number and device type
        &#x201C;<var class="Ar">Headphones</var>&#x201D; will duplicate (with
        automatic mute if jack detection is supported) the first pin in that
        association.</p>
    <p class="Pp">The sequence numbers 14 and 15 has a special meaning for input
        associations. Their presence in association defines it as multiplexed or
        mixed respectively. If none of them are present and there are more than
        one pin in association, the association will provide multichannel
      input.</p>
    <p class="Pp">For multichannel input/output associations sequence numbers
        encode channel 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.</p>
  </dd>
  <dt id="device"><var class="Va">device</var></dt>
  <dd>Device type. Can be specified as a number from 0 to 15 or as a name:
      &#x201C;<code class="Li">Line-out</code>&#x201D;,
      &#x201C;<code class="Li">Speaker</code>&#x201D;,
      &#x201C;<code class="Li">Headphones,</code>&#x201D;
      &#x201C;<code class="Li">CD</code>&#x201D;,
      &#x201C;<code class="Li">SPDIF-out</code>&#x201D;,
      &#x201C;<code class="Li">Digital-out</code>&#x201D;,
      &#x201C;<code class="Li">Modem-line</code>&#x201D;,
      &#x201C;<code class="Li">Modem-handset</code>&#x201D;,
      &#x201C;<code class="Li">Line-in</code>&#x201D;,
      &#x201C;<code class="Li">AUX</code>&#x201D;,
      &#x201C;<code class="Li">Mic</code>&#x201D;,
      &#x201C;<code class="Li">Telephony</code>&#x201D;,
      &#x201C;<code class="Li">SPDIF-in</code>&#x201D;,
      &#x201C;<code class="Li">Digital-in</code>&#x201D;,
      &#x201C;<code class="Li">Res.E</code>&#x201D;, or
      &#x201C;<code class="Li">Other</code>&#x201D;. The device type also
      describes the pin direction (in/out). For example,
      &#x201C;<code class="Li">CD</code>&#x201D; always means an input pin,
      while &#x201C;<code class="Li">Headphones</code>&#x201D; always means an
      output.</dd>
  <dt id="conn"><var class="Va">conn</var></dt>
  <dd>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
      &#x201C;<code class="Li">Jack</code>&#x201D;,
      &#x201C;<code class="Li">None</code>&#x201D;,
      &#x201C;<code class="Li">Fixed</code>&#x201D;, or
      &#x201C;<code class="Li">Both</code>&#x201D;. Pins with a connection type
      of &#x201C;<code class="Li">None</code>&#x201D; are disabled.</dd>
  <dt id="ctype"><var class="Va">ctype</var></dt>
  <dd>Connector physical type. Can be specified as a number from 0 to 15. This
      is a reference only value. It is ignored by the
      <code class="Nm">snd_hda</code> driver.</dd>
  <dt id="color"><var class="Va">color</var></dt>
  <dd>Connector color. Can be specified as a number from 0 to 15 or as one of
      the names &#x201C;<code class="Li">Unknown</code>&#x201D;,
      &#x201C;<code class="Li">Black</code>&#x201D;,
      &#x201C;<code class="Li">Grey</code>&#x201D;,
      &#x201C;<code class="Li">Blue</code>&#x201D;,
      &#x201C;<code class="Li">Green</code>&#x201D;,
      &#x201C;<code class="Li">Red</code>&#x201D;,
      &#x201C;<code class="Li">Orange</code>&#x201D;,
      &#x201C;<code class="Li">Yellow</code>&#x201D;,
      &#x201C;<code class="Li">Purple</code>&#x201D;,
      &#x201C;<code class="Li">Pink</code>&#x201D;,
      &#x201C;<code class="Li">Res.A</code>&#x201D;,
      &#x201C;<code class="Li">Res.B</code>&#x201D;,
      &#x201C;<code class="Li">Res.C</code>&#x201D;,
      &#x201C;<code class="Li">Res.D</code>&#x201D;,
      &#x201C;<code class="Li">White</code>&#x201D;, or
      &#x201C;<code class="Li">Other</code>&#x201D;. This is a reference only
      value. It is ignored by the <code class="Nm">snd_hda</code> driver.</dd>
  <dt id="loc"><var class="Va">loc</var></dt>
  <dd>Connector physical location. Can be specified as a number from 0 to 63.
      This is a reference only value. It is ignored by the
      <code class="Nm">snd_hda</code> driver.</dd>
  <dt id="misc"><var class="Va">misc</var></dt>
  <dd>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.</dd>
</dl>
</div>
</section>
<section class="Ss">
<h2 class="Ss" id="Runtime_Configuration"><a class="permalink" href="#Runtime_Configuration">Runtime
  Configuration</a></h2>
<p class="Pp">The following <a class="Xr">sysctl(8)</a> variables are available
    in addition to those available to all <a class="Xr">sound(4)</a>
  devices:</p>
<div class="Bd-indent">
<dl class="Bl-tag">
  <dt id="dev.hdac._d.pindump"><var class="Va">dev.hdac.%d.pindump</var></dt>
  <dd>Setting this to a non-zero value dumps the current pin configuration, main
      capabilities and jack sense status of all audio functions on the
      controller to console and syslog.</dd>
  <dt id="dev.hdac._d.polling"><var class="Va">dev.hdac.%d.polling</var></dt>
  <dd>Enables polling mode. In this mode the driver operates by querying the
      device state on timer ticks using <a class="Xr">callout(9)</a> instead of
      interrupts. Polling is disabled by default. Do not enable it unless you
      are facing weird interrupt problems or if the device cannot generate
      interrupts at all.</dd>
  <dt id="dev.hdaa._d.config"><var class="Va">dev.hdaa.%d.config</var></dt>
  <dd>Run-time equivalent of the <var class="Va">hint.hdaa.%d.config</var>
      tunable.</dd>
  <dt id="dev.hdaa._d.gpi_state"><var class="Va">dev.hdaa.%d.gpi_state</var></dt>
  <dd>Current state of GPI lines.</dd>
  <dt id="dev.hdaa._d.gpio_state"><var class="Va">dev.hdaa.%d.gpio_state</var></dt>
  <dd>Current state of GPIO lines.</dd>
  <dt id="dev.hdaa._d.gpio_config"><var class="Va">dev.hdaa.%d.gpio_config</var></dt>
  <dd>Run-time equivalent of the <var class="Va">hint.hdaa.%d.gpio.config</var>
      tunable.</dd>
  <dt id="dev.hdaa._d.gpo_state"><var class="Va">dev.hdaa.%d.gpo_state</var></dt>
  <dd>Current state of GPO lines.</dd>
  <dt id="dev.hdaa._d.nid_d_config"><var class="Va">dev.hdaa.%d.nid%d_config</var></dt>
  <dd>Run-time equivalent of the <var class="Va">hint.hdaa.%d.nid%d.config</var>
      tunable.</dd>
  <dt id="dev.hdaa._d.nid_d_original"><var class="Va">dev.hdaa.%d.nid%d_original</var></dt>
  <dd>Original pin configuration written by BIOS.</dd>
  <dt id="dev.hdaa._d.reconfig"><var class="Va">dev.hdaa.%d.reconfig</var></dt>
  <dd>Setting this to a non-zero value makes driver to destroy existing pcm
      devices and process new pins configuration set via
      <var class="Va">dev.hdaa.%d.nid%d_config</var>.</dd>
  <dt id="dev.pcm._d.play.32bit"><var class="Va">dev.pcm.%d.play.32bit</var>,
    <var class="Va">dev.pcm.%d.rec.32bit</var></dt>
  <dd>HDA controller uses 32bit representation for all samples of more then 16
      bits. These variables allow to specify how many bits of these 32 should be
      used by CODEC. Depending on codec capabilities, possible values are 20, 24
      and 32 bit. The default value is 24.</dd>
  <dt id="dev.pcm._d.rec.autosrc"><var class="Va">dev.pcm.%d.rec.autosrc</var></dt>
  <dd>Run-time equivalent of the <var class="Va">hint.pcm.%d.rec.autosrc</var>
      tunable.</dd>
</dl>
</div>
</section>
</section>
<section class="Sh">
<h1 class="Sh" id="HARDWARE"><a class="permalink" href="#HARDWARE">HARDWARE</a></h1>
<p class="Pp">The <code class="Nm">snd_hda</code> driver supports PCI class 04h
    (multimedia), subclass 03h (HDA) audio controllers and codecs compatible
    with the Intel High Definition Audio 1.0 specification.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
<p class="Pp">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 connector). All
    codec pins are reversible (could be configured either as input or
  output).</p>
<p class="Pp">So high codec uniformity and flexibility allow driver to configure
    it in many different ways, depending on requested pins usage described by
    pins configuration. The driver reports such default pin configuration when
    verbose messages enabled:</p>
<div class="Bd Pp Li">
<pre>hdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa0: 20 01014020 2  0  Line-out      Jack  1/8     Rear       Green   0
hdaa0: 21 99130110 1  0  Speaker       Fixed ATAPI   Onboard    Unknown 1
hdaa0: 22 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0: 23 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0: 24 01a19830 3  0  Mic           Jack  1/8     Rear       Pink    8
hdaa0: 25 02a1983f 3  15 Mic           Jack  1/8     Front      Pink    8
hdaa0: 26 01813031 3  1  Line-in       Jack  1/8     Rear       Blue    0
hdaa0: 27 0221401f 1  15 Headphones    Jack  1/8     Front      Green   0
hdaa0: 28 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0: 30 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0: 31 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA</pre>
</div>
<p class="Pp">Here we can see, that the nodes with ID (nid) 25 and 27 are front
    panel connectors (Jack, Front), nids 20, 24 and 26 are rear panel connectors
    (Jack, Rear) and nid 21 is a built-in speaker (Fixed, Onboard). Pins with
    nids 22, 23, 28, 30 and 31 will be disabled by driver due to
    &quot;None&quot; connectivity. So the pin count and description matches to
    connectors that we have.</p>
<p class="Pp">Using association (as) and sequence (seq) fields values pins are
    grouped into 3 associations:</p>
<div class="Bd Pp Li">
<pre>hdaa0: Association 0 (1) out:
hdaa0:   Pin nid=21 seq=0
hdaa0:   Pin nid=27 seq=15
hdaa0: Association 1 (2) out:
hdaa0:   Pin nid=20 seq=0
hdaa0: Association 2 (3) in:
hdaa0:   Pin nid=24 seq=0
hdaa0:   Pin nid=26 seq=1
hdaa0:   Pin nid=25 seq=15</pre>
</div>
<p class="Pp">Each <a class="Xr">pcm(4)</a> device uses two associations: one
    for playback and one for recording. Associations processed and assigned to
    <a class="Xr">pcm(4)</a> devices in increasing numerical order. In this case
    association #0 (1) will become <code class="Li">pcm0</code> device playback,
    using the internal speakers and <var class="Ar">Headphones</var> jack with
    speaker automute on the headphones jack connection. Association #1 (2) will
    become <code class="Li">pcm1</code> playback, using the
    <var class="Ar">Line-out</var> jack. Association #2 (3) will become
    <code class="Li">pcm0</code> recording, using the external microphones and
    the <var class="Ar">Line-in</var> jack.</p>
<p class="Pp">The <code class="Nm">snd_hda</code> driver provides extensive
    verbose messages to diagnose its operation logic and describe its current
    codec configuration.</p>
<p class="Pp">Using <a class="Xr">device.hints(5)</a> 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:</p>
<section class="Ss">
<h2 class="Ss" id="Example_1"><a class="permalink" href="#Example_1">Example
  1</a></h2>
<p class="Pp">Setting the <a class="Xr">device.hints(5)</a> options</p>
<div class="Bd Pp Li">
<pre>hint.hdac.0.cad0.nid20.config=&quot;as=1&quot;
hint.hdac.0.cad0.nid21.config=&quot;as=2&quot;</pre>
</div>
<p class="Pp">will swap line-out and speaker functions. So the
    <code class="Li">pcm0</code> device will play to the line-out and headphones
    jacks. Line-out will be muted on the headphones jack connection. Recording
    on <code class="Li">pcm0</code> will go from two external microphones and
    line-in jacks. <code class="Li">pcm1</code> playback will go to the internal
    speaker.</p>
</section>
<section class="Ss">
<h2 class="Ss" id="Example_2"><a class="permalink" href="#Example_2">Example
  2</a></h2>
<p class="Pp">Setting the <a class="Xr">device.hints(5)</a> options</p>
<div class="Bd Pp Li">
<pre>hint.hdac.0.cad0.nid20.config=&quot;as=1 seq=15 device=Headphones&quot;
hint.hdac.0.cad0.nid27.config=&quot;as=2 seq=0&quot;
hint.hdac.0.cad0.nid25.config=&quot;as=4 seq=0&quot;</pre>
</div>
<p class="Pp">will split the headphones and one of the microphones to a separate
    device. The <code class="Li">pcm0</code> device will play to the internal
    speaker and to the line-out jack, with speaker automute on the line-out jack
    connection. Recording on <code class="Li">pcm0</code> will use input from
    one external microphone and the line-in jacks. The
    <code class="Li">pcm1</code> device will be completely dedicated to a
    headset (headphones and mic) connected to the front connectors.</p>
</section>
<section class="Ss">
<h2 class="Ss" id="Example_3"><a class="permalink" href="#Example_3">Example
  3</a></h2>
<p class="Pp">Setting the <a class="Xr">device.hints(5)</a> options</p>
<div class="Bd Pp Li">
<pre>hint.hdac.0.cad0.nid20.config=&quot;as=1 seq=0&quot;
hint.hdac.0.cad0.nid26.config=&quot;as=2 seq=0&quot;
hint.hdac.0.cad0.nid27.config=&quot;as=3 seq=0&quot;
hint.hdac.0.cad0.nid25.config=&quot;as=4 seq=0&quot;
hint.hdac.0.cad0.nid24.config=&quot;as=5 seq=0 device=Line-out&quot;
hint.hdac.0.cad0.nid21.config=&quot;as=6 seq=0&quot;</pre>
</div>
<p class="Pp">will give 4 independent devices: <code class="Li">pcm0</code>
    (line-out and line-in), <code class="Li">pcm1</code> (headphones and mic),
    <code class="Li">pcm2</code> (additional line-out via retasked rear mic
    jack), and <code class="Li">pcm3</code> (internal speaker).</p>
</section>
<section class="Ss">
<h2 class="Ss" id="Example_4"><a class="permalink" href="#Example_4">Example
  4</a></h2>
<p class="Pp">Setting the <a class="Xr">device.hints(5)</a> options</p>
<div class="Bd Pp Li">
<pre>hint.hdac.0.cad0.nid20.config=&quot;as=1 seq=0&quot;
hint.hdac.0.cad0.nid24.config=&quot;as=1 seq=1 device=Line-out&quot;
hint.hdac.0.cad0.nid26.config=&quot;as=1 seq=2 device=Line-out&quot;
hint.hdac.0.cad0.nid21.config=&quot;as=2 seq=0&quot;</pre>
</div>
<p class="Pp">will give 2 devices: <code class="Li">pcm0</code> for 5.1 playback
    via 3 rear connectors (line-out and retasked mic and line-in) and headset
    (headphones and mic) at front connectors. <code class="Li">pcm1</code> for
    internal speaker playback. On headphones connection rear connectors will be
    muted.</p>
</section>
</section>
<section class="Sh">
<h1 class="Sh" id="MIXER_CONTROLS"><a class="permalink" href="#MIXER_CONTROLS">MIXER
  CONTROLS</a></h1>
<p class="Pp">Depending on codec configuration, these controls and signal
    sources could be reported to <a class="Xr">sound(4)</a>:</p>
<div class="Bd-indent">
<dl class="Bl-tag">
  <dt id="vol"><var class="Va">vol</var></dt>
  <dd>overall output level (volume)</dd>
  <dt id="rec"><var class="Va">rec</var></dt>
  <dd>overall recording level</dd>
  <dt id="igain"><var class="Va">igain</var></dt>
  <dd>input-to-output monitoring loopback level</dd>
  <dt id="ogain"><var class="Va">ogain</var></dt>
  <dd>external amplifier control</dd>
  <dt id="pcm"><var class="Va">pcm</var></dt>
  <dd>PCM playback</dd>
  <dt id="mix"><var class="Va">mix</var></dt>
  <dd>input mix</dd>
  <dt id="mic"><var class="Va">mic</var></dt>
  <dd>first external or second internal microphone input</dd>
  <dt id="monitor"><var class="Va">monitor</var></dt>
  <dd>first internal or second external microphone input</dd>
  <dt id="line"><var class="Va">line</var>, <var class="Va">line1</var>,
    <var class="Va">line2</var>, <var class="Va">line3</var></dt>
  <dd>analog (line) inputs</dd>
  <dt id="dig1"><var class="Va">dig1</var>, <var class="Va">dig2</var>,
    <var class="Va">dig3</var></dt>
  <dd>digital (S/PDIF, HDMI or DisplayPort) inputs</dd>
  <dt id="cd"><var class="Va">cd</var></dt>
  <dd>CD input</dd>
  <dt id="speaker"><var class="Va">speaker</var></dt>
  <dd>PC speaker input</dd>
  <dt id="phin"><var class="Va">phin</var>, <var class="Va">phout</var>,
    <var class="Va">radio</var>, <var class="Va">video</var></dt>
  <dd>other random inputs</dd>
</dl>
</div>
<p class="Pp">Controls have different precision. Some could be just an on/off
    triggers. Most of controls use logarithmic scale.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
  ALSO</a></h1>
<p class="Pp"><a class="Xr">snd_ich(4)</a>, <a class="Xr">sound(4)</a>,
    <a class="Xr">device.hints(5)</a>, <a class="Xr">loader.conf(5)</a>,
    <a class="Xr">sysctl(8)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">The <code class="Nm">snd_hda</code> device driver first appeared
    in <span class="Ux">FreeBSD 6.3</span>.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
<p class="Pp">The <code class="Nm">snd_hda</code> driver was written by
    <span class="An">Stephane E. Potvin</span>
    &lt;<a class="Mt" href="mailto:sepotvin@videotron.ca">sepotvin@videotron.ca</a>&gt;,
    <span class="An">Ariff Abdullah</span>
    &lt;<a class="Mt" href="mailto:ariff@FreeBSD.org">ariff@FreeBSD.org</a>&gt;
    and <span class="An">Alexander Motin</span>
    &lt;<a class="Mt" href="mailto:mav@FreeBSD.org">mav@FreeBSD.org</a>&gt;.
    This manual page was written by <span class="An">Joel Dahl</span>
    &lt;<a class="Mt" href="mailto:joel@FreeBSD.org">joel@FreeBSD.org</a>&gt;,
    <span class="An">Alexander Motin</span>
    &lt;<a class="Mt" href="mailto:mav@FreeBSD.org">mav@FreeBSD.org</a>&gt; and
    <span class="An">Giorgos Keramidas</span>
    &lt;<a class="Mt" href="mailto:keramida@FreeBSD.org">keramida@FreeBSD.org</a>&gt;.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1>
<p class="Pp">Some Hardware/OEM vendors tend to screw up BIOS settings or use
    custom unusual CODEC wiring that create problems to the driver. This may
    result in missing pcm devices, or a state where the
    <code class="Nm">snd_hda</code> driver seems to attach and work, but no
    sound is played. Some cases can be solved by tuning
    <span class="Pa">loader.conf</span> variables. But before trying to fix
    problem that way, make sure that there really is a problem and that the PCM
    audio device in use really corresponds to the expected audio connector.</p>
<p class="Pp">Some vendors use non-standardized General Purpose I/O (GPIO) pins
    of the codec to control external amplifiers. In some cases setting a
    combination of GPIO bits may be needed to make sound work on a specific
    device.</p>
<p class="Pp">HDMI and DisplayPort audio may also require support from video
    driver.</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">January 20, 2025</td>
    <td class="foot-os">FreeBSD 15.0</td>
  </tr>
</table>