Page 1 of 1

Turning off power supply of screen from CLI

PostPosted: Oct 30th, '15, 07:59
by mackowiakp
I am using laptop as my home server. So it works only in text mode without graphic interface started. I want to turn off display power supply after several minutes from boot. I previous laptop (old one) it worked for me by using such command from root:

Code: Select all
vbetool dpms off


But now I got an error:

Code: Select all
Failed to initialise LRMI (Linux Real-Mode Interface)


What the problem is and how can I resolve it?

Re: Turning off power spplu of screen from CLI

PostPosted: Oct 30th, '15, 13:31
by doktor5000
Did you now run it as root or normal user? And please show the output as root of

Code: Select all
mount | grep 'dev '
vbetool vbemode get
journalctl -ab| grep -i vbetool

Re: Turning off power spplu of screen from CLI

PostPosted: Oct 31st, '15, 08:54
by mackowiakp
Of course I run it as root. Below outputs from suggested commands:

Code: Select all
[root@mackowiak ~]# mount | grep 'dev '
devtmpfs on /dev type devtmpfs (rw,nosuid,size=1534760k,nr_inodes=383690,mode=755)
[root@mackowiak ~]# vbetool vbemode get
Failed to initialise LRMI (Linux Real-Mode Interface).
[root@mackowiak ~]# journalctl -ab| grep -i vbetool
[root@mackowiak ~]#

Re: Turning off power spplu of screen from CLI

PostPosted: Nov 4th, '15, 10:41
by mackowiakp
According to https://bugs.mageia.org/show_bug.cgi?id=3910 bug still remains :-(

Re: Turning off power spplu of screen from CLI

PostPosted: Nov 4th, '15, 22:26
by doktor5000
Not really. For one, that is about the installer, not an installed system. And secondly, running it as root worked there on installed system, see e.g. https://bugs.mageia.org/show_bug.cgi?id=3910#c20

Re: Turning off power supply of screen from CLI

PostPosted: Nov 5th, '15, 09:15
by mackowiakp
I run it as root but it does not works for me. The last comment to https://bugs.mageia.org/show_bug.cgi?id=3910#c20 is:

"vbetool/libx86 issue fixed, original bug still remains."

My hardware is HP DV6700 and it is possible to turn off laptop screen from KDE. But my PC works without graphical interface (it acts as a server). So, if turning power supply from KDE it should be possible from CLI. Is any workaround?

Re: Turning off power supply of screen from CLI

PostPosted: Nov 5th, '15, 19:59
by doktor5000
Yes, and the original bug is about vbetool not working during Mageia installation, but it works fine in the installed system.

You could try setterm as an alternative: http://tldp.org/HOWTO/Battery-Powered/methods.html#XF86

Re: Turning off power supply of screen from CLI

PostPosted: Nov 5th, '15, 20:46
by mackowiakp
I dont understand what You mean saying "vbetool not working during Mageia installation, but it works fine in the installed system". Can You explain more?

The alternative You show me is for system running X environment. I use my laptop as a server without any graphical environment. Just ASCII console instead.

Re: Turning off power supply of screen from CLI

PostPosted: Nov 6th, '15, 20:27
by doktor5000
No I can't explain much more clearly then that. Did you actually read the bug report, it's already explained in comment 0 ...
https://bugs.mageia.org/show_bug.cgi?id=3910#c0 wrote:Note that in the installed system itself, the blanking/unblanking functionality works fine.


And for the second one, seems you didn't read there, too. I mentioned setterm, seems using Ctrl+F to find the relevant line is already asked too much.
Let me quote that for you:
If instead you're using the Linux console (not X-Windows), you'll want to use setterm(1):

bash$ setterm -blank 10 # Blank the screen in 10 minutes
bash$ setterm -powersave on # Put the monitor into VESA power saving mode
bash$ setterm -powerdown 20 # Set the VESA powerdown to 20 minutes

Re: Turning off power supply of screen from CLI

PostPosted: Nov 8th, '15, 10:46
by mackowiakp
I try setterm too. But it does not work for me too:

Code: Select all
[root@mackowiak ~]#  setterm -powerdown 2
[root@mackowiak ~]#  setterm -blank 1
setterm: terminal xterm nie obsługuje --blank
[root@mackowiak ~]# setterm -powersave on
setterm: nie można włączyć/wyłączyć trybu oszczędzania energii: Niewłaściwy ioctl dla urządzenia

Translation:

[root@mackowiak ~]#  setterm -powerdown 2
[root@mackowiak ~]#  setterm -blank 1
setterm:xterm terminal does not support --blank
[root@mackowiak ~]# setterm -powersave on
setterm:You can not turn on / off power saving mode: Inappropriate ioctl for device


In my previous installation of M5 (upgraded form M4) vbetool worked fine and it was possible to blank screen including turning off back light.
In this new installation I can only dim screen but back light is still turn on. I want to turn it off because it produces a lot of heat.

Re: Turning off power supply of screen from CLI

PostPosted: Nov 9th, '15, 12:03
by mackowiakp
I try to play with files located in /sys/class/backlight/acpi_video0

I use such command:

Code: Select all
[root@mackowiak acpi_video0]# cd /sys/class/backlight/acpi_video0
[root@mackowiak acpi_video0]# cat actual_brightness
9
[root@mackowiak acpi_video0]# echo 0 > brightness       
[root@mackowiak acpi_video0]# cat brightness     
0


And - system crashed (?!). After reboot, backlight is very dim and I check the content of /sys/class/backlight/acpi_video0

Code: Select all
[root@mackowiak ~]# cd /sys/class/backlight/acpi_video0
[root@mackowiak acpi_video0]# cat brightness
1


Any advice haw to play with files in /sys/class/backlight/acpi_video0 ?

Re: Turning off power supply of screen from CLI

PostPosted: Nov 9th, '15, 21:30
by doktor5000
Same way as you did already. But the backlight controls can usually not be used to completely disable the display. And you might need to set a kernel option for proper backlight control,
e.g. acpi_backlight or acpi_osi as shown in https://wiki.mageia.org/en/Mageia_3_Err ... regression

You might want to read some documentaton about that topic:
https://www.kernel.org/doc/Documentatio ... ension.txt
https://wiki.archlinux.org/index.php/Backlight
https://wiki.ubuntu.com/Kernel/Debugging/Backlight