Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Plasma desktop crashes when monitor turned off
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Lubrigant3
n00b
n00b


Joined: 14 Feb 2025
Posts: 1

PostPosted: Fri Feb 14, 2025 11:51 pm    Post subject: Reply with quote

I have just registered on the forum. I have little experience with Gentoo, but more or less, I think I'm getting the hang of it and my transition is not being as traumatic as I thought; even so I'm having some problems, including one that I don't know if it's the same as the one discussed in this thread but if not, it sounds very similar. So before opening a new thread I've taken the liberty of continuing this one. If you think it's not appropriate and I should open a new one, let me know and disqualify it.

In my case, Plasmashell stops working when I resume the session **with the monitor off** (I only have one monitor). If I first turn on the monitor and then flip the switch on the computer, the session resumes fine.
I've tried with a clean test user, and the same thing happens, so I'm ruling out a possible corruption of some configuration file of my regular user. I don't know if I'm right.
I'm also having some problems with SDDM that I'll check in another thread, but I don't know if they have anything to do with it because when I start the graphical session with `dbus-launch --exit-with-session startplasma-wayland` the same thing happens.

I'm in Plasma 6.2.5, KDE Frameworks 6.10.0 and Qt 6.8.1


Thank you.


P. D:
I forgot to mention that launching Plasmashell from Krunner works the first 2 or 3 times I come back from a suspended session. A while after the first restart of Plasmashell Krunner stops working to execute commands and only from a Konsole window I can execute `plasmashell` or `plasmashell &` , without ` --replace` since it doesn't work anymore either even from Konsole.
Back to top
View user's profile Send private message
Ralphred
l33t
l33t


Joined: 31 Dec 2013
Posts: 747

PostPosted: Sat Feb 15, 2025 1:07 pm    Post subject: Reply with quote

Sorry, I forgot you were running a Pi5.
My Pi5's only have twm and dwm, they're essentially running a headless images for some docker apps. This does work and should be comprehensive enough to stop any "autoconfig", I left in the details for the second monitor because it's easier than writing it again if someone else needs them, you can ignore/delete them. The modes listed are for my monitor, the 60Hz one will probably work but you should update them (you can pull the relevant EDID data from Xorg.0.log, xrandr, or use one of the EDID readers in portage), though it may work if you remove them altogether (and references to them) but I can't test that so left them in.
/etc/X11/xorg.conf:
Section "Device"
    Identifier      "Card0"
    Driver          "fbdev"
EndSection

Section    "Monitor"
    Identifier      "HDMI-1"
    VendorName      "Vendor"
    ModelName       "Model1"
    DisplaySize      531 299
    UseModes        "Model1_Modes"
    Option          "PreferredMode" "Model1_Mode60"
    Option          "Primary"
EndSection

#Section     "Monitor"
#    Identifier      "HDMI-2"
#    VendorName      "Vendor"
#    ModelName       "Model2"
#    DisplaySize     <monitor_width_mm> <montor_height_mm>
#    UseModes        "Model2_Modes"
#    Option          "PreferredMode" "Model2_Mode60"
#    Option          "RightOf" "HDMI-1" #<RightOf|LeftOf|SameAs>
#EndSection

Section "Modes"
    Identifier  "Model1_Modes"
    ModeLine    "Model1_Mode120"   297.00  1920    2008    2052    2200    1080    1084    1089    1125    +hsync  +vsync
    Modeline    "Model1_Mode75"    170.00  1920    1928    1960    2026    1080    1105    1113    1119    +hsync  -vsync
    Modeline    "Model1_Mode60"    148.50  1920    2008    2052    2200    1080    1084    1089    1125    +hsync  +vsync
    Modeline    "Model1_Mode50"    148.50  1920    2448    2492    2640    1080    1084    1089    1125    +hsync  +vsync
EndSection

#Section "Modes"
#    Identifier  "Model2_Modes"
#    ModeLine    "Model2_Mode120"   297.00  1920    2008    2052    2200    1080    1084    1089    1125    +hsync  +vsync
#    Modeline    "Model2_Mode75"    170.00  1920    1928    1960    2026    1080    1105    1113    1119    +hsync  -vsync
#    Modeline    "Model2_Mode60"    148.50  1920    2008    2052    2200    1080    1084    1089    1125    +hsync  +vsync
#    Modeline    "Model2_Mode50"    148.50  1920    2448    2492    2640    1080    1084    1089    1125    +hsync  +vsync
#EndSection

Section "Screen"
    Identifier  "ScreenL"
    Device      "Card0"
    GPUDevice   "Card0"
    Monitor     "HDMI-1"
    SubSection  "Display"
        Virtual     1920    1080
        Depth       24
    EndSubSection
EndSection

#Section "Screen"
#    Identifier  "ScreenR"
#    Device      "Card0"
#    GPUDevice   "Card0"
#    Monitor     "HDMI-2"
#    SubSection  "Display"
#        Virtual     1920    1080
#        Depth       24
#    EndSubSection
#EndSection

Section "ServerFlags"
    Option  "DefaultServerLayout"   "SingleGPU"
    Option  "UseDefaultFontPath"    "False"
    Option  "AutoAddGPU"            "True"
    Option  "AutoBindGPU"           "True"
EndSection

Section "ServerLayout"
    Identifier              "SingleGPU"
    Screen          0       "ScreenL"       0 0
#    Screen          1       "ScreenR"       1920 0
EndSection
If you still have issues after this let me know and I'll build kde on one of them, but I'd be interested to know if the same bug appears on rasbian.
Back to top
View user's profile Send private message
HuskyDog
Tux's lil' helper
Tux's lil' helper


Joined: 20 Feb 2003
Posts: 87
Location: Wiltshire, UK

PostPosted: Fri Feb 21, 2025 10:42 pm    Post subject: Reply with quote

Well, thanks for trying, but that didn't work! I had to make a couple of modifications to reflect my monitor as you suggested. I also included some lines which were in files in /etc/X11/xorg.conf.d. I also had to comment out the "fbdev" line to get it to work at all. The final file was:

Code:
Section "Device"
    Identifier      "Card0"
#    Driver          "fbdev"
EndSection

Section    "Monitor"
    Identifier      "HDMI-1"
    VendorName      "Vendor"
    ModelName       "Model1"
    DisplaySize      520 320
    UseModes        "Model1_Modes"
    Option          "PreferredMode" "1920x1200x60.0"
    Option          "Primary"
EndSection

#Section     "Monitor"
#    Identifier      "HDMI-2"
#    VendorName      "Vendor"
#    ModelName       "Model2"
#    DisplaySize     <monitor_width_mm> <montor_height_mm>
#    UseModes        "Model2_Modes"
#    Option          "PreferredMode" "Model2_Mode60"
#    Option          "RightOf" "HDMI-1" #<RightOf|LeftOf|SameAs>
#EndSection

Section "Modes"
    Identifier  "Model1_Modes"
    Modeline    "1920x1200x60.0"   154.00  1920    1968    2000    2080    1200    1203    1209    1235    +hsync  +vsync
    ModeLine    "Model1_Mode120"   297.00  1920    2008    2052    2200    1080    1084    1089    1125    +hsync  +vsync
    Modeline    "Model1_Mode75"    170.00  1920    1928    1960    2026    1080    1105    1113    1119    +hsync  -vsync
    Modeline    "Model1_Mode60"    148.50  1920    2008    2052    2200    1080    1084    1089    1125    +hsync  +vsync
    Modeline    "Model1_Mode50"    148.50  1920    2448    2492    2640    1080    1084    1089    1125    +hsync  +vsync
EndSection

#Section "Modes"
#    Identifier  "Model2_Modes"
#    ModeLine    "Model2_Mode120"   297.00  1920    2008    2052    2200    1080    1084    1089    1125    +hsync  +vsync
#    Modeline    "Model2_Mode75"    170.00  1920    1928    1960    2026    1080    1105    1113    1119    +hsync  -vsync
#    Modeline    "Model2_Mode60"    148.50  1920    2008    2052    2200    1080    1084    1089    1125    +hsync  +vsync
#    Modeline    "Model2_Mode50"    148.50  1920    2448    2492    2640    1080    1084    1089    1125    +hsync  +vsync
#EndSection

Section "Screen"
    Identifier  "ScreenL"
    Device      "Card0"
    GPUDevice   "Card0"
    Monitor     "HDMI-1"
    SubSection  "Display"
        Virtual     1920    1200
        Depth       24
    EndSubSection
EndSection

#Section "Screen"
#    Identifier  "ScreenR"
#    Device      "Card0"
#    GPUDevice   "Card0"
#    Monitor     "HDMI-2"
#    SubSection  "Display"
#        Virtual     1920    1080
#        Depth       24
#    EndSubSection
#EndSection

Section "ServerFlags"
    Option  "DefaultServerLayout"   "SingleGPU"
    Option  "UseDefaultFontPath"    "False"
    Option  "AutoAddGPU"            "True"
    Option  "AutoBindGPU"           "True"
    Option "AllowIndirectGLX" "on"
    Option "IndirectGLX" "on"
EndSection

Section "ServerLayout"
    Identifier              "SingleGPU"
    Screen          0       "ScreenL"       0 0
#    Screen          1       "ScreenR"       1920 0
EndSection

Section "OutputClass"
  Identifier "vc4"
  MatchDriver "vc4"
  Driver "modesetting"
  Option "PrimaryGPU" "true"
EndSection


With this file X works OK, but the problem is still there unchanged.
Back to top
View user's profile Send private message
Ralphred
l33t
l33t


Joined: 31 Dec 2013
Posts: 747

PostPosted: Sat Feb 22, 2025 2:50 am    Post subject: Reply with quote

OK, gimme time to build kde a Pi5, and I'll see if I can't break it.
Back to top
View user's profile Send private message
Ralphred
l33t
l33t


Joined: 31 Dec 2013
Posts: 747

PostPosted: Mon Feb 24, 2025 2:30 am    Post subject: Reply with quote

This is for HuskyDog's Pi5 only, whilst it may work for anyone using a modesetting driver, I have no hardware on which to test it.
For purely academic purposes only, here is a correct xorg.conf
/etc/X11/xorg.conf.Pi5-ms:
Section "Device"
    Identifier      "Card0"
    Driver          "modesetting"
    Option          "kmsdev" "/dev/dri/card1"   
EndSection

Section    "Monitor"
    Identifier      "HDMI-1"
    VendorName      "Vendor"
    ModelName       "Model1"
    DisplaySize      531 299
    UseModes        "Model1_Modes"
    Option          "PreferredMode" "1920x1200x60.0"
    Option          "Primary"
EndSection

Section "Modes"
    Identifier  "Model1_Modes"
    Modeline    "1920x1200x60.0"   154.00  1920    1968    2000    2080    1200    1203    1209    1235    +hsync  +vsync
EndSection

Section "Screen"
    Identifier  "Screen0"
    Device      "Card0"
    GPUDevice   "Card0"
    Monitor     "HDMI-1"
    SubSection  "Display"
        Virtual     1920    1080
        Depth       24
    EndSubSection
EndSection

Section "ServerFlags"
    Option  "DefaultServerLayout"   "SingleGPU"
    Option  "AutoAddGPU"            "True"
    Option  "AutoBindGPU"           "True"
    Option "AllowIndirectGLX" "on"
    Option "IndirectGLX" "on"
EndSection

Section "ServerLayout"
    Identifier              "SingleGPU"
    Screen          0       "Screen0"       0 0
EndSection
This will conflict with xorg.conf.d/99-v3d.conf, but because of the way the modesetting driver works it doesn't fix plasmashell (it does fix it if you install the ~fbdev driver and configure to use that).

So, I made a wrapper around plasmashell that watches for the error, then cycles the monitor off and on forcing plasmashell to behave:
/home/$USER/bin/plasmafix.start:
#!/usr/bin/env python
from subprocess import Popen, PIPE, run
from time import sleep
global count
count=0
process=Popen(['/usr/bin/plasmashell','--replace'],stdout=PIPE,stderr=PIPE,encoding='UTF-8')
while not process.returncode:
    line=process.stderr.readline().strip()
    if line.find('unexisting screen available')>0:
        count+=1
        if count > 3:
            args=(['/usr/bin/xrandr','--output','HDMI-1','--off'],['/usr/bin/xrandr','--output','HDMI-1','--auto'])
            for arg in args:
                run(arg)
                sleep(1)
            count=0
/home/$USER/bin/plasmafix.stop:
#!/bin/bash
ps -eo pid,cmd|grep "/home/$USER/bin/plasmafix.start$"|awk '{print $1}'|xargs kill 2>/dev/null
Adding the .start as login script, .stop as a logout script made it fix plasma every time I tried it. Depending on how long your monitor takes to "wake up and start communicating" you may need to increase the sleep time a little - so run it in a console and check before committing to use it as a login script.
This sort of stuff was much easier to deal with when you could just shut of the kscreen daemon!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum