Foggy
Posts: 18
Joined: Mon Aug 20, 2012 12:26 pm
Location: Reading UK

How to disable screen blanking

Sun Sep 23, 2012 12:19 pm

Hi,

I have tried to stop the terminal from blanking out.

sudo nano /etc/rc.local and added
setterm -blank 0

apt-get install x11-xserver-utils
Now open up your ~/.xinitrc file (if you don't have one then create it) and enter this:
xset s off # don't activate screensaver
xset -dpms # disable DPMS (Energy Star) features.
xset s noblank # don't blank the video device
exec /etc/alternatives/x-session-manager # start lxde

Nothing seems to work - Even after reboot.

Any suggestions would be appreciated - its starting to drive me crazy.

Best wishes.

James.

kilokahn
Posts: 22
Joined: Sun Sep 09, 2012 3:41 am
Location: Tallmadge, OH, USA

Re: How to disable screen blanking

Sun Sep 23, 2012 4:04 pm

Totally +1 on this! :)
Chris Haslage, Owner
NexMix.com Productions

Foggy
Posts: 18
Joined: Mon Aug 20, 2012 12:26 pm
Location: Reading UK

Re: How to disable screen blanking

Sun Sep 23, 2012 6:22 pm

Hi,

I think I have figured it out.
However I'm a newbie so you may want to double check - But it works for me.

sudo nano /etc/kbd/config

Change these two lines.

# screen blanking timeout. monitor remains on, but the screen is cleared to
# range: 0-60 min (0==never) kernels I've looked at default to 10 minutes.
# (see linux/drivers/char/console.c)
BLANK_TIME=0 (Was 30)

# Powerdown time. The console will go to DPMS Off mode POWERDOWN_TIME
# minutes _after_ blanking. (POWERDOWN_TIME + BLANK_TIME after the last input)
POWERDOWN_TIME=0 (I think it was 15)

Re start the file or just reboot
sudo /etc/init.d/kbd restart

Monitor has now been on for over 2 hrs - so looking good.
Hope it helps some one.

Best wishes.

James.

User avatar
Rasadmin
Posts: 2
Joined: Mon Oct 01, 2012 12:20 pm

Re: How to disable screen blanking

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 :-)

hgreen
Posts: 10
Joined: Tue Sep 04, 2012 1:32 am
Location: Perth, Australia

Re: How to disable screen blanking

Mon Oct 22, 2012 3:58 am

This is a great solution for me, thanks. The app I'm running outputs log messages to the console, so I often just plug in a HDMI screen to see the status of the application on the RPi, but I don't connect a keyboard to it.

I just set those two lines to 0 (BLANK_TIME and POWERDOWN_TIME) and this worked great.
I am running Debian Wheezy (soft-float).

SmokyFrosty
Posts: 3
Joined: Wed Nov 14, 2012 3:59 pm

Re: How to disable screen blanking

Wed Nov 14, 2012 4:48 pm

Neither fix is working for me, Pi still blanks after 15 mins. Need a system that is always on screen wise.

Frosty

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

Re: How to disable screen blanking

Wed Nov 14, 2012 4:52 pm

SmokyFrosty wrote:Neither fix is working for me, Pi still blanks after 15 mins. Need a system that is always on screen wise.

Frosty
the kbd version will stop all console screen blanks
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

User avatar
jojopi
Posts: 3860
Joined: Tue Oct 11, 2011 8:38 pm

Re: How to disable screen blanking

Wed Nov 14, 2012 5:27 pm

RaTTuS wrote:the kbd version will stop all console screen blanks
Putting it another way, kbd will only stop the kernel from blanking the screen when X is not running.

And lightdm.conf is only effective if you boot straight into X using that particular display manager.

And .xinitrc only works after you log in and run "startx" (or use a display manager that defaults to a user session, and allows .xinitrc instead of .xsession).

So you might need all three. And if you run full-screen non-X programs like XBMC you may need to configure them not to blank as well.

Alvaro
Posts: 29
Joined: Sun Aug 19, 2012 8:47 am

Re: How to disable screen blanking

Wed Nov 14, 2012 8:00 pm

So it is not possible at all with the default display manager? (There is no .xinitrc file in the home directory.)

Blackcell
Posts: 20
Joined: Mon Jan 23, 2012 2:25 pm

Re: How to disable screen blanking

Fri Nov 16, 2012 9:22 pm

Is there no way to fix this? I'm sorry I'm not a linux programmer, but it seems ridiculous that there isn't a fix to keep the frikin screen from turning off.

tleland
Posts: 2
Joined: Tue Jan 15, 2013 1:36 pm

Re: How to disable screen blanking

Tue Feb 19, 2013 4:08 pm

Only way I've been able to fix this issue is install xscreensaver. To install you need "sudo apt-get install xscreensaver" . In the gui you will now have the "screensaver" option under preferences. Here you can disable the blank screen. Let me know if this makes sense and helps!

Anu
Posts: 1
Joined: Mon Feb 25, 2013 4:59 pm

Re: How to disable screen blanking

Mon Feb 25, 2013 5:03 pm

Installing xscreensaver worked on me too ...Thanks

pi18
Posts: 1
Joined: Tue Apr 16, 2013 10:36 am

Re: How to disable screen blanking

Tue Apr 16, 2013 11:56 am

Found this thread as I was having the same blank screening issues ever since I enabled the PI to boot automatically, xscreensaver did the trick ! Many thanks for sharing your post tleland :D

tleland
Posts: 2
Joined: Tue Jan 15, 2013 1:36 pm

Re: How to disable screen blanking

Tue Apr 16, 2013 12:44 pm

Glad i was able to help.

User avatar
pabluk
Posts: 1
Joined: Wed May 01, 2013 8:30 pm
Location: Nantes, France

Re: How to disable screen blanking

Wed May 01, 2013 9:06 pm

For me it worked by editing /etc/X11/xinit/xserverrc and changing

Code: Select all

exec /usr/bin/X -nolisten tcp "$@"
by

Code: Select all

exec /usr/bin/X -s 0 dpms -nolisten tcp "$@"
I'm using Raspbian “wheezy” and I start my X session with startx.

User avatar
DetlevSchm
Posts: 76
Joined: Tue Mar 12, 2013 8:43 am
Location: 3rd planet

Re: How to disable screen blanking

Thu May 02, 2013 3:46 pm

And another one:

I have a non-pygame Python script running in the background, that displays every five minutes some stuff on the desktop.

That alone is not sufficient, but after I put

Code: Select all

pygame.event.get()
in the loop, the screen refrains from blanking.

Needs initial

Code: Select all

import pygame
pygame.init()

tom.chamberlain
Posts: 2
Joined: Sat May 25, 2013 10:54 am

Re: How to disable screen blanking

Sat May 25, 2013 11:06 am

I got fed up with all the different options and just wrote a script to kill the screen saver process should it be running;

1 create a file /home/pi/killScreenSaver.sh

#/bin/bash

PID=`ps -ef | grep 'xscreensaver -no-splash' | grep -v "grep" | cut -c 3-14 | sed 's| ||g'`
kill $PID

exit 0


2 Set the file to executable (chmod +x /home/pi/killScreenSaver.sh)

3 Make the file run automatically every minute in cron by executing crontab -e and entering

* * * * * /home/pi/killOffScreensaver.sh > /dev/null

Very hacky and might not be safe but was quick and simple for me. For an explanation;

It prints the process tree (ps -ef), takes only lines with the phrase 'xscreensaver -no-splash' in (grep 'xscreensaver -no-splash'), then removes lines with the word grep in (as the grep process itself will appear), then takes characters 3-14 that contain the ID of the process (cut -c 3-14), then removes all white space using sed, then issues the kill command on the process ID).

User avatar
solar3000
Posts: 1087
Joined: Sat May 18, 2013 12:14 am

Re: How to disable screen blanking

Thu Dec 19, 2013 8:33 pm

