Solved Internal speakers work, Headphones don't!

Hi I installed FreeBSD 12.1 on HP 800 G2 Desktop everything works fine but the audio jack input/output. The box has 4 and none is working. The internal speaker works fine but headphones don't. Any help would be appreciated

dmesg sound:
Code:
hdacc1: <Realtek ALC221 HDA CODEC> at cad 0 on hdac1
hdaa1: <Realtek ALC221 Audio Function Group> at nid 1 on hdacc1
pcm4: <Realtek ALC221 (Analog)> at nid 23 and 26,27 on hdaa1
pcm5: <Realtek ALC221 (Analog 2.0+HP)> at nid 20,33 on hdaa1
hdacc2: <Intel Skylake HDA CODEC> at cad 2 on hdac1
hdaa2: <Intel Skylake Audio Function Group> at nid 1 on hdacc2
pcm6: <Intel Skylake (HDMI/DP 8ch)> at nid 3 on hdaa2

cat /dev/sndstat
Code:
Installed devices:
pcm0: <NVIDIA (0x0080) (HDMI/DP 8ch)> (play)
pcm1: <NVIDIA (0x0080) (HDMI/DP 8ch)> (play)
pcm2: <NVIDIA (0x0080) (HDMI/DP 8ch)> (play)
pcm3: <NVIDIA (0x0080) (HDMI/DP 8ch)> (play)
pcm4: <Realtek ALC221 (Analog)> (play/rec) default
pcm5: <Realtek ALC221 (Analog 2.0+HP)> (play)
pcm6: <Intel Skylake (HDMI/DP 8ch)> (play)
No devices installed from userspace.

sysctl -a | grep snd
Code:
device    snd_cmi
device    snd_csa
device    snd_emu10kx
device    snd_es137x
device    snd_hda
device    snd_ich
device    snd_via8233
hw.snd.maxautovchans: 16
hw.snd.default_unit: 4
hw.snd.version: 2009061500/amd64
hw.snd.default_auto: 1
hw.snd.verbose: 0
hw.snd.vpc_mixer_bypass: 1
hw.snd.feeder_rate_quality: 1
hw.snd.feeder_rate_round: 25
hw.snd.feeder_rate_max: 2016000
hw.snd.feeder_rate_min: 1
hw.snd.feeder_rate_polyphase_max: 183040
hw.snd.feeder_rate_presets: 100:8:0.85 100:36:0.92 100:164:0.97
hw.snd.feeder_eq_exact_rate: 0
hw.snd.feeder_eq_presets: PEQ:16000,0.2500,62,0.2500:-9,9,1.0:44100,48000,88200,96000,176400,192000
hw.snd.basename_clone: 1
hw.snd.compat_linux_mmap: 0
hw.snd.syncdelay: -1
hw.snd.usefrags: 0
hw.snd.vpc_reset: 0
hw.snd.vpc_0db: 45
hw.snd.vpc_autoreset: 1
hw.snd.timeout: 5
hw.snd.latency_profile: 1
hw.snd.latency: 2
hw.snd.report_soft_matrix: 1
hw.snd.report_soft_formats: 1

sysctl -a | grep hda

Code:
device    snd_hda
irq264: hdac0:263 @cpu0(domain0): 23
irq267: hdac1:269 @cpu0(domain0): 1697
dev.pcm.6.%parent: hdaa2
dev.pcm.5.%parent: hdaa1
dev.pcm.4.%parent: hdaa1
dev.pcm.3.%parent: hdaa0
dev.pcm.2.%parent: hdaa0
dev.pcm.1.%parent: hdaa0
dev.pcm.0.%parent: hdaa0
dev.hdaa.2.reconfig: 0
dev.hdaa.2.gpo_config:
dev.hdaa.2.gpo_state:
dev.hdaa.2.gpio_config:
dev.hdaa.2.gpio_state:
dev.hdaa.2.gpi_state:
dev.hdaa.2.config: forcestereo,ivref50,ivref80,ivref100,ivref,vref
dev.hdaa.2.nid3_original: 0x18560010 as=1 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.2.nid3_config: 0x18560010 as=1 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.2.nid3: pin: Digital-out (Jack)
dev.hdaa.2.nid2: audio output
dev.hdaa.2.%parent: hdacc2
dev.hdaa.2.%pnpinfo: type=0x01 subsystem=0x80860101
dev.hdaa.2.%location: nid=1
dev.hdaa.2.%driver: hdaa
dev.hdaa.2.%desc: Intel Skylake Audio Function Group
dev.hdaa.1.reconfig: 0
dev.hdaa.1.gpo_config:
dev.hdaa.1.gpo_state:
dev.hdaa.1.gpio_config: 0=keep 1=keep 2=keep 3=keep
dev.hdaa.1.gpio_state: 0=disabled 1=disabled 2=disabled 3=disabled
dev.hdaa.1.gpi_state:
dev.hdaa.1.config: forcestereo,ivref50,ivref80,ivref100,ivref,vref
dev.hdaa.1.nid35: audio selector
dev.hdaa.1.nid34: audio selector [DISABLED]
dev.hdaa.1.nid33_original: 0x0221102f as=2 seq=15 device=Headphones conn=Jack ctype=1/8 loc=Front color=Black misc=0
dev.hdaa.1.nid33_config: 0x0221102f as=2 seq=15 device=Headphones conn=Jack ctype=1/8 loc=Front color=Black misc=0
dev.hdaa.1.nid33: pin: Headphones (Black Jack)
dev.hdaa.1.nid32: vendor widget [DISABLED]
dev.hdaa.1.nid31: vendor widget [DISABLED]
dev.hdaa.1.nid30_original: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.1.nid30_config: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.1.nid30: pin: Speaker (None) [DISABLED]
dev.hdaa.1.nid29_original: 0x40500001 as=0 seq=1 device=Digital-out conn=None ctype=Unknown loc=0x00 color=Unknown misc=0
dev.hdaa.1.nid29_config: 0x40500001 as=0 seq=1 device=Digital-out conn=None ctype=Unknown loc=0x00 color=Unknown misc=0
dev.hdaa.1.nid29: beep widget
dev.hdaa.1.nid28: vendor widget [DISABLED]
dev.hdaa.1.nid27_original: 0x0181303f as=3 seq=15 device=Line-in conn=Jack ctype=1/8 loc=Rear color=Blue misc=0
dev.hdaa.1.nid27_config: 0x0181303f as=3 seq=15 device=Line-in conn=Jack ctype=1/8 loc=Rear color=Blue misc=0
dev.hdaa.1.nid27: pin: Line-in (Blue Jack)
dev.hdaa.1.nid26_original: 0x02a11030 as=3 seq=0 device=Mic conn=Jack ctype=1/8 loc=Front color=Black misc=0
dev.hdaa.1.nid26_config: 0x02a11030 as=3 seq=0 device=Mic conn=Jack ctype=1/8 loc=Front color=Black misc=0
dev.hdaa.1.nid26: pin: Mic (Black Jack)
dev.hdaa.1.nid25_original: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.1.nid25_config: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.1.nid25: pin: Speaker (None) [DISABLED]
dev.hdaa.1.nid24_original: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.1.nid24_config: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.1.nid24: pin: Speaker (None) [DISABLED]
dev.hdaa.1.nid23_original: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
dev.hdaa.1.nid23_config: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
dev.hdaa.1.nid23: pin: Speaker (Fixed)
dev.hdaa.1.nid22: vendor widget [DISABLED]
dev.hdaa.1.nid21: vendor widget [DISABLED]
dev.hdaa.1.nid20_original: 0x01014020 as=2 seq=0 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Green misc=0
dev.hdaa.1.nid20_config: 0x01014020 as=2 seq=0 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Green misc=0
dev.hdaa.1.nid20: pin: Line-out (Green Jack)
dev.hdaa.1.nid19: vendor widget [DISABLED]
dev.hdaa.1.nid18_original: 0x403c0000 as=0 seq=0 device=CD conn=None ctype=0xc loc=0x00 color=Unknown misc=0
dev.hdaa.1.nid18_config: 0x403c0000 as=0 seq=0 device=CD conn=None ctype=0xc loc=0x00 color=Unknown misc=0
dev.hdaa.1.nid18: pin: CD (None) [DISABLED]
dev.hdaa.1.nid17: vendor widget [DISABLED]
dev.hdaa.1.nid16: vendor widget [DISABLED]
dev.hdaa.1.nid15: audio mixer
dev.hdaa.1.nid14: vendor widget [DISABLED]
dev.hdaa.1.nid13: audio mixer
dev.hdaa.1.nid12: audio mixer [DISABLED]
dev.hdaa.1.nid11: audio mixer
dev.hdaa.1.nid10: vendor widget [DISABLED]
dev.hdaa.1.nid9: audio input [DISABLED]
dev.hdaa.1.nid8: audio input
dev.hdaa.1.nid7: vendor widget [DISABLED]
dev.hdaa.1.nid6: audio output [DISABLED]
dev.hdaa.1.nid5: vendor widget [DISABLED]
dev.hdaa.1.nid4: vendor widget [DISABLED]
dev.hdaa.1.nid3: audio output
dev.hdaa.1.nid2: audio output
dev.hdaa.1.%parent: hdacc1
dev.hdaa.1.%pnpinfo: type=0x01 subsystem=0x103c805d
dev.hdaa.1.%location: nid=1
dev.hdaa.1.%driver: hdaa
dev.hdaa.1.%desc: Realtek ALC221 Audio Function Group
dev.hdaa.0.reconfig: 0
dev.hdaa.0.gpo_config:
dev.hdaa.0.gpo_state:
dev.hdaa.0.gpio_config:
dev.hdaa.0.gpio_state:
dev.hdaa.0.gpi_state:
dev.hdaa.0.config: forcestereo,ivref50,ivref80,ivref100,ivref,vref
dev.hdaa.0.nid13: audio output
dev.hdaa.0.nid12: audio output
dev.hdaa.0.nid11: audio output
dev.hdaa.0.nid10: audio output
dev.hdaa.0.nid9_original: 0x585600f0 as=15 seq=0 device=Digital-out conn=None ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid9_config: 0x585600f0 as=15 seq=0 device=Digital-out conn=None ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid9: pin: Digital-out (None) [DISABLED]
dev.hdaa.0.nid8_original: 0x585600f0 as=15 seq=0 device=Digital-out conn=None ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid8_config: 0x585600f0 as=15 seq=0 device=Digital-out conn=None ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid8: pin: Digital-out (None) [DISABLED]
dev.hdaa.0.nid7_original: 0x185600f0 as=15 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid7_config: 0x185600f0 as=15 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid7: pin: Digital-out (Jack)
dev.hdaa.0.nid6_original: 0x185600f0 as=15 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid6_config: 0x185600f0 as=15 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid6: pin: Digital-out (Jack)
dev.hdaa.0.nid5_original: 0x185600f0 as=15 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid5_config: 0x185600f0 as=15 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid5: pin: Digital-out (Jack)
dev.hdaa.0.nid4_original: 0x185600f0 as=15 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid4_config: 0x185600f0 as=15 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid4: pin: Digital-out (Jack)
dev.hdaa.0.%parent: hdacc0
dev.hdaa.0.%pnpinfo: type=0x01 subsystem=0x14583746
dev.hdaa.0.%location: nid=1
dev.hdaa.0.%driver: hdaa
dev.hdaa.0.%desc: NVIDIA (0x0080) Audio Function Group
dev.hdaa.%parent:
dev.hdacc.2.%parent: hdac1
dev.hdacc.2.%pnpinfo: vendor=0x8086 device=0x2809 revision=0x00 stepping=0x00
dev.hdacc.2.%location: cad=2
dev.hdacc.2.%driver: hdacc
dev.hdacc.2.%desc: Intel Skylake HDA CODEC
dev.hdacc.1.%parent: hdac1
dev.hdacc.1.%pnpinfo: vendor=0x10ec device=0x0221 revision=0x01 stepping=0x03
dev.hdacc.1.%location: cad=0
dev.hdacc.1.%driver: hdacc
dev.hdacc.1.%desc: Realtek ALC221 HDA CODEC
dev.hdacc.0.%parent: hdac0
dev.hdacc.0.%pnpinfo: vendor=0x10de device=0x0080 revision=0x01 stepping=0x00
dev.hdacc.0.%location: cad=0
dev.hdacc.0.%driver: hdacc
dev.hdacc.0.%desc: NVIDIA (0x0080) HDA CODEC
dev.hdacc.%parent:
dev.hdac.1.polling: 0
dev.hdac.1.pindump: 0
dev.hdac.1.wake: 0
dev.hdac.1.%parent: pci0
dev.hdac.1.%pnpinfo: vendor=0x8086 device=0xa170 subvendor=0x103c subdevice=0x805d class=0x040300
dev.hdac.1.%location: slot=31 function=3 dbsf=pci0:0:31:3 handle=\_SB_.PCI0.HDAS
dev.hdac.1.%driver: hdac
dev.hdac.1.%desc: Intel Sunrise Point HDA Controller
dev.hdac.0.polling: 0
dev.hdac.0.pindump: 0
dev.hdac.0.%parent: pci1
dev.hdac.0.%pnpinfo: vendor=0x10de device=0x0fb9 subvendor=0x1458 subdevice=0x3746 class=0x040300
dev.hdac.0.%location: slot=0 function=1 dbsf=pci0:1:0:1 handle=\_SB_.PCI0.PEG0.HDAU
dev.hdac.0.%driver: hdac
dev.hdac.0.%desc: NVIDIA (0x0fb9) HDA Controller
dev.hdac.%parent:

I think the /boot/device.hints has to do with it, I tried adding those hints (which I'm sure are wrong) and of course didn't help
Code:
hint.hdac.0.cad0.nid20.config="as=1"
hint.hdac.0.cad0.nid33.config="as=1 seq=15"

Thanks so much
 
I think the /boot/device.hints has to do with it
Yes, the trouble with snd_hda(4) is that it's a really generic driver. The chipset itself allows for a lot of customization by OEMs and pins can be configured and re-assigned completely differently. So it's going to take quite a bit of fiddling to make it work correctly for your system.
 
Yes, the trouble with snd_hda(4) is that it's a really generic driver. The chipset itself allows for a lot of customization by OEMs and pins can be configured and re-assigned completely differently. So it's going to take quite a bit of fiddling to make it work correctly for your system.
SirDice, what I can do? any hints
 
I don't have equipment with the same snd_hda(4) driver so I have to do things from memory and reading the man pages.

If I recall correctly you need to do a "verbose" boot first, that will provide a lot of information when the driver is loaded. Add to /boot/loader.conf:
Code:
verbose_loading="YES"
Then reboot and check dmesg(8) afterwards. The verbose boot should provide some additional information like this:
Code:
     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

Post that info here so we can have a look at it too.
 
You have 3 chips with Audio capability:

0. NVIDIA (0x0080) HDMI/DP 8ch
1. Realtek ALC221 HDA CODEC
2. Intel Skylake HDMI/DP 8ch - this is System on Chip (SoC).

These are subdivided to a total of 7 devices
cat /dev/sndstat
Code:
Installed devices:
pcm0: <NVIDIA (0x0080) (HDMI/DP 8ch)> (play)
pcm1: <NVIDIA (0x0080) (HDMI/DP 8ch)> (play)
pcm2: <NVIDIA (0x0080) (HDMI/DP 8ch)> (play)
pcm3: <NVIDIA (0x0080) (HDMI/DP 8ch)> (play)
pcm4: <Realtek ALC221 (Analog)> (play/rec) default
pcm5: <Realtek ALC221 (Analog 2.0+HP)> (play)
pcm6: <Intel Skylake (HDMI/DP 8ch)> (play)
No devices installed from userspace.
By default, FreeBSD just utilizes one device: pcm0. The OP stated "speakers work" but speakers could be on the Monitor via an HDMI feed or separate speakers from the back panel jack. Can you pin this down?

Overall, you need to determine which device is wired to the internal speakers and which is wired to the HP jack. Additional info can be gleaned by changing the default device. Section 7.2 in the handbook will walk you through it.
# sysctl hw.snd.default_unit=n
 
Overall, you need to determine which device is wired to the internal speakers and which is wired to the HP jack. Additional info can be gleaned by changing the default device. Section 7.2 in the handbook will walk you through it.
# sysctl hw.snd.default_unit=n
Thanks I will go through section 7.2 and see if I can get it working.
 
I don't have equipment with the same snd_hda(4) driver so I have to do things from memory and reading the man pages.

If I recall correctly you need to do a "verbose" boot first, that will provide a lot of information when the driver is loaded. Add to /boot/loader.conf:
Code:
verbose_loading="YES"
Then reboot and check dmesg(8) afterwards. The verbose boot should provide some additional information like this:
Code:
     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

Post that info here so we can have a look at it too.
I managed to get the front one working by adding the below hints going through snd_hda(4)
hint.hdac.1.cad0.nid30.config="as=0" hint.hdac.1.cad0.nid33.config="as=1 seq=15 device=Headphones"


Sirdice, I added the verbose_loading="YES" but not getting the info you showed up in dmesg? any help regarding that.
 
dev.hdaa.1.nid33_original: 0x0221102f as=2 seq=15 device=Headphones conn=Jack ctype=1/8 loc=Front color=Black misc=0 dev.hdaa.1.nid33_config: 0x0221102f as=2 seq=15 device=Headphones conn=Jack ctype=1/8 loc=Front color=Black misc=0 dev.hdaa.1.nid33: pin: Headphones (Black Jack)
dev.hdaa.1.nid30_original: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1 dev.hdaa.1.nid30_config: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1 dev.hdaa.1.nid30: pin: Speaker (None) [DISABLED]
If you are using the rear 1/8 jack (nwid 30) for your speakers, put them in same group as the headphones. Keep the front headphones (nwid 33) seq=15. Your default audio will be through the speakers and will automatically mute when you plug in the headphones. You could do this by changing the nwid30 as=0 -> as=1.

Code:
hint.hdac.1.cad0.nid30.config="as=1"

In your original post pcm4 was the default and pcm1 was "auto" so this should work. If not try pcm1 as the default.
hw.snd.default_unit: 4
hw.snd.version: 2009061500/amd64
hw.snd.default_auto: 1

More info in snd_hda(4)
 
If you are using the rear 1/8 jack (nwid 30) for your speakers, put them in same group as the headphones. Keep the front headphones (nwid 33) seq=15. Your default audio will be through the speakers and will automatically mute when you plug in the headphones. You could do this by changing the nwid30 as=0 -> as=1.

Code:
hint.hdac.1.cad0.nid30.config="as=1"

In your original post pcm4 was the default and pcm1 was "auto" so this should work. If not try pcm1 as the default.
hw.snd.default_unit: 4
hw.snd.version: 2009061500/amd64
hw.snd.default_auto: 1

More info in snd_hda(4)
I tried the above and add the extra configuration, still one front jack is working. It mutes the speakers. Ideally I love to have the
Rear ones to work, but I'm not sure I have yet the full understanding of the sound configuration. I need to try more.
 
You have to group the headphone and speakers into the same association for seq=15 to work. I think it was overlooked, but it was not clear to me where your speakers are plugged in and this matters. You could be using an HDMI monitor with speakers plugged into the nVidia card or the onboard Intel video. If you are using the rear 1/8 jack, then your are most likely using the Realtek chip. Each one of these has a different as= *. Your headphones are using the Realtek chip. You need to assign the headphones the same as= as the speakers your are using and make this association the default.
 
I did little research on this topic. Here is my device.hints
Code:
#Front
hint.hdaa.1.nid20.config="as=1 seq=0"
#Center
hint.hdaa.1.nid22.config="as=1 seq=1"
#Back/rear
hint.hdaa.1.nid21.config="as=1 seq=2"
#Side
hint.hdaa.1.nid23.config="as=1 seq=4"
#Headphones
hint.hdaa.1.nid27.config="as=1 seq=15"

I have 7.1 speakers connected to my soundcard, with headphones on front connector.
Easy to modify this to your needs, u just need to find which nid is what in your setup.
Seq numbers were took from snd_hda manual. Number 15 is special case, as when u connect headphones it mutes other outputs and play on this connector.
 
Back
Top