FalconFour
Posts: 17
Joined: Sun Jun 28, 2015 3:57 pm

Re: How to disable screen blanking

Sun Jun 28, 2015 4:04 pm

I can install xscreensaver and fix this... but I've got a deeper concern about this whole issue in the first place.

Screen blanking is destructive. It was originally conceived as a cheap hack to prevent burn-in on CRTs (!). It can do some good on plasma TVs, but on every other kind of common LCD out there? For an LCD, a black pixel is "on", blocking light. And the backlight produces the same amount of light so one single pixel can shine brightly. It's just all being blocked by the LCD, which also heats the LCD up.

Who the F&%@ thought this was a good idea?!

Only Linux does it, too - and every Linux distro I've ever seen does this nonsense. With the Raspberry Pi having a slim chance of ever being plugged into a CRT with its HDMI port... how about we get with the DPMS already? Why on earth is DPMS still sitting on the hackish sidelines where people are expected to hack a "fix" in for this every single time?

User avatar
ds18s20
Posts: 81
Joined: Fri Dec 23, 2011 5:44 am
Location: San Francisco

Re: How to disable screen blanking

Thu Dec 10, 2015 5:49 pm

Thank you. The true answer wasn't any of the DPMS stuff.

What made the difference for me testing with a Pi Zero was:

Code: Select all

setterm -blank 0 
Thank you!

DuneAgent
Posts: 1
Joined: Sun Sep 20, 2015 9:59 am

Re: How to disable screen blanking

Wed Dec 30, 2015 2:11 am

This is the full command to turn the screensaver off

Code: Select all

setterm -powersave off -powerdown 0 -blank 0
-powersave off parameter does not seem to work on all systems, so can be omitted if it gives an error :roll:

Nemo1966
Posts: 62
Joined: Fri Jan 01, 2016 8:02 pm

Re: How to disable screen blanking

Wed Jan 20, 2016 10:33 am

I can confirm on Raspbian Wheezy 4.1.13-v7+ that: (hard float)

This works:

Code: Select all

sudo nano /etc/kbd/config
Change these two lines to.

Code: Select all

BLANK_TIME=0 
POWERDOWN_TIME=0
This Doesn't: (or I couldn't get it to work)

Code: Select all

setterm -powersave off -powerdown 0 -blank 0
The "-powersave off" throws an error, but even without it. It doesn't seem to work. e.g.

Code: Select all

setterm -powerdown 0 -blank 0

fatboab
Posts: 1
Joined: Thu Mar 24, 2016 5:35 pm
Location: UK

Re: How to disable screen blanking

Thu Mar 24, 2016 6:07 pm

Sorry to drag this one up again, but none of the solutions posted worked for me on a RPi3 running Jessie.
Linux raspberrypi 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux
I tried adding all the xset stuff to /etc/xdg/lxsession/LXDE/autostart and /etc/xdg/lxsession/LXDE-pi/autostart but this had no effect. Turns out there is another autostart file at ~/.config/lxsession/LXDE-pi/autostart, which according to http://www.raspberrypi-spy.co.uk/2014/0 ... e-desktop/ takes precedence if it exists; which is does. Adding the three xset lines into that appears to have fix things and my screen no longer goes blank. My ~/.config/lxsession/LXDE-pi/autostart looks like:

Code: Select all

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xset s off
@xset -dpms
@xset s noblank
Cheers,

--
Bob.

User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

Re: How to disable screen blanking

Fri Apr 22, 2016 6:10 am

There is an easy way to turn off screen blanking, or increase the duration to whatever you want it to be, set the duration time for the monitor to power off, etc. No need for xscreensaver or any other apps.

Everything OFF

Open:

Code: Select all

sudo nano ~/.config/lxsession/LXDE-pi/autostart
add:

Code: Select all

@xset s 0 0
@xset s noblank
@xset s noexpose
@xset dpms 0 0 0
save with 'cntrl' + 'x', then 'y', then 'enter'


For example:
Screensaver/Blanking Disabled, and Monitor turns off after 20 Min of no activity (and then locks using lxlock (sudo apt-get install light-locker )):

Open:

Code: Select all

sudo nano /boot/config.txt
Add:

Code: Select all

# power down monitor when lockscreen enabled
hdmi_blanking=1

Code: Select all

@xset dpms 0 0 1200

Code: Select all

@xset s 0 0
@xset s noblank
@xset s noexpose
@xset dpms 0 0 1200

Code: Select all

pi@raspberrypi:~ $ xset q
Screen Saver:
  prefer blanking:  no    allow exposures:  no
  timeout:  0    cycle:  0

DPMS (Energy Star):
  Standby: 0    Suspend: 0    Off: 1200
  DPMS is Enabled
  Monitor is On
All time is in seconds...so 1800 seconds equals 30 minutes

To change screensaver time or (blanking) enter time in seconds ('600' sec is 10 min, and the default, '0' sec disables ), if you want it all turned off/disabled, do this:

Your monitor/screen will never turn off or blank
open terminal

Code: Select all

@xset s 0 0
@xset s noblank
@xset s noexpose
@xset dpms 0 0 0
To just turn off screensaver/screen blanking (but have monitor standby/suspend/turn off), then just do this:
Note that the default standby/suspend/off time for monitor is also 10 min ('600' sec) same as screen blanking, so you will want to change this

Turn off screensaver/screen blanking only

Code: Select all

@xset s 0 0
@xset s noblank
@xset s noexpose

verify it is '0' disabled

Code: Select all

xset q
If you want to have your monitor turn off after a set period of time, set it for time (say 20 min of no activity, monitor turns off):

or 2 hours no activity turn off monitor:

Code: Select all

@xset dpms 0 0 7200

Now let's say you want your monitor to turn off, and lock the screen after say 20 min of inactivity:

Code: Select all

@xset dpms 0 0 1200

Code: Select all

sudo apt-get install light-locker
sudo reboot
Then there is the optional Screenlock ( that can also be added to desktop) for manual lock screen. Which becomes functional once you install light-locker.

Image
DNPNWO

pvdmeer
Posts: 28
Joined: Mon Feb 22, 2016 10:29 am

Re: How to disable screen blanking

Sat Dec 17, 2016 10:00 am

i work in the console environment and i tried all of the above with varying degrees of success. the best i could get was no screensaver until a keyboard was plugged in.. so changing /etc/kbd/config definitely is not enough. best is to turn off console blanking in the kernel. pull the problem out by the root, so to say:

in /boot/cmdline.txt:

add: consoleblank=0

presto.

a related issue: SDL2 library seems to depend on libxss1 (an X11 screensaver extension lib), even when used from the console. anybody know why? seems like this could also cause problems..

RomanMeR
Posts: 6
Joined: Fri Jan 06, 2017 3:00 pm

Re: How to disable screen blanking

Sun Jul 30, 2017 12:20 pm

My Python application uses Pygame to display framebuffer graphics and runs as a daemon under systemd’s governance. There is neither keyboard nor mouse attached to my Raspberry Pi. RPi is set up to boot to console, which means neither X server nor desktop manager is started. I manage RPi through SSH and web interface of my application.
In order to disable screen blanking, I made this change first:

Code: Select all

sudo nano /etc/kbd/config
BLANK_TIME=0 
POWERDOWN_TIME=0
But this changed nothing. Then I added the

Code: Select all

setterm --blank 0
call before Pygame initialization to my application and this solved the issue.

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

Re: How to disable screen blanking

Sun Jul 30, 2017 9:06 pm

Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

User avatar
RaTTuS
Posts: 10458
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: How to disable screen blanking

Wed Aug 02, 2017 7:36 am

to blank the console in jessie and beyond append
consoleblank=0

