RFC: massive snd_hda driver update to better conform UAA specification

Alexander Motin mav at FreeBSD.org
Tue Aug 12 22:26:20 UTC 2008


I have made major snd_hda driver rewrite. I will be grateful for reviews 
and any positive or negative feedbacks.

Here is my patches: http://people.freebsd.org/~mav/

For 8-CURRENT use:

For 7-STABLE try (I have no place to test it, but it builds):

The main point of this change was to make driver conforming Universal 
Audio Architecture (UAA) specification. UAA gives ability to avoid most 
of device-dependent quirks (I have removed most of) and make driver more 
friendly to a new hardware, more friendly to average user by using 
information written by system integrators and much more configurable for 
experienced users. UAA allows driver to get all configuration 
information directly from HDA codec and configure system audio devices 
according to it. Same time new driver allows easily override default 
configuration using device.hints mechanism.

Second point of this change was to make driver multichannel. Now driver 
supports multiple HDA codecs per controller, multiple function groups 
per codec, multiple PCM devices per audio function group and multiple 
channels per PCM device (last will be useful if FreeBSD OSS sometimes 
will have multichannel support).

To demonstrate features I can show some operation examples from my 
notebook. This is Acer TM6292 with very simple simple Realtek ALC268 HDA 

1. Previous driver gave me:
  - stereo playback (pcm0) via built in speakers and headphones without 
jack sensing;
  - recording device (pcm0) from external mic. Built in mic, CD and line 
in was dead.

2. New driver by default without any quirks gives me:
  - stereo playback (pcm0) via built in speakers and headphones with 
jack sensing;
  - recording device (pcm0) for built in mic (it does working!), line in 
and mic in;
  - recording device (pcm1) for CD. CD does not working for some unknown 
reason, I think it may be just not implemented in hardware.

3. By adding to the loader.conf string
it will be possible (when OSS will have multichannel support) to get 
quadro playback via built in speakers and HP out connector. cad0 here 
means codec with ID 0. nid20 means pin with ID 20 - HP out, seq=1 
changes pin sequence inside association from 15 to 1 effectively 
disabling redirection making HP out independent.

4. By adding
hint.hdac.0.cad0.nid21.config="as=3 seq=1"
it is possible to get two independent playback devices. One (pcm0) for 
HP connector and second (pcm1) for built in speakers. Record will stay 
as before. Here as=3 changes built in speakers pin association number 
from 1 to 3 separating it completely from HP output.

5. By adding
hint.hdac.0.cad0.nid26.config="as=1 seq=0 device=0" 

hint.hdac.0.cad0.nid20.config="as=1 seq=15" 


it is possible to get two independent playback devices. First (pcm0) for 
playback via line in and HP out connectors with jack sensing in HP 
connector and line in connector auto mute. And second (pcm1) for 
playback via built in speakers. In this codec line in connector is 
reversible. String device=0 changes it's description from Line in to 
Line out forcing actual direction change.

Driver allows to build many others usage scenarios. The main limitation 
factor is codec functionality. Presented ALC268 is very simple and 
restricted one. But I have also successfully tested it on more powerful 
AD1988 and there range of possible scenarios is wider while even default 
configuration covers all present codec functionality.

More information about UAA you can find at:

If you will have any questions/problems boot your system with verbose 
logging. Driver prints a lot of usable information there. If you will 
send me problem reports add please attach that verbose boot output and 
`cat /dev/sndstat` output to your message.


Alexander Motin

More information about the freebsd-multimedia mailing list