Bug 359177

Summary: blanks out original plasma session when I start a new a new plasma session from it
Product: [Plasma] KScreen Reporter: Martin Steigerwald <Martin>
Component: commonAssignee: Sebastian Kügler <sebas>
Status: RESOLVED WORKSFORME    
Severity: major CC: martin.steigerwald
Priority: NOR    
Version First Reported In: git   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Martin Steigerwald 2016-02-09 10:43:19 UTC
Happens with both kscreen + kded5 from git as well as packaged 5.4.3 in Debian (soon to be updated to 5.5.4 I think). With kernel 4.5-rc3 and 4.4. With Intel ThinkPad, i915, internal display and external 22 inch display, both full hd resolution.

Since yesterday I have it that on starting my second Plasma session via Alt-F2 start new session that something completely blanks out the Plasma session I started the second session from. All I see is a black screen.

Right now this happens *everytime*. So right now I have this in a reproducable state.

As I disabled KScreen 2 service on the initial desktop, it may not be related to KScreen, maybe its a powerdevil issue or whatever is dealing with brightness and display on/off controls.

Reproducible: Always

Steps to Reproduce:
1. Start a Plasma session.
2. Alt-F2 start a new Plasma session.

On my system at least.

Actual Results:  
Black screen on original Plasma session. And nothing works to bring it to visibility again. I tried:

1. pressing a key

2. martin@merkaba:~> cat /usr/local/bin/licht 
#!/bin/bash
while true; do
        echo 0 > /sys/class/backlight/intel_backlight/bl_power
        echo 0 > /sys/class/backlight/acpi_video0/bl_power
        echo 4437 > /sys/class/backlight/intel_backlight/brightness
        echo 15 > /sys/class/backlight/acpi_video0/brightness
        sleep 1
done

(it seems it is not just the backlight, it just seems to switch of the display *completely* on that session, cause the script otherwise actually works.)

3. su - othersession
export DISPLAY=:othersession
xrandr --auto

4. vbetool dpms off

5. Disabling KScreen 2 service on one of the sessions (so maybe this is not related to KScreen 2)

6. Of course I also tried the rm -r ~/.local/share/kscreen thing that helped me before with some servere KScreen issue.

7. Masking systemd backlight service:

martin@merkaba:/etc/systemd> find -name "*backlight*" -ls
  7950807      4 lrwxrwxrwx   1 root     root            9 Feb  9 11:13 ./system/systemd-backlight@backlight:acpi_video0.service -> /dev/null
  7950809      4 lrwxrwxrwx   1 root     root            9 Feb  9 11:13 ./system/systemd-backlight@backlight:intel_backlight.service -> /dev/null

8. Trying with kernel 4.4 to make sure its not related to 4.5-rc3.

9. Fiddling around with Solid brightness controls by su - othersession, eval $(dbus-launch) and using

martin@merkaba:~> qdbus org.kde.kded5 /org/kde/Solid/PowerManagement/Actions/BrightnessControl org.kde.Solid.PowerManagement.Actions.BrightnessControl.brightnessMax
15

to query maximum brightness. It *did* not return within half a minute for the broken session. It worked on the session that is running.



Next I will go with removing all self-compiled stuff, as it means not using KDEPIM altogether, cause self-compiled KDEPIM has most recent Akonadi with multi level cache directories I cannot go back to 15.08 which is currently packaged in Debian (15.12 in experimental is not yet fully build).

Expected Results:  
kscreen / powerdevil / sddm / systemd backlight service – frankly I do not care what component will do it, well I do think that systemd has no business fiddling with brightness, but otherwise… – *totally* *ensures* that I *always* can see my desktop sessions.

In *no* case it is a valid response to present the user with a black screen. Unless there is some display connected and with a laptop there *always* is show me the desktop at least on one of the displays when I press a key.

*Always*. No exception, I am the user, I am the king. No complex evaluation, just *show* the desktop.


And for starters please give me a command I can use that does this:

