Bug 488005 - Lid close leads to suspend even when external monitor is attached (only for Wayland session)
Summary: Lid close leads to suspend even when external monitor is attached (only for W...
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Power management & brightness (show other bugs)
Version: 6.2.4
Platform: Neon Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: multiscreen
: 479384 493888 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-06-04 07:34 UTC by Jan Andrle
Modified: 2024-12-18 21:40 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Andrle 2024-06-04 07:34:17 UTC
SUMMARY
When I connect to the Wayland session with the laptop lid closed (but with the external monitor connected) the laptop immediately goes to sleep. Sometimes I manage to interrupt the sleep by clicking the mouse/keyboard, then the system works as expected (meaning as it is set up). When I connect to X11 everything works as it should.

It seems very similar to [Bug 438716](https://bugs.kde.org/show_bug.cgi?id=438716), but I have started testing Wayland session after v6 (as it was setted to default).

STEPS TO REPRODUCE
1. uncheck “even if external monitor is connected” or choose “do nothing” when lid closed
2. connect external monitor (tested with hdmi and usb-c)
3. restart system
4. close lid
5. on login page, choose Wayland and login

alternatively
1. login to Wayland
2. uncheck “even if external monitor is connected” or choose “do nothing” when lid closed
3. connect external monitor (tested with hdmi and usb-c)
4. close lid

OBSERVED RESULT
System suspends immediately

EXPECTED RESULT
Login to the system and being able to use it on external monitor.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.0

ADDITIONAL INFORMATION
OS: KDE neon 6.0
Kernel: 6.5.0-10040-tuxedo (64-bit)
Graphics: Mesa Intel® Xe Graphics
Computer: TUXEDO InfinityBook S 15 Gen6
Comment 1 Nate Graham 2024-06-11 20:36:37 UTC
I cannot reproduce this issue as described. The setting works as expected for me on Wayland.
Comment 2 Zamundaaa 2024-06-12 16:21:53 UTC
Can't reproduce either, on git master or on 6.0.5 from Fedora packages
Comment 3 Vinícius 2024-08-16 15:34:27 UTC
i'm getting the same issue, the setting "even when en external monitor is connected" is deselected, but when closing my laptop lid it goes immediately to sleep, with my external monitor connected or my TV both using HDMI

Operating System: Fedora Linux 40
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.3-200.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5700U with Radeon Graphics
Memory: 7,1 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: LENOVO
Product Name: 82MF
System Version: IdeaPad 3 15ALC6
Comment 4 Nate Graham 2024-08-21 15:58:51 UTC
Still working perfectly for me here with current git master. Hopefully someone who knows the details of any of the power management stuff can investigate soon.
Comment 5 Vinícius 2024-08-22 01:29:53 UTC
yeah, i can't reproduce this anymore, maybe it was a kernel bug and got fixed when i updated it?, i'm not gonna mark as fixed because i don't know if my issue were the same
Comment 6 Nate Graham 2024-08-22 02:39:29 UTC
Could be, yeah.
Comment 7 Jan Andrle 2024-08-23 10:35:45 UTC
Unfortunately for me, the issue still persists 😟
…I am including my current `uname -a` output:

> Linux TUXEDO-InfinityBook-s15gen6 6.8.0-40-generic #40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Comment 8 Nate Graham 2024-08-29 23:15:09 UTC
Jan, what version of Plasma are you running?
Comment 9 Jan Andrle 2024-08-30 08:38:35 UTC
(In reply to Nate Graham from comment #8)
> Jan, what version of Plasma are you running?

plasmashell 6.1.4
Comment 10 TraceyC 2024-08-30 20:55:30 UTC
I am able to reproduce this reliably on git-master on Solus, HDMI cable to external monitor
I can only reproduce after reboot, not after waking from sleep with the monitor already connected 
I also found a related bug

**Settings**
When laptop lid closed: Sleep
Even with external monitor: unchecked
Security & Privacy -> Screen Locking: "Lock after waking from sleep" is checked

**Steps**
Connected HDMI monitor, restarted
Closed lid before boot
At boot, the login screen was correctly shown on the external monitor
Logged in
System immediately went to sleep. Not just the monitor, the power button on the side of the laptop was pulsing

ALSO, after waking the system using an external keyboard, the desktop loaded, unlocked, without requiring me to log in.

Note: I also saw the system immediately go to sleep after logging out and logging back in. Again, I was not prompted to login after waking from that sleep.

kernel 6.10.6
Comment 11 Nate Graham 2024-08-31 01:56:43 UTC
Hmm, with those settings and steps and also Kernel 6.10.6, I cannot reproduce the issue with a wayland session and a monitor connected using DisplayPort-over-USB-C. Need to try again with an HDMI cable on the same or a different monitor.

Were you logging into a Wayland session or an X11 session? Also what kind of GPU does the laptop have? Mine has a 10th gen Intel HD630 GPU.
Comment 12 Jan Andrle 2024-08-31 15:48:45 UTC
(In reply to Nate Graham from comment #11)
> DisplayPort-over-USB-C. Need to try again with an HDMI cable on the same or
I have tested HDMI and USB-C myself and both have the same issue for me

> Were you logging into a Wayland session or an X11 session? Also what kind of
into Wayland  (x11 works correctly)

> GPU does the laptop have? Mine has a 10th gen Intel HD630 GPU.
i am not a linux geek, is this output ok?
`sudo lspci  -v -s  $(lspci | grep ' VGA ' | cut -d" " -f 1)`
00:02.0 VGA compatible controller: Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics] (rev 01) (prog-if 00 [VGA controller])
        Subsystem: CLEVO/KAPOK Computer TigerLake-LP GT2 [Iris Xe Graphics]
        Flags: bus master, fast devsel, latency 0, IRQ 182, IOMMU group 1
        Memory at 6020000000 (64-bit, non-prefetchable) [size=16M]
        Memory at 4000000000 (64-bit, prefetchable) [size=128M]
        I/O ports at 4000 [size=64]
        Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
        Capabilities: [40] Vendor Specific Information: Len=0c <?>
        Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
        Capabilities: [ac] MSI: Enable+ Count=1/1 Maskable+ 64bit-
        Capabilities: [d0] Power Management version 2
        Capabilities: [100] Process Address Space ID (PASID)
        Capabilities: [200] Address Translation Service (ATS)
        Capabilities: [300] Page Request Interface (PRI)
        Capabilities: [320] Single Root I/O Virtualization (SR-IOV)
        Kernel driver in use: i915
        Kernel modules: i915, xe
Comment 13 Zamundaaa 2024-09-02 16:47:37 UTC
I can't trigger this either, logging in with the lid closed works correctly on 6.1 and git master
Comment 14 TraceyC 2024-09-23 22:02:30 UTC
(In reply to Nate Graham from comment #11)
> Hmm, with those settings and steps and also Kernel 6.10.6, I cannot
> reproduce the issue with a wayland session and a monitor connected using
> DisplayPort-over-USB-C. Need to try again with an HDMI cable on the same or
> a different monitor.
> 
> Were you logging into a Wayland session or an X11 session? Also what kind of
> GPU does the laptop have? Mine has a 10th gen Intel HD630 GPU.

I can still reliably reproduce this on a Wayland session

KDE Plasma Version: 6.1.80
KDE Frameworks Version: 6.7.0
Qt Version: 6.7.2
Kernel Version: 6.10.11-303.current (64-bit)
Graphics Platform: Wayland
Graphics Processor: AMD Radeon Vega 10 Graphics
Comment 15 Natalie Clarius 2024-09-23 23:19:58 UTC
Does it only happen right after login after a reboot or also when you already have a session running and then change the setting?
Comment 16 TraceyC 2024-09-24 16:09:03 UTC
(In reply to Natalie Clarius from comment #15)
> Does it only happen right after login after a reboot or also when you
> already have a session running and then change the setting?

I can only reproduce right after login with a reboot

With these steps the display moves to the HDMI display as expected, with an already running session
1. Have Wayland session running
2. Uncheck “even if external monitor is connected” or choose “do nothing” when lid closed (also tested with lid close: sleep, except if external monitor connected)
3. connect external monitor over HDMI
4. close lid
Comment 17 Natalie Clarius 2024-09-25 00:53:30 UTC
I can reproduce the bug with the steps given in the OP.
Comment 18 Natalie Clarius 2024-09-25 01:11:51 UTC
In the logs I don't see any PowerDevil activity before the system suspends. So perhaps it's not PowerDevil putting the system to sleep, or rather PowerDevil failing to prevent the system from going to sleep?
Comment 19 Natalie Clarius 2024-09-30 21:26:52 UTC
*** Bug 479384 has been marked as a duplicate of this bug. ***
Comment 20 Natalie Clarius 2024-09-30 21:27:05 UTC
*** Bug 493888 has been marked as a duplicate of this bug. ***
Comment 21 Jan Andrle 2024-10-18 07:46:01 UTC
Hi all.
I have news from last time.

In the end, I decided to do a clean (re)install of the system (yah, the upgrade to Ubuntu 24.04 was not downright successful in my case). Since I have a Tuxedo laptop, I'm trying out TUXEDO OS 3, with the following parameters:

KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Kernel Version: 6.11.0-102007-tuxedo (64-bit)
Graphics Platform: Wayland
Graphics Processor: Mesa Intel® Xe Graphics
Based on Ubuntu: 22.04.5

**...and the problem no longer occurs**. So, maybe something “went wrong” in the original system during the upgrade or …?

PS: I still have the original system temporarily on a secondary drive, so I can add some information for investigation if needed. Just booting into graphics mode doesn't work.
Comment 22 TraceyC 2024-10-18 19:54:25 UTC
I'm not able to reproduce this on git-master. This may have been fixed by other development work.
Are you still able to reproduce this, Natalie?
Comment 23 Dennis 2024-10-22 12:42:02 UTC
I don't see this behaviour anymore:

Operating System: KDE neon 6.2
KDE Plasma Version: 6.2.1
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Kernel Version: 6.8.0-45-generic (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-8565U CPU @ 1.80GHz
Memory: 15,3 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Manufacturer: Dell Inc.
Product Name: XPS 13 9380
Comment 24 Alberto Salvia Novella 2024-10-22 14:08:02 UTC
But I do on:

Operating System: Arch Linux
KDE Plasma Version: 6.2.1
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.0
Kernel Version: 6.11.4-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 12 × Intel® Core™ i7-10750H CPU @ 2.60GHz
Memory: 15,5 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1650/PCIe/SSE2
Manufacturer: LENOVO
Product Name: 81Y4
System Version: IdeaPad Gaming 3 15IMH05
Comment 25 Alberto Salvia Novella 2024-10-22 14:09:13 UTC
Graphic driver: nvidia-open 560.35.03