Solved Sound not switching 'line-out' <-> 'headphone'

rigoletto@

Developer
Hello!

The default configuration is not working to mute the line-out when I plug the headphone. I tried putting this in /boot/device.hints but without success:

Code:
hint.hdac.1.cad0.nid20.config="as=1 device=Line-out"
hint.hdac.1.cad0.nid27.config="as=2 device=Headphones"

I am indeed quite lost in those parameters. I use the speaker connected to the connector in the motherboard, and the headphone in the connector in the front of the case. I am willing to use the on-board card (ALC892).

cat /dev/sndstat
Code:
pcm0: <NVIDIA GT440 (HDMI/DP 8ch)> (play)
pcm1: <NVIDIA GT440 (HDMI/DP 8ch)> (play)
pcm2: <NVIDIA GT440 (HDMI/DP 8ch)> (play)
pcm3: <NVIDIA GT440 (HDMI/DP 8ch)> (play)
pcm4: <Realtek ALC892 (Rear Analog 7.1/2.0)> (play/rec)
pcm5: <Realtek ALC892 (Front Analog)> (play/rec) default
pcm6: <Realtek ALC892 (Rear Digital)> (play)
pcm7: <Realtek ALC892 (Onboard Digital)> (play)
No devices installed from userspace

sysctl -a | grep hda
Code:
dev.pcm.7.%parent: hdaa4
dev.pcm.6.%parent: hdaa4
dev.pcm.5.%parent: hdaa4
dev.pcm.4.%parent: hdaa4
dev.pcm.3.%parent: hdaa3
dev.pcm.2.%parent: hdaa2
dev.pcm.1.%parent: hdaa1
dev.pcm.0.%parent: hdaa0
dev.hdaa.4.reconfig: 0
dev.hdaa.4.gpo_config:
dev.hdaa.4.gpo_state:
dev.hdaa.4.gpio_config: 0=keep 1=keep
dev.hdaa.4.gpio_state: 0=disabled 1=disabled
dev.hdaa.4.gpi_state:
dev.hdaa.4.config: forcestereo,ivref50,ivref80,ivref100,ivref,vref
dev.hdaa.4.nid38: audio mixer
dev.hdaa.4.nid37: audio output
dev.hdaa.4.nid36: vendor widget [DISABLED]
dev.hdaa.4.nid35: audio mixer
dev.hdaa.4.nid34: audio mixer
dev.hdaa.4.nid33: vendor widget [DISABLED]
dev.hdaa.4.nid32: vendor widget [DISABLED]
dev.hdaa.4.nid31_original: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.4.nid31_config: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.4.nid31: pin: Speaker (None) [DISABLED]
dev.hdaa.4.nid30_original: 0x01456130 as=3 seq=0 device=SPDIF-out conn=Jack ctype=Optical loc=Rear color=Orange misc=1
dev.hdaa.4.nid30_config: 0x01456130 as=3 seq=0 device=SPDIF-out conn=Jack ctype=Optical loc=Rear color=Orange misc=1
dev.hdaa.4.nid30: pin: SPDIF-out (Orange Jack)
dev.hdaa.4.nid29_original: 0x4005e601 as=0 seq=1 device=Line-out conn=None ctype=Optical loc=0x00 color=White misc=6
dev.hdaa.4.nid29_config: 0x4005e601 as=0 seq=1 device=Line-out conn=None ctype=Optical loc=0x00 color=White misc=6
dev.hdaa.4.nid29: beep widget
dev.hdaa.4.nid28_original: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.4.nid28_config: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.4.nid28: pin: Speaker (None) [DISABLED]
dev.hdaa.4.nid27_original: 0x02214120 as=2 seq=0 device=Headphones conn=Jack ctype=1/8 loc=Front color=Green misc=1
dev.hdaa.4.nid27_config: 0x02214120 as=2 seq=0 device=Headphones conn=Jack ctype=1/8 loc=Front color=Green misc=1
dev.hdaa.4.nid27: pin: Headphones (Green Jack)
dev.hdaa.4.nid26_original: 0x0181305f as=5 seq=15 device=Line-in conn=Jack ctype=1/8 loc=Rear color=Blue misc=0
dev.hdaa.4.nid26_config: 0x0181305f as=5 seq=15 device=Line-in conn=Jack ctype=1/8 loc=Rear color=Blue misc=0
dev.hdaa.4.nid26: pin: Line-in (Blue Jack)
dev.hdaa.4.nid25_original: 0x02a19960 as=6 seq=0 device=Mic conn=Jack ctype=1/8 loc=Front color=Pink misc=9
dev.hdaa.4.nid25_config: 0x02a19960 as=6 seq=0 device=Mic conn=Jack ctype=1/8 loc=Front color=Pink misc=9
dev.hdaa.4.nid25: pin: Mic (Pink Jack)
dev.hdaa.4.nid24_original: 0x01a19850 as=5 seq=0 device=Mic conn=Jack ctype=1/8 loc=Rear color=Pink misc=8
dev.hdaa.4.nid24_config: 0x01a19850 as=5 seq=0 device=Mic conn=Jack ctype=1/8 loc=Rear color=Pink misc=8
dev.hdaa.4.nid24: pin: Mic (Pink Jack)
dev.hdaa.4.nid23_original: 0x01012014 as=1 seq=4 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Grey misc=0
dev.hdaa.4.nid23_config: 0x01012014 as=1 seq=4 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Grey misc=0
dev.hdaa.4.nid23: pin: Line-out (Grey Jack)
dev.hdaa.4.nid22_original: 0x01016011 as=1 seq=1 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Orange misc=0
dev.hdaa.4.nid22_config: 0x01016011 as=1 seq=1 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Orange misc=0
dev.hdaa.4.nid22: pin: Line-out (Orange Jack)
dev.hdaa.4.nid21_original: 0x01011012 as=1 seq=2 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Black misc=0
dev.hdaa.4.nid21_config: 0x01011012 as=1 seq=2 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Black misc=0
dev.hdaa.4.nid21: pin: Line-out (Black Jack)
dev.hdaa.4.nid20_original: 0x01014010 as=1 seq=0 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Green misc=0
dev.hdaa.4.nid20_config: 0x01014010 as=1 seq=0 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Green misc=0
dev.hdaa.4.nid20: pin: Line-out (Green Jack)
dev.hdaa.4.nid19: vendor widget [DISABLED]
dev.hdaa.4.nid18_original: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.4.nid18_config: 0x411111f0 as=15 seq=0 device=Speaker conn=None ctype=1/8 loc=Rear color=Black misc=1
dev.hdaa.4.nid18: pin: Speaker (None) [DISABLED]
dev.hdaa.4.nid17_original: 0x99430140 as=4 seq=0 device=SPDIF-out conn=Fixed ctype=ATAPI loc=Onboard color=Unknown misc=1
dev.hdaa.4.nid17_config: 0x99430140 as=4 seq=0 device=SPDIF-out conn=Fixed ctype=ATAPI loc=Onboard color=Unknown misc=1
dev.hdaa.4.nid17: pin: SPDIF-out (Fixed)
dev.hdaa.4.nid16: audio output
dev.hdaa.4.nid15: audio mixer
dev.hdaa.4.nid14: audio mixer
dev.hdaa.4.nid13: audio mixer
dev.hdaa.4.nid12: audio mixer
dev.hdaa.4.nid11: audio mixer
dev.hdaa.4.nid10: audio input [DISABLED]
dev.hdaa.4.nid9: audio input
dev.hdaa.4.nid8: audio input
dev.hdaa.4.nid7: vendor widget [DISABLED]
dev.hdaa.4.nid6: audio output
dev.hdaa.4.nid5: audio output
dev.hdaa.4.nid4: audio output
dev.hdaa.4.nid3: audio output
dev.hdaa.4.nid2: audio output
dev.hdaa.4.%parent: hdacc4
dev.hdaa.4.%pnpinfo: type=0x01 subsystem=0x1043841b
dev.hdaa.4.%location: nid=1
dev.hdaa.4.%driver: hdaa
dev.hdaa.4.%desc: Realtek ALC892 Audio Function Group
dev.hdaa.3.reconfig: 0
dev.hdaa.3.gpo_config:
dev.hdaa.3.gpo_state:
dev.hdaa.3.gpio_config:
dev.hdaa.3.gpio_state:
dev.hdaa.3.gpi_state:
dev.hdaa.3.config: forcestereo,ivref50,ivref80,ivref100,ivref,vref
dev.hdaa.3.nid5_original: 0x18560010 as=1 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.3.nid5_config: 0x18560010 as=1 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.3.nid5: pin: Digital-out (Jack)
dev.hdaa.3.nid4: audio output
dev.hdaa.3.%parent: hdacc3
dev.hdaa.3.%pnpinfo: type=0x01 subsystem=0x10de0101
dev.hdaa.3.%location: nid=1
dev.hdaa.3.%driver: hdaa
dev.hdaa.3.%desc: NVIDIA GT440 Audio Function Group
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.nid5_original: 0x18560010 as=1 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.2.nid5_config: 0x18560010 as=1 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.2.nid5: pin: Digital-out (Jack)
dev.hdaa.2.nid4: audio output
dev.hdaa.2.%parent: hdacc2
dev.hdaa.2.%pnpinfo: type=0x01 subsystem=0x10de0101
dev.hdaa.2.%location: nid=1
dev.hdaa.2.%driver: hdaa
dev.hdaa.2.%desc: NVIDIA GT440 Audio Function Group
dev.hdaa.1.reconfig: 0
dev.hdaa.1.gpo_config:
dev.hdaa.1.gpo_state:
dev.hdaa.1.gpio_config:
dev.hdaa.1.gpio_state:
dev.hdaa.1.gpi_state:
dev.hdaa.1.config: forcestereo,ivref50,ivref80,ivref100,ivref,vref
dev.hdaa.1.nid5_original: 0x18560010 as=1 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.1.nid5_config: 0x18560010 as=1 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.1.nid5: pin: Digital-out (Jack)
dev.hdaa.1.nid4: audio output
dev.hdaa.1.%parent: hdacc1
dev.hdaa.1.%pnpinfo: type=0x01 subsystem=0x10de0101
dev.hdaa.1.%location: nid=1
dev.hdaa.1.%driver: hdaa
dev.hdaa.1.%desc: NVIDIA GT440 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.nid5_original: 0x18560010 as=1 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid5_config: 0x18560010 as=1 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: audio output
dev.hdaa.0.%parent: hdacc0
dev.hdaa.0.%pnpinfo: type=0x01 subsystem=0x10de0101
dev.hdaa.0.%location: nid=1
dev.hdaa.0.%driver: hdaa
dev.hdaa.0.%desc: NVIDIA GT440 Audio Function Group
dev.hdaa.%parent:
dev.hdacc.4.%parent: hdac1
dev.hdacc.4.%pnpinfo: vendor=0x10ec device=0x0892 revision=0x03 stepping=0x02
dev.hdacc.4.%location: cad=0
dev.hdacc.4.%driver: hdacc
dev.hdacc.4.%desc: Realtek ALC892 HDA CODEC
dev.hdacc.3.%parent: hdac0
dev.hdacc.3.%pnpinfo: vendor=0x10de device=0x0014 revision=0x01 stepping=0x00
dev.hdacc.3.%location: cad=3
dev.hdacc.3.%driver: hdacc
dev.hdacc.3.%desc: NVIDIA GT440 HDA CODEC
dev.hdacc.2.%parent: hdac0
dev.hdacc.2.%pnpinfo: vendor=0x10de device=0x0014 revision=0x01 stepping=0x00
dev.hdacc.2.%location: cad=2
dev.hdacc.2.%driver: hdacc
dev.hdacc.2.%desc: NVIDIA GT440 HDA CODEC
dev.hdacc.1.%parent: hdac0
dev.hdacc.1.%pnpinfo: vendor=0x10de device=0x0014 revision=0x01 stepping=0x00
dev.hdacc.1.%location: cad=1
dev.hdacc.1.%driver: hdacc
dev.hdacc.1.%desc: NVIDIA GT440 HDA CODEC
dev.hdacc.0.%parent: hdac0
dev.hdacc.0.%pnpinfo: vendor=0x10de device=0x0014 revision=0x01 stepping=0x00
dev.hdacc.0.%location: cad=0
dev.hdacc.0.%driver: hdacc
dev.hdacc.0.%desc: NVIDIA GT440 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=0x1002 device=0x4383 subvendor=0x1043 subdevice=0x841b class=0x040300
dev.hdac.1.%location: slot=20 function=2 dbsf=pci0:0:20:2 handle=\_SB_.PCI0.SBAZ
dev.hdac.1.%driver: hdac
dev.hdac.1.%desc: ATI SB600 HDA Controller
dev.hdac.0.polling: 0
dev.hdac.0.pindump: 0
dev.hdac.0.%parent: pci1
dev.hdac.0.%pnpinfo: vendor=0x10de device=0x0bea subvendor=0x3842 subdevice=0x2631 class=0x040300
dev.hdac.0.%location: slot=0 function=1 dbsf=pci0:1:0:1
dev.hdac.0.%driver: hdac
dev.hdac.0.%desc: NVIDIA GT108 HDA Controller

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: 5
hw.snd.version: 2009061500/amd64
hw.snd.default_auto: 0
hw.snd.verbose: 0
hw.snd.vpc_mixer_bypass: 1
hw.snd.feeder_rate_quality: 4
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: 100
hw.snd.vpc_autoreset: 1
hw.snd.timeout: 5
hw.snd.latency_profile: 1
hw.snd.latency: 5
hw.snd.report_soft_matrix: 1
hw.snd.report_soft_formats: 1

dmesg | grep -i hda
Code:
hdac0: <NVIDIA GT108 HDA Controller> mem 0xfea7c000-0xfea7ffff irq 19 at device 0.1 on pci1
hdac1: <ATI SB600 HDA Controller> mem 0xfcff4000-0xfcff7fff irq 16 at device 20.2 on pci0
hdacc0: <NVIDIA GT440 HDA CODEC> at cad 0 on hdac0
hdaa0: <NVIDIA GT440 Audio Function Group> at nid 1 on hdacc0
pcm0: <NVIDIA GT440 (HDMI/DP 8ch)> at nid 5 on hdaa0
hdacc1: <NVIDIA GT440 HDA CODEC> at cad 1 on hdac0
hdaa1: <NVIDIA GT440 Audio Function Group> at nid 1 on hdacc1
pcm1: <NVIDIA GT440 (HDMI/DP 8ch)> at nid 5 on hdaa1
hdacc2: <NVIDIA GT440 HDA CODEC> at cad 2 on hdac0
hdaa2: <NVIDIA GT440 Audio Function Group> at nid 1 on hdacc2
pcm2: <NVIDIA GT440 (HDMI/DP 8ch)> at nid 5 on hdaa2
hdacc3: <NVIDIA GT440 HDA CODEC> at cad 3 on hdac0
hdaa3: <NVIDIA GT440 Audio Function Group> at nid 1 on hdacc3
pcm3: <NVIDIA GT440 (HDMI/DP 8ch)> at nid 5 on hdaa3
hdacc4: <Realtek ALC892 HDA CODEC> at cad 0 on hdac1
hdaa4: <Realtek ALC892 Audio Function Group> at nid 1 on hdacc4
pcm4: <Realtek ALC892 (Rear Analog 7.1/2.0)> at nid 20,22,21,23 and 24,26 on hdaa4
pcm5: <Realtek ALC892 (Front Analog)> at nid 27 and 25 on hdaa4
pcm6: <Realtek ALC892 (Rear Digital)> at nid 30 on hdaa4
pcm7: <Realtek ALC892 (Onboard Digital)> at nid 17 on hdaa4

/etc/sysctl.conf
Code:
hw.snd.vpc_mixer_bypass=1
hw.snd.feeder_rate_quality=4
hw.snd.vpc_0db=100

Thanks! :)
 
Last edited:
seq Sequence number. A unique, per-association number used to
order pins inside the particular association. Sequence
numbers can be specified as numeric values from 0 to 15.

The sequence number 15 has a special meaning for output
associations. Output pins with this number and device
type ``Headphones'' will duplicate (with automatic mute if
jack detection is supported) the first pin in that association.

see snd_hda(4)

If you are using standard 1/8 inch audio jacks, you will want pcm4 to be your default sound device.

see FreeBSD Handbook - Sound troubleshooting.

Manufacturers "hard wire" the sound pins inconsistently. If you are lucky someone has sorted this out for your motherboard. If websearch/forum search comes up empty you can sort it out following the linked manual page.
 
shepper

Hi! I've tried pcm4 as default and it just works for the rear output, plug-in the headphone on the front change nothing. To use the front output I need to set pcm5 as default.

Both have seq=0 but different as={1,2}

Thanks!
 
Hi! I've tried pcm4 as default and it just works for the rear output, plug-in the headphone on the front change nothing. To use the front output I need to set pcm5 as default.

FreeBSD tends to associate gpio pins based on their location. It is possible to associate the front headphones with the rear output. If the front headphones are also given a seq=15, the rear output will mute when the headphones are plugged in. There are some solved forum posts where this has been done.

