User avatar
kaczy18
Posts: 7
Joined: Wed Mar 25, 2020 6:42 pm
Location: Warsaw, Poland

How to turn off HDMI on blank screen?

Wed Mar 25, 2020 7:26 pm

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.
Raspberry Pi Zero, Rasberry Pi 4B

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26659
Joined: Sat Jul 30, 2011 7:41 pm

Re: How to turn off HDMI on blank screen?

Wed Mar 25, 2020 9:13 pm

You need to set the DPMS option - that is the specific rune to turn the display off as well as blanking it.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

klricks
Posts: 7154
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: How to turn off HDMI on blank screen?

Wed Mar 25, 2020 11:19 pm

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
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

User avatar
kaczy18
Posts: 7
Joined: Wed Mar 25, 2020 6:42 pm
Location: Warsaw, Poland

Re: How to turn off HDMI on blank screen?

Thu Mar 26, 2020 4:05 pm

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 95 times
2020-03-26-165117_1920x1080_scrot.png
2020-03-26-165117_1920x1080_scrot.png (83.92 KiB) Viewed 95 times
Raspberry Pi Zero, Rasberry Pi 4B

Return to “Beginners”