# Sound hardware problems and trying to understand snd_hda



## lasuit (May 25, 2021)

I have an HP EliteDesk 800 and I cannot get line out audio to work.  The internal speaker works, but that's all.  When I search the dmesg for sound ports, these are the ones that look relavent:


```
hdac0: <ATI RV930 HDA Controller> mem 0xf7c40000-0xf7c43fff irq 17 at device 0.1 on pci1
hdac1: <Intel Haswell HDA Controller> mem 0xf7d34000-0xf7d37fff irq 16 at device 3.0 on pci0
hdac2: <Intel Lynx Point HDA Controller> mem 0xf7d30000-0xf7d33fff irq 22 at device 27.0 on pci0
```

The output of /dev/sndstat is:


```
Installed devices:
pcm0: <ATI R6xx (HDMI)> (play)
pcm1: <Intel Haswell (HDMI/DP 8ch)> (play)
pcm2: <Realtek ALC221 (Analog)> (play/rec) default
No devices installed from userspace.
```

It appears for a straight line out on the back 1/8 jack I will need to use pcm2.  But when I look up the pins in sysctl this is what I get:


```
dev.hdaa.2.init_clear: 0
dev.hdaa.2.reconfig: 0
dev.hdaa.2.gpo_config:
dev.hdaa.2.gpo_state:
dev.hdaa.2.gpio_config: 0=keep 1=keep
dev.hdaa.2.gpio_state: 0=disabled 1=disabled
dev.hdaa.2.gpi_state:
dev.hdaa.2.config: forcestereo,ivref50,ivref80,ivref100,ivref,vref
dev.hdaa.2.nid35: audio mixer
     Widget cap: 0x0020010b STEREO
    Association: 2 (0x8001)
            OSS: speaker, line, mic, mix
      Input amp: 0x80000000 mute=1 step=0 size=0 offset=0 (0/0dB)
    Connections: 6
          + [DISABLED] <- nid=24 [pin: Speaker (None)] [DISABLED]
          + [DISABLED] <- nid=25 [pin: Speaker (None)] [DISABLED]
          + <- nid=26 [pin: Mic (Black Jack)]
          + <- nid=27 [pin: Line-in (Blue Jack)]
          + <- nid=29 [beep widget]
          + <- nid=11 [audio mixer]

dev.hdaa.2.nid34: audio selector [DISABLED]
     Widget cap: 0x0030010b STEREO
    Connections: 7
          + [DISABLED] <- nid=24 [pin: Speaker (None)] [DISABLED] (selected)
          + [DISABLED] <- nid=25 [pin: Speaker (None)] [DISABLED]
          + <- nid=26 [pin: Mic (Black Jack)]
          + <- nid=27 [pin: Line-in (Blue Jack)]
          + <- nid=29 [beep widget]
          + <- nid=11 [audio mixer]
          + [DISABLED] <- nid=18 [pin: CD (None)] [DISABLED]

dev.hdaa.2.nid33_original: 0x0221102f as=2 seq=15 device=Headphones conn=Jack ctype=1/8 loc=Front color=Black misc=0
dev.hdaa.2.nid33_config: 0x0221102f as=2 seq=15 device=Headphones conn=Jack ctype=1/8 loc=Front color=Black misc=0
dev.hdaa.2.nid33: pin: Headphones (Black Jack)
     Widget cap: 0x0040018d UNSOL STEREO
    Association: 1 (0x8000)
        Pin cap: 0x0001001c PDC HP OUT EAPD
     Pin config: 0x0221102f as=2 seq=15 device=Headphones conn=Jack ctype=1/8 loc=Front color=Black misc=0
    Pin control: 0x000000c0 HP OUT
           EAPD: 0x00000002 EAPD
     Output amp: 0x80000000 mute=1 step=0 size=0 offset=0 (0/0dB)
    Connections: 2
          + <- nid=12 [audio mixer] (selected)
          + [DISABLED] <- nid=13 [audio mixer] [DISABLED]

dev.hdaa.2.nid32: vendor widget [DISABLED]
     Widget cap: 0x00f00040 PROC

dev.hdaa.2.nid31: vendor widget [DISABLED]
     Widget cap: 0x00f00000

dev.hdaa.2.nid30_original: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.2.nid30_config: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.2.nid30: pin: Speaker (None) [DISABLED]
     Widget cap: 0x00400381 DIGITAL UNSOL STEREO
        Pin cap: 0x00000010 OUT
     Pin config: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
    Pin control: 0x00000040 OUT
    Connections: 1
          + <- nid=6 [audio output] [DISABLED]

dev.hdaa.2.nid29_original: 0x40400001 as=0 seq=1 device=SPDIF-out conn=None ctype=Unknown loc=0x00 color=Unknown misc=0
dev.hdaa.2.nid29_config: 0x40400001 as=0 seq=1 device=SPDIF-out conn=None ctype=Unknown loc=0x00 color=Unknown misc=0
dev.hdaa.2.nid29: beep widget
     Widget cap: 0x00700000
    Association: -2 (0x0000)
            OSS: speaker (speaker)
        Pin cap: 0x00000020 IN
     Pin config: 0x40400001 as=0 seq=1 device=SPDIF-out conn=None ctype=Unknown loc=0x00 color=Unknown misc=0
    Pin control: 0x00000020 IN

dev.hdaa.2.nid28: vendor widget [DISABLED]
     Widget cap: 0x00f00000

dev.hdaa.2.nid27_original: 0x01813030 as=3 seq=0 device=Line-in conn=Jack ctype=1/8 loc=Rear color=Blue misc=0
dev.hdaa.2.nid27_config: 0x01813030 as=3 seq=0 device=Line-in conn=Jack ctype=1/8 loc=Rear color=Blue misc=0
dev.hdaa.2.nid27: pin: Line-in (Blue Jack)
     Widget cap: 0x0040018f UNSOL STEREO
    Association: 2 (0x0001)
            OSS: line (line)
        Pin cap: 0x00000034 PDC OUT IN
     Pin config: 0x01813030 as=3 seq=0 device=Line-in conn=Jack ctype=1/8 loc=Rear color=Blue misc=0
    Pin control: 0x00000020 IN
     Output amp: 0x80000000 mute=1 step=0 size=0 offset=0 (0/0dB)
      Input amp: 0x002f0300 mute=0 step=3 size=47 offset=0 (0/36dB)
    Connections: 2
          + [DISABLED] <- nid=12 [audio mixer] (selected)
          + [DISABLED] <- nid=13 [audio mixer] [DISABLED]

dev.hdaa.2.nid26_original: 0x02a1103f as=3 seq=15 device=Mic conn=Jack ctype=1/8 loc=Front color=Black misc=0
dev.hdaa.2.nid26_config: 0x02a1103f as=3 seq=15 device=Mic conn=Jack ctype=1/8 loc=Front color=Black misc=0
dev.hdaa.2.nid26: pin: Mic (Black Jack)
     Widget cap: 0x0040018f UNSOL STEREO
    Association: 2 (0x8000)
            OSS: mic (mic)
        Pin cap: 0x0000373c PDC HP OUT IN VREF[ 50 80 100 GROUND HIZ ]
     Pin config: 0x02a1103f as=3 seq=15 device=Mic conn=Jack ctype=1/8 loc=Front color=Black misc=0
    Pin control: 0x00000025 IN VREFs
     Output amp: 0x80000000 mute=1 step=0 size=0 offset=0 (0/0dB)
      Input amp: 0x002f0300 mute=0 step=3 size=47 offset=0 (0/36dB)
    Connections: 2
          + [DISABLED] <- nid=12 [audio mixer] (selected)
          + [DISABLED] <- nid=13 [audio mixer] [DISABLED]

dev.hdaa.2.nid25_original: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.2.nid25_config: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.2.nid25: pin: Speaker (None) [DISABLED]
     Widget cap: 0x0040008b UNSOL STEREO
        Pin cap: 0x00003724 PDC IN VREF[ 50 80 100 GROUND HIZ ]
     Pin config: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
    Pin control: 0x00000020 IN
      Input amp: 0x002f0300 mute=0 step=3 size=47 offset=0 (0/36dB)

dev.hdaa.2.nid24_original: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.2.nid24_config: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.2.nid24: pin: Speaker (None) [DISABLED]
     Widget cap: 0x0040018f UNSOL STEREO
        Pin cap: 0x00003734 PDC OUT IN VREF[ 50 80 100 GROUND HIZ ]
     Pin config: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
    Pin control: 0x00000020 IN
     Output amp: 0x80000000 mute=1 step=0 size=0 offset=0 (0/0dB)
      Input amp: 0x002f0300 mute=0 step=3 size=47 offset=0 (0/36dB)
    Connections: 1
          + [DISABLED] <- nid=13 [audio mixer] [DISABLED]

dev.hdaa.2.nid23_original: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
dev.hdaa.2.nid23_config: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
dev.hdaa.2.nid23: pin: Speaker (Fixed) [DISABLED]
     Widget cap: 0x0040010c
        Pin cap: 0x00010010 OUT EAPD
     Pin config: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
    Pin control: 0x00000000
           EAPD: 0x00000002 EAPD
     Output amp: 0x80000000 mute=1 step=0 size=0 offset=0 (0/0dB)
    Connections: 1
          + [DISABLED] <- nid=15 [audio mixer] [DISABLED]

dev.hdaa.2.nid22: vendor widget [DISABLED]
     Widget cap: 0x00f00000

dev.hdaa.2.nid21: vendor widget [DISABLED]
     Widget cap: 0x00f00000

dev.hdaa.2.nid20_original: 0x01014020 as=2 seq=0 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Green misc=0
dev.hdaa.2.nid20_config: 0x01014010 as=1 seq=0 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Green misc=0
dev.hdaa.2.nid20: pin: Line-out (Green Jack) [DISABLED]
     Widget cap: 0x0040018d UNSOL STEREO
        Pin cap: 0x00010014 PDC OUT EAPD
     Pin config: 0x01014010 as=1 seq=0 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Green misc=0
    Pin control: 0x00000000
           EAPD: 0x00000002 EAPD
     Output amp: 0x80000000 mute=1 step=0 size=0 offset=0 (0/0dB)
    Connections: 2
          + [DISABLED] <- nid=12 [audio mixer] (selected)
          + <- nid=13 [audio mixer] [DISABLED]

dev.hdaa.2.nid19: vendor widget [DISABLED]
     Widget cap: 0x00f00000

dev.hdaa.2.nid18_original: 0x403c0000 as=0 seq=0 device=CD conn=None ctype=0xc loc=0x00 color=Unknown misc=0
dev.hdaa.2.nid18_config: 0x403c0000 as=0 seq=0 device=CD conn=None ctype=0xc loc=0x00 color=Unknown misc=0
dev.hdaa.2.nid18: pin: CD (None) [DISABLED]
     Widget cap: 0x0040000b STEREO
        Pin cap: 0x00000020 IN
     Pin config: 0x403c0000 as=0 seq=0 device=CD conn=None ctype=0xc loc=0x00 color=Unknown misc=0
    Pin control: 0x00000000
      Input amp: 0x002f0300 mute=0 step=3 size=47 offset=0 (0/36dB)

dev.hdaa.2.nid17: vendor widget [DISABLED]
     Widget cap: 0x00f00000

dev.hdaa.2.nid16: vendor widget [DISABLED]
     Widget cap: 0x00f00000

dev.hdaa.2.nid15: audio mixer [DISABLED]
     Widget cap: 0x0020010a
      Input amp: 0x80000000 mute=1 step=0 size=0 offset=0 (0/0dB)
    Connections: 2
          + [DISABLED] <- nid=2 [audio output]
          + [DISABLED] <- nid=11 [audio mixer]

dev.hdaa.2.nid14: vendor widget [DISABLED]
     Widget cap: 0x00f00000

dev.hdaa.2.nid13: audio mixer [DISABLED]
     Widget cap: 0x0020010b STEREO
    Association: -2 (0x0000)
      Input amp: 0x80000000 mute=1 step=0 size=0 offset=0 (0/0dB)
    Connections: 2
          + [DISABLED] <- nid=3 [audio output] [DISABLED]
          + [DISABLED] <- nid=11 [audio mixer]

dev.hdaa.2.nid12: audio mixer
     Widget cap: 0x0020010b STEREO
    Association: 1 (0x8000)
            OSS: pcm, mix
      Input amp: 0x80000000 mute=1 step=0 size=0 offset=0 (0/0dB)
    Connections: 2
          + <- nid=2 [audio output]
          + <- nid=11 [audio mixer]

dev.hdaa.2.nid11: audio mixer
     Widget cap: 0x0020010b STEREO
    Association: 2 (0x8001)
            OSS: mix (mix)
      Input amp: 0x80051f17 mute=1 step=31 size=5 offset=23 (-34/12dB)
    Connections: 5
          + [DISABLED] <- nid=24 [pin: Speaker (None)] [DISABLED]
          + [DISABLED] <- nid=25 [pin: Speaker (None)] [DISABLED]
          + <- nid=26 [pin: Mic (Black Jack)]
          + <- nid=27 [pin: Line-in (Blue Jack)]
          + <- nid=29 [beep widget]

dev.hdaa.2.nid10: vendor widget [DISABLED]
     Widget cap: 0x00f00000

dev.hdaa.2.nid9: audio input [DISABLED]
     Widget cap: 0x0010011b STEREO
     Stream cap: 0x00000001 PCM
        PCM cap: 0x000e0560 16 20 24 bits, 44 48 96 192 KHz
      Input amp: 0x80051f0b mute=1 step=31 size=5 offset=11 (-16/30dB)
    Connections: 1
          + [DISABLED] <- nid=34 [audio selector] [DISABLED]

dev.hdaa.2.nid8: audio input
     Widget cap: 0x0010011b STEREO
    Association: 2 (0x8001)
     Stream cap: 0x00000001 PCM
        PCM cap: 0x000e0560 16 20 24 bits, 44 48 96 192 KHz
      Input amp: 0x80051f0b mute=1 step=31 size=5 offset=11 (-16/30dB)
    Connections: 1
          + <- nid=35 [audio mixer]

dev.hdaa.2.nid7: vendor widget [DISABLED]
     Widget cap: 0x00f00000

dev.hdaa.2.nid6: audio output [DISABLED]
     Widget cap: 0x00000211 DIGITAL STEREO
     Stream cap: 0x00000001 PCM
        PCM cap: 0x000e05e0 16 20 24 bits, 44 48 88 96 192 KHz

dev.hdaa.2.nid5: vendor widget [DISABLED]
     Widget cap: 0x00f00000

dev.hdaa.2.nid4: vendor widget [DISABLED]
     Widget cap: 0x00f00000

dev.hdaa.2.nid3: audio output [DISABLED]
     Widget cap: 0x0000001d STEREO
     Stream cap: 0x00000001 PCM
        PCM cap: 0x000e0560 16 20 24 bits, 44 48 96 192 KHz
     Output amp: 0x00025757 mute=0 step=87 size=2 offset=87 (-65/0dB)

dev.hdaa.2.nid2: audio output
     Widget cap: 0x0000001d STEREO
    Association: 1 (0x8000)
            OSS: pcm (pcm)
     Stream cap: 0x00000001 PCM
        PCM cap: 0x000e0560 16 20 24 bits, 44 48 96 192 KHz
     Output amp: 0x00025757 mute=0 step=87 size=2 offset=87 (-65/0dB)

dev.hdaa.2.%parent: hdacc2
dev.hdaa.2.%pnpinfo: type=0x01 subsystem=0x103c18e5
dev.hdaa.2.%location: nid=1
dev.hdaa.2.%driver: hdaa
dev.hdaa.2.%desc: Realtek ALC221 Audio Function Group
```

It appears from the output that the necessary pin is nid20 for line out rear jack.  But, it's disabled!  How do I enable it and make this work?  Thanks for your help.


----------



## bsduck (Jun 9, 2021)

Does the following work? It should make the rear line-out the default output instead of the internal speaker.

/boot/device.hints

```
hint.hdaa.2.nid20.config="as=1 seq=0"
hint.hdaa.2.nid33.config="as=1 seq=15"
hint.hdaa.2.nid23.config="as=2 seq=0"
```


----------

