Making sense of snd_hda device.hints

I've got a new system with an Intel DQ45CB motherboard. I am running 7.1-STABLE. The board has Intel HDA audio, which is working nicely out the back speakers. The only problem is that I also want to use headphone out of the front panel. Ideally, plugging in the phones should mute the back speakers.

I've looked at snd_hda manpage, and I don't understand it. It was not written for end users. Apparently I need to set a sdevice hint, but I can't figure out the magic numbers. All I want to know is how to use the headphones! Can someone please help?

Here is the information I have:

Code:
cat /dev/sndstat
FreeBSD Audio Driver (newpcm: 32bit 2007061600/i386)
Installed devices:
pcm0: <HDA Analog Devices AD1882 PCM #0 Analog> at cad 2 nid 1 on hdac0 kld snd_hda [MPSAFE] (1p:4v/1r:1v channels duplex default)
pcm1: <HDA Analog Devices AD1882 PCM #1 Analog> at cad 2 nid 1 on hdac0 kld snd_hda [MPSAFE] (1p:1v/1r:1v channels duplex)

Code:
From verbose dmesg:
hdac0: GPIO: 0x40000002 NumGPIO=2 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1
hdac0:  nid 17 0x02214030 as  3 seq  0    Headphones  Jack jack  1 loc  2 color   Green misc 0
hdac0:  nid 18 0x01014010 as  1 seq  0      Line-out  Jack jack  1 loc  1 color   Green misc 0
hdac0:  nid 19 0x511711f0 as 15 seq  0       Speaker  None jack  7 loc 17 color   Black misc 1
hdac0:  nid 20 0x02a19040 as  4 seq  0           Mic  Jack jack  1 loc  2 color    Pink misc 0
hdac0:  nid 21 0x0181302e as  2 seq 14       Line-in  Jack jack  1 loc  1 color    Blue misc 0
hdac0:  nid 22 0x41011012 as  1 seq  2      Line-out  None jack  1 loc  1 color   Black misc 0
hdac0:  nid 23 0x01a19020 as  2 seq  0           Mic  Jack jack  1 loc  1 color    Pink misc 0
hdac0:  nid 24 0x59331122 as  2 seq  2            CD  None jack  3 loc 25 color   Black misc 1
hdac0: Patching widget caps nid=26 0x00400000 -> 0x00700000
hdac0:  nid 27 0x4145f1a0 as 10 seq  0     SPDIF-out  None jack  5 loc  1 color   Other misc 1
hdac0: GHOST: nid=29 j=0 entnum=4 index=0 res=0x00000b01
hdac0: Adding 58 (nid=35): Max connection reached! max=32
hdac0:  nid 36 0x41016011 as  1 seq  1      Line-out  None jack  1 loc  1 color  Orange misc 0
hdac0: Patched pins configuration:
hdac0:  nid 17 0x02214030 as  3 seq  0    Headphones  Jack jack  1 loc  2 color   Green misc 0
hdac0:  nid 18 0x01014010 as  1 seq  0      Line-out  Jack jack  1 loc  1 color   Green misc 0
hdac0:  nid 19 0x511711f0 as 15 seq  0       Speaker  None jack  7 loc 17 color   Black misc 1 [DISABLED]
hdac0:  nid 20 0x02a19040 as  4 seq  0           Mic  Jack jack  1 loc  2 color    Pink misc 0
hdac0:  nid 21 0x0181302e as  2 seq 14       Line-in  Jack jack  1 loc  1 color    Blue misc 0
hdac0:  nid 22 0x41011012 as  1 seq  2      Line-out  None jack  1 loc  1 color   Black misc 0 [DISABLED]
hdac0:  nid 23 0x01a19020 as  2 seq  0           Mic  Jack jack  1 loc  1 color    Pink misc 0
hdac0:  nid 24 0x59331122 as  2 seq  2            CD  None jack  3 loc 25 color   Black misc 1 [DISABLED]
hdac0:  nid 27 0x4145f1a0 as 10 seq  0     SPDIF-out  None jack  5 loc  1 color   Other misc 1 [DISABLED]
hdac0:  nid 36 0x41016011 as  1 seq  1      Line-out  None jack  1 loc  1 color  Orange misc 0 [DISABLED]
hdac0: 4 associations found:
hdac0: Association 0 (1) out:
hdac0:  Pin nid=18 seq=0
hdac0: Association 1 (2) in:
hdac0:  Pin nid=23 seq=0
hdac0:  Pin nid=21 seq=14
hdac0: Association 2 (3) out:
hdac0:  Pin nid=17 seq=0
hdac0: Association 3 (4) in:
hdac0:  Pin nid=20 seq=0
hdac0: Tracing association 0 (1)
hdac0:  Pin 18 traced to DAC 4
hdac0: Association 0 (1) trace succeded
hdac0: Tracing association 1 (2)
hdac0:  Pin 23 traced to ADC 8
hdac0:  Pin 21 traced to ADC 8
hdac0: Association 1 (2) trace succeded
hdac0: Tracing association 2 (3)
hdac0:  Pin 17 traced to DAC 3
hdac0: Association 2 (3) trace succeded
hdac0: Tracing association 3 (4)
hdac0:  Pin 20 traced to ADC 9
hdac0: Association 3 (4) trace succeded
hdac0: Tracing input monitor
hdac0:  Tracing nid 32 to out
hdac0:  nid 32 is input monitor
hdac0: Tracing beeper
hdac0:  nid 26 traced to out

Thanks!
 
Figured it out. Here are the hints I needed to make the front panel ports behave:

hint.hdac.0.cad2.nid17.config="as=1 seq=15 device=Headphones"
hint.hdac.0.cad2.nid20.config="as=2 seq=15"

p.s. This is a task that could REALLY use a user interface of some kind.
 
Back
Top