Sound on headphones, sometimes on speakers

Hello everybody !
I've been carefully following the handbook, and several threads here (mainly https://forums.freebsd.org/threads/headphones-work-but-not-loudspeakers.85433/) but no luck : on my MSI GL65, I can get sound from the headphones jack, but not on the speakers. It sometimes work -I don't know why, but most of time there's nothing but headphones. (The FreeBSD I run is in my signature).
I tested both snd_hda and snd_driver (in /boot/loader.conf).

My current setup is NOT to explicitely load snd_hda or snd_driver (snd_hda_load or snd_load), as snd_hda is automatically loaded on Intel setups. As of writing, that's my setup, and I get sound (headphones only) from VLC (from pcm3:virtual:dsp3.vp0) and from Firefox (from Invideous ; Firefox is setup to output to OSS, and I just removed Pulseaudio which came when I setup Audacious).

My manual attempts on adding hints (in /boot/loader.conf) are also disabled.
Code:
#hint.hdaa.1.nid20.config="as=2 seq=0"
#hint.hdaa.1.nid33.config="as=2 seq=15"

cat /dev/sndstat returns this (it did sometimes noted pcm2 as Analog 2.0+HP/2.0 and pcm3 as Left Analog Mic, I think when I add hints to /boot/loader.conf) :
Code:
pcm0: <NVIDIA (0x0093) (HDMI/DP 8ch)> (play)
pcm1: <NVIDIA (0x0093) (HDMI/DP 8ch)> (play)
pcm2: <Realtek ALC235 (Internal Analog)> (play/rec)
pcm3: <Realtek ALC235 (Left Analog)> (play/rec) default
pcm4: <Intel Kaby Lake (HDMI/DP 8ch)> (play)
No devices installed from userspace.

It appears that pcm2 should be my speakers and pcm3 the headphones.

Mixer is fine :
Code:
Mixer vol      is currently set to  53:53
Mixer pcm      is currently set to 100:100
Mixer mic      is currently set to  67:67
Mixer mix      is currently set to  74:74
Mixer rec      is currently set to  37:37
Mixer igain    is currently set to   0:0
Mixer ogain    is currently set to 100:100
Recording source: mic

The hw.snd.default_unit: 3 (no sound from pcm2 or any other) ; I also use DSBMixer to test and levels are absolutely fine on the other pcmX.

dmesg | grep pcm returns :
Code:
pcm0: <NVIDIA (0x0093) (HDMI/DP 8ch)> at nid 4 on hdaa0
pcm1: <NVIDIA (0x0093) (HDMI/DP 8ch)> at nid 5 on hdaa0
pcm2: <Realtek ALC235 (Analog 2.0+HP/2.0)> at nid 20,33 and 18 on hdaa1
pcm3: <Realtek ALC235 (Left Analog Mic)> at nid 26 on hdaa1
pcm4: <Intel Kaby Lake (HDMI/DP 8ch)> at nid 3 on hdaa2
pcm0: <NVIDIA (0x0093) (HDMI/DP 8ch)> at nid 4 on hdaa0
pcm1: <NVIDIA (0x0093) (HDMI/DP 8ch)> at nid 5 on hdaa0
pcm2: <Realtek ALC235 (Internal Analog)> at nid 20 and 18 on hdaa1
pcm3: <Realtek ALC235 (Left Analog)> at nid 33 and 26 on hdaa1
pcm4: <Intel Kaby Lake (HDMI/DP 8ch)> at nid 3 on hdaa2

And... sysctl dev.hdaa
Code:
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:
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)
     Widget cap: 0x0040778d PWR DIGITAL UNSOL 8CH
    Association: 0 (0x0001)
        Pin cap: 0x09000094 PDC OUT HDMI DP HBR
     Pin config: 0x18560010 as=1 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
    Pin control: 0x00000040 OUT
     Output amp: 0x80000000 mute=1 step=0 size=0 offset=0 (0/0dB)
    Connections: 1
          + <- nid=2 [audio output]

dev.hdaa.2.nid2: audio output
     Widget cap: 0x00006611 PWR DIGITAL 8CH
    Association: 0 (0x0001)
            OSS: pcm (pcm)
     Stream cap: 0x00000005 AC3 PCM
        PCM cap: 0x001a07f0 16 24 32 bits, 32 44 48 88 96 176 192 KHz

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 Kaby Lake Audio Function Group
dev.hdaa.1.init_clear: 0
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
dev.hdaa.1.gpio_state: 0=disabled 1=disabled 2=disabled
dev.hdaa.1.gpi_state:
dev.hdaa.1.config: forcestereo,ivref50,ivref80,ivref100,ivref,vref
dev.hdaa.1.nid35: audio mixer
     Widget cap: 0x0020010b STEREO
    Association: 2 (0x0001)
            OSS: speaker, monitor
      Input amp: 0x80000000 mute=1 step=0 size=0 offset=0 (0/0dB)
    Connections: 7
          + [DISABLED] <- nid=24 [pin: Speaker (None)] [DISABLED]
          + [DISABLED] <- nid=25 [pin: Speaker (None)] [DISABLED]
          + [DISABLED] <- nid=26 [pin: Mic (Pink Jack)]
          + [DISABLED] <- nid=27 [pin: Speaker (None)] [DISABLED]
          + <- nid=29 [beep widget]
          + [DISABLED] <- nid=11 [audio mixer]
          + <- nid=18 [pin: Mic (Fixed)]

dev.hdaa.1.nid34: audio mixer
     Widget cap: 0x0020010b STEREO
    Association: 3 (0x0001)
            OSS: speaker, 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 (Pink Jack)]
          + [DISABLED] <- nid=27 [pin: Speaker (None)] [DISABLED]
          + <- nid=29 [beep widget]
          + <- nid=11 [audio mixer]

dev.hdaa.1.nid33_original: 0x03214020 as=2 seq=0 device=Headphones conn=Jack ctype=1/8 loc=Left color=Green misc=0
dev.hdaa.1.nid33_config: 0x03214020 as=2 seq=0 device=Headphones conn=Jack ctype=1/8 loc=Left color=Green misc=0
dev.hdaa.1.nid33: pin: Headphones (Green Jack)
     Widget cap: 0x0040058d PWR UNSOL STEREO
    Association: 1 (0x0001)
        Pin cap: 0x0001001c PDC HP OUT EAPD
     Pin config: 0x03214020 as=2 seq=0 device=Headphones conn=Jack ctype=1/8 loc=Left color=Green 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
          + [DISABLED] <- nid=12 [audio mixer]
          + <- nid=13 [audio mixer] (selected)

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

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

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]
     Widget cap: 0x00400781 PWR DIGITAL UNSOL STEREO
        Pin cap: 0x00000014 PDC 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.1.nid29_original: 0x40e8396d as=6 seq=13 device=Res.E conn=None ctype=DIN loc=0x00 color=Blue misc=9
dev.hdaa.1.nid29_config: 0x40e8396d as=6 seq=13 device=Res.E conn=None ctype=DIN loc=0x00 color=Blue misc=9
dev.hdaa.1.nid29: beep widget
     Widget cap: 0x00700400 PWR
    Association: -2 (0x0000)
            OSS: speaker (speaker)
        Pin cap: 0x00000020 IN
     Pin config: 0x40e8396d as=6 seq=13 device=Res.E conn=None ctype=DIN loc=0x00 color=Blue misc=9
    Pin control: 0x00000020 IN

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

dev.hdaa.1.nid27_original: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.1.nid27_config: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.1.nid27: pin: Speaker (None) [DISABLED]
     Widget cap: 0x0040058f PWR UNSOL STEREO
        Pin cap: 0x0001373c PDC HP OUT IN VREF[ 50 80 100 GROUND HIZ ] EAPD
     Pin config: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
    Pin control: 0x00000020 IN
           EAPD: 0x00000002 EAPD
     Output amp: 0x80000000 mute=1 step=0 size=0 offset=0 (0/0dB)
      Input amp: 0x00270300 mute=0 step=3 size=39 offset=0 (0/30dB)
    Connections: 2
          + [DISABLED] <- nid=12 [audio mixer] (selected)
          + <- nid=13 [audio mixer]

dev.hdaa.1.nid26_original: 0x03a19040 as=4 seq=0 device=Mic conn=Jack ctype=1/8 loc=Left color=Pink misc=0
dev.hdaa.1.nid26_config: 0x03a19040 as=4 seq=0 device=Mic conn=Jack ctype=1/8 loc=Left color=Pink misc=0
dev.hdaa.1.nid26: pin: Mic (Pink Jack)
     Widget cap: 0x0040048b PWR UNSOL STEREO
    Association: 3 (0x0001)
            OSS: mic (mic)
        Pin cap: 0x00003724 PDC IN VREF[ 50 80 100 GROUND HIZ ]
     Pin config: 0x03a19040 as=4 seq=0 device=Mic conn=Jack ctype=1/8 loc=Left color=Pink misc=0
    Pin control: 0x00000025 IN VREFs
      Input amp: 0x00270300 mute=0 step=3 size=39 offset=0 (0/30dB)

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]
     Widget cap: 0x0040048b PWR 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: 0x00270300 mute=0 step=3 size=39 offset=0 (0/30dB)

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]
     Widget cap: 0x0040048b PWR 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: 0x00270300 mute=0 step=3 size=39 offset=0 (0/30dB)