to the ends of /boot/cmdline.txt [make sure you have the correct /boot/
and reboot
systemd does not respect /etc/kbd/config as you may expect [it's a long story]
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

charlesasantos
Posts: 1
Joined: Wed Sep 20, 2017 6:23 am

Re: How to disable screen blanking

Wed Sep 20, 2017 6:25 am

I tried quite a few different variants of this, in the end what worked was discovered by accident. If you put the mouse over the volume control icon, the screen saver will not come on. Mine's been permanently on for about 36 hours so far. Sure, you get a little bubble that says "Volume control x %" but hey, the screen is still on!

Toolworker
Posts: 5
Joined: Tue Nov 28, 2017 10:53 pm

Re: How to disable screen blanking

Tue Nov 28, 2017 11:01 pm

I finally got a simple slideshow (using NOOBS and feh) working with blanking disabled. The xscreensaver method worked for me.

But the first few ways I used to autostart the slide show started it before the desktop opened up, so the screen saver wasn't working yet.

When I put the slide show command in the ~/.config/lxsession/LXDE-pi/autostart file, the slide show starts after boot and the monitor doesn't blank.

User avatar
Dodecha
Posts: 12
Joined: Tue Apr 16, 2013 7:06 am
Location: Norway

Re: How to disable screen blanking

Tue Feb 06, 2018 1:22 pm

Rasadmin wrote:
Mon Oct 01, 2012 12:57 pm
Tried Foggy's way, and it did not work for me.
I found another solution elsewhere in these forums and it works for me:

sudo nano /etc/lightdm/lightdm.conf

In that file, look for:
[SeatDefault]

and insert this line:
xserver-command=X -s 0 dpms

My test monitor has been on for a couple of days now :-)
This is what helped me!

I had:
@xset s off
@xset -dpms
@xset s noblank

in both /etc/xdg/lxsession/LXDE-pi/autostart and ~/.config/lxsessions/LXDE-pi/autostart and I still saw that dpms and screensaver was on when i ran the xset -q command. BUT putting in the X-server-command=X -s 0 -dpms under the [Seat*] in /etc/lightdm/lightdm.conf worked!
I ran the xset -q and saw:
Screen Saver:
prefer blanking: yes allow exposures: yes
timeout: 0 cycle: 600
DPMS (Energy Star):
Standby: 0 Suspend: 0 Off: 0
DPMS is Disabled

screen has been running for an hour now without blanking.

fableman
Posts: 22
Joined: Mon Oct 22, 2012 12:27 pm

Re: How to disable screen blanking

Wed Feb 21, 2018 10:00 pm

In terminal mode only, nothing of this work for a china hdmi attached screen using a pi zero with

RASPBIAN STRETCH LITE
Minimal image based on Debian Stretch
Version:November 2017
Release date:2017-11-29
Kernel version:4.9

The only thing that helps to keep the screen alive is using pygame with a never ending loop with: pygame.event.get() as DetlevSchm pointed out.

Feel like raspi messed up stuff with latest firmware 2017-11 when not even /boot/config.txt commands work!

SALTY! YES!

User avatar
RaTTuS
Posts: 10458
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: How to disable screen blanking

Thu Feb 22, 2018 9:12 am

in terminal mode only the best* way is to add
consoleblank=0 to the end of the correct /boot/cmdline.txt

*best - well easiest there are other ways but systemd changes the older ways
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Tanner85
Posts: 1
Joined: Mon Jul 16, 2018 4:32 pm

Re: How to disable screen blanking

Mon Jul 16, 2018 4:38 pm

One of the motivations for which I bought a Raspberry, is to display things with a projector in my Club. This whole thing of screen blanking and everybody suggesting fixes till now, 2018, seems to me astonishlingy ridiculous. Without adding the issues arising when trying to play videos, even after having paid for the correct "licences". The sum of the two things, goes beyond any acceptance, strange nobody from the Raspberry team noticed anything.

User avatar
DougieLawson
Posts: 36106
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: How to disable screen blanking

Mon Jul 16, 2018 6:50 pm

The one time I wanted to run a slide show with a projector I used Pi Presents.
https://pipresents.wordpress.com

https://pipresents.wordpress.com/download/

No screen blanking with that stuff.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

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

Re: How to disable screen blanking

Tue Jul 17, 2018 1:50 am

Tanner85 wrote:
Mon Jul 16, 2018 4:38 pm
One of the motivations for which I bought a Raspberry, is to display things with a projector in my Club. This whole thing of screen blanking and everybody suggesting fixes till now, 2018, seems to me astonishlingy ridiculous. Without adding the issues arising when trying to play videos, even after having paid for the correct "licences". The sum of the two things, goes beyond any acceptance, strange nobody from the Raspberry team noticed anything.
Someone suggested that a couple of years ago however the issue is still open and unassigned:
https://github.com/raspberrypi-ui/rc_gui/issues/22
and
https://github.com/RPi-Distro/raspi-config/issues/38

I believe the issue is seen as a configuration preference and not as defect or bug. This default setting is just inherited from Debian which Raspbian is derived from. My guess is that other distributions include a screensaver such as xscreensaver, but this was left out of Raspbian to conserve disk image size.

I have found that these 2 methods work well...
Method 1:

Code: Select all

nano /home/pi/.config/lxsession/LXDE-pi/autostart
Add these 3 commands to the end of autostart

Code: Select all

@xset s noblank
@xset -dpms
@xset s off
Method 2:
Install xscreensaver and then set mode to disabled:
Note this will install 40MB of files.....

Code: Select all

sudo apt update
sudo apt install xscreensaver
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

alecsy
Posts: 1
Joined: Tue Sep 03, 2019 10:03 am

Re: How to disable screen blanking

Tue Sep 03, 2019 10:26 am

After many hours of research and many tested solutions, only this one worked
Rasadmin wrote:
Mon Oct 01, 2012 12:57 pm
Tried Foggy's way, and it did not work for me.
I found another solution elsewhere in these forums and it works for me:

sudo nano /etc/lightdm/lightdm.conf

In that file, look for:
[SeatDefault]

and insert this line:
xserver-command=X -s 0 dpms

My test monitor has been on for a couple of days now :-)
thx

wh7qq
Posts: 1326
Joined: Thu Oct 09, 2014 2:50 am

Re: How to disable screen blanking

Sun Sep 08, 2019 8:10 pm

@alecsy: Thanks for the post and the research...it is working for me as well. Yours was the first post I saw searching on "screen blank". I am using a MHS35 tft display and having it turn off all the time was a serious problem.

Return to “Raspbian”