Dual monitor loses settings after screen sleep

Bug #1573345 reported by Rich Johnson
130
This bug affects 27 people
Affects Status Importance Assigned to Milestone
kscreen
New
Medium
kscreen (Ubuntu)
Undecided
Unassigned

Bug Description

If I leave my computer until the desktop locks & then the screen goes black, when I log back in I still have dual monitors. however my config isn't used. It goes to using laptop display as main display & HDMI as a secondary display. Weird thing is, it does use the screen positioning portion of the config & the resolution, just moves bar to other screen & HDMI screen is just black. This happens every time, so yes it is reproducible.

Reproducible: Always

Steps to Reproduce:
1. Let screen lock & go black (aka sleep)
2. Move mouse to wake screen up
3. Log in to unlock desktop

Actual Results:
HDMI is no longer primary, laptop screen becomes primary. HDMI screen doesn't have desktop background settings nor panel, nor right click functions.

Expected Results:
My display settings should be used where HDMI is primary & laptop is secondary. Plasma panel should be on the HDMI screen & not the laptop screen.

My current work around is after unlocking the desktop log out & log back in. Everything goes back to normal until the next time the screen goes to sleep.

Revision history for this message
In , Rjohnson-m (rjohnson-m) wrote :

If I leave my computer until the desktop locks & then the screen goes black, when I log back in I still have dual monitors. however my config isn't used. It goes to using laptop display as main display & HDMI as a secondary display. Weird thing is, it does use the screen positioning portion of the config & the resolution, just moves bar to other screen & HDMI screen is just black. This happens every time, so yes it is reproducible.

Reproducible: Always

Steps to Reproduce:
1. Let screen lock & go black (aka sleep)
2. Move mouse to wake screen up
3. Log in to unlock desktop

Actual Results:
HDMI is no longer primary, laptop screen becomes primary. HDMI screen doesn't have desktop background settings nor panel, nor right click functions.

Expected Results:
My display settings should be used where HDMI is primary & laptop is secondary. Plasma panel should be on the HDMI screen & not the laptop screen.

My current work around is after unlocking the desktop log out & log back in. Everything goes back to normal until the next time the screen goes to sleep.

Changed in kscreen:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
JohnEverest (john-everest) wrote :

I have this bug. It was in Kubuntu 15.04 and 15.10. It occurs after some system changes and often after an update. I have not been able to find exactly what changes cause the loss of configuration.

I have dual monitors on an Nvidia GTX750 graphics card.

Revision history for this message
In , Mgraesslin (mgraesslin) wrote :

this sounds like your XServer "loses" the output - which should not happen on power management. Could you please check whether that's the case in e.g. /var/log/Xorg.0.log?

Revision history for this message
G. Guzmics (g4b) wrote :

I think I can confirm this.
I did not have this behaviour in 15.04, which I used until recently with the same setup for years.

When I upgraded to xenial, I got the same behaviour, just the other way around: I do have primary screen set to the laptop (LVDS1), while my monitor is secondary (using a larger resolution).
Upon disconnecting HDMI and closing the lid, plasmas main bar gets resized as if its on the external monitor (so it gets moved over and back?), reconnecting hdmi with closed lid however moves primary screen to the monitor - otherwise I would not have even realized, why the main bar gets resized in such a weird fashion.

Logging out and back in fixes the problem.
Graphics card is intel.

Revision history for this message
cengopon (pognonec) wrote :

Similar here I guess:
Dual screen (different resolutions and sizes). After sleep, windows that were opened are not found were they were (on the other screen, and on other workspace).

Something else: sometimes wake up does not work properly. Have to go TTY and back to GUI to get my desktop.

This is with Ubuntu 16.10, NVIDIA GF119, driver NVIDIA 367.57

Revision history for this message
Mike (mikemilleris) wrote :

Kubuntu 16.04, KDE plasma 5.5.5, Qt 5.5.1

Using Sky Lake Integrated Graphics with driver=i915_bpo

Using dual monitors with different configurations and resolutions. On waking the screens the desktop shown on HDMI2 monitor crashes. The background is black and the KDE panel is gone. The primary display is unaffected. I am still able to run application windows on the crashed desktop and the app windows will take up the space of the missing panel. To resolve I run

killall plasmashell; sleep 3; plasmashell

This brings the desktop wallpaper and panel back as expected and application windows on the crashed desktop will resize to fit the panel.

