Thursday, June 25, 2015

[solved] screen blanking

Link: Excellent Blanking Overview

The Linux solutions in forums seem to me to often lack some necessary detail. And if something is missing, a person doesn't even know this, of course, until they entirely overcome whatever was left out. That might be hours or days later, if ever. It can be frustrating.

For screen blanking management, the key detail, unstated in any forum solution I found, was to first be sure blanking was disabled in runlevel3. Screen blanking settings are baked into the kernel, and if they're not first managed in runlevel3, prior to startx, blanking cannot be narrowed down to X settings. Rule-out half of the possible screen blanking problems by disabling runlevel3 blanking.

Run Level 3 (Non-GUI blanking isolation)

Again, do this first, prior to working on X, since terminal blanking is baked into the kernel and must be defeated before any X solution will work. In runlevel3 terminals, the setterm command controls several terminal settings, among them blanking times. To stop blanking in the terminal:
$ setterm -blank 0
The setterm command is not permanent when used in a terminal -- the next boot will reset to default kernel settings. To permanently stop blanking users can: disable blanking using their GRUB/LILO configuration, add a bootline flag, or make a systemd command. But another permanent option, which I considered the easiest hack for my installation, was to add a setterm line into /etc/profile. In other words:
$ nano /etc/profile
setterm -blank 0
This arrangement survived reboots. And, with the runlevel3 managed, I could attempt various X session solutions. Ideally, I wanted a 2.5 hour blank-out so I could watch a film while going to sleep and have it blank soon after.

X session failed configurations

Typically, the primary file for X configuration is ~/.xinitrc. If you're running Arch, multiple options are described here. Users may have to try several configurations or combine them. In my case, no suggested settings within ~/.xinitrc was successful. Even a suggested combination of runlevel3 and x commands did not work, for example:
$ nano .xinitrc
setterm -blank 0 -powersave off -powerdown 0
xset s off

X session successful configuration

Per the same link, after failures with ~/.xinitrc, I created a DPMS file to place into /etc/X11/xorg.conf.d/. The file was named, 10-monitor.conf. Here is one way to set it up.
# nano /etc/X11/xorg.conf.d/10-monitor.conf
Section "Monitor"
Identifier "LVDS0"
Option "DPMS" "false"
EndSection

Section "ServerLayout"
Identifier "ServerLayout0"
Option "BlankTime" "150"
Option "StandbyTime" "155"
Option "SuspendTime" "160"
Option "OffTime" "0"
EndSection
This worked for me. As described here, one can tweak these entries. Trial and error revealed that times in the ServerLayout are in units of minutes. I left "OffTime" as 0, to disable automatic power-down.

Summary: Manipulating blanking requires two files, one to stop runlevel3 blanking, and a second to adjust X session blanking.

No comments: