Announcement

Collapse
No announcement yet.

Displays always messed up after a cold boot

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Displays always messed up after a cold boot

    If I shutdown my computer for a couple days, when I come to boot back up, the displays are always messed up, usually the top one will just not get detected, and will be set to some weird refresh rate and I need to fiddle around with the settings and reenable it and move them all around to get them back the way they were. Super annoying.

    Is there a way to get these settings to stick properly even after a cold reboot? If I just do a quick reboot it sticks, it's after a long shutdown that it messes up.

    Also for whatever reason, after a cold boot it will reopen a bunch of apps that were previously opened even if I closed them before the shutdown. I have to use the shutdown and reboot command on this computer to shutdown or reboot, if it matters. If I try to do it through the GUI it just hangs and never shuts down.

    It's almost like settings just don't save.

    In fact I have another issue where file extension association for excell files also keep getting lost and I always have to set it back to Calc. But it will forget even within the same session, so I think that's a whole separate issue.

    #2
    Well the open windows is easy to fix. In settings go to session.

    Make sure you don't have save previous session enabled.

    Sent from my HD1905 using Tapatalk

    Comment


      #3
      See I'm ok with previous sessions, like if the system crashed or something, but if I manually close off everything before rebooting I just find it all that everything opens back up anyway.

      Comment


        #4
        Run these commands and give the output

        cd ~/.config

        ls -la

        Sent from my HD1905 using Tapatalk

        Comment


          #5
          Originally posted by Red Squirrel View Post
          See I'm ok with previous sessions, like if the system crashed or something, but if I manually close off everything before rebooting I just find it all that everything opens back up anyway.
          You're kind of arguing with yourself here - or at least the answer. What mr_raider suggests IS the solution to not having all your windows open back up when you log in. Either you want that or you don't. AFIAK there is no way to determine using System Settings whether a log in is the result of a crash or a normal exit. You only get to select one behavior of three: New Session, Saved Session, Previous Session. I doubt what you're asking for is even possible, as there's no way to predict a crash so no way to somehow save a session just before a crash. Sounds like there is a Saved Session. Just enable New Session, log out and back in to a blank desktop, then set thing the way you want and select Saved Session again, or just leave it on New Session and you get a clear desktop at every log in.

          As far as the display settings, depending on how or what is causing it there are a few possible solutions. You state "if I shutdown my computer for a couple of days..." Is this meant to indicate that a shutdown of only a few hours results in a different behavior? Are you manually powering down the monitors in one instance but not another? Computers are rarely random by nature so specificity as to the actual causal circumstances is necessary to offer any real solutions. It actually makes sense that a reboot would not cause the monitors to be reset as they remain connected and powered on during the reboot.

          I can say in for years kscreen has caused me all kinds of problems in certain situations. In some cases, just removing it and manually setting ad saving the displays works very well. Assuming this is not a laptop, then you don't really need the ability to auto-adjust monitor setups. In the worst cases, I've had to write a startup script that detected the monitors and properly set them for me. I have a laptop with a 4K screen and an external QHD+ (3840x1600) monitor. When I connected the external monitor, kscreen would always try and set the external monitor to 3840x1600@60 which isn't supported by the connection being used. I had to write a startup script that set it properly using xrandr.
          Last edited by oshunluvr; Aug 31, 2020, 08:14 AM.

          Please Read Me

          Comment


            #6
            Oh I did not realize the saved session was static. Not sure why that particular session is what it decided to save as I never touched that. I figured it just restored the previous session if you did not close out of the apps before shutting down or computer crashed etc, kinda like Windows does if it crashes or is shut down without closing out of your apps. Though even Windows seems inconsistent with that. I just disabled it then. Was a minor annoyance just thought it was odd.

            How would I go about manually setting the displays? I don't tend to change my displays around so that could probably work. Is there a way to just tell it to keep whatever is already set?

            So this is output of .config folder:

            Code:
             total 492
            drwxr-xr-x 31 ****** 4096 Aug 31 11:56 .
            drwxr-xr-x 27 ****** 4096 Aug 31 08:24 ..
            -rw-------  1 ******   66 Apr 23 23:36 akregatorrc
            -rw-------  1 ******  379 Jun 29 20:25 arkrc
            drwxrwxr-x  2 ****** 4096 Jun 27 23:48 autostart
            drwxrwxr-x  2 ****** 4096 Apr 23 23:36 autostart-scripts
            -rw-------  1 ******  551 Apr 24 15:22 baloofileinformationrc
            -rw-------  1 ******  789 Apr 23 23:36 baloofilerc
            drwxrwxr-x  3 ****** 4096 Aug 13 22:34 blender
            -rw-------  1 ******   28 Apr 23 23:39 bluedevilglobalrc
            drwx------  2 ****** 4096 Aug 17 19:58 darktable
            drwx------  2 ****** 4096 Aug 25 22:22 dconf
            -rw-------  1 ******   49 Aug 31 08:26 discoverrc
            -rw-------  1 ****** 1827 Aug 13 17:34 dolphinrc
            -rw-------  1 ******  144 Jun 22 00:39 drkonqirc
            -rw-------  1 ******  112 May 27 20:52 elisarc
            -rw-------  1 ******   58 Apr 24 13:14 emaildefaults
            -rw-------  1 ******  335 Jul  7 23:34 filetypesrc
            drwx------  2 ****** 4096 Aug 25 22:48 filezilla
            drwxrwxr-x  2 ****** 4096 Apr 24 00:16 fontconfig
            drwxrwxr-x  4 ****** 4096 Apr 29 00:22 freerdp
            drwxr-xr-x  3 ****** 4096 Apr 25 01:15 GIMP
            drwx------  2 ****** 4096 Jul 23 11:42 gtk-2.0
            drwxrwxr-x  2 ****** 4096 Aug 31 08:24 gtk-3.0
            -rw-rw-r--  1 ****** 1451 Aug 31 08:24 gtkrc
            -rw-rw-r--  1 ****** 1411 Aug 31 08:24 gtkrc-2.0
            -rw-------  1 ****** 1213 Aug 17 20:18 gwenviewrc
            drwx------  3 ****** 4096 Apr 23 23:42 ibus
            -rw-------  1 ******  119 Apr 23 23:36 kactivitymanagerdrc
            -rw-------  1 ****** 2701 Apr 24 15:34 kactivitymanagerd-statsrc
            -rw-------  1 ****** 8870 Aug  2 18:52 katemetainfos
            -rw-------  1 ****** 2878 Aug  1 23:44 katerc
            -rw-------  1 ******  338 May 28 16:30 kateschemarc
            -rw-------  1 ******38906 May 28 16:29 katesyntaxhighlightingrc
            -rw-------  1 ******  419 Apr 24 16:03 katevirc
            -rw-------  1 ******   33 Apr 25 23:34 kcalcrc
            -rw-------  1 ******   53 Apr 24 00:16 kcmfonts
            -rw-------  1 ******    0 Jun 28 00:13 kcminputrc
            -rw-------  1 ****** 1865 May 26 02:16 kconf_updaterc
            drwxrwxr-x  2 ****** 4096 Apr 23 23:36 kdeconnect
            -rw-------  1 ******  136 May  1 20:25 kded5rc
            -rw-------  1 ****** 3928 Aug 25 22:46 kdeglobals
            -rw-------  1 ****** 5672 Aug  7 11:25 kdenliverc
            drwxrwxr-x  2 ****** 4096 Aug 10 15:37 kde.org
            -rw-------  1 ******   72 Apr 24 00:16 kfontinstuirc
            -rw-------  1 ******   26 Apr 29 19:26 kgammarc
            -rw-------  1 ******14491 Aug 31 08:24 kglobalshortcutsrc
            -rw-------  1 ******30269 Aug 31 08:24 khotkeysrc
            drwxrwxr-x  3 ****** 4096 Aug 16 18:13 kicad
            -rw-------  1 ******  127 Apr 24 16:04 kiorc
            -rw-------  1 ******   81 Jun 27 23:56 klaunchrc
            -rw-------  1 ******   96 Aug 18 14:40 klipperrc
            -rw-------  1 ******   74 Apr 23 23:36 kmixrc
            -rw-------  1 ******  216 Aug 31 08:21 konsolerc
            -rw-r--r--  1 ******   40 Apr 23 23:18 korgacrc
            -rw-------  1 ******   98 Apr 24 00:18 kscreenlockerrc
            -rw-------  1 ******  304 Apr 24 16:04 kservicemenurc
            -rw-------  1 ****** 2561 Aug  7 08:00 ksmserverrc
            -rw-------  1 ******  107 Apr 23 23:36 ktimezonedrc
            -rw-------  1 ******  118 May  2 18:15 ktrashrc
            -rw-------  1 ****** 1697 Aug 31 08:24 kwinrc
            -rw-------  1 ******   43 Apr 24 00:53 kwin_rules_dialogrc
            -rw-------  1 ****** 1956 Aug 15 11:38 kwinrulesrc
            -rw-------  1 ******  184 Aug 31 08:24 kxkbrc
            drwxr-xr-x  2 ****** 4096 Apr 23 23:36 libaccounts-glib
            drwxrwxr-x  3 ****** 4096 Apr 24 13:32 libreoffice
            -rw-------  1 ******  931 Jul  7 23:34 mimeapps.list
            drwx------  2 ****** 4096 May 28 12:38 Mousepad
            drwx------  2 ****** 4096 May  2 14:55 mpv
            -rw-------  1 ******  477 Apr 24 17:32 muonrc
            -rw-------  1 ******  599 Aug 16 11:48 okularrc
            -rw-------  1 ******  150 Jun 30 14:18 org.kde.gwenviewrc
            -rw-------  1 ******   27 May  2 17:19 plasma_calendar_holiday_regions
            -rw-------  1 ******   27 Apr 23 23:36 plasma-localerc
            -rw-------  1 ******   36 Apr 23 23:36 plasma-nm
            -rw-------  1 ******    0 Aug 31 11:56 plasmanotifyrc
            -rw-------  1 ****** 9386 Aug 31 11:56 plasma-org.kde.plasma.desktop-appletsrc
            -rw-------  1 ******  170 May 26 01:21 plasmarc
            -rw-------  1 ****** 1856 Aug 31 08:24 plasmashellrc
            drwxrwxr-x  4 ****** 4096 Jun 27 23:48 plasma-workspace
            -rw-------  1 ******   44 May 27 18:20 powerdevilrc
            -rw-------  1 ******  544 May 27 18:20 powermanagementprofilesrc
            -rw-------  1 ****** 1173 Apr 29 19:28 print-manager
            drwx------  2 ****** 4096 Apr 24 01:35 procps
            drwx------  2 ****** 4096 Apr 23 23:36 pulse
            -rw-rw-r--  1 ******  124 Aug 25 22:46 QtProject.conf
            drwxrwxr-x  2 ****** 4096 Aug 31 08:24 session
            drwxrwxr-x  3 ****** 4096 Aug 10 21:20 smplayer
            -rw-------  1 ******  124 Aug 25 20:17 soffice.binrc
            -rw-------  1 ****** 1333 Aug 25 22:46 spectaclerc
            -rw-------  1 ******   45 Apr 24 18:26 systemsettingsrc
            -rw-------  1 ******   97 Jun  4 00:27 trashrc
            -rw-rw-r--  1 ****** 1059 Aug 31 08:24 Trolltech.conf
            -rw-------  1 ******  633 Apr 23 23:36 user-dirs.dirs
            -rw-rw-r--  1 ******    5 Apr 23 23:36 user-dirs.locale
            drwx------  2 ****** 4096 Jul  3 20:28 VirtualBox
            -rw-------  1 ******   44 Apr 24 21:27 VirtualBoxrc
            drwxrwxr-x  2 ****** 4096 Jul  7 23:25 vlc
            drwxr-xr-x  3 ****** 4096 Jul 29 21:54 wireshark
            drwxrwxr-x  3 ****** 4096 May 28 12:23 xfce4
            drwxrwxr-x  2 ****** 4096 Aug 31 08:24 xsettingsd

            Comment


              #7
              Manually configuring them is the last resort. Try uninstalling kscreen first, then setting your monitors in system settings and see if it last through a shutdown.

              If not, manual configuration is just figuring out the xrandr commands that set things, putting them in a script, setting it to auto-run, done.

              Try the kscreen removal first. If that doesn't solve it, post back and we'll try the script thingy.

              Please Read Me

              Comment


                #8
                Ok I removed kscreen. Though I guess that's what lets me set the screens? Since now I don't get the option anymore. But they are setup the way I want right now so I'll leave it to see what happens.

                The issue only comes up if the computer has been off for several days and that only really happens when I go on night shift as I don't use it at all then.

                Comment


                  #9
                  So that did not work. I had to reboot and now the second monitor is not coming up at all. And I can't get to the option to add it anymore, it's gone. So it seems to be a very random issue because this was not even a cold boot. My system completely locked up while rendering video (I think it's an issue with kdenlive, I have lot of weird glitchyness with that program) so I had to force power it off.

                  Anything else I can try?

                  I have some programs that keep trying to open on the 2nd monitor now and I can't access them. That's another thing, how do I force apps to always open on the primary no matter what? I tried the KDE rules, but those don't seem to do anything, I don't even know if they save.

                  Edit:
                  I think I'm going to reinstall. I have a bunch of other glitchyness going on this system including copy and paste barely working. Driving me nuts.

                  Was playing with xrandr, but I can't even copy and paste commands from console to notepad. It's really hit and miss when copy and paste decides to break on this system and it's gotten worse over time. It's letting me paste here for some reason so just leaving this here so I can remember the command I typed that worked...

                  Code:
                  sudo xrandr --output HDMI-A-0 --mode 3840x2160 --rate  30
                  sudo xrandr --output HDMI-A-1 --mode 3840x2160 --rate  30
                  
                  sudo xrandr --output HDMI-A-0 --primary
                  
                  sudo xrandr --output HDMI-A-1 --above HDMI-A-0
                  It seems this system can't handle driving both displays at 60hz. Either it's a system limitation (doubt it, have a decent video card in there) or a Linux/driver limitation. If both are running at 30 then the monitors work. So I managed to get the screens up, only issue is the orientation is wrong, so trying to play with that.

                  Good news is the commands above seem to work. With my copy and paste bug I was able to copy and paste it from here into vim, I just was not able to go direct... but that's another story. So managed to make a script now to figure out how to make it go at startup. Can't seem to get that part working. I guess this is the script you were talking about?

                  But yeah considering all the other issues going on with this machine think I will reinstall, this is a pretty crap work around especially if I can't get it to run at startup and have to do it manually each time.
                  Last edited by Red Squirrel; Sep 14, 2020, 05:49 AM.

                  Comment


                    #10
                    I can't comment on the abilities of your video card or monitors or HDMI cables as to why you're having trouble getting them to work at 60hz. I can't here either when I'm using HDMI to my QHD+ monitor.

                    IME Kdenlive has always been glitchy and I don't see what that has to do with your screen setup issues. My advice - use something else. There are several options.

                    Windows that are positioned off-screen are (or should be) reachable by simply right-clicking on the program icon in Task Manager, hovering over "More Actions" and selecting "Move" and dragging the window to where you want. If you're having set up issues, starting with a new session is advisable until you get everything resolved. That should prevent this from re-occurring.

                    Running a script at startup (not an uncommon need when trying to use special setups or when resolving hardware incompatibility issues) is a simple matter but there's more than one way to do it. The needs of the script and user will dictate the best way to do that.

                    For one thing, you have "sudo" with all your xrandr commands. Frankly, I'm surprised it works at all. Normally, xrandr commands are run in user space and don't require sudo (root) access nor do they usually work at all because root isn't running an xsession. Usually running commands like these as root causes problem like changing your user Xauthority file to root ownership which leaves you unable to log into your desktop.

                    Also note that the display manager (DM) and the desktop environment (DE) do not use that same settings and changing them requires different actions.

                    You don't say what you've tried to do to cause the script to run at startup, but I can immediately think of a couple ways all of which I've used with success - a startup script action via System Settings or calling a script from ~/.profile, The best way for your set up will depend on several things, but the easiest way is to set the script to run at login using System Settings > Startup and Shutdown > Autostart.

                    @here, I created a hidden folder in my user folder under .local called .scripts and I put my local script needs in there. Makes them easy to find later. Also, I added that location to my path so I can run them whenever i might need to.

                    As far as your xrandr commands; I'm no expert but I believe you can "stack" options and reduce the number of commands like this:

                    xrandr --output HDMI-A-0 --mode 3840x2160 --rate 30 --primary
                    xrandr --output HDMI-A-1 --mode 3840x2160 --rate 30 --above HDMI-A-0

                    Test those like that first, and assuming they work as needed, put them in a file preceded with a shebang (#!/bin/bash) and save it somewhere you'll remember, make it executable, and add it to Autostart. Then try rebooting and see if the results are as desired.
                    Last edited by oshunluvr; Sep 14, 2020, 07:06 AM. Reason: spelling

                    Please Read Me

                    Comment


                      #11
                      Yeah I know kdenlive is not the issue I just mentioned it as it was the reason for the forced reboot and it's one of the many issues with this system. The copy and paste being another issue. Then the monitors. I also have an issue with file extension associations not saving - even within the same session! .xlm files seem to be the major culprit. I keep having to associate it back with calc. Come to think of it I wonder if I have a bigger underlying issue... whatever "registry" system settings get stored in maybe is not actually saving right? Wonder if there is a service that should be running that is not.

                      I just assumed something that messes with display would require root, but I can try without sudo in the script and see how it goes. I tried placing it in the /etc/rc.local file, but I had to create that file so no idea if it's even being processed.

                      The other thing I tried is adding it to startup (I just typed "startup" in the start menu search and found a dialog where I can add scripts, so not sure if this is right way). Actually it looks like this is the Autostart you are talking about. I set it as a script, and put it to run "before session startup" is that right? Or should it be "Startup"?

                      I'm working from home now so don't want to mess with my monitors as it could affect the work machine - windows acts very strangely when it comes to displayport and doing anything to a monitor causes all the windows to shuffle. But after work I will try it again.

                      Comment


                        #12
                        There's no "registry" in Linux. That's a Microsoft invention to hide settings and prevent normal users form changing or fixing things. They want you to buy a program from them or someone they get a kickback from.

                        "Messes" with the display is pretty generic term. An xsession is a user-space event so doesn't require root access. If you wanted to configure xorg then you'd need to have root access, but you would do that by creating files in /etc/xorg.conf.d that contained the settings you wanted.

                        I could have been more specific on the Autostart thing, but sounds like you found it. I would assume you would want "Startup" because the session is the thing you're changing.

                        If it worked better with kscreen than without, you can always re-install it. IME kscreen has caused me problems so it's the first thing I suspect when monitor setups go sideways. Really, xrandr via a script is the most stable way to go unless you change you monitor setups often.

                        Frankly, it is odd that you're having so many problems with monitor arrangements. Reboots are a normal thing so shouldn't cause this many problems.

                        Please Read Me

                        Comment


                          #13
                          The messes part is more a Windows thing, I have Windows machine on same monitor as my Linux secondary (primary is on kvm so that one is fine), Windows starts to go nuts and shuffle windows all over if you turn off or disconnect or do anything to a monitor if it's plugged in via displayport. By changing Linux settings and overall playing with the monitors there's a small chance it causes the monitor to restart or switch inputs or do anything like that. So I will wait until I am done my shifts from home to test the reboot or otherwise play with this again, but I think I got the script to work at startup. "startup" seems to be what it needs to be set to. I will know for sure once I'm done working from home and don't have to worry, then I can manually change the monitors to something I don't want, then reboot, and see if it goes back.

                          I'm in the process of learning python so a nice project might be to write a GUI front end to xrandr that will then generate a script and run at startup, just need to figure out how to programatically add an entry to that startup box. I guess the tricky part is it may not work the same way in every distro so that might make things more complicated if I want this app to be universal.

                          Comment


                            #14
                            So turns out this is not working. The script itself works if I run it manually but it's not executing at startup. I tried to set it to "startup" and "before startup" no go. I made it write a log to /tmp to see if maybe it's running but it's being overwritten, and it's not even running.

                            There is a crazy amount of monitor flickering and dicking around at startup though, it spends a good minute doing weird stuff. Like one monitor will be black, the other will be out of range, then they'll switch, then they'll come back to active, then go to blue (like a connection being disconnected) and just keep doing this for a good minute before finally I'm at the desktop. The primary one will work, the secondary one will sometimes work, or not, its random. When it does work, it's not located the right way though, it will be to the left and not on top.

                            Seems having stuff run at startup at the right time has always been a challenge in Linux, it seems there are 100 ways to do it, and only 1 works.

                            Also should the script be chmodded as root, or as my user? What user is executing it at startup? Either way, it works manually if I execute it as my user...

                            Comment


                              #15
                              It works as your user because that's how xrandr works. Your issue getting it to run is unrelated to it's content IMO. I have no problems on several systems getting things to run during boot, before log in, or after log in. Why don't you post detail about what exactly you've tried, the actual full contents of whatever files you're trying to run, etc.?

                              Frankly, if your monitors are flickers and so forth there's something seriously amiss. You might try booting from a live USB and see what sort of behavior you observe.

                              Please Read Me

                              Comment

                              Working...
                              X