LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Home Forums HCL Reviews Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-12-2005, 05:28 AM   #1
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,192

Rep: Reputation: 101Reputation: 101
Suspend monitor when in console


Hi,

How do you set the monitor to go into powersave mode rather than turn the screen black when in the CLI. I have set this in X for when I leave my computer running something that requires X, say downloading a file with firefox and that works OK, but I have my computer boot up to a console and not startx and similarly when I log off it is in console mode, so I would like it to suspend the monitor after a while rather than make the screen go black

thanks

Phil
 
Old 07-12-2005, 05:34 AM   #2
marghorp
Senior Member
 
Registered: Jan 2004
Location: Slovenia
Distribution: Slackware 10.1, SLAX to the MAX :)
Posts: 1,040

Rep: Reputation: 45
wouldn't the xset command work in console mode too? I think it's something like xset blank or something like it. Check the man page for xset.
 
Old 07-12-2005, 05:38 AM   #3
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
The command you're looking for is setterm. By default it's called at the beggining of /etc/rc.d/rc.M, you can change that line so the settings you want will be loaded every boot.
See setterm man page for more info about using it.
 
Old 07-12-2005, 06:04 AM   #4
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,192

Original Poster
Rep: Reputation: 101Reputation: 101
Ok, I've found the command and read the man page, this is the line in rc.M
Code:
/bin/setterm -blank 15 -powersave powerdown -powerdown 60
so from what I understand the monitor should powerdown after 75 mins. I don't think it does, the green light that normally goes orange to say its powersave mode stays green unlike when in X, also when I waggle the mouse it come on straight away rather than have a 10 second wait for the monitor to initialise.

I am using the 2.6.10 kernel from /testing on the Slackware 10.1 disc.
I have modprobe apm in rc.modules, this was to allow the computer to knock off when I shut it down, but I think it may have an impact on this.

I am using a GeForce FX5200 graphics card and have installed the nvidia drivers and have configure xorg.conf accordingly, but that driver isn't used in the CLI mode is it? Could that explain why powersave works in X and not in CLI, because the VESA driver doesn't know how to work the graphics card?

regards
Phil
 
Old 07-13-2005, 06:58 AM   #5
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,192

Original Poster
Rep: Reputation: 101Reputation: 101
Am not getting anywhere with this, has anyone any other ideas please?

xset will not work because X server isn't running, marghorp.
 
Old 07-30-2005, 10:25 AM   #6
kvdb
LQ Newbie
 
Registered: Jul 2005
Location: The Netherlands
Distribution: Slackware
Posts: 1

Rep: Reputation: 0
I have the same issue here. When rc.M is executed I get:

Code:
cannot (un)set powersave mode
So afterwards, on the console, only blanking works. Well, kind of: bold text remains visible.

If I execute

Code:
setterm -blank 15 -powersave powerdown -powerdown 60
manually on the console, powerdown works, but the interval of 60 (or whatever value) minutes does not apply: the monitor powers down shortly after the screen has blanked out.
 
Old 07-16-2006, 12:20 AM   #7
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
powerdown problem found in fbcon.c's fbcon_blank()

setterm just sets a flag. the real problem is in the kernel. i've had the same problem when i was just using kernel 2.6.12. i've found out that fb_blank() in the fbcon_blank function of video/console/fbcon.c was not really referring to the fb_blank of the fb driver.

take a look at this code:

Code:
static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch)
{
	struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
	struct fbcon_ops *ops = info->fbcon_par;

	if (mode_switch) {
		struct fb_var_screeninfo var = info->var;

		ops->graphics = 1;

		if (!blank) {
			var.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE;
			fb_set_var(info, &var);
			ops->graphics = 0;
		}
	}

 	if (!fbcon_is_inactive(vc, info)) {
		if (ops->blank_state != blank) {
			ops->blank_state = blank;
			fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW);
			ops->cursor_flash = (!blank);

 			if (fbsplash_active(info, vc))
				fbsplash_blank(vc, info, blank);
			else
				fbcon_generic_blank(vc, info, blank);

			fb_blank(blank, info);
		}

 		if (!blank)
 			update_screen(vc);
 	}

 	return 0;
}
you see here fb_blank(blank, info) should have been something like fbops->fb_blank(blank, info)

we must also add struct fb_ops *fbops = info->fbops;

so the output code should be

Code:
static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch)
{
	struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
	struct fbcon_ops *ops = info->fbcon_par;
	struct fb_ops *fbops = info->fbops;

	if (mode_switch) {
		struct fb_var_screeninfo var = info->var;

		ops->graphics = 1;

		if (!blank) {
			var.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE;
			fb_set_var(info, &var);
			ops->graphics = 0;
		}
	}

 	if (!fbcon_is_inactive(vc, info)) {
		if (ops->blank_state != blank) {
			ops->blank_state = blank;
			fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW);
			ops->cursor_flash = (!blank);

 			if (fbsplash_active(info, vc))
				fbsplash_blank(vc, info, blank);
			else
				fbcon_generic_blank(vc, info, blank);

			if (fbops->fb_blank)
				fbops->fb_blank(blank, info);
		}

 		if (!blank)
 			update_screen(vc);
 	}

 	return 0;
}
after that i recompiled the kernel and made the console blank and powerdown the way i expected it to be.

if i am correct fb_blank() remained fb_blank() from 2.6.12 even up to the current version 2.6.17.4. and IMO the real reason devs leave this behind is because each fb driver has their own different behavior and it might just be buggy if powerdown is enabled to other fb drivers.

ps. i tried to redo this in the 2.6.16 kernel and just found out that the fb driver nvidiafb has already changed and for unknown reasons powerdown was no longer working. i already spent too much time trying to figure out the problem of fb_blank and i expect more more time if i'll go on trying to hack the more complicated nvidia.c.

pps. i hope the kernel devs will find a more complete solution to these problems. powerdown in console is a real need.
 
Old 07-19-2006, 01:21 PM   #8
dangerboy
Member
 
Registered: Aug 2003
Distribution: Slackware 12.1, Slackware Current, Ubuntu Hardy Heron 8.04
Posts: 110

Rep: Reputation: 15
Thanx for the reply to my ancient thread. I had completely forgotten about it. With Slackware and a 2.4 kernel on my laptop, the monitor shuts down. My other two machines still need this addressed, but since I ssh into both through my laptop more often than I'm physically at them they can wait a bit longer.

I really appreciate the info. I'm glad that I finally got an answer; better late than never.
 
Old 07-19-2006, 09:48 PM   #9
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
Wow. You're welcome. I mean thanks a lot too. That's the first time I heard someone appreciate from my post. At least from the linux community.

Anyways I've been into using 2.4 version before but I don't remember the console working with powerdown too. Maybe it's already fixed so I might as well try downgrading to that version sometime.
 
Old 07-19-2006, 10:50 PM   #10
dangerboy
Member
 
Registered: Aug 2003
Distribution: Slackware 12.1, Slackware Current, Ubuntu Hardy Heron 8.04
Posts: 110

Rep: Reputation: 15
Thumbs up

I like to give kudos where they are due.

I'm using the 2.4.32 kernel on an IBM Thinkpad 600x with the APM module. I am very satisfied with the results. I tried the 2.6 kernels but they didn't behave without a fair amount of configuration. Not to mention, I was feeling very lazy at the time. The 2.4 kernels worked well the first time so I chose to stick with them.

I'll try to apply the above knowledge in this thread and see how far it gets me. Again, thanx for the info.

Last edited by dangerboy; 07-19-2006 at 11:03 PM.
 
Old 09-01-2006, 09:32 AM   #11
V@no
LQ Newbie
 
Registered: Oct 2003
Posts: 11

Rep: Reputation: 0
Question

Hello!
What if one wants make the monitor go into suspend or powerdown and not just blank?
For some reason my monitor only turns blank and stays on all the time, I'd like to either shut it down or suspend after NN minutes...
When I use
Code:
setterm -powersave powerdown -powerdown 1 -blank 0
nothing happend (well, no blank screen anymore), and after playing around with this, I came up to conclusion that only -blank parameter is working...
Is this also depence on video card? (I'm using old voodoo3)

Thanks.

P.S. I'm using text mode, no X

Last edited by V@no; 09-01-2006 at 09:34 AM.
 
Old 09-23-2006, 06:32 AM   #12
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
If you can, try to change your video/console/fbcon.c similar to the one i posted above then recompile the kernel.
 
Old 01-04-2009, 06:03 PM   #13
wilson47
Member
 
Registered: Jan 2009
Posts: 50

Rep: Reputation: 15
how about for linux-2.26.27-7?

Sorry to bring this one back from the dead, but this is the only intelligent information i have found on this topic. I've been trying to figure out how to go about recompiling the kernel and all, without much avail. Maybe I am just not looking in the right place, but I only can find fbcon.ko which is of no real help.

Are there any new solutions to this? It has been a while =)

Thanks for the great help!
 
Old 01-07-2009, 09:48 AM   #14
wilson47
Member
 
Registered: Jan 2009
Posts: 50

Rep: Reputation: 15
Hello! I solved my issue here:
http://ubuntuforums.org/showthread.php?t=1030362 .
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Monitor powermanagment only sends black screen, doesn't suspend or powerdown. oryan_dunn Linux - Hardware 4 09-07-2006 09:09 AM
Best console network monitor tools? V@no. Linux - Networking 3 11-03-2005 08:07 PM
apm and console suspend linuxhippy Slackware 13 07-04-2005 02:46 PM
console dual monitor? marlor Slackware 3 08-20-2004 04:01 PM
monitor wont switch to standby/suspend mode quest4knowledge Linux - General 1 08-13-2003 01:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration