Bug 469277 - Black screen after loging in my machine when external screen is attached
Summary: Black screen after loging in my machine when external screen is attached
Status: RESOLVED WORKSFORME
Alias: None
Product: KScreen
Classification: Plasma
Component: common (show other bugs)
Version: 5.27.4
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kscreen-bugs-null@kde.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-02 16:58 UTC by Ahmed
Modified: 2023-07-02 03:45 UTC (History)
1 user (show)

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


Attachments
The output of running `kscreen-doctor -o` (when everything is working) (1.29 KB, text/x-log)
2023-05-16 09:28 UTC, Ahmed
Details
The output of running `kscreen-doctor -o` (when everything is not working) (307.24 KB, image/jpeg)
2023-05-31 20:19 UTC, Ahmed
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ahmed 2023-05-02 16:58:31 UTC
SUMMARY
***
My laptop is attached to external screen through HDMI cable, and "Display Layout" is set to "Expand to right", but after I suspend the laptop when it is attached to external screen, the screen of the laptop does not display anything after going out of suspend.
***

STEPS TO REPRODUCE
1. Attach external screen to a laptop through HDMI cable.
2. Choose "Expand to right" from "Display Layout".
3. Suspend the laptop.
4. Turn on the laptop again.

OBSERVED RESULT
On the lock screen only the cursor appears and nothing else, but when I detach the external screen then suspend the laptop and turned it on again, the laptop screen works normally.

EXPECTED RESULT
The laptop screen to turn on again after going out of suspend.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 23.04
KDE Plasma Version: KDE Plasma 5.27.4
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
My wild guess: "Display Layout" is set to external monitor, which is an option that is not selected previously. Moreover, the external screen is turned off and KDE Plasma is not aware of that and choose to use the external monitor only, which is the worst option in this situation. Furthermore, I can not change "Display Layout" when the HDMI cable is not attached, which add more complications to this issue.

Finally, to be more clear, I use Wayland, but I encountered this issue before when using X11.
Comment 1 Ahmed 2023-05-02 17:08:22 UTC
One more thing: I suspend the laptop from the external monitor while the lid of the laptop is closed.
Comment 2 Ahmed 2023-05-04 08:18:36 UTC
Additional info: I found out that this issue happens when I suspend, reboot, or shutdown my machine even when "Screen Layout" is set to "Switch to Laptop screen", and I must detach the HDMI cable, then press the power button to suspend and press it again to go out of suspend, so I can use my Laptop screen.

Please, fix this issue because it is so annoying.
Comment 3 Ahmed 2023-05-07 07:37:44 UTC
What happens is after I close the lid of the laptop, the external screen is set as primary, and when I suspend, restart, or shutdown my machine, the external screen is still set as primary, and I have to change screen layout from the external screen.

The problem with that is the external screen is far away from the laptop, so it is painful for me to keep doing that everyday.
Comment 4 Ahmed 2023-05-08 15:56:32 UTC
Also, screen layout change from "Switch to external laptop" to "Extend to right" without changing it myself, it changes randomly even when the external screen is off.
Comment 5 Nate Graham 2023-05-15 23:12:25 UTC
Some questions:

1. Can you please paste the output of running `kscreen-doctor -o` in a terminal window before suspending the machine (when everything is working) and then again afterewards (when things are messed up)? Thanks!

2. Can you describe the screen in a bit more detail? You said it's far away from the laptop... what kind of screen is it? Does it fully power off when it goes to sleep such that the computer no longer recognizes that there's an external screen attached?
Comment 6 Ahmed 2023-05-16 09:28:53 UTC
Created attachment 158993 [details]
The output of running `kscreen-doctor -o` (when everything is working)

Here is the output of running `kscreen-doctor -o` in a terminal window before suspending the machine (when everything is working)
Comment 7 Ahmed 2023-05-16 09:41:07 UTC
I attached the output of running `kscreen-doctor -o` in a terminal window before suspending the machine (when everything is working), and I will attach the output of the same command later when the issue happens again.

The attached screen is Samsung TV screen, here is a link to the specification of the screen: https://www.samsung.com/levant/support/model/UA32J4303ARXTW/

The screen does not turn off completely, it stays in suspend until you press the power button from the remote control, or after pushing the power button underneath it. The only way to turn the screen off completely is by unplugging it from the power outlet. Also, when the TV screen is attached to the laptop when it is suspended, Xrandr recognizes it.
Comment 8 Nate Graham 2023-05-16 16:11:36 UTC
FWIW cannot reproduce with the original Steps To Reproduce when connecting an HDMI monitor (not a TV) to my laptop and extending to the right.
Comment 9 Ahmed 2023-05-17 08:23:52 UTC
(In reply to Nate Graham from comment #8)
> FWIW cannot reproduce with the original Steps To Reproduce when connecting
> an HDMI monitor (not a TV) to my laptop and extending to the right.

I tried to reproduce the same issue all day, yesterday, and somehow it is gone.

I remember using ARandR to save Screen Layout, maybe that is what fixed the misconfiguration.
Comment 10 Nate Graham 2023-05-17 14:08:31 UTC
:/

Well, if I can't reproduce it, and you can't reproduce it anymore either, I don't think there's much chance we can proceed here, unfortunately.
Comment 11 Ahmed 2023-05-31 20:12:18 UTC
I encountered the same issue today and yesterday. I have updated Kubuntu recently to 5.27.5.
Pressing the power button does not suspend my machine, and unplugging the HDMI cable does not help either.
I could go to the terminal by pressing alt+ctrl+f2, and after trying to execute `kscreen-doctor -o`, I got an error that I captured using my phone. I will upload it in my next comment.
Comment 12 Ahmed 2023-05-31 20:19:55 UTC
Created attachment 159375 [details]
The output of running `kscreen-doctor -o` (when everything is not working)

qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be intialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
Aborted (core dumped).
Comment 13 Nate Graham 2023-06-02 20:50:50 UTC
Can you move aside your ~/.local/share/kscreen folder, disable any randr scripts you're using, and then try again?

If the issue happens again, hit Alt+F2 to launch KRunner, which you can use to launch Konsole, and then you can run kscreen-doctor in there. But from the looks of it, the problem here may be in Plasma, rather than KScreen.
Comment 14 Bug Janitor Service 2023-06-17 03:45:03 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 15 Bug Janitor Service 2023-07-02 03:45:08 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!