RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Turning the screen off (again) and screensaver problems.

    Scheduled Pinned Locked Moved Help and Support
    screenoffscreensaverscreenblankingrpi5bookworm64bit
    11 Posts 3 Posters 755 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Z
      Zlutz
      last edited by

      Don't really want to bump this, but it's been more than two weeks so I'll try to paraphrase and/or maybe ask for specific help or something.

      1. What's is the EmulationStation running on in RetroPie 4.8.9? (is it running on something or is it working by itself?)

      2. What is EmulationStation using to blank the screen when it starts a screensaver? Maybe I can disable it? I can turn the screen ON and OFF in CMD when EmulationStation is not running.

      mituM 1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator @Zlutz
        last edited by mitu

        @Zlutz said in Turning the screen off (again) and screensaver problems.:

        What's is the EmulationStation running on in RetroPie 4.8.9? (is it running on something or is it working by itself?)

        It's working by itself, but to be honest I don't understand what 'runs on something' could mean ? Are you running EmulationStation from the desktop environment or from the console ?

        What is EmulationStation using to blank the screen when it starts a screensaver? Maybe I can disable it? I can turn the screen ON and OFF in CMD when EmulationStation is not running.

        EmulationStation has a power saving feature which you can configure from the menus, but I'm not sure if it has a 'black screen' option - by default it just dims the screen.

        Z 1 Reply Last reply Reply Quote 0
        • Z
          Zlutz @mitu
          last edited by

          @mitu Thanks for the reply!

          I'm using EmulationStation on autorun, I disabled desktop environment so it runs from console.
          If I exit EmulationStation with F3, I can turn off the screen with a command, but the same command isn't working when EmulationStation is running. I'm hoping to figure out how ES works - how it dims the screen so I could maybe disable that module, and script commands maybe won't get overridden/disabled.

          'runs on something' - as far as I understand, ES might be using something else as a core? I know when I tried to use xset, it didn't work "because I didn't have X running. I found one more command that didn't work because something else wasn't running, and both things "not running" were desktop environments... I'm running ES on autostart directly from CMD; can it run on autostart from desktop on RPI5?

          "setterm -term linux -blank force -powersave powerdown" is the only command that I found working even in CMD (after vcgencmd was disabled a couple years ago) but it doesn't work in ES on Bookworm (it worked on Buster).

          Just dimming the screen isn't good enough for me because backlight is pretty strong, has some bleed and uses a lot of power. My joysticks are also bugged so the monitor keeps waking up every 5-10 minutes anyways.

          mituM 1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator @Zlutz
            last edited by mitu

            @Zlutz said in Turning the screen off (again) and screensaver problems.:

            I'm hoping to figure out how ES works - how it dims the screen so I could maybe disable that module, and script commands maybe won't get overridden/disabled.

            It's doing this by itself, there's no external program that is being run - it's just image processing. You can check the options for power saving in the ES menus.

            'runs on something' - as far as I understand, ES might be using something else as a core?

            Not quite, it's uses a library, but there's no separate program ontop of which it runs.

            I know when I tried to use xset, it didn't work "because I didn't have X running. I found one more command that didn't work because something else wasn't running, and both things "not running" were desktop environments... I'm running ES on autostart directly from CMD; can it run on autostart from desktop on RPI5?

            You can, but it's not a supported configuration.

            "setterm -term linux -blank force -powersave powerdown" is the only command that I found working even in CMD (after vcgencmd was disabled a couple years ago) but it doesn't work in ES on Bookworm (it worked on Buster).

            How did you run the blanking command ? Retropie disables screen blanking because it functions as a terminal 'screensaver' and - just like in a desktop env - ignores the gamepad as an input and can kick in anytime.

            You can leverage EmulationStation's scripting support and trigger a script when the screensaver starts/stops. Since vcgencmd is not available, on KMS/DRM (console) you can use kmsblank to blank the display. Do note that kmsblank runs (and keeps the screen blank) until a key is pressed, so you need to stop it manually when the screen saver is stopped in ES through another event script.

            Z 1 Reply Last reply Reply Quote 0
            • Z
              Zlutz @mitu
              last edited by

              @mitu said in Turning the screen off (again) and screensaver problems.:

              How did you run the blanking command ?

              I run a script called "idle-screenoff.sh", sheduler runs it on boot.
              In that script, I first run a joystick fix (to filter out ghost inputs) and then detect both joystick movements.
              If there are no movements: "setterm -term linux -blank force -powersave powerdown"
              if there are movements: "setterm -term linux -blank poke"

              I also made a USB arduino device that controls the arcade cabinet light, and the light (and buttons) get dimmer when screen is off.
              Same script also makes everything even dimmer between 7PM and 6AM.
              The script worked in Buster, and it works in CMD when ES is not running.

              Retropie disables screen blanking because it functions as a terminal 'screensaver' and - just like in a desktop env - ignores the gamepad as an input and can kick in anytime.

              So, my solution might be to simply to disable the RetroPie disabling of screen blanking?

              You can leverage EmulationStation's scripting support and trigger a script when the screensaver starts/stops. Since vcgencmd is not available, on KMS/DRM (console) you can use kmsblank to blank the display. Do note that kmsblank runs (and keeps the screen blank) until a key is pressed, so you need to stop it manually when the screen saver is stopped in ES through another event script.

              When I run the command over ssh - It works when ES is not running, but when ES is running, I get the response:

              Failed to set DPMS: -13

              I suspect I have to somehow disable the "screen blank disabling"

              mituM RapidEdwin08R 2 Replies Last reply Reply Quote 0
              • mituM
                mitu Global Moderator @Zlutz
                last edited by

                @Zlutz said in Turning the screen off (again) and screensaver problems.:

                When I run the command over ssh - It works when ES is not running, but when ES is running, I get the response:

                Failed to set DPMS: -13

                Yes, unfortunately that doesn't seem to work with ES started.

                You can use the EmulationStation screensaver and instead of 'dim', you can choose to 'black' the screen. This turns off the image, through it's not enabling the powersaving on the monitor.

                You can power off the monitor if the monitor supports receiving commands via DDC. My HDMI connected monitor supports this, so I can tell it to turn off with:

                sudo modprobe i2c-dev
                ddcutil setvcp -d 1 0xd6 1
                

                and to turn it back on with:

                # (optional) sudo modprobe i2c-dev
                ddcutil setvcp -d 1 0xd6 1
                

                The ddcutil command is part of the ddcutil package, which is not installed by default on RaspiOS. You can use the commands above instead of the old vcgencmd commands (if your monitor supports it).

                Z 1 Reply Last reply Reply Quote 0
                • RapidEdwin08R
                  RapidEdwin08 @Zlutz
                  last edited by RapidEdwin08

                  @Zlutz I found this info HERE.
                  This works for me on Raspberry Pi 5 Bookworm 64bit, and on a TV too (DIdn't test on a monitor).

                  xrandr --display :0 --output HDMI-1 --off #Turn OFF HDMI-1
                  xrandr --display :0 --output HDMI-1 --auto # Turn ON HDMI-1
                  

                  EDIT: Actually does NOT work with ES running, only worked in Desktop...

                  Raspberry Pi B, Pi B+, Pi2 B, Pi3 B, Pi3 B+, Pi Zero W, Pi4 (4GB/8GB), Pi5 (8GB/16GB), Pi Zero 2 W, GPi V1, minisforum GK50 / RetroPie 4.8.x

                  1 Reply Last reply Reply Quote 0
                  • Z
                    Zlutz @mitu
                    last edited by Zlutz

                    @mitu Thanks for trying to find a solution!

                    In the meanwhile I made "a workaround" by putting extra stuff in the script...

                    killall emulationstation
                    sleep 1
                    

                    before turning OFF the screen, and then putting

                    bash emulationstation > /dev/tty1 &
                    

                    after turning the screen back ON

                    ... unfortunately, the screen turns back on with

                    emulationstation should not be run as root. If you used 'sudo emulationstation' pleaser run without sudo
                    

                    "-u pi bash emulationstation > /dev/tty1 &" doesn't seem to work either, and now it doesn't say anything so... now to figure that one out... I guess you (have to) learn something new every day!

                    Any pointers on how to actually start the emulationstation from superuser script again?

                    mituM 1 Reply Last reply Reply Quote 0
                    • mituM
                      mitu Global Moderator @Zlutz
                      last edited by

                      @Zlutz said in Turning the screen off (again) and screensaver problems.:

                      Any pointers on how to actually start the emulationstation from superuser script again?

                      You can log off the console user (the one on the tty1) and the auto-login will kick in and start EmulationStation again. An ugly workaround, to say the least.

                      Z 1 Reply Last reply Reply Quote 0
                      • Z
                        Zlutz @mitu
                        last edited by

                        @mitu said in Turning the screen off (again) and screensaver problems.:

                        You can log off the console user (the one on the tty1) and the auto-login will kick in and start EmulationStation again. An ugly workaround, to say the least.

                        I'd preffer not to do that, I was trying out some chatgpt suggestions and instead of logging in and starting ES, I was met with log-in screen for virtual terminal 0, and tty1 wasn't starting at all.
                        I had to "sudo apt remove --purge kmscon" to make it work again (after hour or two of debugging, I already wanted to reinstall everything) It seems that kmscon was hijacking the getty (I never heard of getty nor kmscon before so it was like an actual study doing it)

                        ... well, I asked chatgpt about the "starting as NOT superuser problem", I tried out the first suggestion it gave and it actually works first try!

                        su - pi -c "setsid emulationstation < /dev/tty1 > /dev/tty1 2>&1 &"
                        

                        I actually understand the linux stuff more now as this needs both "< /dev/tty1" and "> /dev tty1" (it didn't occur to me that you can do both!). It also needs setsid before running, it needs that weird "2>&1" in the end ... that's allegedly also doing something... ok... as long as it works! :D

                        Thanks for the help guys, I appreciate it a lot!

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                        Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.