Turning the screen off (again) and screensaver problems.
-
Pi Model or other hardware: Pi5b 4GB ram, M.2 HAT with 128GB NVME drive (system is on this drive)
Power Supply used: Official 5.1V 5A brick
RetroPie Version Used:
Bookworm 6.6.62+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.62-1+rpt1 (2024-11-25) aarch64
RetroPie 4.8.9
Built From: On top of existing Fresh Official Bookworm OS (baked by Raspberry Pi Imager)
USB Devices connected: 4TB hard drive, 2 Joysticks, Mouse, Keyboard, Sound card, ArduinoTo cut the long story short, after a lot of problems with Pi4, new versions etc, etc, etc (I got it working on 4 even when "vcgencmd display_power 0" stopped working)
I fixed it by using "setterm -term linux -blank force -powersave powerdown" for turning screen OFF
"setterm -term linux -blank poke" for turning the screen back ON - worked perfectly on buster, old rpi4 (don't know what version it was, I think I updated it a couple months ago)This is working when emulationstation is not running
When emulationstation is running, the emulationstation turns the screen instantly back on (I see it flash black briefly)
This never happened before, is there something I can do to disable this behaviour?
-> Why? Two reasons:
-
Because in-built screen saver just turns the screen black and not off. Backlight is strong and very visible, monitor runs hot and uses a lot of electricity...
-
Because my joysticks have a bug and they send ghost invisible inputs of invisible buttons and they're waking up my pi even when the built in screensaver feature turns the monitor black. I'm using a bugfix in my "idle-screenoff.sh" so my script ignores the ghost inputs.
Bugfix was to install (jscal -s 7,1,0,127,127,4227201,4194176,1,0,127,127,4227201,4194176,1,0,-1,260,1,1,1,0,-1,260,1,1,1,0,-1,260,1,1,1,0,0,0,536870912,536870912,1,0,0,0,536870912,536870912 /dev/input/js0)
-
-
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.
-
What's is the EmulationStation running on in RetroPie 4.8.9? (is it running on something or is it working by itself?)
-
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.
-
-
@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.
-
@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.
-
@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 usekmsblank
to blank the display. Do note thatkmsblank
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. -
@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 usekmsblank
to blank the display. Do note thatkmsblank
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"
-
@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 theddcutil
package, which is not installed by default on RaspiOS. You can use the commands above instead of the oldvcgencmd
commands (if your monitor supports it).
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.