# ALC892 Yet Another snd_hda 5.1 cry for help



## schrodinger (Jan 9, 2013)

Hi everyone. Happy new year!

I am trying to get 5.1 sound working at home. I have a 7.1 card on board and a 6.1 speaker set. My problem right now is that I can only hear audio from two front speakers and then a lot of "bad" (too much) bass.

I have read the manuals, the forums posts and the mailing lists - but I am comfortable enough to admit that I just don't know what I am doing. I just upgraded my Star Trek collection to HD and I would love to hear the hum of the Enterprise. Please help! 

Here it the information as best I can gather.

Motherboard:

 ASUS P8Z68-V PRO/GEN3


Sound card:
Realtek ALC892
HD Audio (8-channel)
DTS Surround Sensation UltraPC, High Definition Audio


Speakers:
 Logitech X-620 Manual: https://konundrum.org/X-620.pdf

The manual states :



> 6-channel (5.1) sound card: Connect all 3 colored plugs from the audio input cable to the color-coded jacks on the sound card. Select 5.1 on the source selector switch.



The colours on the end of the audio input cables are green, orange and black.

`$ uname -a"
FreeBSD pegasus.konundrum.org 9.0-STABLE FreeBSD 9.0-STABLE #2: Mon Mar 12 02:44:55 GMT 2012     root@pegasus:/usr/obj/usr/src/sys/PEGASUS  amd64`

`$ cat /dev/sndstat
FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
Installed devices:
pcm0: <HDA NVidia (Unknown) PCM #0 DisplayPort> (play)
pcm1: <HDA NVidia (Unknown) PCM #0 DisplayPort> (play)
pcm2: <HDA NVidia (Unknown) PCM #0 DisplayPort> (play)
pcm3: <HDA NVidia (Unknown) PCM #0 DisplayPort> (play)
pcm4: <HDA Realtek ALC892 PCM #0 Analog> (play/rec) default
pcm5: <HDA Realtek ALC892 PCM #1 Analog> (play/rec)
pcm6: <HDA Realtek ALC892 PCM #2 Digital> (play)
pcm7: <HDA Realtek ALC892 PCM #3 Digital> (play)

verbose=2

pcm4: <HDA Realtek ALC892 PCM #0 Analog> at cad 0 nid 1 on hdac1 kld snd_hda (1p:1v/1r:1v) default
snddev flags=0x2e2<AUTOVCHAN,BUSY,MPSAFE,REGISTERED,VPC>
[pcm4:play:dsp4.p0]: spd 48000, fmt 0x02600010, flags 0x00002100, 0x00000004
interrupts 0, underruns 0, feed 0, ready 0 [b:7680/3840/2|bs:8184/4092/2]
channel flags=0x2100<BUSY,HAS_VCHAN>
{userland} -> feeder_mixer(0x02600010) -> {hardware}
pcm4:play:dsp4.p0[pcm4:virtual:dsp4.vp0]: spd 8000, fmt 0x00100008, flags 0x10000000, 0x00000000
interrupts 0, underruns 0, feed 0, ready 0 [b:0/0/0|bs:0/0/0]
channel flags=0x10000000<VIRTUAL>
{userland} -> feeder_root(0x00000000) -> {hardware}
[pcm4:record:dsp4.r0]: spd 48000, fmt 0x00200010, flags 0x00002100, 0x00000005
interrupts 0, overruns 0, feed 0, hfree 4096, sfree 4096 [b:4096/2048/2|bs:4096/2048/2]
channel flags=0x2100<BUSY,HAS_VCHAN>
{hardware} -> feeder_root(0x00200010) -> feeder_mixer(0x00200010) -> {userland}
pcm4:record:dsp4.r0[pcm4:virtual:dsp4.vr0]: spd 8000, fmt 0x00100008, flags 0x10000000, 0x00000000
interrupts 0, overruns 0, feed 0, hfree 0, sfree 0 [b:0/0/0|bs:0/0/0]
channel flags=0x10000000<VIRTUAL>
{hardware} -> feeder_root(0x00000000) -> {userland}`


`$ sysctl dev.hdac.1
dev.hdac.1.%desc: Intel Cougar Point High Definition Audio Controller
dev.hdac.1.%driver: hdac
dev.hdac.1.%location: slot=27 function=0
dev.hdac.1.%pnpinfo: vendor=0x8086 device=0x1c20 subvendor=0x1043 subdevice=0x8410 class=0x040300
dev.hdac.1.%parent: pci0
dev.hdac.1.polling: 0
dev.hdac.1.polling_interval: 250
dev.hdac.1.pindump: 0`

`$ sysctl dev.hdac.1.pindump=1
hdac1: Dumping AFG cad=0 nid=1 pins:
hdac1:  nid 17 0x99430140 as  4 seq  0     SPDIF-out Fixed jack  3 loc 25 color Unknown misc 1
hdac1:        Caps:    OUT
hdac1:  nid 18 0x411111f0 as 15 seq  0       Speaker  None jack  1 loc  1 color   Black misc 1 [DISABLED]
hdac1:        Caps: IN
hdac1:  nid 20 0x01014010 as  1 seq  0      Line-out  Jack jack  1 loc  1 color   Green misc 0
hdac1:        Caps: IN OUT HP EAPD      Sense: 0x80000000
hdac1:  nid 21 0x01011012 as  1 seq  2      Line-out  Jack jack  1 loc  1 color   Black misc 0
hdac1:        Caps: IN OUT              Sense: 0x80000000
hdac1:  nid 22 0x01016011 as  1 seq  1      Line-out  Jack jack  1 loc  1 color  Orange misc 0
hdac1:        Caps: IN OUT              Sense: 0x00000000
hdac1:  nid 23 0x01012014 as  1 seq  4      Line-out  Jack jack  1 loc  1 color    Grey misc 0
hdac1:        Caps: IN OUT              Sense: 0x80000000
hdac1:  nid 24 0x01a19850 as  5 seq  0           Mic  Jack jack  1 loc  1 color    Pink misc 8
hdac1:        Caps: IN OUT         VREF Sense: 0x00000000
hdac1:  nid 25 0x02a19c60 as  6 seq  0           Mic  Jack jack  1 loc  2 color    Pink misc 12
hdac1:        Caps: IN OUT HP      VREF Sense: 0x00000000
hdac1:  nid 26 0x0181305f as  5 seq 15       Line-in  Jack jack  1 loc  1 color    Blue misc 0
hdac1:        Caps: IN OUT         VREF Sense: 0x00000000
hdac1:  nid 27 0x02214c20 as  2 seq  0    Headphones  Jack jack  1 loc  2 color   Green misc 12
hdac1:        Caps: IN OUT HP EAPD VREF Sense: 0x00000000
hdac1:  nid 28 0x411111f0 as 15 seq  0       Speaker  None jack  1 loc  1 color   Black misc 1 [DISABLED]
hdac1:        Caps: IN                  Sense: 0x00000000
hdac1:  nid 29 0x4005e601 as  0 seq  1      Line-out  None jack  5 loc  0 color   White misc 6 [DISABLED]
hdac1:        Caps: IN
hdac1:  nid 30 0x01456130 as  3 seq  0     SPDIF-out  Jack jack  5 loc  1 color  Orange misc 1
hdac1:        Caps:    OUT
hdac1:  nid 31 0x411111f0 as 15 seq  0       Speaker  None jack  1 loc  1 color   Black misc 1 [DISABLED]
hdac1:        Caps: IN
hdac1: NumGPIO=2 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1
hdac1: GPIO: data=0x00000000 enable=0x00000000 direction=0x00000000
hdac1:       wake=0x00000000  unsol=0x00000000    sticky=0x00000000`

Here is a summary of my pins associations and sequences, formatted like the example from snd_hda() :



> hdac1: Association 0 (1) out:
> hdac1:  Pin nid 20 seq  0
> hdac1:  Pin nid 21 seq  2
> hdac1:  Pin nid 22 seq  1
> ...



Based on the information from snd_hda() my card is, as expected, configured for 7.1 sound. seq (0, 1, 2, 4) - 7.1

`$ sysctl dev.hdac.1.pindump
hdac1:  nid 20 0x01014010 as  1 seq  0      Line-out  Jack jack  1 loc  1 color   Green misc 0
hdac1:        Caps: IN OUT HP EAPD      Sense: 0x80000000
hdac1:  nid 21 0x01011012 as  1 seq  2      Line-out  Jack jack  1 loc  1 color   Black misc 0
hdac1:        Caps: IN OUT              Sense: 0x80000000
hdac1:  nid 22 0x01016011 as  1 seq  1      Line-out  Jack jack  1 loc  1 color  Orange misc 0
hdac1:        Caps: IN OUT              Sense: 0x00000000
hdac1:  nid 23 0x01012014 as  1 seq  4      Line-out  Jack jack  1 loc  1 color    Grey misc 0
hdac1:        Caps: IN OUT              Sense: 0x80000000`

Example 4 from snd_hda() shows the following for a 5.1 setup:



> 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"



dmesg verbose

My guess has been that Association 0 (1) needs to go from sequence (0, 1, 2, 4) to sequence lay out (0, 1, 2) which would mean removing nid=23 Line-Out jack Grey from as 1.

Then ensuring that dev.pcm.4.play.vchanformat is set to s16le:5.1. It is currently set to s16le:5.1.

I am completely lost in all of this and I simply cannot determine what is needed in /boot/device.hints. All help is greatly appreciated.


----------

