-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logind does not detect docking station, goes into sleep when turning on the monitor #18333
Comments
is this reproducible in something less exotic than swamsg? no idea what that does with logind, i.e. whether it inibits its handling or not... how does your docking station communicate its state? logind only checks for an SW_DOCK input device. If you docking station doesn't have that we have no idea about the docking state. That's why we also check the displays. |
Following your comments in older issues, I used
I searched for SW_DOCK in supported events for each of them, but didn't find anything. I tested "ThinkPad Extra Buttons" to see if there was any event triggered when I undock-and-redock the laptop but there was none. I also tested "HDA Intel PCH Dock Mic" and "HDA Intel PCH Dock Headphone", only the latter did something.
Back to the reproduction steps, I've realized that swaymsg is not necessary. 1 - Turn on the monitor, place the laptop in the docking station and close the lid. |
Also, these are some of the files in
|
I investigated further into the monitor issue. I've run 1 - Turn on the monitor place the laptop in the docking station. The lid remains open, running This is the result
All events are repoted to EDIT: This was with an Display Port cable, because it's a 4k monitor. I tried with an HDMI cable and the problem did not happen, no events are triggered when the monitor is turned on/off. There are only events when the HDMI cable is plugged/unplugged. |
So the problem appears to be the Display Port Protocol. Turning the monitor on or off doesn't trigger any event when connected by HDMI, only if the cable is connected/disconnected. However when connected by Display Port, the monitor appears to trigger a new display port handshake after being turned on[1], that explains why both disconnect and connect events are sent almost simultaneously. Regarding docking support, is there any chance of supporting the thinkpad ultra dock station? Could something be patched so that a SW_DOCK event is triggered when connected? Or could logind somehow subscribe to |
we never had support for such "acpi dock" devices. Is that a class device with a defined API? Ideally these devices would just generate SW_DOCK input events like any other dock... i.e. I'd really prefer for this to be fixed in the kernel. That said, supporting this in logind dirctly would probably be OK. We don't like adding code that deals with specific hardware, specific drivers, but I guess a reasonably ACPI interface is probably OK to support, it's after all already an abstraction layer of its own. That said, this would require a patch being submitted, by someone who has the hw, i.e. not us... Summary: unless you prep a patch this is not going to get fixed, and I'd suggest fixing it in the kernel by changing the driver to register an SW_DOCK input device like all other dock drivers. But if that's not in the cards, it shoul dbe OK to submit a patch against logind instead — however only if the driver is reasonably OK, i.e. has notifications in some form? |
I decided to see how deep the rabbit hole goes, and I'm afraid it there is nothing we can do. Let me explain. First I located the kernel driver behind The thinkpad_acpi driver is huge and complex, so first I gathered some general information about the context. ACPI is how the t470 communicates with the dock station. I installed
None of these events is related to dock/undock. Only
I found similar reports[2] complaining about t470 not detecting dock status. At this point I was completely puzzled, how does To cope with the confusion and uncertainty generated by this information, I needed some entertainment. I typed the following command in the terminal from time to time. I was amazed, wondering about all the complexities hidden behind such a simple command.
I picked up the laptop and moved to the living room. There I continued typing the same command every minute or so.
And... I finally realized what was going on. There is no way to know if the laptop is docked and the kernel doesn't know it either. So if someone reading this is facing the same problem, consider these workarounds.
@poettering, thanks for bearing with me. |
but that sounds like some bug in the kernel driver that could be fixed, no? Ping the kernel driver maintainers maybe? |
I've just contacted kernel driver maintainers to let them know |
I'm on Kernel 5.14.8 and still experience that issue. Are there any updates on this? |
On January 26 I posted a text-only email to I also received no bounce notification. My guess is that the email was filtered out because it was not interesting enough or because there were some requirements that I was not aware of and this message didn't meet. |
Thank you for the reply. I can launch another attempt to get a foot in the door. |
systemd version the issue has been seen with
Used distribution
Fedora 33
Linux kernel version used (
uname -a
)CPU architecture issue was seen on
x86_64 Intel core i5 7th gen
Expected behaviour you didn't see
According to this function, if the docking station had been detected, systemd should have printed
"System is docked."
instead of"External (1) displays connected."
systemd/src/login/logind-core.c
Lines 634 to 654 in fee6441
In my system, the docking station can be found in
/sys/devices/platform/dock.0/
.Unexpected behaviour you saw
Steps to reproduce the problem
Place the laptop (t470) in its docking station. Have an external monitor attached and turn it on, close the lid of the laptop.
Lock the screen and wait until it times out and turns off the screen (from software,
swaymsg "output * dpms off"
). Then manually turn off the monitor (physically).The problem is that now, when you turn on again the monitor (physically) the system will go into sleep. Since I'm docked I expected that logind should not suspend the system I think there are two issues:
The text was updated successfully, but these errors were encountered: