View previous topic :: View next topic |
Author |
Message |
cyfred Retired Dev
Joined: 23 Aug 2002 Posts: 596
|
Posted: Tue Jan 28, 2003 11:55 am Post subject: ACPI commands |
|
|
Howdy,
I have my laptop setup nicely running Gentoo and all seems to work well, except for the power management side of things.
What I cant get to work it the ACPI command executions.
For example I have in /etc/acpi/events/default
Code: | event=button power.*
action=/sbin/init 0 |
Which should shutdown the PC when the power button is pressed.
The log file /var/log/acpid shows that the power button was registered as being pressed, but also shows that nothing was done.
My reckoning is that acpid hasnt got permission to execute /sbin/halt but that is the only thing I can come up with.
Also what action should I set to have the machine enter suspend or standby modes? There is a lot on things needing S1 S3 S4 etc... but nothing on what the actual commands are.
Someone please help |
|
Back to top |
|
|
fbix n00b
Joined: 16 Jan 2003 Posts: 3
|
Posted: Tue Jan 28, 2003 12:14 pm Post subject: |
|
|
My system send to this event to me:
received event "button/power PWRF 00000080 00000002"
so I've modified
/etc/acpi/events/default:
event=button/power.*
action=/sbin/init 0
and it's worked
bix
[/quote] |
|
Back to top |
|
|
cyfred Retired Dev
Joined: 23 Aug 2002 Posts: 596
|
Posted: Tue Jan 28, 2003 12:16 pm Post subject: |
|
|
What about suspending?
What command do I use to suspend and standby the system?
I want to put the machine into either (depending which works) by pressing the power button, not shut it down. |
|
Back to top |
|
|
Reformist Guru
Joined: 06 Oct 2002 Posts: 323
|
Posted: Mon Feb 24, 2003 6:14 am Post subject: |
|
|
I would also like to know how to do this. Lol is this even possible? The mor eI work with linux on my laptop, the less I hear of a succesful power-managed system.... _________________ -Phil Crosby |
|
Back to top |
|
|
monkeyBox Tux's lil' helper
Joined: 14 Feb 2003 Posts: 111 Location: Dallas, TX
|
Posted: Tue Mar 04, 2003 8:42 pm Post subject: |
|
|
I'd also like to know... It suprises me how hard it is to find information on this. ACPI has been around long enough I would think it would have been fully implemented sooner. Oh well.
The basic things I'm wanting to do but can't figure out how:
CPU speed stepdown
Suspend to ram (normal suspend)
Suspend to disk (hibernation)
if ANYONE knows how to do ANY of these please let us know!! |
|
Back to top |
|
|
Jimboberella Guru
Joined: 19 Jun 2002 Posts: 358 Location: Brisbane/Australia
|
Posted: Tue Mar 04, 2003 9:40 pm Post subject: |
|
|
In my experince with linux on laptops, all the automatic power saving features have just worked. Sleep mode and all. This is on Dell and Compaq models over the past few years, with Mandrake. |
|
Back to top |
|
|
monkeyBox Tux's lil' helper
Joined: 14 Feb 2003 Posts: 111 Location: Dallas, TX
|
Posted: Tue Mar 04, 2003 11:27 pm Post subject: |
|
|
Jimboberella wrote: | In my experince with linux on laptops, all the automatic power saving features have just worked. Sleep mode and all. This is on Dell and Compaq models over the past few years, with Mandrake. |
Are you saying you know how to use the features I mentioned above (at least in gentoo anyways)? If so, could you please enlighten us? |
|
Back to top |
|
|
Reformist Guru
Joined: 06 Oct 2002 Posts: 323
|
Posted: Sat Mar 08, 2003 5:50 am Post subject: |
|
|
"Just worked"? How did you enable standby? Is it set to a timer or did you run a command? If so, which command did you run?
Please be a bit more specific. I'm almost to the impression that I can just "think" my computer off and it will "just work".
Forgive my sarcasm. _________________ -Phil Crosby |
|
Back to top |
|
|
Reformist Guru
Joined: 06 Oct 2002 Posts: 323
|
Posted: Tue Mar 11, 2003 11:06 pm Post subject: |
|
|
I think Jimboberella means by BIOS functions and timers. Unfortunately for me, I have no such settings in my BIOS because my BIOS is ghetto, came by default on an HP laptop. The users in this thread are looking for a specific command to put the system into standby, or hibernation. WIthout such commands ACPI is useless, and it appears there are no such commands because I'd think someone would have found them by now.
Or maybe I (we're) just blind. _________________ -Phil Crosby |
|
Back to top |
|
|
Reformist Guru
Joined: 06 Oct 2002 Posts: 323
|
|
Back to top |
|
|
Ian Goldby Guru
Joined: 18 May 2002 Posts: 539 Location: (Inactive member)
|
Posted: Sun Mar 16, 2003 2:41 pm Post subject: |
|
|
Ok, for documentation have a look at:I assume from this that Code: | $ cat S0 > /proc/acpi/sleep | should suspend the system, and so on.
I haven't tried any of this yet. I'm just compiling my kernel to enable APCI instead of APM, since APM seems to be incompatible with xfree4.3.0, causing it to freeze on resuming from a suspend. |
|
Back to top |
|
|
Ian Goldby Guru
Joined: 18 May 2002 Posts: 539 Location: (Inactive member)
|
Posted: Sun Mar 16, 2003 3:37 pm Post subject: |
|
|
Ok, that should have been Code: | # echo -n 1 > /proc/acpi/sleep | Well, it sort of worked, though not in any useful sense. The next prompt didn't appear, and the power light started to flash. But the CPU fan didn't stop, and it woke up again just with a move of the mouse. Not very useful, really.
One warning: Code: | # echo -n 5 > /proc/acpi/sleep | caused an immediate power-off without going through the proper shutdown procedure. Don't do this at home, kids. Also, when I tried to set the alarm (cat xxxx > /proc/acpi/alarm) I got a complete freeze. Don't do that either, unless you like rescuing corrupted filesystems. |
|
Back to top |
|
|
Ian Goldby Guru
Joined: 18 May 2002 Posts: 539 Location: (Inactive member)
|
Posted: Sun Mar 16, 2003 3:42 pm Post subject: |
|
|
According to this Code: | # echo -n 3 > state | executed in the /proc/acpi/fan/FAN directory should turn the fan off. Doesn't work for me. |
|
Back to top |
|
|
Reformist Guru
Joined: 06 Oct 2002 Posts: 323
|
Posted: Mon Mar 17, 2003 3:33 pm Post subject: |
|
|
Greaty job iangoldby, this is some much needed information! Now we know how to execute a few power commands, and when they work, well, it will be easy to write a front end.
None of the sleep states worked for me (by executing echo -n x > /proc/acpi/sleep, where x is 1-5) except the 5th stage, which you tried, which gave me a hard reboot. "Soft restart" indeed. They say that mode corresponds to the windows' shutdown command; I'd say it needs some work.
Anyway, good info to know. If any of the states work for anyone, or if there is progress... post! _________________ -Phil Crosby |
|
Back to top |
|
|
Reformist Guru
Joined: 06 Oct 2002 Posts: 323
|
Posted: Mon Mar 17, 2003 3:35 pm Post subject: |
|
|
Also, for those interested, the doc links that iangoldby posted also contain information on how to "step down" your cpu, to consume less power. Not sure if it actually works, but it is supported and looks very cool. I didn't try this out, because sleep modes are the most neccessary for me, and CPU stepping is only useful to me if it is done automatically while the system is detected as being idle. _________________ -Phil Crosby |
|
Back to top |
|
|
CodeHacker84 n00b
Joined: 22 Jan 2003 Posts: 68 Location: Rapids of Cedar, IA
|
Posted: Mon Mar 17, 2003 6:22 pm Post subject: |
|
|
I have followed the links that iangoldboy has posted, and I am currently reading the ACPI 2.0 standard. It seems to me that there is a misconception on the S5 power state at this point, because according to the ACPI 2.0 standard, section 2.4; the Sleep 5 state is defined to be a state where the system saves nothing and does a "soft power off," meaning that it is a state similar to flipping a power switch, but it can be controlled electronically. The Sleep 4 state is where one would want to be for a typical "Hibernate" command, where all system information is saved to disk, and one of the higher sleep states would be for a "Sleep" command.
P.S. Sorry for the lengthy post, but this also helps me clarify my understanding of all this information that I've absorbed in the past 24 hours. _________________ Athlon64 3200
1GB Corsair PC3200 C2
MSI K8T Neo FIS2R
CoolerMaster WaveMaster (Black)
Antec TruePower 550W
120 GB WD SATA Drive
160 GB WD PATA Drive
54x32x54 CD-R/RW
Dual head: ATI 9800 AiW/LG1720P && Voodoo3 PCI/IBM G40 CRT |
|
Back to top |
|
|
Ian Goldby Guru
Joined: 18 May 2002 Posts: 539 Location: (Inactive member)
|
Posted: Mon Mar 17, 2003 7:31 pm Post subject: |
|
|
I had a go with the CPU throttling, and it made X very choppy indeed, so I guess it was working
(I've given up on APCI for now and have gone back to APM, but I still can't get it to restore after a sleep when KDE is running. I think I will have to resign myself to booting the PC every time I want to use it.)
Ian |
|
Back to top |
|
|
zumo n00b
Joined: 11 Mar 2003 Posts: 8
|
Posted: Wed Mar 19, 2003 1:23 am Post subject: Hibernate feature found (maybe?) |
|
|
I think I may have found a hibernate program. I will try it out when I have time, but hopefully you all will try it out in parallel Linkage below:
http://sourceforge.net/projects/swsusp |
|
Back to top |
|
|
Ian Goldby Guru
Joined: 18 May 2002 Posts: 539 Location: (Inactive member)
|
Posted: Wed Mar 19, 2003 7:22 pm Post subject: |
|
|
There's a good thread on swsusp here.
I thought 1 minute 19 seconds to restore from suspend versus 1 minute 56 seconds to boot from scratch was distinctly unimpressive, and rather defeats the point. |
|
Back to top |
|
|
CodeHacker84 n00b
Joined: 22 Jan 2003 Posts: 68 Location: Rapids of Cedar, IA
|
Posted: Mon Mar 24, 2003 2:38 pm Post subject: |
|
|
Yes, the latency between the suspended state and the working state suggests to me that the suspend command is using a higher sleep state (S4) than, IMHO, it should (S2). I think that the purpose of a suspend should be to reduce power consumption to low levels, but that restores should be rather quick. Perhaps the developers should make a distinction somewhere between a high sleep state (S4) and a low sleep state (S2), not unlike *GASP* WinBlows' "hibernate" and "sleep" commands.
[EDIT] Oh, perhaps someone can find a way to just "dump" all the contents of memory to disk and then merely restore from the "dump." Of course, I suppose that all the other things that need to be saved (such as /proc) increase the latency to the point where almost any hibernate command is pointless, like iangoldby said. _________________ Athlon64 3200
1GB Corsair PC3200 C2
MSI K8T Neo FIS2R
CoolerMaster WaveMaster (Black)
Antec TruePower 550W
120 GB WD SATA Drive
160 GB WD PATA Drive
54x32x54 CD-R/RW
Dual head: ATI 9800 AiW/LG1720P && Voodoo3 PCI/IBM G40 CRT |
|
Back to top |
|
|
Ian Goldby Guru
Joined: 18 May 2002 Posts: 539 Location: (Inactive member)
|
Posted: Mon Mar 24, 2003 5:30 pm Post subject: |
|
|
I may be talking nonsense here, but doesn't swsusp just store the entire state of the PC to disk and then completely power-off? Then when you power back on later, it goes through a customised boot process that restores the PC to where it last was.
That's very different to APM/APCI suspend/hibernate functions, where removing all power will cause you to lose the state of the machine. |
|
Back to top |
|
|
|