Bug 475632 - When booting up with laptop lid closed, external monitor turns off after logging in and then session locks
Summary: When booting up with laptop lid closed, external monitor turns off after logg...
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: multi-screen (show other bugs)
Version: master
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL: https://github.com/systemd/systemd/is...
Keywords: multiscreen, qt6, regression, wayland
: 478325 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-10-14 22:28 UTC by Piotr Mierzwinski
Modified: 2024-01-29 15:56 UTC (History)
7 users (show)

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


Attachments
lspci -v (10.01 KB, text/plain)
2023-10-31 15:27 UTC, Piotr Mierzwinski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Mierzwinski 2023-10-14 22:28:08 UTC
SUMMARY
Since couple weeks I experience issue like in subject.

I work with passwordless user account, which starts Wayland session. Monitor is connected via HDMI, via USB (type C) hub. Please notice that this was working well couple weeks ago.

Anyway. Splash screen starts working, and after couple of seconds I can see like my external monitor turns off. Using keyboard I wake up it and get lock screen. After unlock it, Plasma starts normally, so in my case are opening Firefox windows (I have save session turned on, but unfortunately other applications are not restored) and shows: wallpaper and panel.

STEPS TO REPRODUCE
prerequisite: external monitor
1. Start Plasma with passwordless user account (not sure if this is enough, didn't test with normal account)
2. 
3. 

OBSERVED RESULT
External monitor turns off in moment of start Plasma

EXPECTED RESULT
External monitor should not turns off in moment of start Plasma

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.27.80
KDE Frameworks Version: 5.240
Qt Version: 6.6

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2023-10-20 15:59:40 UTC
Seems like it could be a regression from https://invent.kde.org/plasma/kwin/-/merge_requests/4431, which went in 2 weeks ago, so the timeframes roughly match up.
Comment 2 Zamundaaa 2023-10-23 13:48:01 UTC
Can you give some more details on the exact setup? Are you starting the system with the laptop lid closed?
Comment 3 Piotr Mierzwinski 2023-10-31 15:27:21 UTC
Created attachment 162767 [details]
lspci -v

Yes. I start with lid closed.
In attachment please find details of my hardware configuration. Please let me know if you need some specific information about my laptop.
Comment 4 Piotr Mierzwinski 2023-10-31 15:31:11 UTC
BTW. Recently I observed this issue also when I logged in to xfce4, which works in X11. I mean after I enter my password in login screen also my monitor is turned off.
Comment 5 Piotr Mierzwinski 2023-10-31 15:32:12 UTC
BTW. When I start system with monitor connected directly by HDMI then issue doesn't happen.
Comment 6 Piotr Mierzwinski 2023-10-31 15:42:21 UTC
And my kscreen configuration:
<cut>
[
    {
        "enabled": false,
        "id": "0ee196951a0c645a9e9b471a475fe301",
        "metadata": {
            "fullname": "xrandr-unknown",
            "name": "eDP-1"
        },
        "mode": {
            "refresh": 60.02000045776367,
            "size": {
                "height": 1080,
                "width": 1920
            }
        },
        "overscan": 0,
        "pos": {
            "x": 0,
            "y": 0
        },
        "priority": 0,
        "rgbrange": 0,
        "rotation": 1,
        "scale": 1,
        "vrrpolicy": 0
    },
    {
        "enabled": true,
        "id": "e0890536ab4abaa0187dbf8d8288970a",
        "metadata": {
            "fullname": "xrandr-NEC Corporation-EA275WMi-74105467NB",
            "name": "DP-1"
        },
        "mode": {
            "refresh": 59.95100021362305,
            "size": {
                "height": 1440,
                "width": 2560
            }
        },
        "overscan": 0,
        "pos": {
            "x": 0,
            "y": 0
        },
        "priority": 1,
        "rgbrange": 0,
        "rotation": 1,
        "scale": 1,
        "vrrpolicy": 0
    }
]
</cut>
Comment 7 Nate Graham 2023-11-01 18:20:44 UTC
It sounds like you're also using auto-lock-on-login, right? How exactly did you turn that on?
Comment 8 Piotr Mierzwinski 2023-11-15 02:02:46 UTC
(In reply to Nate Graham from comment #7)
> It sounds like you're also using auto-lock-on-login, right? How exactly did
> you turn that on?

Sorry, I wasn't aware I used this option. To be honest I don't know what it is this option and seems intentionally I didn't turn it on. I had only autologin (password less login), but since couple days (maybe week) stopped work and I get login screen.
I'm not sure where should I find this option.
Comment 9 Nate Graham 2023-11-17 21:58:41 UTC
Ok, so you don't have auto-lock-on-login enabled.
Comment 10 Nate Graham 2023-11-17 22:09:56 UTC
I can reproduce the issue even without auto-login. Steps:

1. Connect an external monitor
2. Shut down machine and close laptop lid
3. Turn on laptop without opening lid (or, if you have to open the lid to turn it on, immediately close it)
4. SDDM is shown on the external screen. All good. Log in

At this point, the external screen turns off. If I bang on the keyboard, it turns back on again and shows the lock screen (not the login screen). If I then unlock, I see the chooser OSD but can otherwise use the system normally in "only external screen" mode.
Comment 11 Piotr Mierzwinski 2023-11-23 00:09:09 UTC
(In reply to Nate Graham from comment #10)
> I can reproduce the issue even without auto-login. Steps:
> 
> 1. Connect an external monitor
> 2. Shut down machine and close laptop lid
> 3. Turn on laptop without opening lid (or, if you have to open the lid to
> turn it on, immediately close it)
> 4. SDDM is shown on the external screen. All good. Log in
> 
> At this point, the external screen turns off. If I bang on the keyboard, it
> turns back on again and shows the lock screen (not the login screen). If I
> then unlock, I see the chooser OSD but can otherwise use the system normally
> in "only external screen" mode.

I'm happy you were able to reproduce the issue. Big thanks for your effort.
So now there is need to find out the reason of this and of course solve it.
Comment 12 Doug 2023-12-04 04:41:29 UTC
I am having a similar issue without the laptop lid being closed and without auto-login.

My monitor is connected via DP, when I start up Neon both monitors come on, as they should, for SDDM.  Enter my login info fine and hit enter, then both screens go blank.  The laptop screen should, as it is set to switch to the external monitor which should still be on.  I can get the external monitor to come back on by turning it off (which starts up my laptop monitor), and then back on again (which turns off laptop monitor and sends desktop to the external monitor as originally intended.
Comment 13 Nate Graham 2023-12-11 22:40:00 UTC
*** Bug 478325 has been marked as a duplicate of this bug. ***
Comment 14 Bug Janitor Service 2023-12-12 16:39:52 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/289
Comment 15 Zamundaaa 2023-12-14 22:20:38 UTC
Git commit 66dc609244b716a59bec55dda3ecc8553522783f by Xaver Hugl.
Committed on 14/12/2023 at 22:11.
Pushed by zamundaaa into branch 'master'.

actions/bundled: wait for output config before acting on lid close

When the system starts up with the lid closed, powerdevil must not act on
that before it has the output configuration, as otherwise it may suspend
the system even though an external display is connected

M  +8    -2    daemon/actions/bundled/handlebuttonevents.cpp
M  +1    -1    daemon/actions/bundled/handlebuttonevents.h

https://invent.kde.org/plasma/powerdevil/-/commit/66dc609244b716a59bec55dda3ecc8553522783f
Comment 16 Piotr Mierzwinski 2023-12-19 02:08:01 UTC
Confirm. Issue disappeared.
I tested with monitor connected directly by HDMI and by HDMI located in my USB Hub. In both cases monitor didn't turn off during Plasma booting.
Thanks a lot for fixing.
Comment 17 Nate Graham 2023-12-20 18:09:27 UTC
Hooray!
Comment 18 techxgames 2023-12-22 23:04:05 UTC
Just tested from my laptop: Dell Inspiron 5559.

Didn't fix it.
Comment 19 techxgames 2023-12-22 23:04:44 UTC
(In reply to techxgames from comment #18)
> Just tested from my laptop: Dell Inspiron 5559.
> 
> Didn't fix it.

and I just updated it to Beta 2 today
Comment 20 techxgames 2023-12-22 23:06:42 UTC
(In reply to techxgames from comment #18)
> Just tested from my laptop: Dell Inspiron 5559.
> 
> Didn't fix it.

$ lspci -v
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers (rev 08)
        Subsystem: Dell Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers
        Flags: bus master, fast devsel, latency 0
        Capabilities: <access denied>
        Kernel driver in use: skl_uncore

00:02.0 VGA compatible controller: Intel Corporation Skylake GT2 [HD Graphics 520] (rev 07) (prog-if 00 [VGA controller])
        DeviceName:  Onboard IGD
        Subsystem: Dell Skylake GT2 [HD Graphics 520]
        Flags: bus master, fast devsel, latency 0, IRQ 128
        Memory at de000000 (64-bit, non-prefetchable) [size=16M]
        Memory at c0000000 (64-bit, prefetchable) [size=256M]
        I/O ports at f000 [size=64]
        Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
        Capabilities: <access denied>
        Kernel driver in use: i915
        Kernel modules: i915

00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 21) (prog-if 30 [XHCI])
        Subsystem: Dell Sunrise Point-LP USB 3.0 xHCI Controller
        Flags: bus master, medium devsel, latency 0, IRQ 126
        Memory at df210000 (64-bit, non-prefetchable) [size=64K]
        Capabilities: <access denied>
        Kernel driver in use: xhci_hcd
        Kernel modules: xhci_pci

00:14.2 Signal processing controller: Intel Corporation Sunrise Point-LP Thermal subsystem (rev 21)
        Subsystem: Dell Sunrise Point-LP Thermal subsystem
        Flags: fast devsel, IRQ 18
        Memory at df230000 (64-bit, non-prefetchable) [size=4K]
        Capabilities: <access denied>
        Kernel driver in use: intel_pch_thermal
        Kernel modules: intel_pch_thermal

00:15.0 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #0 (rev 21)
        Subsystem: Dell Sunrise Point-LP Serial IO I2C Controller
        Flags: bus master, fast devsel, latency 0, IRQ 16
        Memory at df22f000 (64-bit, non-prefetchable) [size=4K]
        Capabilities: <access denied>
        Kernel driver in use: intel-lpss
        Kernel modules: intel_lpss_pci

00:15.1 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #1 (rev 21)
        Subsystem: Dell Sunrise Point-LP Serial IO I2C Controller
        Flags: bus master, fast devsel, latency 0, IRQ 17
        Memory at df22e000 (64-bit, non-prefetchable) [size=4K]
        Capabilities: <access denied>
        Kernel driver in use: intel-lpss
        Kernel modules: intel_lpss_pci

00:16.0 Communication controller: Intel Corporation Sunrise Point-LP CSME HECI #1 (rev 21)
        Flags: bus master, fast devsel, latency 0, IRQ 125
        Memory at df22d000 (64-bit, non-prefetchable) [size=4K]
        Capabilities: <access denied>
        Kernel driver in use: mei_me

00:17.0 SATA controller: Intel Corporation Sunrise Point-LP SATA Controller [AHCI mode] (rev 21) (prog-if 01 [AHCI 1.0])
        Subsystem: Dell Sunrise Point-LP SATA Controller [AHCI mode]
        Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 124
        Memory at df228000 (32-bit, non-prefetchable) [size=8K]
        Memory at df22c000 (32-bit, non-prefetchable) [size=256]
        I/O ports at f090 [size=8]
        I/O ports at f080 [size=4]
        I/O ports at f060 [size=32]
        Memory at df22b000 (32-bit, non-prefetchable) [size=2K]
        Capabilities: <access denied>
        Kernel driver in use: ahci

00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #5 (rev f1) (prog-if 00 [Normal decode])
        Flags: bus master, fast devsel, latency 0, IRQ 122
        Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
        I/O behind bridge: [disabled]
        Memory behind bridge: df100000-df1fffff [size=1M]
        Prefetchable memory behind bridge: [disabled]
        Capabilities: <access denied>
        Kernel driver in use: pcieport

00:1c.5 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #6 (rev f1) (prog-if 00 [Normal decode])
        Flags: bus master, fast devsel, latency 0, IRQ 123
        Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
        I/O behind bridge: 0000e000-0000efff [size=4K]
        Memory behind bridge: df000000-df0fffff [size=1M]
        Prefetchable memory behind bridge: 00000000d0000000-00000000d00fffff [size=1M]
        Capabilities: <access denied>
        Kernel driver in use: pcieport

00:1f.0 ISA bridge: Intel Corporation Sunrise Point-LP LPC Controller (rev 21)
        Subsystem: Dell Sunrise Point-LP LPC Controller
        Flags: bus master, medium devsel, latency 0

00:1f.2 Memory controller: Intel Corporation Sunrise Point-LP PMC (rev 21)
        Subsystem: Dell Sunrise Point-LP PMC
        Flags: fast devsel
        Memory at df224000 (32-bit, non-prefetchable) [disabled] [size=16K]

00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)
        Subsystem: Dell Sunrise Point-LP HD Audio
        Flags: bus master, fast devsel, latency 32, IRQ 135
        Memory at df220000 (64-bit, non-prefetchable) [size=16K]
        Memory at df200000 (64-bit, non-prefetchable) [size=64K]
        Capabilities: <access denied>
        Kernel driver in use: snd_hda_intel
        Kernel modules: snd_hda_intel, snd_soc_skl, snd_soc_avs, snd_sof_pci_intel_skl

00:1f.4 SMBus: Intel Corporation Sunrise Point-LP SMBus (rev 21)
        Subsystem: Dell Sunrise Point-LP SMBus
        Flags: medium devsel, IRQ 16
        Memory at df22a000 (64-bit, non-prefetchable) [size=256]
        I/O ports at f040 [size=32]
        Kernel driver in use: i801_smbus
        Kernel modules: i2c_i801

01:00.0 Network controller: Intel Corporation Wireless-AC 9260 (rev 29)
        Subsystem: Intel Corporation Wireless-AC 9260
        Flags: bus master, fast devsel, latency 0, IRQ 16
        Memory at df100000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: <access denied>
        Kernel driver in use: iwlwifi
        Kernel modules: iwlwifi

02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL810xE PCI Express Fast Ethernet controller (rev 07)
        Subsystem: Dell RTL810xE PCI Express Fast Ethernet controller
        Flags: bus master, fast devsel, latency 0, IRQ 17
        I/O ports at e000 [size=256]
        Memory at df000000 (64-bit, non-prefetchable) [size=4K]
        Memory at d0000000 (64-bit, prefetchable) [size=16K]
        Capabilities: <access denied>
        Kernel driver in use: r8169
        Kernel modules: r8169
Comment 21 techxgames 2024-01-08 03:08:39 UTC
Should this be reopened?
Comment 22 techxgames 2024-01-18 12:00:16 UTC
Issue still persists for me.  I had to open the lid constantly just to make Plasma launch
Comment 23 Zamundaaa 2024-01-29 15:03:00 UTC
Can reproduce, kind of - my laptop just wakes up quickly again while it's connected to the monitor.
It's not powerdevil causing the problem though, but systemd, which suspends the computer before powerdevil or kwin even run
Comment 24 Zamundaaa 2024-01-29 15:56:00 UTC
See https://github.com/systemd/systemd/issues/31119