Revision history for this message
K4LiN (kalinq) wrote :

Hi,

I think I had similar issue. Mine was more related to suspend on lid close, but maybe you'll find something useful. My second screen position was resetting and overlaying primary laptop screen after resuming from suspend.

I noticed that in my journalctl that during lid close kscreen.kded is sending

"Lid closed, waiting to see if the computer goes to sleep..."
(https://github.com/KDE/kscreen/blob/master/kded/daemon.cpp#L291)

After timeout, which is set here btw:

m_lidClosedTimer->setInterval(1000);
(https://github.com/KDE/kscreen/blob/master/kded/daemon.cpp#L110)

it triggered this code:

"Lid closed without system going to suspend -> turning off the screen"
(https://github.com/KDE/kscreen/blob/master/kded/daemon.cpp#L324)

which is causing turning off the screen and saving info about that in new config. Then, after resume from suspend, position of second monitor is set to (0,0) and is overlaying the primary one..

The thing is that it should not trigger that function on timeout, because my system is going to suspend and counting down should be stopped. The thing is that function which is responsible for stopping the timer is not triggering.
(https://github.com/KDE/kscreen/blob/master/kded/daemon.cpp#L125)

And that is because of other error during kscreen daemon start:
kscreen.kded: PowerDevil SuspendSession action not available!
kscreen.kded: "The name org.kde.Solid.PowerManagement was not provided by any .service files"
(https://github.com/KDE/kscreen/blob/master/kded/device.cpp#L77)

I am not very familiar with all that stuff, but it looks like kscreen daemon is starting too soon and there's no power devil yet, so kscreen deamon doesn't have a reference to powerdevil "aboutToSuspend" signal or something...

Anyway. When I reload kscreen in KDE settings or from command line - suspend on lid close is working as expected.

Adding this script to KDE autostart works for me as an workaround of the issue:

sleep 10 && qdbus org.kde.kded5 /kded org.kde.kded5.unloadModule kscreen && qdbus org.kde.kded5 /kded org.kde.kded5.loadModule kscreen

Best!

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in kscreen (Ubuntu):
status: New → Confirmed
Revision history for this message
AB (aborka) wrote :

This is totally happening for me since a long while now. It was there in 17.x , it is there in 18.04 beta.
No matter if we use KDE or Cinnamon.
No matter if we use noveau or NVIDIA drivers.

I have 2 monitors for my desktop, a big one in front and a smaller one on the left. The big one is supposed to be the main desktop screen.

Once the screen saver timer kicks in to turn off the monitors, the big one never comes back to life after entering the password (can only enter it on the secondary-left side monitor). The big one stays without any image, it even says there is no signal when turned on/off.

Have to reboot to fix it.

Revision history for this message
AB (aborka) wrote :

update: Executing "xset -dpms" at startup
(System Settings -> Startup and Shutdown -> Automatically Started Applications)
solves the problem (on KUbuntu 18.04 Beta + NVIDIA-390 Drivers, didn't test the other mentioned ones) for me.

Revision history for this message
Kenny Stier (kestier19) wrote :

I have the same issue, only I'm running the 18.04 beta on Gnome.
I have yet to try the workaround.

Revision history for this message
Kenny Stier (kestier19) wrote :

I can confirm that the "Executing "xset -dpms" at startup" workaround fixes the issue for me. I don't believe the issue is with kscreen though, as I'm running a Gnome stack and had the same issue starting with 18.04.

Revision history for this message
Vlad (servervd) wrote :

I used to use two screens with outputs on VGA and DP(with converter to HDMI as monitor has only HDMI input) and this worked fine as long as I used it. Now I have upgraded screen and am using two DP where one screen is 4k and other is using DP2HDMI(same screen as used before).

Previous configuration was fine as screens came up quite swiftly but now my 4k screen takes longer to show up and this messes up whole config. (Cairo-dock is showing on left screen in the middle when mouse over right screen's edge etc..).

I believe this whole thing is down to timing when xorg is expecting all screens be ready to accept signal and reply with "Ready" signal but first screen responds faster and second may not respond in time and xorg believes that screen is off or not available so adjust config accordingly.

I don't know what dpms at startup does but I can live with this bug for now as all it does, shuffles my windows all over the place and cairo dock can be reconfigured quickly.

This bug should be submitted to xorg not kscreen I guess.

CPU: Intel® Core™ i5-3570 CPU @ 3.40GHz × 4
GPU: Intel® Ivybridge Desktop
Base Sys: Debian GNU/Linux 9 (stretch) 64-bit
Gnome: Ver 3.22.2

Revision history for this message
Rion (rion4ik) wrote :
Revision history for this message
Jeff.m (vsteel) wrote :

I have this problem. Everything works great with my two monitor setup until my screen blanker comes on. After I wake the system (which my secondary monitor seems to wake up a couple of seconds faster) when I click the application launcher, the screen opens up on my secondary monitor. All windows I open show up on the secondary monitor. If I log out and in that will fix the issue and things will open on the correct monitor.

Nivdia driver 410.78 Nvidia 2080 video card.
Primary monitor: Dell AW3418DW on display port. 3440x1440 resolution
Secondary monitor: Dell 2407WFP on HDMI 1920x1200 resolution

Operating System: Kubuntu 18.10
KDE Plasma Version: 5.14.4
Qt Version: 5.11.1
KDE Frameworks Version: 5.52.0
Kernel Version: 4.18.0-12-generic
OS Type: 64-bit
Processors: 16 × AMD Ryzen 7 1800X Eight-Core Processor
Memory: 31.4 GiB of RAM

This is reproducible every time.

Revision history for this message
swisswuff (wuff) wrote :

Since I started to run xset -dpms, now also as part of a startup script, the problem seems to have gone. Otherwise it was specifically there, when I connected an external monitor to my laptop, using the display port connector. Using the HDMI connector would not provoke the error, which was having all applications closed when simply locking the display using WINDOWS-L or by mouse/menu. The display port connector was the one to use to get the really good resolution going though.

Revision history for this message
FiNeX (finex) wrote :

I'm experiencing the same bug on Arch Linux when one monitor is connected using Display Port (and two with DVI).

Revision history for this message
FiNeX (finex) wrote :
Revision history for this message
Eugene (tsura-evgeniy) wrote :

I had the same issue, my system:
Linux 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Steps:
 - connect and external monitor via HDMI
 - disconnect external monitor, select laptop monitor only
 - put system to sleep mode
 - wake up system, enter login and password in prompt
Result:
 - screen is black, i need to connect external HDMI monitor and choose "laptop only" in dialog on external display to activate laptop display
This issue reproduces every time after system sleep. Even if i choose laptop only every time.

Revision history for this message
Платонов Николай (nickolay8) wrote :

I can confirm this bug too. Using MSI GS 73 with Ubuntu 18.04.2 + latest official kubuntu desktop.
The notebook has 4k display and I'm using external dispaly LG 27UL850-W, which is 4k too.

As it was mentioned in the thread, it seems to be related to the "Screen energy saving" checkbox in the "Power managment settings". Once the timeout for this option passes both displays goes to power saving mode and becomes blank black. After you resume a session by moving a mouse, you can actually notice, how all windows first goes to the laptop display, then, all windows moves to external display.

This is a MAJOR usability bug. Need to manually re-position all windows again and again.

Revision history for this message
Платонов Николай (nickolay8) wrote :

Using `xset -dpms` indeed seems to fix the problem, however, the external display does not become blank. This is not healthy for the display's matrice - in the manual, they recommend to not keep the same image on the screen for too long.

Anyone know a workaround similar to `xset -dpms` but with external screen blanking?

Revision history for this message
Платонов Николай (nickolay8) wrote :

I've just checked and Gnome does not suffer from this bug.

`Bug #1573345 reported by Richard Johnson on 2016-04-22`

Any chance this issue can be solved properly? Is this tracker monitored by KDE developers at all?

Revision history for this message
Joshua Ogburn (ogburn-joshua) wrote :

This is affecting me too.

OS: Linux Mint 19.2 Cinnamon,
Kernel: 4.15.0-58-generic,
GPU: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X]

Revision history for this message
Vyacheslav N. Boyko (bvn13) wrote :

Have the same annoying issue on Ubuntu 18.04.3 LTS

kernel 5.0.0-29-generic
Gnome 3.28.2

I have tried to fix it with xrandr with no result.

Also I have investigated changes of ~/.config.monitors.xml - it does not changes when this bug occurres.

Revision history for this message
Jussi (jusaus) wrote :

Confirmed here too.

Deepin 15.11
4.15.0-30deepin-generic
Intel HD5500

Revision history for this message
Marco Seravalli (mseravalli) wrote :

Same issue

Debian rodete
Linux 4.19.67-2rodete2-amd64
Cinnamon 3.8.8
NVIDIA Driver Version 430.50

Revision history for this message
Stefan Haubenthal (polluks) wrote :

annoying

Mint 19.2
4.15.0-70-generic
Mate
Intel Corporation Device 3ea5

Revision history for this message
Jeff.m (vsteel) wrote :

I have this issue, even my sound preferences change. I have my onboard sound as default and after waking the monitors it defaults back to the HDMI sound device.

Graphics card - NVIDIA 2080
NVIDIA driver version - 440.36
Monitors - Dell AW3418DW (DP-4) and a DELL2407WFP (HDMI-0) the HDMI display is physically rotated 90 degrees clockwise
Operating System: Kubuntu 19.10
KDE Plasma Version: 5.17.4
KDE Frameworks Version: 5.64.0
Qt Version: 5.12.4
Kernel Version: 5.3.0-24-generic
OS Type: 64-bit
Processors: 16 × AMD Ryzen 7 3800X 8-Core Processor
Memory: 31.3 GiB of RAM

Revision history for this message
jp (jorp) wrote :

I might not belong here, but I come with some additional info. I've had this same issue as well with xfce. I also do believe it may have to do with xorg.

I've opened this bug report with xfce (although it may not be filed correctly):
https://bugzilla.xfce.org/show_bug.cgi?id=16430

and I found this related forum post here:
https://forum.xfce.org/viewtopic.php?pid=56538#p56538

Monitors: 3x ASUS VS239
OS: Fedora 31
Xfce 4.14

Revision history for this message
In , Matthew Barnes (mbarnes536) wrote :

I am experiencing this issue also. Looking at the Xorg.0.log I am seeing the screen disconnect .

[ 71289.913] (--) NVIDIA(GPU-0): DFP-4: disconnected
[ 71289.913] (--) NVIDIA(GPU-0): DFP-4: Internal DisplayPort
[ 71289.913] (--) NVIDIA(GPU-0): DFP-4: 1440.0 MHz maximum pixel clock
[ 71289.913] (--) NVIDIA(GPU-0):
[ 71289.927] (--) NVIDIA(GPU-0): DFP-6: disconnected
[ 71289.927] (--) NVIDIA(GPU-0): DFP-6: Internal DisplayPort
[ 71289.927] (--) NVIDIA(GPU-0): DFP-6: 1440.0 MHz maximum pixel clock
[ 71289.927] (--) NVIDIA(GPU-0):
[ 71290.640] (--) NVIDIA(GPU-0): Acer KG281K (DFP-4): connected
[ 71290.640] (--) NVIDIA(GPU-0): Acer KG281K (DFP-4): Internal DisplayPort
[ 71290.640] (--) NVIDIA(GPU-0): Acer KG281K (DFP-4): 1440.0 MHz maximum pixel clock
[ 71290.640] (--) NVIDIA(GPU-0):
[ 71290.649] (--) NVIDIA(GPU-0): Acer KG281K (DFP-6): connected
[ 71290.649] (--) NVIDIA(GPU-0): Acer KG281K (DFP-6): Internal DisplayPort
[ 71290.649] (--) NVIDIA(GPU-0): Acer KG281K (DFP-6): 1440.0 MHz maximum pixel clock
[ 71290.649] (--) NVIDIA(GPU-0):
[ 71290.798] (II) NVIDIA(0): Setting mode "DP-4: nvidia-auto-select @3840x2160 +3840+0 {ViewPortIn=3840x2160, ViewPortOut=3840x2160+0+0}"
[ 71290.937] (II) NVIDIA(0): Setting mode "NULL"
[ 71291.089] (II) NVIDIA(0): Setting mode "DP-2: nvidia-auto-select @3840x2160 +0+0 {ViewPortIn=3840x2160, ViewPortOut=3840x2160+0+0}"
[ 71291.141] (II) NVIDIA(0): Setting mode "DP-2: nvidia-auto-select @3840x2160 +0+0 {ViewPortIn=3840x2160, ViewPortOut=3840x2160+0+0}, DP-4: nvidia-auto-select @3840x2160 +3840+0 {ViewPortIn=3840x2160, ViewPortOut=3840x2160+0+0}"

Revision history for this message
Christopher Harper (charper) wrote :

Confirmed I have the same bug, and the same sound issues as Jeff.m @vsteel.

1. LG UltraGear (DP-2)
 - After sleep, this one goes away. Display properties -> Enable brings it back.
 - Sound goes to this monitor, but doesn't work?!
2. E2742 (DVI-D-0)
 - After sleep, only monitor that works.

Workarounds:
* Display Properties, Dropdown to LG Ultragear, Enable. Brings it back.
* Audio is much harder. Only thing I could find that re-enables it is HDAJackRetask. For some reason, the OS 'forgets' that I have 5.1 speakers on Realtek ALCS1200A codec, and only goes to the NVidia GPU 83 HDMI/DP.

Gets annoying to apply after every time my system goes to sleep. :/

Revision history for this message
Christopher Harper (charper) wrote :

Further info:
Kubuntu 20.10
KDE Plasma 5.19.5
Kernel 5.8.0-41-generic
GTX 1070 with nvidia-driver-450 (also tried -460)

Revision history for this message
In , Jacek Wieczorek (mrjjot) wrote :

I think I'm experiencing this bug too. In my case, each broken screen sleep leads to wallpaper change on my secondary monitor, disabling the compositor and sometimes moving certain windows around (usually code-oss).

In my /var/log/Xorg.0.log I can see the the screens disconnecting, exactly as Matthew Barnes said.

My testing consisted of logging output of `xrandr` in 0.1s intervals throughout different sleep cycles. I set "Switch off screens after" to 1 minute in system settings and then woke up the screens after different periods of time. I found out that if I wake up my computer after 3 or less minutes (including 1 min of waiting for the screens to switch off), it always wakes up correctly.

Correct screen wake up after 3 min - everything is fine:
   1562 DP-2 connected 2560x1440+0+0 (normal left inverted right x axis y axis) 597mm x 336mm
   1562 DP-4 connected primary 2560x1440+2560+0 (normal left inverted right x axis y axis) 597mm x 336mm

Broken wake up after 4 min - monitors temporarily disconnect, compositor is disabled, wallpapers change, windows are moved around (for DP-4):
   2027 DP-4 connected primary 2560x1440+2560+0 (normal left inverted right x axis y axis) 597mm x 336mm
      7 DP-4 disconnected primary 2560x1440+2560+0 (normal left inverted right x axis y axis) 0mm x 0mm
      8 DP-4 disconnected (normal left inverted right x axis y axis)
      7 DP-4 connected (normal left inverted right x axis y axis)
     54 DP-4 connected primary 2560x1440+2560+0 (normal left inverted right x axis y axis) 597mm x 336mm

Interestingly, when kscreen is not running, the behavior doesn't change but the logs look a bit differently.
Broken wake up after 4 min, kscreen not running (for DP-4):
   1982 DP-4 connected primary 2560x1440+2560+0 (normal left inverted right x axis y axis) 597mm x 336mm
     15 DP-4 disconnected primary 2560x1440+2560+0 (normal left inverted right x axis y axis) 0mm x 0mm
     76 DP-4 connected primary 2560x1440+2560+0 (normal left inverted right x axis y axis) 600mm x 340mm

I uploaded the compressed logs to this Github repo: https://github.com/Jacajack/logs/tree/master/dual-monitor. I use `xzcat log.txt.xz | grep 'DP-2' | uniq -c` to read them.

Some other observations:
 - "Broken" wake up always takes visibly more time than a normal one
 - I can reproduce this behavior on fresh Manjaro Live with or without Nvidia driver
 - Enabling/disabling DPMS doesn't change anything
 - It doesn't matter whether the lockscreen appears
 - "Auto input switch", "Automatic Standby" and "Smart Energy Saving" in screens' OSD menus don't affect this behavior

Given that XFCE users report similar behavior and that kscreen is not necessary for this bug to happen, maybe X.Org is in fact the problem? Maybe we should think of filing a bug report there?

System info:
  Manjaro Linux, kernel 5.10.49
  plasmashell version: 5.22.3
  xorg version: 1.20.11
  GPU: Nvidia RTX 2070 SUPER
  Nvidia driver version: 470.42.01
  Monitors: 2 x LG Ultragear 27GL850 connected via Display Port

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.