back to the beginning

FreeBSD 12.0 Sound

Last updated: 2019-02-24

Get audio to switch to headphone jack

Sound worked fine from install, but I want a better understanding of how it works and how to make modifications. I can manually switch from rear jack to front audio but I need to set it up to work automatically.

Here's how I did it manually. First, find out which audio lines you want to use:

dmesg | grep hda

Output:

hdac0: mem 0xe7080000-0xe7083fff irq 17 at device 0.1 on pci1
hdac1: mem 0xef530000-0xef533fff irq 22 at device 27.0 on pci0
hdacc0: at cad 0 on hdac0
hdaa0: at nid 1 on hdacc0
pcm0: at nid 4 on hdaa0
pcm1: at nid 5 on hdaa0
pcm2: at nid 6 on hdaa0
pcm3: at nid 7 on hdaa0
hdacc1: at cad 2 on hdac1
hdaa1: at nid 1 on hdacc1
pcm4: at nid 20,22,21 and 24,26 on hdaa1
pcm5: at nid 27 and 25 on hdaa1
pcm6: at nid 17 and 31 on hdaa1
pcm7: at nid 30 on hdaa1

This shows nvidia audio from the graphics card using HDMI and the on board Realteck audio (which is what I want to use). Note the simple descriptions on the lines beginning pcm4 and pcm5. Those are the jacks I want to use.

To switch to front audio:

sysctl hw.snd.default_unit=5

To switch to rear audio:

sysctl hw.snd.default_unit=4

I found I needed to switch to a new track in my media player before the sound started being output to the new jack.

Get audio to auto switch to headphone jack

I haven't done this yet, but the link in the resources below explains it.

Resources

back to the beginning

Something need fixing? Contact me: