Jump to content

power management


navarre
 Share

Recommended Posts

  • 2 weeks later...

with kernel 2.60 - which I've recompiled with toshiba latptop extras (not as module, but compiled in) and with software suspend and suspend to disk (hibernate) I finally have all acpi extras working.

 

Right now I can easily read and set may parameters like, fan on/auto, , lcd brightness, processor power consumption profile and many others. Also setting video output (lcd, crt, tv) works (I've not connected it to tv or crt but acpi setting shows everything according to real state so I believe it works).

 

As for now, all those settings - plus hibernate (suspend to disk) can be set from console :

it's very easy to find what is what - just look at /proc/acpi , there should be a lot of files and directories which are responsible for setting hardware. For example:

 

hibernate:

 echo 4 > /proc/acpi/sleep  

(as root)

suspend (computer does NOT need ANY power supply as stores all data on swap partition (harddisk)):

 echo 3 > /proc/acpi/sleep  

(as root)

Quicker to awake than hibernate, still need some minimal power supply (battery). Unfortunately, for some reason my toshiba goes to suspend but cant properly wake up. I can see console and switch to other consoles, but no responding to keystrokes :(

 echo x > /proc/acpi/toshiba/lcd  

(as root)

where x is 1 to 7 levels of lcd brightness

 

and so on ... it's easy to find out what can be set, just do 'more <filename>' to files in /proc/acpi

 

Hibernate to disk works fine - BUT yesterday for some reason I could not properly get computer back from hibernate state - with 'noresume' options (given at lilo when booting up) I can still run system but swap partition cannot be mounted :( Had no time to work it out.

 

with all this stuff it's now time to write some simple 'akpi like' software which could set computer state automatically or with easy kde interface.

Edited by melon2003
Link to comment
Share on other sites

Oh, theres one other thing. If you don't want (like, can) use acpi, some laptop features works fine with apm. All you have to do is to set things like lcd brightness, power consumption in BIOS. If you switch to apm instead of acpi - even suspend works fine when you close lid.

It's not comfortable for one reason - you cannot switch settings without rebooting (and getting to BIOS). But it's easier because no need to recompile kernel (it worked fine with standard 2.4.22 from rpm from mandrake)

Alway remember when switching apm<->acpi or acpi<->apm:

1) go to MandrakeControl , go to System, click Services and turn ON acpi and acpid (and set them to run at system boot) AND TURN OFF APM (and off at boot). If you want to switch to apm do opposite.

2) go to boot control (at MandrakeControl) and check if acpi options while booting are on (off)

 

with those two set properly next time you boot system you should see info that acpi, acpid OR apm is running.

Link to comment
Share on other sites

Thanks mellon2003!

I tried what you said and the acpi appears to work, only there are other problems:

 

1) how do i enter any of the suspension modes without being root? is it even possible? because let's face it, the root mode in mandrake is horrible...

 

2) i still can't make the battery last for the normal 2,5 hours. how do i solve that?

 

3) i seem to have problems accessing the cdrom and floppy drives! i don't even find a way to mount them! how do i this?

 

Thanks in advance!

Link to comment
Share on other sites

well I managed it in some... er, obvious (but maybe unsafe?) way.

 

I wrote very simple gcc program (I called hibernate) which writes 4 into /proc/acpi/sleep. It has set suid bit (and it's owner is root) so it can be run by any user and works with root privileges. Now I could - for example - set klaptop acpi hibernate command to... hibernate and it works!

 

Of course there probably no need to write gcc program, just a shell script and set privilege (this suid bit). It should work as a charm ;)

 

About batteries - it's quite complicated, because depends of many parameters, some of them are not obvious. Just find out how and what works from /proc/acpi. Setting lcd brightness to 1 will help, setting fan to auto will help, not sure what else. Theres plenty of documentation of acpi under linux.

just google around :)

 

 

I'm not sure what's wrong with your cd/floppy access but maybe they are already mounted? :D Try rightclick on desktop and New->Devices->Floppy shortcut (and same with cd-rom). I hope that will help, but I'm not mandrake guru :unsure:

 

by the way: do you have suspend mode (echo 3 >/proc/acpi/sleep) working as well?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...