that's not going to work because xscreensaver is not installed by default.
Antikythera

carlhage
Posts: 2
Joined: Sat Mar 15, 2014 1:53 am

Re: How to disable screen blanking

Sat Mar 15, 2014 2:22 am

I finally had success disabling blanking with the default Raspbian installation. The xset program is not installed by default, so I did the "sudo apt-get install x11-xserver-utils". I tested using the "xset q" command. To disable the screen blanking with the default LXDE, edit the file:
/etc/xdg/lxsession/LXDE/autostart
comment out a xscreensaver command, and add these xset lines

Code: Select all

#@xscreensaver -no-splash
@xset s off
@xset -dpms
@xset s noblank
More info at: http://www.raspberrypi.org/phpBB3/viewt ... 91&t=57552

naumann
Posts: 1
Joined: Tue Jul 22, 2014 11:00 am

Re: How to disable screen blanking

Tue Jul 22, 2014 11:03 am

by Rasadmin worked 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 :-)

mrmsbarnes
Posts: 17
Joined: Thu Jul 31, 2014 11:27 pm

Re: How to disable screen blanking

Thu Aug 07, 2014 2:08 am

About 2 years ago Rasadmin may well have posted THE answer for your system. However, I vote for carlhage, because that solution worked for my late model Raspbian system (uname -r says '3.12.22+' with LXDE display manager). Don't put magic xset commands in /etc/rc.local as advised elsewhere. Use the magic @xset commands where carlhage says.

You know you got it licked when your first terminal command after start up:
xset q
says:
prefer blanking: no allow exposures: yes
timeout: 0 cycle: nnn (600 in my case)
and:
DPMS is Disabled

NeilEric
Posts: 2
Joined: Wed Aug 13, 2014 8:11 pm

Re: How to disable screen blanking

Wed Aug 13, 2014 8:21 pm

Re tleland's post from 2013 about installing xscreensaver in order to be able to disable screen blanking from the GUI rather than from the command line:

- I installed xscreensaver and rebooted my Pi.
- When I restart the GUI, I still don't have a screensaver option in the GUI under Preferences.

Is there more to using xscreensaver than simply installing it by typing sudo apt-get install xscreensaver and rebooting?

Thanks,
Neil

idris
Posts: 1
Joined: Sun Jul 29, 2012 10:55 pm

Re: How to disable screen blanking

Sat Mar 28, 2015 6:37 am

I am curious as to where all these obscure commands come from? Linux seems just so over whelming surely there must be documentation somewhere that explains these issues. I have tried the lightdm.conf , kdb and none of them have worked, The TV display blanks out after 10 mins. I start the GUI display which I assume is the X server via startx. It looks like the chap from France might have the fix for this.
Cheers Alan

holyman83
Posts: 5
Joined: Sat May 24, 2014 8:51 pm

Re: How to disable screen blanking

Fri Apr 24, 2015 6:43 pm

sudo nano /etc/lightdm/lightdm.conf

In that file, look for:
[SeatDefault]

and insert this line:
xserver-command=X -s 0 dpms
Worked for mine...well I had all the other all ready in.

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

Re: How to disable screen blanking

Sat Apr 25, 2015 12:16 am

NeilEric wrote:Re tleland's post from 2013 about installing xscreensaver in order to be able to disable screen blanking from the GUI rather than from the command line:

- I installed xscreensaver and rebooted my Pi.
- When I restart the GUI, I still don't have a screensaver option in the GUI under Preferences.

Is there more to using xscreensaver than simply installing it by typing sudo apt-get install xscreensaver and rebooting?

Thanks,
Neil

I installed xscreensaver and it shows up in preferences as Screensaver. (Assuming the latest version of Raspbian installed)
If you can't find that then go to xterminal and run:

Code: Select all

 xscreensaver-demo
Then do this:
In the [Display Mode] tab, set like this - Mode: [Disable Screen Saver]
3B+ & 4B4G Running RPi OS Bookworm w/ Desktop

Return to “Raspberry Pi OS”