Page 1 of 1

How to turn off HDMI on blank screen?

Posted: Wed Mar 25, 2020 7:26 pm
by kaczy18
Hello to all Rapberry Pi community! I have a Raspberry Pi 4B and just installed a XScreenServer (ver. 5.42) but it doesn't work as expected. In advanced settings tab there is an option to turn off monitor after 240 minutes (by default). It does not work. Actually what work is a black screen (after 10 min. by default), but my monitor still working when screen goes black.

I researched that running from terminal:

Code: Select all

vcgencmd display_power 0
will turn off monitor (by turning off HDMI). 1 value turn monitor on.

Is there any way to connect those mechanisms? I mean when screen goes black it automatically turn my monitor off and when I move a mouse or start typing on keyboard it turns my monitor on.

Re: How to turn off HDMI on blank screen?

Posted: Wed Mar 25, 2020 9:13 pm
by jamesh
You need to set the DPMS option - that is the specific rune to turn the display off as well as blanking it.

Re: How to turn off HDMI on blank screen?

Posted: Wed Mar 25, 2020 11:19 pm
by klricks
It is much simpler to use the xset commands. On the RPi4 the HDMI will be turned off. (There is no blanking mode anymore only HDMI off).
The monitor will then use its own timeout settings.
In my case, on screen blank timeout, the monitor will show a no input banner for about 20 min. Then will shut down. After shutdown I have to physically turn the monitor on with power button or remote. Your monitor may act differently.

Note you will have to uninstall xscreensaver for this to work.
To set a timeout of 240 min. You can use this command:

Code: Select all

xset dpms 14400 14400 14400
To check the settings:

Code: Select all

xset q
To make permanent add these command to autostart:

Code: Select all

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

Code: Select all

@xset s off
@xset dpms 14400 14400 14400

Re: How to turn off HDMI on blank screen?

Posted: Thu Mar 26, 2020 4:05 pm
by kaczy18
Thank you for your responses! Yesterday I was trying to solve my problem and set Sceensaver as below (Polish language) and it magically started to work! My monitor turns automatically off after 10 min. of inactivity and on on any interaction. I'll leave it that way and don't touch it :D
2020-03-26-165122_1920x1080_scrot.png
2020-03-26-165122_1920x1080_scrot.png (43.24 KiB) Viewed 94 times
2020-03-26-165117_1920x1080_scrot.png
2020-03-26-165117_1920x1080_scrot.png (83.92 KiB) Viewed 94 times