Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: bigpcman on May 19, 2009, 11:09:39 PM

Title: [solved] How to turn off display?
Post by: bigpcman on May 19, 2009, 11:09:39 PM
When the tc user desktop is loaded the display times out and turns off just as it should. But when I exit to prompt and then exit to login the display timeout no longer turns off the display. The timeout blanks out the screen but the lcd backlight stays on.  I guess xvesa is handling the display turnoff. Is there a command that can be executed to turnoff the display.
Title: Re: How to turn off display?
Post by: bigpcman on May 19, 2009, 11:46:38 PM
The timeout blanks out the screen but the lcd backlight stays on because of the  loaded display times out and turns off..

What does this mean? "because of the  loaded display times out and turns off.."

[^thehatsrule^: fixed up post]
Title: Re: How to turn off display?
Post by: curaga on May 20, 2009, 08:18:03 AM
The linux console can't turn your screen off. X can, because it uses DPMS.

Or did you mean that it won't work after restarting X?
Title: Re: How to turn off display?
Post by: bigpcman on May 20, 2009, 09:43:03 AM
The linux console can't turn your screen off. X can, because it uses DPMS.

Or did you mean that it won't work after restarting X?
OK. Is there another approach. I tried logging in via ssh and then killing Xvesa but that causes the lcd screen to turn back on. There must be a way to reclaim the Xvesa memory when the screen is not needed and have the lcd screen turned off.
Title: Re: How to turn off display?
Post by: curaga on May 20, 2009, 10:09:30 AM
If X is running, you can control the features with xset (for example command it to turn the screen off immediately), but that only works as long as X runs unfortunately.

Hmm, it appears I had old info, after googling I found the console can turn the screen off too:
http://alexis.m2osw.com/console.html
Title: Re: How to turn off display?
Post by: bigpcman on May 20, 2009, 10:54:10 AM
If X is running, you can control the features with xset (for example command it to turn the screen off immediately), but that only works as long as X runs unfortunately.

Hmm, it appears I had old info, after googling I found the console can turn the screen off too:
http://alexis.m2osw.com/console.html

Thanks. That's a great link on the subject. What do think causes this error:

tc@box:/dev$ sudo echo -e "\033[14;10]" >/dev/console
-sh: can't create /dev/console: Permission denied
Title: Re: How to turn off display?
Post by: jpeters on May 20, 2009, 11:06:43 AM
re: link.

manual can be accessed with modified man script (see thread)  "man 4 console_codes" 


edit:   "http://linux.die.net/man/4/console_codes"

Quote
What do think causes this error:

tc@box:/dev$ sudo echo -e "\033[14;10]" >/dev/console
-sh: can't create /dev/console: Permission denied

Probably the same reason /dev/null always gets it....it's root:root
Code: [Select]
crw------- 1 root root 5, 1 May 19 08:47 /dev/console

Title: Re: How to turn off display?
Post by: curaga on May 20, 2009, 11:55:49 AM
Run the command from a root console, or use sudo in a slightly dfferent way:

Quote
sudo sh -c 'echo -e "\033[14;10]" >/dev/console'
Title: Re: How to turn off display?
Post by: jpeters on May 20, 2009, 12:55:43 PM
Run the command from a root console, or use sudo in a slightly dfferent way:

Quote
sudo sh -c 'echo -e "\033[14;10]" >/dev/console'

It would be nice if it wasn't necessary to "sudo" the shell. Sometimes these "permission" issues
are crazymaking.   
Title: Re: How to turn off display?
Post by: bigpcman on May 23, 2009, 10:09:32 PM
Well I finally got back to this problem. The escape sequence command from the console to the console to turn off the display did not work. The command:
Code: [Select]
sudo sh -c 'echo -e "\033[14;10]" >/dev/console'executed without any messages whatsoever. The display did not turn off. I also tried the blank screen command:
Code: [Select]
sudo sh -c 'echo -e "\033[14;1]" >/dev/console'set to 1 minute and it did not work either.

I found this googling:
Quote
January 8, 2009
Turn off LCD Display Backlight from Linux command line
Posted by Paul at 08:32

Use vbetool to turn off the backlight in an LCD display from the Linux command line. This is useful if using Linux on a laptop computer in text mode. The normal screen blanking utilities do not turn off the backlight, leaving a dull glow and using power unnecessarily. The vbetool utility can manipulate the VESA DPMS (Display Power Management Signaling) features of the display. DPMS can turn off the backlight. Use vbetool dpms off to turn it off, vbetool dpms on to turn it on.

Is this tool in one of the extentions?
Title: Re: How to turn off display?
Post by: Juanito on May 23, 2009, 11:18:21 PM
I don't believe so, but you can get it from here:

http://www.codon.org.uk/~mjg59/vbetool/download/ (http://www.codon.org.uk/~mjg59/vbetool/download/)

I think you also need libx86, which is in suspend.tce
Title: Re: How to turn off display?
Post by: bigpcman on May 24, 2009, 09:26:41 AM
I don't believe so, but you can get it from here:

http://www.codon.org.uk/~mjg59/vbetool/download/ (http://www.codon.org.uk/~mjg59/vbetool/download/)

I think you also need libx86, which is in suspend.tce

Looks like it needs libpci as well. Is that buried in an existing extension?
Title: Re: How to turn off display?
Post by: Juanito on May 24, 2009, 09:35:16 AM
..the pci-utils extension
Title: Re: How to turn off display?
Post by: bigpcman on May 24, 2009, 10:32:58 AM
..the pci-utils extension
Thanks. I see the suspend extension loads pci-utils as a dep. So all the libs for the vbetool should be covered by installing suspend. However, suspend is a bit large to keep in ram. Could you make a tcz 2.0 version?
Title: Re: How to turn off display?
Post by: Juanito on May 25, 2009, 06:22:36 AM
The suspend extension is made to /usr rather than /usr/local, so I'm not too sure it is a good idea to make a tcz extension out of it.

Maybe it would make sense to extract libx86 from the suspend extension in order to test if vbetool is the answer to your problems? If it is, then I could recompile libx86 to /usr/local as a separate extension.

Edit: I played around with this a little - libx86 doesn't seem to want to compile in tc_2.x. Using libx86 from the suspend extension, vbetool requires libpci.a to build (not installed by pci-utils along with the headers and the .pc file) - after fixing all that, vbetools didn't seem to want to work...
Title: Re: How to turn off display?
Post by: bigpcman on May 25, 2009, 09:59:47 AM
Thanks for the effort. It's a shame vbetools won't work. It's the only solution I've found that will turn off the lcd backlight from the console.
Title: Re: How to turn off display?
Post by: Juanito on May 25, 2009, 10:03:18 AM
I don't say it won't work - only that I haven't got it to work yet  :)
Title: Re: How to turn off display?
Post by: bigpcman on May 27, 2009, 08:17:15 AM
I don't say it won't work - only that I haven't got it to work yet  :)
Any progress to share?
Title: Re: How to turn off display?
Post by: Juanito on May 27, 2009, 08:27:29 AM
Give me a couple more days - I'm tied up with work at the moment...
Title: Re: How to turn off display?
Post by: Juanito on May 29, 2009, 05:27:02 AM
vbetool extension posted
Title: Re: How to turn off display?
Post by: bigpcman on May 29, 2009, 08:39:03 AM
vbetool extension posted

And it works great! Many thanks.