Sunday, November 16, 2014

[solved] xbacklight -- try to adjust your backlight to preserve it

I recently had an LCD display burn-out its backlight element and had the following consideration:
  • $60 (1.5 hrs) Replace screen and backlight combo
  • $12 (5 hrs) Replace backlight only
On my current schedule,I did the $60 but, since I was doing it for the backlight, I wanted to be sure I adjusted the backlight to a low setting going forward. The commands I'm aware of are
  • xgamma
  • xbacklight
  • xrandr
I've regularly used xgamma and xrandr in the past, but was never sure what I was adjusting -- the lcd, the backlight, or some blend. For example, with the new display, even when I set the gamma very low, eg
$ xgamma -gamma 0.1
...I would see what appeared to be a full-intensity backlight combined with a low contrast LCD setting. A similar problem appeared if I used xrandr, eg
$ xrandr --output LVDS --brightness 0.2
... which would give a bright haze (the backlight?) overlaying a barely visible display underneath. I wanted to definitively adjust the backlight so I could begin to untangle what was what. "Xbacklight" seemed the most logical choice. Murphy arrived immediately.

xbacklight problem

$ xbacklight
No outputs have backlight property
Checking the arch wiki on backlight control, we get the mysterious information:
All methods are exposed to the user through /sys/class/backlight and xrandr/xbacklight can choose one method to control brightness. It is still not very clear which one xbacklight prefers by default.
There is a note about how to fix the error message if one is using Debian, but of course Arch is not Debian. I did find the following directory however:
/sys/class/backlight/acpi_video0/
Based on what I read here from greengeek, I did the following with a nice dimming effect (required root)
# echo 1 > /sys/class/backlight/acpi_video0/brightness
Echoing a value obviously doesn't use an application (eg., xbacklight), but it appears to set the backlight effectively, and uses settings between 0 and 2.

final command combination

With the new LCD and backlight, a crisp setting appears to be
$ xgamma -gamma 0.4
# echo 0 > /sys/class/backlight/acpi_video0/brightness

xrandr and external displays or projectors

A person can get a printout of possible display settings for an external device attached to their desktop or laptop by simply typing $ xrandr. Using these, a person can set exact refresh settings for secondary displays, however, I haven't found backlight control of these displays. Still, xrandr is great to simply turn the display/projector on and off (with the proper screen resolution). Note the screen resolution of your laptop (eg. 1200x800)and send it to a projector...
$ xrandr --output VGA-0 --mode "1280x800" [initiates external video]
$ xrandr --output VGA-0 --off [terminates external video]

If I don't put the quotation marks around 1280x800, xrandr will bark at me that the resolution isn't found (most projectors don't natively have it).

No comments: