Bug 359542 - Waking up notebook from sleep after undocking leaves display turned off
Summary: Waking up notebook from sleep after undocking leaves display turned off
Status: RESOLVED NOT A BUG
Alias: None
Product: KScreen
Classification: Plasma
Component: common (show other bugs)
Version: 5.8.2
Platform: Arch Linux Linux
: NOR grave
Target Milestone: ---
Assignee: Sebastian Kügler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-18 18:14 UTC by OlafLostViking
Modified: 2016-10-21 14:53 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
output of kscreen (deleted)
2016-02-18 18:14 UTC, OlafLostViking
Details
output of "kscreen bug" (deleted)
2016-02-18 18:15 UTC, OlafLostViking
Details
output of "kscreen-console" (2.02 KB, text/plain)
2016-02-18 18:15 UTC, OlafLostViking
Details
output of "kscreen config" (deleted)
2016-02-18 18:16 UTC, OlafLostViking
Details
output of "kscreen-console json" (6.59 KB, application/json)
2016-02-18 18:17 UTC, OlafLostViking
Details
output of "kscreen-console" (2.02 KB, text/plain)
2016-02-18 18:18 UTC, OlafLostViking
Details
output of "kscreen-console config" (862 bytes, text/plain)
2016-02-21 09:20 UTC, OlafLostViking
Details
output of "kscreen-console bug" (6.69 KB, text/plain)
2016-02-21 09:24 UTC, OlafLostViking
Details
output of "loginctl session-status" (9.84 KB, text/plain)
2016-02-21 09:26 UTC, OlafLostViking
Details
xrandr.log (1.21 KB, text/x-log)
2016-07-28 07:59 UTC, OlafLostViking
Details
kscreen-console.log (4.60 KB, text/x-log)
2016-07-28 08:00 UTC, OlafLostViking
Details
the automatically created kscreen.log (806.16 KB, text/plain)
2016-10-20 08:42 UTC, OlafLostViking
Details
screen photo showing the broken profile pics (351.48 KB, image/jpeg)
2016-10-20 08:43 UTC, OlafLostViking
Details
screen photo showing the broken qupzilla workspace (385.78 KB, image/jpeg)
2016-10-20 08:43 UTC, OlafLostViking
Details
screen photo showing the broken weather applet (483.45 KB, image/jpeg)
2016-10-20 08:44 UTC, OlafLostViking
Details

Note You need to log in before you can comment on or make changes to this bug.
Description OlafLostViking 2016-02-18 18:14:10 UTC
After putting my notebook to sleep with external monitors attached to the docking station it's currently connected to and waking it up on the road (obviously without anything attached) the display stays off.

I can switch with CTRL+ALT+F2 to a text console, but I didn't manage to reactivate the display from there. There I called kscreen-console; I will attach the output to the following comments.

The severity was set to "grave" as this is equivalent to a crash with data loss (at least until I know how to reactivate the screen from a text console ;-) ) when all applications are force-shutdown when rebooting the machine.
Comment 1 OlafLostViking 2016-02-18 18:14:35 UTC
Created attachment 97283 [details]
output of kscreen
Comment 2 OlafLostViking 2016-02-18 18:15:03 UTC
Created attachment 97284 [details]
output of "kscreen bug"
Comment 3 OlafLostViking 2016-02-18 18:15:39 UTC
Created attachment 97285 [details]
output of "kscreen-console"
Comment 4 OlafLostViking 2016-02-18 18:16:03 UTC
Created attachment 97286 [details]
output of "kscreen config"
Comment 5 OlafLostViking 2016-02-18 18:17:21 UTC
Created attachment 97287 [details]
output of "kscreen-console json"
Comment 6 OlafLostViking 2016-02-18 18:18:09 UTC
Created attachment 97288 [details]
output of "kscreen-console"
Comment 7 Ben Cooksley 2016-02-20 23:12:33 UTC
The content of attachment 97286 [details] has been deleted for the following reason:

Deleted per request of uploader.
Comment 8 Ben Cooksley 2016-02-20 23:12:56 UTC
The content of attachment 97284 [details] has been deleted for the following reason:

Deleted per request of uploader.
Comment 9 Ben Cooksley 2016-02-20 23:13:06 UTC
The content of attachment 97283 [details] has been deleted for the following reason:

Deleted per request of uploader.
Comment 10 OlafLostViking 2016-02-21 09:20:41 UTC
Created attachment 97326 [details]
output of "kscreen-console config"
Comment 11 OlafLostViking 2016-02-21 09:24:34 UTC
Created attachment 97327 [details]
output of "kscreen-console bug"
Comment 12 OlafLostViking 2016-02-21 09:26:00 UTC
Created attachment 97328 [details]
output of "loginctl session-status"
Comment 13 Martin Flöser 2016-07-20 16:38:18 UTC
could you please run xev before going to suspend and monitor for RR* events?
Comment 14 OlafLostViking 2016-07-22 14:43:36 UTC
"Unfortunately" I have to say, the error no longer appears all the time (newest packages from kf, apps, plasma) but only from time to time (or kwin just crashes and reloads - so no data loss in that specific case. However, the main culprit in messing up the screens became Plasma.).

I'll still try to remember checking xev and will report back, if I find something - I just wanted to ACK so that the report doesn't get closed because of a missing answer.
Comment 15 OlafLostViking 2016-07-25 08:58:29 UTC
Okay, let's try it ;-)

At home, the laptop was running inside a docking station with the internal LVDS and an external screen active. I put it to sleep and woke it up again at work inside another docking station with two external screen connected (due to the machine's architecture only two displays can be used at the same time; the LVDS has to stay inactive at work).

Here the laptop shortly showed the kscreenlocker before shutting off the internal display but not activating the external ones. Even switching to a kernel console wasn't possible anymore.

Each following reboot SDDM was showing on the internal screen as well as the "first" external one (which, btw., is rotated - SDDM doesn't know that, of course). After logging in, all screens turned and stayed black. Switching to a kernel console WAS possible at that point in time (on the LVDS).

Rebooting outside of the docking station, the desktop came up normaly. Deleting the .local/share/kscreen folder made it possible again to put the laptop into the docking station without it turning off the screens.

Having a look at the kscreen GUI now revealed that kscreen thinks the secondary external screen has NO resolution... Simply clicking on Unify Outputs two times made it recognize the correct resolutions again. (Perhaps kscreen should NOT change anything when it is unsure about the system's state so that the user isn't left with no screen active at all.)

Switching to the wanted setup with the primary external display active and rotated, the secondary active and the internal inactive now worked. Even though Plasma couldn't handle the primary screen and had to be restarted to get my wallpaper (but that's nothing new and for another bug report one day).

Before putting the laptop to sleep, I let xev run:

$ xev | tee xev.log
# suspend
# steps described above
$ grep RR xev.log 
RRNotify event, serial 41, synthetic NO, window 0xa00001,
    subtype XRROutputPropertyChangeNotifyEvent
RRScreenChangeNotify event, serial 41, synthetic NO, window 0xa00001,
    rotation RR_Rotate_0
RRNotify event, serial 41, synthetic NO, window 0xa00001,
    subtype XRROutputChangeNotifyEvent
    rotation RR_Rotate_0
    connection RR_Disconnected, subpixel_order SubPixelUnknown
RRScreenChangeNotify event, serial 41, synthetic NO, window 0xa00001,
    rotation RR_Rotate_0
RRNotify event, serial 41, synthetic NO, window 0xa00001,
    subtype XRROutputChangeNotifyEvent
    rotation RR_Rotate_0
    connection RR_Connected, subpixel_order SubPixelUnknown
RRScreenChangeNotify event, serial 41, synthetic NO, window 0xa00001,
    rotation RR_Rotate_0
RRNotify event, serial 41, synthetic NO, window 0xa00001,
    subtype XRROutputChangeNotifyEvent
    rotation RR_Rotate_0
    connection RR_Connected, subpixel_order SubPixelUnknown
RRScreenChangeNotify event, serial 174, synthetic NO, window 0xa00001,
$ 

The whole xev.log is available for one year at https://paste.kde.org/pn9e0snkc
Comment 16 OlafLostViking 2016-07-28 07:59:27 UTC
Created attachment 100345 [details]
xrandr.log
Comment 17 OlafLostViking 2016-07-28 08:00:01 UTC
Created attachment 100346 [details]
kscreen-console.log
Comment 18 OlafLostViking 2016-07-28 08:01:19 UTC
The problem described in comment #15 just happened again. This time, I switched to a console after  hard rebooting and dumped a simple "xrandr" and "kscreen-console" output. Perhaps it's helpful.
Comment 19 Martin Flöser 2016-08-01 07:00:14 UTC
Given the xrandr output it seems like two external screens are connected, but not configured (?). They don't have a position and the X-Server screen size only matches the internal size.
Comment 20 OlafLostViking 2016-08-02 08:41:40 UTC
I have no idea why kscreen is forgetting the correct settings as they are available in the config files (deleting the config files makes it work with a standard setup - see below - again).

BTW: This behaviour is reproducible since the update that lead to this situation. So whenever I come to the docking station at work, my screens turn black. I found out undocking the laptop activates the internal display again. But deleting the kscreen configs in this running system and then re-docking the laptop leads to a complete lockup (the internal screen freezes, the other screens are not changed, hard reboot needed).

After a reboot SDDM is using the (X11?) standard config (as always) with the first external screen and the internal screen active (this machine only supports two active screens) which is also used by the desktop then. Plasma fails to recognize the correct setup and only uses one screen (sometimes even with a default wallpaper instead of my personal one...?), but a restart of plasma fixes that. :-/

In the end this means I have to reboot my laptop whenever sitting down at my desk (annoying as I have a fully enrcrypted harddisk with two-factor authentication ;-) ).
Comment 21 Sebastian Kügler 2016-10-18 21:05:12 UTC
Does this still happen with Plasma 5.8?
Comment 22 OlafLostViking 2016-10-19 08:15:25 UTC
Sometimes. (I know, very helpfui. It happened once or twice this week, if I remember correctly.)

Just now after docking the internal screen was shut off (which took two or three seconds), the secondary external monitor was showing the lockscreen, the primary was not (albeit it was powered on). After logging in, both were active. Undocking worked, redocking it (taking again a few seconds) messed Plasma up (panel on the wrong screen, far too small, wallpaper replaced by default wallpaper, windows all on different screens with random sizes). Doing the cycle again led to the panel being on the correct screen, the wallpaper on the secondary screen is still the default wallpaper. After changing the wallpaper on the secondary screen, I retried: The third try took over six or seven seconds to shut off the LVDS (I first thought it hangs). The wallpapers of both external screens are fine, the windows messed up and the panel again shifted (and shrinked) to the secondary screen. To not make it an endless loop: The fourth and last try reset the wallpaper again, but the panel was fine.

I will now delete the kscreen files again and re-start with a clean config as I am now using 5.8.1.
Comment 23 OlafLostViking 2016-10-20 08:41:32 UTC
(Very) long story short: yes. I updated to 5.8.2 and I already saw many improvements! Thank you! But the problem is still there.

BTW (I don't know if we need [another] bug report for that): when playing around with multiple screen in the kscreen GUI, they something jump around (when getting activated) and ruin any sorting work done up unto this point.

So, tighten your seatbelts, here it comes...  I will now give some kind of diary (with terrible unprecise times as I just counted in my head) of what I did and append the kscreen.log file that was created during that time. Please do at least scan over the whole text, as the problems with the panels/wallpapers and the window's movements _could_ perhaps give you an idea (at least I hope so). I will change the docking stations later in the text and the black-out happens after the second "pause".

* updated to Plasma 5.8.2
* "fixed" my desktop settings
* logged out
* deleted .local/share/kscreen/* on the console
* rebooted _in_ docking station WORK
  - WORK has a primary screen on Displayport DP-2 and a vertically rotated secondary on DVI DP-1
  - the internal LVDS-0 screen has to be shut off because DELL was creative when wiring the CPU internal and the mobile GeForce to the ports
  - SDDM shows login screen on LVDS-0 and the secondary screen DP-1 (not rotated, understandably)
* logged in
  - keeps the screen configuration of SDDM
  - panel and wallpaper are shown correctly on the primary screen (still LVDS-0)
  - on the secondary screen (DP-1) the default wallpaper is shown
* use kscreen to switch LVDS-0 off, set DP-2 as active primary and DP-1 as active secondary (rotated by 90 deg)
  - the switching works almost immediately (of course no atomic modesetting yet)
* set my own wallpaper on the secondary screen (DP-1)
* undock from docking station WORK
  - LVDS-0 get activated quite fast, all seems okay
* redock into WORK
  - setting up the screens takes a very short time (no atomic) but everything seems to work
* undock again
  - the screen setup looks fine
  - my active browser gets moved out of the screen (I cannot see it anymore despite on the panel)
* redock into WORK
  - screen setup is fine
  - panel is okay, but the wallpaper on the secondary screen is now the default wallpaper
* undock
  - the browser window, which was moved out of the view earlier, is now centered on screen (here I may add that I did not touch the GUI while doing this docking-undocking cycles)
* redock into WORK
  - now it takes several seconds (my guess was 10-12) for the new setup to start  <====
  - screen setup is fine
  - the panel is now very narrow and on the secondary screen (DP-1)
  - there is NO wallpaper or anything else (like cashew/hamburger) on this secondary screen; I also cannot right click on the black area (the panel is responsive) <====
* undock
  - screen setup is fine
  - panel is fine again
  - now, the afore mentioned browser window is half-way shifted (to the right side) out of the visible desktop
* redock into WORK
  - primary screen is fine
  - secondary is showing the default wallpaper
* set the wallpaper to my own
* put notebook into sleep mode while still docked
* wake it up while still docked in WORK
  - lockscreen shows up correctly (new in 5.8.2! :-) ) on primary and secondary (incl. rotation) screen
* put it into sleep
* wake it up
  - now the profile pics in the lockscreen are messed up (white area with a few coloured sprinkles - I will add a photo if I don't forget later when attaching files)
  - rest seems to be fine
* put it into sleep in docking station WORK
* undock!
* wake it up outside of docking station
  - profile pics are still messed up, rest seems fine
* redock into WORK
  - screen setup is fine
  - wallpapers are fine
  - but the panel is now on the wrong/secondary screen
* undock from WORK
  - the screen stays "half-black" for a surprisingly long time, but plasma fills the missing part up, eventually
  - panel also takes several seconds to appear
* put notebook to sleep (still not docked)
* wake it up after docking it into WORK
  - SDDM appears on internal screen (LVDS-0) with broken profile pics (as described above)
  - LVDS-0 shuts off
  - Secondary screen (DP-1) shows screenlocker with _working_ profile pics
  - Primary screen (DP-2) is black (no screenlocker!) while still showing the mouse cursor
* login
  - screen setup is fine
  - my weather widget in the plasma panel as well as the website view of the Qupzilla browser now show the same "coloured-sprinkels-on-white-ground" background as the profile pics
  - qupzilla can be fixed by resizing, the weather applet works again after some time (I guess after an update)
  - wallpaper is back to the default
* setting the wallpaper to mine again

== I really needed to go back to my work here ;-). So there is a pause of "strange" things in the kscreen.log

* put notebook into sleep in the docking station WORK
* wake it up in _another_ docking station HOME (only one external screen connected to the DVI-port DP-0)
  - lockscreen show correctly on internal as well as external screen
  - internal is fine (weather applet defective again as describe above)
  - external shows default wallpaper (at this time it is still the secondary screen, as I deleted the kscreen settings at work as written above)
* use kscreen to switch DP-0 to primary
  - wallpaper and panel "migrate" automaticalle (also new in 5.8.2!)
* set wallpaper on secondary (now LVDS-0) to mine
* put it into sleep in docking station HOME

== Pause

* wake it up in docking station WORK (with the two external screens)
  - lockscreen shows on LVDS-0
  - profile pics are defective
  - it takes between 10 and 20 seconds(!) to shut LVDS-0 off <====
  - external screen do NOT get powered on (staying in sleep mode; so not just a black image)
  - I cannot switch to a text console; all screens stay off
* undock
  - no change, still switched off LVDS-0

:-(

* reboot (two times) outside of the dock [around here I had to use another OS on the machine for a few minutes]
* login
  - LVDS-0 is fine
* dock it with low battery
  - after probably 60s still no change from kscreen <====
* manually setting screen configuration with kscreen
  - primary (DP-2) is fine
  - secondary (DP-1) is showing the default wallpaper again
  - (as mentioned at the beginngin, screen jump around when trying to sort them - meh ;-p )

At this point I decided you will probably not even read all the things I wrote down until now and stopped playing around. I hope this is somehow useful for debugging. I will attach the kscreen.log file and screen photos soon.
Comment 24 OlafLostViking 2016-10-20 08:42:25 UTC
Created attachment 101652 [details]
the automatically created kscreen.log
Comment 25 OlafLostViking 2016-10-20 08:43:04 UTC
Created attachment 101653 [details]
screen photo showing the broken profile pics
Comment 26 OlafLostViking 2016-10-20 08:43:31 UTC
Created attachment 101654 [details]
screen photo showing the broken qupzilla workspace
Comment 27 OlafLostViking 2016-10-20 08:44:56 UTC
Created attachment 101655 [details]
screen photo showing the broken weather applet

Actually... I just saw the picture is quite bad. Basically, the white are looks just like the qupzilla and profile pics background. It is the weather applet from http://kde-apps.org/content/show.php/Weather+Widget?content=169572
Comment 28 Simone Gaiarin 2016-10-20 10:59:55 UTC
I have a similar problem. Basically when waking the notebook up after undocking (or docked to a different docking station with different moitors) mess the configuration. Undocking and redocking restore the configuration in some cases.

I can provide a log if the one provided by the other user are not enough.
Comment 29 Sebastian Kügler 2016-10-21 12:03:45 UTC
@Olaf

> At this point I decided you will probably not even read all the things I wrote
> down until now and stopped playing around. I hope this is somehow useful for
> debugging. I will attach the kscreen.log file and screen photos soon.

That's unfortunately correct. You have by now put so much information into this bugreport that it's a pain and very inefficient to sift through. I have to filter out the relevant bits from your huge swathes of text, and often, I need to read a bugreport multiple times. You can imagine what a huge waste of time it becomes then. I wonder, if you know it's not useful, why you put so much (unrelated) info in it.

So, for your understanding:
- I'm interested in problems with resolution, position and enablement of outputs, these problems fall under kscreen
- if you have problems with applications, file a bug against the app, leave the info out here
- if you've problems with the plasmashell (panels location, containment location, etc.), file a bug against plasmashell (there's a Multiscreen component)

In order to keep my bug triaging life manageable, I'm closing this bugreport, asking you to file a new one, with *only* the relevant information.

Thanks for your cooperation, it's really appreciated.
Comment 30 OlafLostViking 2016-10-21 14:50:45 UTC
Hi Sebas,

first thank you very much for the work. I really don't want you to get this wrong and I fully understand that you are scanning through a lot of bug reports and it takes time to understand each of them. (Especially considering my bad English from time to time ;-) )

But I (personally) think that closing the bug because of too many details is not the best solution. If I would have written "Yes, doesn't work with 5.8.2." and that's it, would that have been better? So I tried around a long time to find a way to provoke this bug and attached the logfile. To make it easier for you to see what was happening in the log that lead to the crash I described what I did. If you are not interested in that, wouldn't it work to just ignore it and jump to the marked "2nd pause", where the crash happened - as written at the beginning?

There are no problems with specific apps, as the broken images happen on multiple ones and only after kscreen "did things" ;-). So this wasn't a "Please fix the app." but a "Look, Kscreen(??) does something that leads to problems at many other places." The same goes with Plasma which takes the information vom libkscreen, I guess. Of course, nobody wants you to take care of that! It was just mentioned so that you could guess what kscreen is doing wrong at that point in time.

So in the end I do not know what else I could write in a new bug report but "Crashes when (un-)docking." and attaching the very same log as above (there was no kscreen.log at the beginning which is why I started with kscreen-console and xrandr logs).

I tried it on bug #371417 - I hope it helps.