dev.hdaa.1.nid23_original: 0x40000000 as=0 seq=0 device=Line-out conn=None ctype=Unknown loc=0x00 color=Unknown misc=0
dev.hdaa.1.nid23_config: 0x40000000 as=0 seq=0 device=Line-out conn=None ctype=Unknown loc=0x00 color=Unknown misc=0
dev.hdaa.1.nid23: pin: Line-out (None) [DISABLED]
     Widget cap: 0x0040050c PWR
        Pin cap: 0x00000010 OUT
     Pin config: 0x40000000 as=0 seq=0 device=Line-out conn=None ctype=Unknown loc=0x00 color=Unknown misc=0
    Pin control: 0x00000000
     Output amp: 0x80000000 mute=1 step=0 size=0 offset=0 (0/0dB)
    Connections: 1
          + [DISABLED] <- nid=15 [audio mixer] [DISABLED]

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

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

dev.hdaa.1.nid20_original: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
dev.hdaa.1.nid20_config: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
dev.hdaa.1.nid20: pin: Speaker (Fixed)
     Widget cap: 0x0040058d PWR UNSOL STEREO
    Association: 0 (0x0001)
        Pin cap: 0x00010014 PDC OUT EAPD
     Pin config: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
    Pin control: 0x00000040 OUT
           EAPD: 0x00000002 EAPD
     Output amp: 0x80000000 mute=1 step=0 size=0 offset=0 (0/0dB)
    Connections: 1
          + <- nid=12 [audio mixer]

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

dev.hdaa.1.nid18_original: 0x90a60130 as=3 seq=0 device=Mic conn=Fixed ctype=Digital loc=Internal color=Unknown misc=1
dev.hdaa.1.nid18_config: 0x90a60130 as=3 seq=0 device=Mic conn=Fixed ctype=Digital loc=Internal color=Unknown misc=1
dev.hdaa.1.nid18: pin: Mic (Fixed)
     Widget cap: 0x0040040b PWR STEREO
    Association: 2 (0x0001)
            OSS: monitor (monitor)
        Pin cap: 0x00000020 IN
     Pin config: 0x90a60130 as=3 seq=0 device=Mic conn=Fixed ctype=Digital loc=Internal color=Unknown misc=1
    Pin control: 0x00000020 IN
      Input amp: 0x00270300 mute=0 step=3 size=39 offset=0 (0/30dB)

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

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

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

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

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

dev.hdaa.1.nid12: audio mixer
     Widget cap: 0x0020010b STEREO
    Association: 0 (0x0001)
            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.1.nid11: audio mixer
     Widget cap: 0x0020010b STEREO
    Association: 3 (0x0001)
            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 (Pink Jack)]
          + [DISABLED] <- nid=27 [pin: Speaker (None)] [DISABLED]
          + <- nid=29 [beep widget]

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

dev.hdaa.1.nid9: audio input
     Widget cap: 0x0010051b PWR STEREO
    Association: 3 (0x0001)
     Stream cap: 0x00000001 PCM
        PCM cap: 0x000e0560 16 20 24 bits, 44 48 96 192 KHz
      Input amp: 0x80023f17 mute=1 step=63 size=2 offset=23 (-17/30dB)
    Connections: 1
          + <- nid=34 [audio mixer]

dev.hdaa.1.nid8: audio input
     Widget cap: 0x0010051b PWR STEREO
    Association: 2 (0x0001)
     Stream cap: 0x00000001 PCM
        PCM cap: 0x000e0560 16 20 24 bits, 44 48 96 192 KHz
      Input amp: 0x80023f17 mute=1 step=63 size=2 offset=23 (-17/30dB)
    Connections: 1
          + <- nid=35 [audio mixer]

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

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

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

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

dev.hdaa.1.nid3: audio output
     Widget cap: 0x0000041d PWR STEREO
    Association: 1 (0x0001)
            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.1.nid2: audio output
     Widget cap: 0x0000041d PWR STEREO
    Association: 0 (0x0001)
            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.1.%parent: hdacc1
dev.hdaa.1.%pnpinfo: type=0x01 subsystem=0x146212b8
dev.hdaa.1.%location: nid=1
dev.hdaa.1.%driver: hdaa
dev.hdaa.1.%desc: Realtek ALC235 Audio Function Group
dev.hdaa.0.init_clear: 0
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.nid11: audio output [DISABLED]
     Widget cap: 0x000062b1 DIGITAL UNSOL STRIPE(x4) 8CH
     Stream cap: 0x00000005 AC3 PCM
        PCM cap: 0x000e07f0 16 20 24 bits, 32 44 48 88 96 176 192 KHz

