Bug 222636 - Headphones redirection for Lenovo T420s
Summary: Headphones redirection for Lenovo T420s
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.1-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-multimedia (Nobody)
URL: https://www.freebsd.org/cgi/man.cgi?q...
Keywords: feature, needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2017-09-27 09:08 UTC by Slawomir Wojciech Wojtczak
Modified: 2022-12-05 15:50 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Slawomir Wojciech Wojtczak 2017-09-27 09:08:19 UTC
Same as here:
https://lists.freebsd.org/pipermail/freebsd-bugs/2013-March/052009.html

The headphone jack is 'deaf' on T420s while it works well on T520.

I had the same problem as X300 and as I see the thread from the link there is also an 'exception' for X300.

Regards,
vermaden
Comment 1 Slawomir Wojciech Wojtczak 2017-09-27 21:33:10 UTC
These lines in /boot/device.hints file solves the problem:

# SOUND ON HEADPHONES
hint.hdaa.0.nid31.config="as=1"
hint.hdaa.0.nid25.config="as=1 seq=15 device=Headphones mute=0 misc=0"
hint.hdaa.0.nid28.config="as=1 seq=15 device=Headphones mute=0 misc=0"

Here are devices details from 'sysctl -a | grep hda' command:

# dev.hdaa.0.nid31_original: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
# dev.hdaa.0.nid31_config: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
# dev.hdaa.0.nid31: pin: Speaker (Fixed)
#      Widget cap: 0x00400501 PWR STEREO
#     Association: 0 (0x0001)
#         Pin cap: 0x00000010 OUT
#      Pin config: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
#     Pin control: 0x00000040 OUT
#     Connections: 2
#           + <- nid=16 [audio output] (selected)
#           + [DISABLED] <- nid=17 [audio output]
# 
# dev.hdaa.0.nid28_original: 0x6121401f as=1 seq=15 device=Headphones conn=None ctype=1/8 loc=Ext-Rear color=Green misc=0
# dev.hdaa.0.nid28_config: 0x6121401f as=1 seq=15 device=Headphones conn=None ctype=1/8 loc=Ext-Rear color=Green misc=0
# dev.hdaa.0.nid28: pin: Headphones (None) [DISABLED]
#      Widget cap: 0x00400581 PWR UNSOL STEREO
#         Pin cap: 0x00000014 PDC OUT
#      Pin config: 0x6121401f as=1 seq=15 device=Headphones conn=None ctype=1/8 loc=Ext-Rear color=Green misc=0
#     Pin control: 0x00000000
#     Connections: 2
#           + <- nid=16 [audio output] (selected)
#           + <- nid=17 [audio output]
# 
# dev.hdaa.0.nid25_original: 0x04211040 as=4 seq=0 device=Headphones conn=Jack ctype=1/8 loc=Right color=Black misc=0
# dev.hdaa.0.nid25_config: 0x04211040 as=4 seq=0 device=Headphones conn=Jack ctype=1/8 loc=Right color=Black misc=0
# dev.hdaa.0.nid25: pin: Headphones (Black Jack)
#      Widget cap: 0x00400581 PWR UNSOL STEREO
#     Association: 1 (0x0001)
#         Pin cap: 0x0000001c PDC HP OUT
#      Pin config: 0x04211040 as=4 seq=0 device=Headphones conn=Jack ctype=1/8 loc=Right color=Black misc=0
#     Pin control: 0x000000c0 HP OUT
#     Connections: 2
#           + [DISABLED] <- nid=16 [audio output]
#           + <- nid=17 [audio output] (selected)
Comment 2 Slawomir Wojciech Wojtczak 2018-05-24 08:44:55 UTC
Is it possible to add that information to FreeBSD tree so it does not have to be added at every install to /boot/device.hints file? Expecially when 11.2-BETA* is in the table?
Comment 3 Slawomir Wojciech Wojtczak 2019-10-14 13:13:08 UTC
Could you finally add/commit this 'quirk' please?

Its the same on 12.1-RC1.

These lines in /boot/device.hints fix the problem on ThinkPad T420s:

# SOUND ON HEADPHONES
hint.hdaa.0.nid31.config="as=1"
hint.hdaa.0.nid25.config="as=1 seq=15 device=Headphones mute=0 misc=0"
hint.hdaa.0.nid28.config="as=1 seq=15 device=Headphones mute=0 misc=0"

Regards.
Comment 4 Slawomir Wojciech Wojtczak 2020-10-28 19:16:35 UTC
Maybe its possible to add such quirk for 13-CURRENT now?
Comment 5 Slawomir Wojciech Wojtczak 2021-05-10 09:30:46 UTC
Maybe for 14-CURRENT now? :)
Comment 6 Slawomir Wojciech Wojtczak 2022-10-10 03:33:21 UTC
It also solves the same problem on Lenovo ThinkPad X220T (do not confuse with regular X220).
Comment 7 Graham Perrin freebsd_committer freebsd_triage 2022-12-05 04:06:37 UTC
Keyword: needs-patch

(In reply to Slawomir Wojciech Wojtczak from comment #3)

> These lines in /boot/device.hints …

Please, can you provide what's needed? A .patch or .diff as an attachment. Thanks. 

Seeking    hints   at <https://github.com/freebsd/freebsd-src/find/main>, I can't tell which file(s) should be patched.
Comment 8 Slawomir Wojciech Wojtczak 2022-12-05 15:50:22 UTC
(In reply to Graham Perrin from comment #7)

Sorry to disappoint - but I do not know what (and how) to patch this.

This is only thing I know it works - these lines in /boot/device.hints file:

# SOUND ON HEADPHONES T420s/X220T
hint.hdaa.0.nid31.config="as=1"
hint.hdaa.0.nid25.config="as=1 seq=15 device=Headphones mute=0 misc=0"
hint.hdaa.0.nid28.config="as=1 seq=15 device=Headphones mute=0 misc=0"

I do not know how to translate that into code ...

Regards.