Bug 195161
Summary: | No Jack sound on Lenovo dock with a T470 connected | ||
---|---|---|---|
Product: | Drivers | Reporter: | Dieter Mummenschanz (dmummenschanz) |
Component: | Sound(ALSA) | Assignee: | Jaroslav Kysela (perex) |
Status: | RESOLVED CODE_FIX | ||
Severity: | high | CC: | acfoltzer, chenders, dan, danielhorak, em_prv, george.sapkin, gerrit.erpenstein.dev, jeff, markus.zimmermann, max.deineko, mhonek, michael.groh, mr.felixoid, ptalbert, public, simon-bugzilla-kernel, simon.meinhard, stanislav.graf, tiwai, tomi, v.ondruch+kbz |
Priority: | P1 | ||
Hardware: | Intel | ||
OS: | Linux | ||
Kernel Version: | 4.11-rc, 4.12, 4.13-rc, 4.14, 4.15-rc | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
alsa-info.sh dump
Output of alsa-info on X270 alsa-info.sh output on ThinkPad T470s in Dock - kernel 4.11.1 Thinkpad T570, before pin reconfig Thinkpad T570, after pin reconfig Test fix for resume issue |
Created attachment 255801 [details]
Output of alsa-info on X270
Also experiencing this on an X270 with ultradock.
Sorry, forgot to mention: running 4.10.8. Waiting for rescue to arrive I did some research on my alsa configuration and found out that there is no pin configuration supplied from the Laptop BIOS that connects to the Docking Headphone Jack. The hdajacksensetest tool only shows this when the Laptop is docked and a Headphone is pluged in: Pin 0x18 (Black Mic, Left side): present = No Pin 0x21 (Black Headphone, Left side): present = No So I did some patching using a early firmware load patch floating around the web targeting the same docking station for my older T440p laptop: echo 0x17 0x21211010 > /sys/class/sound/hwC0D0/user_pin_configs echo 1 > /sys/class/sound/hwC0D0/reconfig Now my Docking Station Headphone Jack is being detected! :) With the Headphone Connected: Pin 0x17 (Black Headphone, Docking station, Rear side): present = Yes Pin 0x18 (Black Mic, Left side): present = No Pin 0x21 (Black Headphone, Left side): present = No And disconnected: Pin 0x17 (Black Headphone, Docking station, Rear side): present = No Pin 0x18 (Black Mic, Left side): present = No Pin 0x21 (Black Headphone, Left side): present = No However there is STILL no sound even after unmuting everything in alsamixer! I'm pretty sure 0x17 is the right pincfg but I'm not sure about 0x21211010 and how I obtain such an address for my laptop. Could someone please help me out here or give me a hint? Here is a alsa-info.sh dump when the Laptop is not connected to the Dock: https://pastebin.com/eTNnfnzL And here when the Laptop is connected to the Dock (No changes): https://pastebin.com/ySBsKUeH And here after setting the pin config 0x17 0x21211010: https://pastebin.com/xmDfsNtQ I'm sure I'm very close. But something is still missing. Any help is much apprechiated! Thanks in advance Dieter Created attachment 256653 [details]
alsa-info.sh output on ThinkPad T470s in Dock - kernel 4.11.1
Hello everyone,
i have the same Problem: The Headphone-Jack on the ThinkPad Ultra Dock is not working. I am running Linux 4.11.1 on a ThinkPad T470s, the attached file has been generated with the alsa-info.sh script while the external Speakers were plugged into the Headphone-Jack on the Dock.
I have been playing around with the reconfiguration of the pins ( with the hdajackretask tool) but so far have not been able to get output on the external speakers. I fear that Lenovo tried to create something clever - as i am not able to get the internal speakers to output sound as soon as something is plugged into the headphone jack on the laptop itself.
If there is anything to do that helps to debug this issue, i would be glad to help.
Thanks in advance for the help, and thanks in general for creating and keeping alive the linux kernel ;)
Michael
I have the same issue on a T570 incl. the behavior described in comment 3. > uname -sr Linux 4.11.6-3-ARCH Created attachment 257197 [details]
Thinkpad T570, before pin reconfig
Created attachment 257199 [details]
Thinkpad T570, after pin reconfig
So the situation is same on both T470 and T570, where the sound doesn't come out even after you set up the pin NID 0x17 to 0x21211010, right? Could you try to pass model=nofixup so that it skips the other Thinkpad quirks (e.g. for LED)? (In reply to Takashi Iwai from comment #8) > So the situation is same on both T470 and T570, where the sound doesn't come > out even after you set up the pin NID 0x17 to 0x21211010, right? Exactly. > > Could you try to pass model=nofixup so that it skips the other Thinkpad > quirks (e.g. for LED)? It does not change anything. I also tried tpt460, tpt440-dock and thinkpad already, both with and without the pin config. No success. The pincfg override is mostly mandatory without doubt, so you need to keep the pincfg. Just to be sure, try model=generic as well. I don't think this matters, but let's check the all possibilities. BTW, when you test with different model options, be sure the mixer setup before the actual sound test. The mixer elements may change depending on the parser and its setup, thus some new mixer element might be muted as default. No, model=generic does not work either. A weird thing in alsamixer is that "Headphone 1" (which appears after pincfg) has only a mute toggle but no volume bar. (In reply to Tim Ruffing from comment #11) > A weird thing in alsamixer is that "Headphone 1" (which appears after > pincfg) has only a mute toggle but no volume bar. This is correct behavior. The pin widget node has only the mute bit, and the volume is controlled in DAC node that is shared by both headphone jacks. BTW, does the built-in headphone jack work? If yes, what if you plug both the built-in and dock headphone jacks at the same time? (In reply to Takashi Iwai from comment #12) > BTW, does the built-in headphone jack work? If yes, what if you plug both > the built-in and dock headphone jacks at the same time? Yes, the built-in jacks. It makes no difference whether it's plugged or not. Built-in plugged, dock plugged: sound from built-in, no sound from dock Built-in not plugged, dock plugged: no sound Detection works: Headphones are detected if either the built-in or the dock jack are plugged (or both). (In reply to Tim Ruffing from comment #13) > Yes, the built-in jacks. "The built-in jack works", of course... Is there anything else I could test? Update: No changes with Kernel 4.12 (In reply to Takashi Iwai from comment #12) > > BTW, does the built-in headphone jack work? If yes, what if you plug both > the built-in and dock headphone jacks at the same time? With the 4.13 Kernel, when using both the dock and the headphone jack on the laptop, only the headphone jack is working. And there is still no sound with only the dock plugged in. Is there anything more we can test? Thanks for your help, Michael Same issue on kernel 4.13.7 with a Thinkpad T570. When connecting to the Ultra Dock’s jack output the built-in speakers mute, but no audio is sent to that jack. On a previous laptop Thinkpad T450s with the same Ultra Dock, I could get audio from the dock’s jack output. (Though I sometimes had to disconnect that jack and connect it again to get it recognized when resuming from suspend-to-RAM.) For future readers who like me are new to all this and try to debug this: https://www.kernel.org/doc/html/latest/sound/hd-audio/notes.html#hd-audio-reconfiguration has documentation on messing with HDA config without rebooting. Writing to the '/sys/class/sound/hwC0D0/reconfig' file may fail with an error message like "Device is busy" if pulseaudio is running. On Archlinux with GNOME, I’ve had to: * Run 'systemctl --user mask pulseaudio.socket' * Run 'pulseaudio --kill' * Run 'machinectl shell gdm@' - In the newly opened subshell, run 'pulseaudio --kill' - Exit that subshell with CTRL-D or 'exit' Then when I’m done messing with config: * 'pulseaudio --start' * 'systemctl --user unmask pulseaudio.socket' (In reply to Dieter Mummenschanz from comment #3) > The hdajacksensetest tool only shows this when the Laptop is docked and a > Headphone is pluged in: > Pin 0x18 (Black Mic, Left side): present = No > Pin 0x21 (Black Headphone, Left side): present = No > > So I did some patching using a early firmware load patch floating around the > web targeting the same docking station for my older T440p laptop: > echo 0x17 0x21211010 > /sys/class/sound/hwC0D0/user_pin_configs > echo 1 > /sys/class/sound/hwC0D0/reconfig > > Now my Docking Station Headphone Jack is being detected! :) > > With the Headphone Connected: > Pin 0x17 (Black Headphone, Docking station, Rear side): present = Yes > Pin 0x18 (Black Mic, Left side): present = No > Pin 0x21 (Black Headphone, Left side): present = No > > And disconnected: > Pin 0x17 (Black Headphone, Docking station, Rear side): present = No > Pin 0x18 (Black Mic, Left side): present = No > Pin 0x21 (Black Headphone, Left side): present = No > > However there is STILL no sound even after unmuting everything in alsamixer! I’ve managed to reproduce this result, but I don’t know if it’s significant. `hdajacksensetest --help` documents this option: -a, --allpins try all pins, even those who (probably) does not have a physical jack Running with this option, without any user_pin_configs, and with a jack connected to the dock, I get: Pin 0x12 (Internal Mic): present = No Pin 0x13 (Not connected): present = No Pin 0x14 (Internal Speaker): present = No Pin 0x17 (Not connected): present = Yes Pin 0x18 (Black Mic, Left side): present = No Pin 0x19 (Not connected): present = No Pin 0x1a (Not connected): present = No Pin 0x1d (Not connected): present = No Pin 0x1e (Not connected): present = No Pin 0x1f (Not connected): present = No Pin 0x21 (Black Headphone, Left side): present = No That Yes for pin 0x17 becomes No when I disconnect the physical jack. So it looks like jack sensing works correctly regardless of user_pin_configs (all that does is make hdajacksensetest without -a not skip that pin because it assumes there’s nothing there), what’s missing is somehow routing audio to that output. > I'm pretty sure 0x17 is the right pincfg but I'm not sure about 0x21211010 > and how I obtain such an address for my laptop. For what it’s worth, I believe 0x21211010 is not an address but a bit-field. The hdajackretask tool gives a GUI for picking and setting these values. If you select "Advanced override" you can see the components. A pin config says things like "This is a jack connector, 3.5mm, black, located at the rear of a dock, for headphones" etc. This file: http://git.alsa-project.org/?p=alsa-tools.git;a=blob;f=hdajackretask/sysfs-pin-configs.c contains bit masks and offsets that indicate which component is what. Could you try to play with the 0x17 config 0x21211010 and GPIO pins - for example using HDA Analyzer ? https://www.alsa-project.org/main/index.php/HDA_Analyzer The GPIO might control an amplifier or something else on the analog path in the docking station.. # uname -sr Linux 4.13.12-1-ARCH Now things are different (maybe due to the new kernel?). - pulseaudio -k - echo 0x17 0x21211010 > /sys/class/sound/hwC0D0/user_pin_configs - echo 1 > /sys/class/sound/hwC0D0/reconfig - pulseaudio spawns again Results: - sound over speaker works initially - connect headphones to jack on laptop -> no sound at all - connect headphones to jack on dock -> no sound at all - unplug headphones again -> no sound at all (not even on speaker!) - sensing does not work anymore: pavucontrol shows me whatever was sensed before the reconfig, but it does not change anymore when I plug or unplug the headphones - pulseaudio shows me a new audio profile with 4.0 surround instead of stereo. It does not have headphones as output, only speakers. Trying more: - select the new profile -> still no sound - select stereo again -> at least speakers work again - sensing still does not work, I need to restart to get that working again I tried to play around with GPIO but nothing happened -- but maybe this observation is useless before the other issue has been sorted. Info for 0x17: Node 0x17 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out Control: name="Headphone Playback Switch", index=0, device=0 ControlAmp: chs=3, dir=1, idx=0, ofs=0 Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x00 0x00] Pincap 0x0001001c: OUT HP EAPD Detect EAPD 0x2: EAPD Pin Default 0x411111f0: [N/A] Speaker at Ext Rear Conn = 1/8, Color = Black DefAssociation = 0xf, Sequence = 0x0 Misc = NO_PRESENCE Pin-ctls: 0xc0: OUT HP Unsolicited: tag=0x01, enabled=1 Power: setting=D3, actual=D3 Connection: 3 0x0c 0x0d* 0x06 I have the same problem with a Thinkpad T470s on an Ultra Dock 90W using OpenSUSE Tumbleweed 20180116 with Kernel 4.14.13. Anything I can provide to help debug this problem? The issue has FINALLY been fixed with this commit: https://cgit.freedesktop.org/drm-tip/commit/?id=61fcf8ece9b6b09450250c4ca40cc3b81a96a68d I confirm the headphone jack now works with my T470 attached to the my ultra dock! Does this work for anybody? Trying the patch, now just PA crashes, but still no sound :/ https://bugzilla.redhat.com/show_bug.cgi?id=1543326 Nevermind, as it turns out, it did not work due to my previous attempts fixing this issue. Removing all the modprobes, the sound output via my dock works now. Thx for fixing this and sorry for the noise. The patch is in kernel changelog 4.15.5 https://cdn.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.15.5 Updated from https://www.archlinux.org/packages/testing/x86_64/linux/ It works like magic. T740p and thinkpad ultradoc 40a2 This seemed fixed after rebooting into 4.15.5 on Archlinux, but after a suspend-to-ram/resume cycle I’m back to the previous situation where hdajacksensetest does detect when a jack is connected to the dock’s output but no audio comes out form there. (There’s a new entry though: Pin 0x19 (Black Mic, Docking station, Rear side): present = No) (In reply to simon-bugzilla-kernel from comment #27) > This seemed fixed after rebooting into 4.15.5 on Archlinux, but after a > suspend-to-ram/resume cycle I’m back to the previous situation where > hdajacksensetest does detect when a jack is connected to the dock’s output > but no audio comes out form there. (There’s a new entry though: Pin 0x19 > (Black Mic, Docking station, Rear side): present = No) As a blind shot: does the patch below change the behavior? Created attachment 274455 [details]
Test fix for resume issue
This additional patch does work for me after suspend/resume. Thanks for your quick response! Thanks for testing. I'll submit and merge the additional fix to upstream. Could you say please since which version it will be in upstream? ```uname -r 4.15.6-1-ARCH``` Seems resume wasn't fixed Felixoid, the initial patch is in 4.15.5 and worked for me as long as I did not suspend. The second patch attached here (which as far as I know is not upstream yet) improves things, but I sometimes still need remove/reconnect the jack to the dock in order for it to be detected. I’m not quite sure of the exact conditions, but I’ve seen it happen after a reboot (while leaving laptop and jack on the dock), and another time after suspend-to-RAM, moving to a different dock (but same model), then resume. (In reply to Takashi Iwai from comment #31) > Thanks for testing. I'll submit and merge the additional fix to upstream. This is part of 4.15.9, isn’t it? It's part of the 4.15.8 kernel which I installed today on arch linux. check the changelog: https://cdn.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.15.8 |
Created attachment 255643 [details] alsa-info.sh dump Hello, I'm unable to get sound via the jack headphone connection on my lenovo dock when a t470 is connected. Some years ago I've experienced a similar issue with a t440p connected to the same docking station. Back then a patch helped to activate the jack sound over the docking station: [codec] 0x10ec0292 0x17aa220e 0 [pincfg] 0x16 0x21211010 0x19 0x21a11010 So I've tried to match codec and pincfg to my t470 without success unfortunately: [codec] 0x10ec0298 0x17aa2245 0 [pincfg] 0x17 0x21211010 0x19 0x21a11010 alsa-info.sh attached. Any ideas / pathces I can test?