I am the user, I am the king, show me the light (i.e. the desktop) *now*. At least I want to be able to use two Plasma sessions again even if I have to manually bring the blanked one back to light. Right now I know no way to unblank the blanked session and as you can see I tried a lot. I have no words to express how broken this is.

martin@merkaba:~> phoronix-test-suite system-info

Phoronix Test Suite v5.2.1
System Information

Hardware:
Processor: Intel Core i5-2520M @ 3.20GHz (4 Cores), Motherboard: LENOVO 42433WG, Chipset: Intel 2nd Generation Core Family DRAM, Memory: 16384MB, Disk: 300GB INTEL SSDSA2CW30 + 480GB Crucial_CT480M50, Graphics: Intel HD 3000 (1300MHz), Audio: Conexant CX20590, Monitor: P24T-7 LED, Network: Intel 82579LM Gigabit Connection + Intel Centrino Advanced-N 6205

Software:
OS: Debian unstable, Kernel: 4.5.0-rc3-tp520+ (x86_64), Desktop: KDE Frameworks 5, Display Server: X Server 1.18.0, Display Driver: intel 2.99.917, OpenGL: 3.3 Mesa 11.1.1, Compiler: GCC 5.3.1 20160205, File-System: btrfs, Screen Resolution: 3840x1080


I compile KDEPIM + KF5 from git master on Debian Sid packages Plasma 5.4.3 and Qt 5.5.1-3. For testing I uninstalled the KDE Framework kinit, kded and kscreen.
Comment 1 Martin Steigerwald 2016-02-09 10:44:36 UTC
PS: I will try to calm down now a bit, and I am willing to constructively help with finding what does on here, even self-compile from git master, but I hope you understand that this "I blank the screen, you no see any desktop anymore hahaha" kind of thing is as frustrating as it can get.
Comment 2 Martin Steigerwald 2016-02-09 11:14:44 UTC
After almost switching to LXDE, I know have a setup that works. On Kernel 4.4 with KScreen 2 disabled on both plasma sessions. So Kernel 4.5-rc3 may be somehow be related, but to early to say for sure as I also had these issues while running 4.4 before.
Comment 3 Sebastian Kügler 2016-02-09 11:15:05 UTC
Could you check if disabling the Power Management Service helps?
Comment 4 Martin Steigerwald 2016-02-09 11:30:19 UTC
okay, it is not 4.5-rc3. I just had it again with 4.4. With power management service disabled on both sessions – thought of this myself. This appears to be too crazy and I wonder whether some other crazy stuff is running that messes with display brightness.

I am avalailable on IRC (depending on whether I can see anything) as helios21 or helios55 (depending on session I see)
Comment 5 Martin Steigerwald 2016-02-09 11:41:20 UTC
Just happened again. I have confirmed that on both sessions power management service is disabled. Power management kcm tells so.

What I see happening is this: other session get dimmed (reduced brightness) after a time and then blanked. Despite power management service not running. Now I am really puzzled.
Comment 6 Martin Steigerwald 2016-02-09 12:39:31 UTC
Even after removing *all* of the self-compiled KDE Frameworks + KDEPIM stuff the issue persists. So I can rule two things out:

1) Its not linux 4.5-rc3 kernel.

2) Its not any of git master.

I did remove /var/tmp/kdecache stuff as well as ~/.local/share/kscreen for both users with me recent attempt. 

So I now have stock Debian Sid + disabled KScreen 2 services on both sessions + disabled power management settings on both sessions. And still get this issue.

Additionally to that there is no such issue when I use two LXDE sessions instead.

I cannot yet upgrade to 5.6 rc3 packages for Qt from Debian experimental as that would uninstall the Plasma desktop. So using Qt 5.5.1, but I think this has been in Debian for quite a while already.

This is so broken beyond words. :(
Comment 7 Sebastian Kügler 2016-02-09 12:51:22 UTC
It's also entirely confusing. The amount of data you give makes it hard to extract the useful info from it. Could you perhaps boil it down a bit? It now reads more like an unstructured testing log (this kernel, that kernel, disabled this, that-thing from packages, this-thing from source, ... I simply lost track).
Comment 8 Martin Steigerwald 2016-02-09 12:57:49 UTC
Well, I now have only Debian Sid. Nothing self-compiled from master (so KDEPIM + Akonadi gone for now as well). A kernel 4.4 that worked okay for more than a month.

I have disabled power management service and KScreen 2. What else can cause havoc? Solid? I have no idea.

Two sessions are working just fine in LXDE and for some added comfort MATE.

As for unstructured: I am struggling to get back a working system. This already has taken too much time. I had hoped that there is something I can give you to better understand the issue. But I received no workable suggestion. No command to try to gather some debug output as to what is happening here… so now

… I need to get back to work. So I try to get along with MATE for now.

This is beyond anything I ever saw on my desktop in the last 10 years of Linux usage.
Comment 9 Martin Steigerwald 2016-02-09 12:58:36 UTC
I am willing to look into this again, but now I need to focus on work.
Comment 10 Martin Steigerwald 2016-02-09 13:53:26 UTC
What also seems to work this: First session is  MATE, second is Plasma. I have the impression that things get confused with two Plasma sessions running.

Well at least I can now have the session I work most with with Plasma again, while the other runs with MATE.

Is there anything else except power management and kscreen, both still disabled, that can mess with screen, display switched on/off, brightness? I would like to find out what component is actually dimming and blanking the screen. It would help to get a clue about whats going on here. Anything in Solid or kded5?
Comment 11 Martin Steigerwald 2016-02-09 13:55:52 UTC
Okay, one more obversation: Things actually got confused with two running Plasma sessions before – two different users – it dimmed the session before sometimes in that case. Yet it never switched off the display without enabling it again on a key press before, so that is new.

I will set the severity a big back, since it appears to work with one Plasma sessions and I bet two sessions running on different X displays are a not well tested usecase.
Comment 12 Martin Steigerwald 2016-02-13 21:23:55 UTC
Okay. On the same day I tested further around. It then also happened if one session is MATE and one is Plasma. But it didn´t happen if there was only one session and it is Plasma.

So two Plasma sessions or two sessions one MATE (I think it doesn´t matter) one Plasma triggers it.

It then came to my mind that I changed another setting that at first I didn´t relate to this: I found that in both sessions XRender was set as compositor. I didn´t think thats right for Intel Sandybridge graphics, so I set it to OpenGL 3.1 with GLX as I think I had it on both sessions for quite some time (I had issues with EGL I think I reported here as well).

As I set compositing back to XRender I was able to use two Plasma sessions like before again.

I also ruled out the kernel or whether KDE Frameworks + KDEPIM is self-compiled or from packages as it happened as well with 4.4 kernel + packaged Plasma / KDE Frameworks. I now have 4.5-rc3 kernel + self-compiled stuff again and two sessions still work.

So whenever I run one Plasma session with OpenGL 3.1 on GLX compositing together with any other session at some times it makes kaboooom on switching between the sessions. If I use two Plasma session, it blanks only one of them. The other is still fine.

I am not sure what to make of this. I am willing to close this bug report and start a new one if it got to confusing. Please advice.
Comment 13 Martin Steigerwald 2016-02-24 08:56:29 UTC
Okay, I think I found the exact circumstances that cause the issue for me. As said it is both sessions have compositing + GLX, but I additionally found that it only happens with DRI v3. I now commented out DRI v3 again like this:

Section "Device"
        Identifier      "Grafikkern"

        Driver          "intel"

#       Option          "Backlight"     "/dev/null"
        Option          "AccelMethod"   "uxa"
#       Option          "AccelMethod"   "sna"
#       Option          "TearFree"      "true"

#       Option          "DRI"           "3"
EndSection

and two sessions now work stable again.

I thought it would be kscreen as I had a quite nasty brightness to zero bug with it before that went away when deleten ~/.local/share/kscreen.

This time it wasn´t kscreen. I am sorry.

I am closing this one and opening a new one for KWin even tough it may be a driver issue, but then I think it is good Martin is aware of it. Thanks, Martin
Comment 14 Martin Steigerwald 2016-02-24 09:40:35 UTC
Replaced by #359743.