New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Turn off xset screensaver and dpms (energy star) modes #247
Conversation
New rpi firmware disables omxplayer video and audio when xset screensaver turns on. Disable on omxplayer start, re-enable on exit.
Not sure this is a good idea. Where omxplayer is embedded in an application (e.g. Pi Presents) which needs the screensaver disabled continually this patch will re-enable it at the end of each video :-( Disabling of screensaver should be in the script that calls omxplayer. |
Is it possible to have a firmware switch to disable this behaviour firmware-side? I find it useful to have the X or console screen go black in power saving mode after some minutes while I'm playing videos. I know there is already a command line switch to go black, but I like the previous behaviour of being able to wake the X screen with the mouse for some minutes while playing, to eg. see the clock or the CPU graph (I've got a 5:4 1280x1024 screen of course hehe, I hate 16:9 screens....). Also, maybe the firmware should only turn video processing off along with the screen, and not audio too... |
@ktws presumably xset only helps when running X? Do we need to use setterm to achieve the same effect when launching from console (outside of X)? And as @KenT2 says, we don't want to enable screensaver if it was originally disabled. @VittGam HDMI audio and video share the same physical channel and so cannot be disabled independently. I agree we want to change something, but I'm undecided on the best place to fix this. A config.txt override is probably useful if some users prefer the hdmi output not be shut down. |
@KenT2 @popcornmix Knocked up the code below which querys "xset -q" to see if DPMS or screensaver are on and, if they are, set to off. Then on-exit reset to original values. Thoughts? Just did some tests and yes, "setterm -powersave off -blank 0" is needed. You can query "sudo cat /sys/module/kernel/parameters/consoleblank" to find blanking time in seconds but I can't find a way to query the powersave state. Any suggestions where I could find this? It would then be possible to set setterm is in the same way xset is set int the code below. ON-STARTUP:
ON-EXIT:
|
It seems to me that to blank videos when the screensaver kicks in is the intuitively correct solution for most occasions. However I can see there is a good reason for wanting not to blank omxplayer at this time. How about then as an alternative to @ktws solution to have an omxplayer option --noscreensaver (or whatever) which will disable the blanking for omxplayer. @popcornmix the config.txt looks good as well. I just wondered if there were other uses of dispmanx for which the user would not want to disable blanking, also if there are other non-framebuffer layers (e.g. opengles) that need to be considered. (Ignore this if I'm talking rubbish). |
the proper solution is XScreenSaverSuspend as seen in https://github.com/pigoz/mplayer-svn/blob/master/libvo/x11_common.c#L1488 that will suspend the timer, and resume it later but that would require adding some x11 support to omxplayer while still being able to fall back when it cant connect |
firmware: Add config option hdmi_blanking to allow hdmi output to be disabled when framebuffer is blanked See: popcornmix/omxplayer#247 firmware: Keep built files out of source tree to avoid tainted builds See: Hexxeh/rpi-update#146
firmware: Add config option hdmi_blanking to allow hdmi output to be disabled when framebuffer is blanked See: popcornmix/omxplayer#247 firmware: Keep built files out of source tree to avoid tainted builds See: Hexxeh/rpi-update#146
Latest firmware makes the hdmi disable on framebuffer blank disabled by default. It may be enabled by default in the future when either the firmware uses info on other dispmanx layers being active (e.g. from omxplayer, GL ES, camera preview etc) to be more sure that disabling hdmi is safe, or when the host apps are correctly disabling blanking when display is active. |
firmware: Add config option hdmi_blanking to allow hdmi output to be disabled when framebuffer is blanked See: popcornmix/omxplayer#247 firmware: Keep built files out of source tree to avoid tainted builds See: Hexxeh/rpi-update#146
@popcornmix New rpi firmware disables omxplayer video and audio when xset screensaver turns on. Disable on omxplayer start, re-enable on exit.
I'm new to shell scripting so not exactly sure if this is the best way to do it, but it works. Feel free to reject if it's not up to scratch.