Both have seq=0 but different as={1,2}

The linked man page tells how to list the gpio pin assignments (referred to as nid's in the pin listing). You should be able to solve this by searching the forums for posts on headphone muting and reviewing snd_hda(4). Basically, move the front headphone nid from as=2 to as=1 and assign it a seq=15
 
A small advance, but still not switching/muting but only playing from the rear jack:

Code:
Installed devices:
pcm0: <NVIDIA GT440 (HDMI/DP 8ch)> (play)
pcm1: <NVIDIA GT440 (HDMI/DP 8ch)> (play)
pcm2: <NVIDIA GT440 (HDMI/DP 8ch)> (play)
pcm3: <NVIDIA GT440 (HDMI/DP 8ch)> (play)
pcm4: <Realtek ALC892 (Analog 7.1+HP/2.0)> (play/rec) default
pcm5: <Realtek ALC892 (Rear Digital)> (play)
pcm6: <Realtek ALC892 (Onboard Digital)> (play)
pcm7: <Realtek ALC892 (Front Analog Mic)> (rec)
No devices installed from userspace.

Code:
dev.hdaa.4.nid20_original: 0x01014010 as=1 seq=0 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Green misc=0
dev.hdaa.4.nid20_config: 0x01014010 as=1 seq=0 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Green misc=0
dev.hdaa.4.nid20: pin: Line-out (Green Jack)

Code:
dev.hdaa.4.nid27_original: 0x02214120 as=2 seq=0 device=Headphones conn=Jack ctype=1/8 loc=Front color=Green misc=1
dev.hdaa.4.nid27_config: 0x0221411f as=1 seq=15 device=Headphones conn=Jack ctype=1/8 loc=Front color=Green misc=1
dev.hdaa.4.nid27: pin: Headphones (Green Jack)
 
Back
Top