Solved JACK detection fails

Hi all,

whenever I insert a jack into my ThinkPad E145, it fails to detect it and doesn't switch the audio output. I can still switch the output manually with:

Code:
sysctl hw.snd.default_unit=3

I don't know where to start fixing it. How could I debug it and find out what's wrong?

I am using FreeBSD 10.1-BETA3 with snd_hda driver.

Cheers
Marek
 
Please read the manual page for the snd_hda driver:

man 4 snd_hda

It instructs you to do a verbose boot, after which dmesg will give you output like this:

Code:
hdaa0: Patched pins configuration:
hdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa0: 25 042110f0 15 0  Headphones    Jack  1/8     Right      Black   0
hdaa0: 26 61a190f0 15 0  Mic           None  1/8     Ext-Rear   Pink    0 DISA
hdaa0: 27 04a110f0 15 0  Mic           Jack  1/8     Right      Black   0
hdaa0: 28 612140f0 15 0  Headphones    None  1/8     Ext-Rear   Green   0 DISA
hdaa0: 29 40f001f0 15 0  Other         None  Unknown 0x00       Unknown 1 DISA
hdaa0: 30 40f001f0 15 0  Other         None  Unknown 0x00       Unknown 1 DISA
hdaa0: 31 901701f0 15 0  Speaker       Fixed Analog  Internal   Unknown 1
hdaa0: 32 40f001f0 15 0  Other         None  Unknown 0x00       Unknown 1 DISA
hdaa0: 34 40f001f0 15 0  Other         None  Unknown 0x00       Unknown 1 DISA
hdaa0: 35 90a601f0 15 0  Mic           Fixed Digital Internal   Unknown 1

Notice the as column is filled with all 15's indicating for my Thinkpad T410 that all the pins are independent and unassociated with each other by default. The same might not be the case for you since you mention being able to switch the sound output by changing the default sound unit.

My laptop's analog internal speaker is nid 31 while the headphone jack is nid 25, so these are the lines I add to /boot/device.hints

Code:
hint.hdac0.cad0.nid31.config="as=1"
hint.hdac0.cad0.nid25.config="as=1 seq=15"

Again, start with a verbose boot so you can see your pin configuration. So that you don't have to verbose boot repeatedly, save the output to a file:

dmesg > verbose_boot.txt

Hopefully, seeing my configuration will aid your understanding of the snd_hda() manual page.
 
Thank you @sag for reply. I combined it with the info from one of the previous posts about a similar problem [1] and it was very useful!

How I solved it:

1. Get info about the current pin configuration:
Code:
sysctl dev.hdac.1.pindump=1
dmesg

After a little clean-up it looked like that:

Code:
hdaa1: Dumping AFG pins:
hdaa1: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa1: 18 90a60130 3  0  Mic           Fixed Digital Internal   Unknown 1
hdaa1: 20 90170110 1  0  Speaker       Fixed Analog  Internal   Unknown 1
hdaa1: 21 03211020 2  0  Headphones    Jack  1/8     Left       Black   0
hdaa1: 23 40008008 0  8  Line-out      None  Unknown 0x00       Purple  0 DISA
hdaa1: 24 03a11040 4  0  Mic           Jack  1/8     Left       Black   0
hdaa1: 25 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa1: 26 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa1: 27 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa1: 30 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA

2. Edit /boot/device.hints

Code:
hint.hdaa.1.nid21.config="as=1 seq=15"


3. Reboot the system.

[1] viewtopic.php?f=19&t=47852
 
Last edited by a moderator:
Back
Top