Solved Getting sound to automatically switch to laptop headphone jack? (X1 Carbon 6th Gen ThinkPad Realtek ALC285)

i-bsd

Member

Thanks: 6
Messages: 52

#1
I haven't been able to find a clear guide on this.

Currently, when I plug in headphones, the speakers cut out. So it's obviously detecting it but no sound in headphones. Can't see any way to raise the volume on the headphones.
 

shepper

Aspiring Daemon

Thanks: 233
Messages: 701

#2
Sound in FreeBSD is complex.
See https://forums.freebsd.org/threads/no-audio-on-my-system.57473/post-327863
pcm(4) and mixer(8)

One other possibility is that newer laptops (is that what your using?) have combined the headphone and mic into a single 4 pin jack. Older 3 pin headphones will mute but not align the contacts for sound.

If you have further questions it would help to know your hardware. Hopefully, someone has worked this out. If not, then a listing of the sound pins will be needed.
 

michael_hackson

Active Member

Thanks: 76
Messages: 141

#4
I managed to get my sound working thanks to contributions made by shepper in multiple threads. Have you doublechecked that the headphones and speakers are in the same association? I guess they could be because the sound gets muted but you can always go with dmesg | grep hda to find out.

Example from my laptop:
Code:
hdaa0: Patched pins configuration:
hdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa0: 22 0221101f 1  15 Headphones    Jack  1/8     Front      Black   0
hdaa0: 23 02a19020 2  0  Mic           Jack  1/8     Front      Pink    0
hdaa0: 24 400001f0 15 0  Line-out      None  Unknown 0x00       Unknown 1 DISA
hdaa0: 25 400001f0 15 0  Line-out      None  Unknown 0x00       Unknown 1 DISA
hdaa0: 26 92170110 1  0  Speaker       Fixed Analog  0x12       Unknown 1
hdaa0: 27 400001f0 15 0  Line-out      None  Unknown 0x00       Unknown 1 DISA
hdaa0: 28 224511f0 15 0  SPDIF-out     Jack  Optical Ext-Front  Black   1
hdaa0: 29 95a7112e 2  14 Mic           Fixed Analog  0x15       Black   1
And "as" you can see they have the same association with "as" (1).
If they are not in the same association then you fix it by adding the correct line to /boot/device.hints
where you put information about sound driver, nid, as, seq, device: as found in snd_hda(4).

Line in my /boot/device.hints is hint.hdaa.0.nid22.config="as=1 seq=15". This sets the headphones to be associated with the speakers on my laptop.
^^^
Make sure to put correct hinting corresponding to your devices and system. Hope this is the case and you became somewhat helped by this.
 
OP
OP
i-bsd

i-bsd

Member

Thanks: 6
Messages: 52

#5
I managed to get my sound working thanks to contributions made by shepper in multiple threads. Have you doublechecked that the headphones and speakers are in the same association? I guess they could be because the sound gets muted but you can always go with dmesg | grep hda to find out.

Example from my laptop:
Code:
hdaa0: Patched pins configuration:
hdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa0: 22 0221101f 1  15 Headphones    Jack  1/8     Front      Black   0
hdaa0: 23 02a19020 2  0  Mic           Jack  1/8     Front      Pink    0
hdaa0: 24 400001f0 15 0  Line-out      None  Unknown 0x00       Unknown 1 DISA
hdaa0: 25 400001f0 15 0  Line-out      None  Unknown 0x00       Unknown 1 DISA
hdaa0: 26 92170110 1  0  Speaker       Fixed Analog  0x12       Unknown 1
hdaa0: 27 400001f0 15 0  Line-out      None  Unknown 0x00       Unknown 1 DISA
hdaa0: 28 224511f0 15 0  SPDIF-out     Jack  Optical Ext-Front  Black   1
hdaa0: 29 95a7112e 2  14 Mic           Fixed Analog  0x15       Black   1
And "as" you can see they have the same association with "as" (1).
If they are not in the same association then you fix it by adding the correct line to /boot/device.hints
where you put information about sound driver, nid, as, seq, device: as found in snd_hda(4).

Line in my /boot/device.hints is hint.hdaa.0.nid22.config="as=1 seq=15". This sets the headphones to be associated with the speakers on my laptop.
^^^
Make sure to put correct hinting corresponding to your devices and system. Hope this is the case and you became somewhat helped by this.
This is my verbose boot output:

Code:
hdaa0: Patching widget caps nid=29 0x00400400 -> 0x00700400
hdaa0: Patched pins configuration:
hdaa0: nid 0x as seq device conn jack loc color misc
hdaa0: 18 90a60130 3 0 Mic Fixed Digital Internal Unknown 1
hdaa0: 19 40000000 0 0 Line-out None Unknown 0x00 Unknown 0 DISA
hdaa0: 20 90170110 1 0 Speaker Fixed Analog Internal Unknown 1
hdaa0: 22 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA
hdaa0: 23 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA
hdaa0: 24 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA
hdaa0: 25 04a11040 4 0 Mic Jack 1/8 Right Black 0
hdaa0: 26 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA
hdaa0: 27 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA
hdaa0: 30 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA
hdaa0: 33 04211020 2 0 Headphones Jack 1/8 Right Black 0
hdaa0: 4 associations found:
It looks like "as" is 1 for Internal Speaker and 2 for Headphones Jack. Is that correct?
 

shepper

Aspiring Daemon

Thanks: 233
Messages: 701

#6
Code:
hdaa0: 20 90170110 1 0 Speaker Fixed Analog Internal Unknown 1
This should be your internal speaker that is wired to nid 20. The default association is AS=1.

Code:
hdaa0: 33 04211020 2 0 Headphones Jack 1/8 Right Black 0
This should be a 1/8 inch jack on the Right side of your laptop that is wired to nid 33. For nid33 the default association is AS=2

If you reassign nid33 to be in the same association as nid20 (AS=1) and give it a sequence of 15 (seq=15), when headphones are plugged into the jack, the lower output nid (nid20) should mute. There are a number of examples of the actual syntax that can be found by searching the forum or you can modify michael_hackson's example by changing nid22 to nid20.
 
Last edited:
OP
OP
i-bsd

i-bsd

Member

Thanks: 6
Messages: 52

#7
Code:
hdaa0: 20 90170110 1 0 Speaker Fixed Analog Internal Unknown 1
This should be your internal speaker that is wired to nid 20. The AS=1.

Code:
hdaa0: 33 04211020 2 0 Headphones Jack 1/8 Right Black 0
This should be a 1/8 inch jack on the Right side of your laptop that is wired to nid 33.

If you assign nid 33 to be in the same association as nid20 (AS=1) and give it a sequence of 15 (seq=15), when headphones are plugged into the jack, the lower output nid (20) should mute. There are a number of examples of the actual syntax that can be found by searching the forum or you can modify michael_hackson example by changing nid22 to nid20.
This worked. Just had to give Headphones Jack the same "as" (1) as the Internal Speaker.

Thanks.
 

shepper

Aspiring Daemon

Thanks: 233
Messages: 701

#8
i-bsd
You can help future users by posting the make/model of laptop. Future users who search the web and this forum using "make/model + FreeBSD + sound" should find your fix.
 
Top