dev.hdaa.0.nid10: audio output [DISABLED]
     Widget cap: 0x000062b1 DIGITAL UNSOL STRIPE(x4) 8CH
     Stream cap: 0x00000005 AC3 PCM
        PCM cap: 0x000e07f0 16 20 24 bits, 32 44 48 88 96 176 192 KHz

dev.hdaa.0.nid9: audio output
     Widget cap: 0x000062b1 DIGITAL UNSOL STRIPE(x4) 8CH
    Association: 1 (0x0001)
            OSS: pcm (pcm)
     Stream cap: 0x00000005 AC3 PCM
        PCM cap: 0x000e07f0 16 20 24 bits, 32 44 48 88 96 176 192 KHz

dev.hdaa.0.nid8: audio output
     Widget cap: 0x000062b1 DIGITAL UNSOL STRIPE(x4) 8CH
    Association: 0 (0x0001)
            OSS: pcm (pcm)
     Stream cap: 0x00000005 AC3 PCM
        PCM cap: 0x000e07f0 16 20 24 bits, 32 44 48 88 96 176 192 KHz

dev.hdaa.0.nid7_original: 0x585600f0 as=15 seq=0 device=Digital-out conn=None ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid7_config: 0x585600f0 as=15 seq=0 device=Digital-out conn=None ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid7: pin: Digital-out (None) [DISABLED]
     Widget cap: 0x00407381 DIGITAL UNSOL 8CH
        Pin cap: 0x09000094 PDC OUT HDMI DP HBR
     Pin config: 0x585600f0 as=15 seq=0 device=Digital-out conn=None ctype=Digital loc=0x18 color=Unknown misc=0
    Pin control: 0x00000000
    Connections: 4
          + <- nid=8 [audio output] (selected)
          + <- nid=9 [audio output]
          + <- nid=10 [audio output] [DISABLED]
          + <- nid=11 [audio output] [DISABLED]

dev.hdaa.0.nid6_original: 0x585600f0 as=15 seq=0 device=Digital-out conn=None ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid6_config: 0x585600f0 as=15 seq=0 device=Digital-out conn=None ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid6: pin: Digital-out (None) [DISABLED]
     Widget cap: 0x00407381 DIGITAL UNSOL 8CH
        Pin cap: 0x09000094 PDC OUT HDMI DP HBR
     Pin config: 0x585600f0 as=15 seq=0 device=Digital-out conn=None ctype=Digital loc=0x18 color=Unknown misc=0
    Pin control: 0x00000000
    Connections: 4
          + <- nid=8 [audio output] (selected)
          + <- nid=9 [audio output]
          + <- nid=10 [audio output] [DISABLED]
          + <- nid=11 [audio output] [DISABLED]

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)
     Widget cap: 0x00407381 DIGITAL UNSOL 8CH
    Association: 1 (0x0001)
        Pin cap: 0x09000094 PDC OUT HDMI DP HBR
     Pin config: 0x185600f0 as=15 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
    Pin control: 0x00000040 OUT
    Connections: 4
          + [DISABLED] <- nid=8 [audio output]
          + <- nid=9 [audio output] (selected)
          + [DISABLED] <- nid=10 [audio output] [DISABLED]
          + [DISABLED] <- nid=11 [audio output] [DISABLED]

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)
     Widget cap: 0x00407381 DIGITAL UNSOL 8CH
    Association: 0 (0x0001)
        Pin cap: 0x09000094 PDC OUT HDMI DP HBR
     Pin config: 0x185600f0 as=15 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
    Pin control: 0x00000040 OUT
    Connections: 4
          + <- nid=8 [audio output] (selected)
          + [DISABLED] <- nid=9 [audio output]
          + [DISABLED] <- nid=10 [audio output] [DISABLED]
          + [DISABLED] <- nid=11 [audio output] [DISABLED]

dev.hdaa.0.%parent: hdacc0
dev.hdaa.0.%pnpinfo: type=0x01 subsystem=0x146212b8
dev.hdaa.0.%location: nid=1
dev.hdaa.0.%driver: hdaa
dev.hdaa.0.%desc: NVIDIA (0x0093) Audio Function Group
dev.hdaa.%parent:

Any idea or help is greatly appreciated, as I do miss something but I can't beat it... Thank you a lot !!
 
I'm probably not going to be a great deal of help since in my case sound "just works" ;-)

But I do have the following to select speakers or headphone, which I believe can be jiggled in some way to automate it, but I've never looked that far into it.
Code:
laptop:/home/dave %cat bin/headphones
#! /bin/csh
sysctl hw.snd.default_unit=1
echo ANALOGUE HEADPHONES sysctl hw.snd.default_unit=1
sysctl hw.snd.default_unit=3
echo USB HEADPHONES sysctl hw.snd.default_unit=3

laptop:/home/dave %cat bin/speakers
#! /bin/csh
sysctl hw.snd.default_unit=0
echo SPEAKERS sysctl hw.snd.default_unit=0

And yes, I'm aware of the oddness of the headphone selection script! 99% of the time I use analogue headphones and can manually change it if I'm using USB headphones :-)

Firefox, on the other hand, seems to be a law unto itself and only plays through the speakers, no matter the sysctl set as above. There is, however, a firefox extension called "Audio Output Selector" which lets you force FF to use the headphones one the relevant video is playing, you clicked on the video to "interact" with it then the extension activates and lets you choose the output. There may be better solutions to either or both of my "fixes" above, but that involves me find the time to research them, which probably isn't happening in the near future :)
 
Thanks !! Like you, it works "out of the box" for me too, but only for headphones.
Maybe you should use hints to switch between both instead of scripting...?

When it works here, I have headphones output on pcm3, and speakers on pcm2 (switching from each to another DOES work).
When it's broken, I have sound from headphones (pcm3) but nothing on pcm2. I noticed that the headphones output works everytime, there's a problem on the speaker pcm2 only.
I've been using both VLC and Firefox as I know FF is a bit tricky on it ; I switched it to OSS because I'd like to use Bluetooth speakers too (UE Megaboom), but I couldn't get it to work neither (dsp error, something like this).

I think FreeBSD does not detect correctly the setup, as today dmesg | grep pcm is not like yesterday (as stated in my first post, it sometimes change, there are no double entries today...) :
Code:
pcm0: <Generic (0x0000) (HDMI/DP 8ch)> at nid 4 on hdaa0
pcm1: <Generic (0x0000) (HDMI/DP 8ch)> at nid 5 on hdaa0
pcm2: <Realtek ALC235 (Internal Analog)> at nid 20 and 18 on hdaa1
pcm3: <Realtek ALC235 (Left Analog)> at nid 33 and 26 on hdaa1
pcm4: <Intel Kaby Lake (HDMI/DP 8ch)> at nid 3 on hdaa2

On pcm3, nid 33 is always fine (this is the headphone jack). nid 26 goes to a Mic (I don't use it).
On broken pcm2, nid 20 is the speaker. (nid 18 is a Mic)
Code:
dev.hdaa.1.nid20_original: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
dev.hdaa.1.nid20_config: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
dev.hdaa.1.nid20: pin: Speaker (Fixed)
     Widget cap: 0x0040058d PWR UNSOL STEREO
    Association: 0 (0x0001)
        Pin cap: 0x00010014 PDC OUT EAPD
     Pin config: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
    Pin control: 0x00000040 OUT
           EAPD: 0x00000002 EAPD
     Output amp: 0x80000000 mute=1 step=0 size=0 offset=0 (0/0dB)
    Connections: 1
          + <- nid=12 [audio mixer]

So, my original hints are correct, since I have to put the nids on the same AS to get the switch between headphones/speakers (tested with as=1 and as=0 too) :
Code:
hint.hdaa.1.nid20.config="as=2 seq=0"
hint.hdaa.1.nid33.config="as=2 seq=15"

But it has no effect (I'm going to re-enable them). I'll reboot and if/when it works, I'll try to compare the sysctl dev.hdaa differences... I note there a mute=1 on the output amp by the way...
 
Well, news for today !
Yesterday in the morning, it didn't work at all ; the afternoon,it worked perfectly. I've done several plug/unplug tests, several reboots, it was working perfectly.
Today, here we go again : it doesn't work. I'm puzzled on what to do.
I've backed up the results of a working and non working sound and running diff on it, I have these two differences (the first one is the perfectly working setup) :
Code:
< dev.hdaa.2.nid3_original: 0x18560020 as=2 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
< dev.hdaa.2.nid3_config: 0x18560020 as=2 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
---
> 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
15c15
<      Pin config: 0x18560020 as=2 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
---
>      Pin config: 0x18560010 as=1 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0

Looks like it works when hdaa.2.nid3 is on as=2, am I wrong...?

Edit : for information, hdaa2: <Intel Kaby Lake Audio Function Group> at nid 1 on hdacc2.
 
Back
Top