0

I'm trying to completely powerdown the backlight of an LCD panel which is built into a device I'm using. Although the screen blanks, you can still see a glow from the backlight in a darkened room.

I think that (as root) I should be able to do this as follows:

setterm -powersave powerdown > /dev/tty1

which should force the DPMS state once the screen is blanked. However, although man setterm suggests that -powersave is a valid option, whichever of the suggested arguments I supply (on, off, powerdown, etc.), I receive an error:

setterm: cannot (un)set powersave mode: Invalid argument

I have tried this in two other Ubuntu installations with similar results.

Can anyone suggest:

  1. Why this command doesn't seem to work anywhere?
  2. Whether there is a better way to control backlight power?

Additional Info:

  • The device is an O2 Joggler, based on an OpenPeak OpenFrame 7 and is running a slightly modified Ubuntu 12.04.02 server image distributed by the community for this device. It's an i386 architecture (Intel Atom processor)
  • X (which I understand can interefere with setterm operation) is not installed anywhere I've tried this. This also means the xset command won't operate
  • A driver is provided which offers control over the display via sysfs, including a psuedo-file which purports to switch off the backlight, but it still glows dimly
  • The other two installs I tried (12.04 and 10.04) were different devices: a VMWare VM and a physical Dell server respectively
Bob Sammers
  • 206
  • 2
  • 8

4 Answers4

2

I spent 5 hours for it trying setterm, fbset and other...

This powers monitor down on my board:

echo 1 > /sys/devices/pci0000\:00/0000\:00\:01.0/graphics/fb0/blank

Also try search LVDS backlight descriptor in /sys/

eri
  • 349
  • 2
  • 13
  • What is "your board"? I can't find anything under `/sys/devices/pci0000\:00/0000\:00\:*` named graphics on my device, unfortunately. (Your command verbatim results in a `No such file...` error.) – Bob Sammers Sep 19 '16 at 10:58
  • kirkwood with xgi pci graphics. your graphics may be placed at another bus, but it should be in sysfs – eri Sep 19 '16 at 14:25
  • try `find /sys/ -name fb0` – eri Sep 19 '16 at 14:30
  • I've found the `fb0` (and `backlight`) sysfs entries. Unfortunately, this doesn't appear to be possible in my install: I get `bash: echo: write error: Invalid argument` when writing to the `blank` psuedo file (as root) and although I can control the backlight power by writing a number to `/sys/class/backlight/openframe-bl/brightness`, `0` still leaves the backlight dimly on. – Bob Sammers Sep 19 '16 at 16:58
  • inspect your board and lcd panel. maybe backlight shorted to power phisicaly... – eri Sep 20 '16 at 16:47
2

Actually I had the same problem and I managed to solve it.

With a little help from strace I found that setterm -powersave powerdown sends a ioctl() to the fd 0 (stdin).

So I tried with:

root@zanac:~# setterm -powersave powerdown < /dev/tty1

and that worked (the command returns 0). I cannot verify ATM if the command actually does what it's supposed to because I'm doing this via SSH. Besides it seems you have a peculiar configuration so YMMV.

user308851
  • 21
  • 2
  • Thanks for your help. I must confess, I don't understand what is supposed to happen here (redirecting _from_ the console _to_ the `setterm` command?), but I am seeing a return code of 0 on my device when using your variation of the command. However, it doesn't affect the backlight, unfortunately. Actually I wrote a small C program to send an `ioctl()` to /dev/fb0 directly and that also failed to work (it reported error 22: "Invalid Argument", although as far as I could tell, I'd done what I should have). – Bob Sammers Mar 19 '14 at 16:06
0

The datasheet of the Sharp LQ070Y3LG4A used in the Joggler shows that the LED backlight is connected directly (Note 1 on page 11) to pins 24-30. So even if you blank the display with DPMS (using whatever method), the backlight stays on.

So the question is if there is any other piece of hardware on the mainboard that allows to cut the power supply to the LED backlight, and if yes, how to control it. I couldn't find anything about this on the Joggler Wiki, typical candidates are chips controlled by the I2C/SMBUS. But maybe there's just no way to turn it off the backlight by software (unless you add some hardware of your own).

dirkt
  • 16,421
  • 3
  • 31
  • 37
  • The brightness of the backlight can be altered (and I know how to do that) so there is something that controls the voltage applied to these LED strings. The question is, can whatever is responsible for this also cut the power completely? It seems sensible that it should, but I've not investigated the hardware, and your approach is interesting. In fact, I seem to recall (I haven't looked at this for 3 years, even though I'm still using the device) that I established that `xset` could do it, but I shied away from installing X just to switch _off_ the display. Perhaps I should reconsider! – Bob Sammers Sep 19 '16 at 16:28
  • So how can the backlight be altered? Don't keep it a secret. :-) If you could tell us this, it should be possible to figure out which driver manages it, and what hardware is responsible. Installing X will also just use DPMS, so that doesn't make any difference. – dirkt Sep 19 '16 at 17:06
  • Saw the `openframe-bl` in the other comment. [This](https://searchcode.com/codesearch/view/40100743/) seems to be the code, confusingly not in `driver/gpu/drm/gma500`, which has *other* ways to control backlights on various models. So there seems to be a pulse-width modulation register `BLC_PWM_CTL` in the GMA 500, with a bitfield for brightness, and some other bits (e.g. the bit 31 that is always set). You probably have to set/reset some bits in that register to turn the backlight completely off. But without proper documentation, nobody knows which ones ... – dirkt Sep 19 '16 at 17:52
  • I detailed my investigations in this thread, http://www.jogglerwiki.com/forum/viewtopic.php?t=1277, which includes the brightness control and a few other things discovered by myself and others. – Bob Sammers Sep 20 '16 at 11:48
  • That thread seems to be mostly a search for "which API can I use". In the end, no matter which API you use, you have to control actual hardware, and both the code for the framebuffer device (`driver/gpu/drm/gma500`) and `openframe-bl` only ever set the brightness bitfield in `BLC_PWM_CTL`. So the conclusion is the same: If this doesn't turn off the PWM completely per your observation, then either it can't be turned off completely, or some other bits in this or similar registers do it. Without documentation, we can't know which ones. – dirkt Sep 20 '16 at 15:05
  • If you can code, there's always the option to play around with the other bits and see what happens, but this is potentially dangerous for the hardware, especially if more substantial amps are involved somewhere. – dirkt Sep 20 '16 at 15:07
0

I have discovered why setterm is giving an error... well up to a point. It seems that the method of controlling a physical console screen via SSH (i.e. redirecting the output of setterm to /dev/tty1 doesn't work in this case.

I was being thrown by the fact that the following variation does work exactly as expected (it clears the console's physical screen from an SSH session):

root@joggler:/home/bob# setterm -clear all > /dev/tty1

As to why some setterm commands work and others not, I don't have an answer for that.

For anyone finding this question in relation to a Joggler problem, I should clarify that it appears not to be possible to do what I want (completely disable the backlight) using setterm -powersave powerdown: the screen remains very dimly lit as before.

Bob Sammers
  • 206
  • 2
  • 8
  • "setterm clear all" sends the same character as CRTL+L, clearing the console and relocating the cursor to top left. – rob Oct 30 '13 at 09:08