ACPI and S3 Sleep on the Linux Desktop?
"For those of you not familiar with S3, this feature allows you to save the current state of your machine to RAM, power down all of your internal devices (PCI cards, AGP, CPU) and shut down down all your fans. The machine is now in a deep sleep, using but only a few watts to keep the RAM refreshed. Pressing a key or the power switch brings you back to your desktop and applications in a matter of seconds. In contrast to leaving your machine on constantly, and with today's high wattage processors and graphics cards, using S3 is not only environmentally friendly, but can save you more than a few bucks on your electric bill. Getting Linux and ACPI working is a whole other story. I have had no luck getting ACPI sleep states working on an Intel D875PBZ motherboard, even with extensive help from the gentlemen on the ACPI mailing list."
I have never, ever, in all the years of using Windows or Linux had suspend, either S3 or suspend-to-disk work properly. None of the machines (many of them at this point) ever resumed, forcing a hard reset, fsck, and all the usual attendant issues. It also doesn't matter the vintage of the machine, or even the vintage of the OS. My experience (or lack of a successful one) spans everything from Linux kernel 2.0 and Windows 95 to kernel 2.4 and Windows 2000 Pro.
Bleakness... Desolation... Plastic Forks...
Using a stock 2.6.x kernel, I've gotten my Dell Latitude C610 to sleep fully and come out of it 95% of the time. The other 5% of the time I get weird video issues. I've not taken the time to debug this properly yet. I use "echo 3 > /proc/acpi/sleep" to put it to sleep, and pressing the power button brings it out.
Hope this helps.
As I type this I have a uptime of about 4 days. I have found on mac systems the sleep and resume features are excellent. I never turn off this machine and just wake it from sleep all the time. Works great. My sisters x86 though.....not so great, resuming take forever and sometimes the thing just crashes on resume.
S3 suspend works fine for me under WinXP, but I can't say that I've ever used it except to see if it really worked. I don't really know anyone who's ever used it except on a laptop that suspends when the lid is closed, and they only use it them because that's default behaviour for their hardware.
I'm sure it's a valuable feature for those who really use it, and that there are many advantages that people will point out like saving application states etc. But for me and everyone I know, except the laptop users I mentioned whose hardware automatically suspends, we either have our PC's on 24/7 or turn them off when not in use. Mine is on 24/7 for broadband filesharing, while the average users I know just turn their computers on and off as needed.
Personally, I found myself wanting an application-specific suspend-to-disk option for saving Mozilla tabs whenever I have to reboot every few weeks for hardware/driver/general-wonkyness reasons, since I have the nasty habit of queueing up a bunch of pages for later reading. But I've never had a reason personally to want to suspend the whole system state.
Chasing Amy
(We all chase Amy...)
"The more corrupt the state, the more numerous the laws"-Tacitus
Windows 95 was often accused of being incredibly unstable, on through Windows 98. ME got weird, but many found it more stable. And with XP and 2000 it seems to have gotten rock solid. Is this the kernel maturing? Only slightly.
Drivers for all versions of Windows and Linux run in ring 0. They have the capability to bring the kernel down just as hard as a bug in the memory manager. This is the cost of not running a true microkernel, but it's been found often too hard to efficiently transfer large amounts of data through the levels of abstraction of a microkernel. As such, we have the situation we're in now.
Whenever a power change occurs, a message needs to be sent to every driver asking it to do whatever it needs to do. Often enough, what it needs to do is nothing at all. But even in such a simple case, the driver can hose up, and bring the machine crashing down. Heck, your machine might even have been in a stable state until you brought it awake from hibernating. Then, on getting the awake message, your NVidia driver corrupted something it shouldn't have, and it all comes tumbling down.
When faced with this in Windows 95 and 98, Microsoft started its signed driver initiative and manufacturers got better at writing drivers. Now, good hardware manufacturers get their drivers vetted, then signed by Microsoft. And Windows XP becomes stable.
Linux might be in a similar position if either (1) companies got much better at writing Linux drivers or (2) more companies opened the source to their drivers.
You like splinters in your crotch? -Jon Caldara
ACPI is apparently really, really hard to get right, and not just for the OS developers. Hardware vendors typically screw it up, too (which causes even more pain for the programmers).
APM, however, is pretty well-supported in Linux. On all five of the machines I've used as "mine" in the last three or so years, suspend has worked just fine -- as long as I disabled ACPI and used APM instead.
Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
I've been using my Toshiba Tecra 8000 with suspend-to-ram (S3) under Gentoo for months. It was difficult at first to get it to work, but after scripting the acpi myself, it has consistently worked. Right now I have it resuming via the power key. You can find all sorts of great hints for using ACPI/Sleep modes via the gentoo forums, even if you aren't using gentoo, the acpi script examples there are nice.
Check out ioquake3.org for a great, free, First-Person Shooter engine!
I just decided to see what would be invloved in getting this to work, and was surprised to find that it's remarkably simple.
/etc/acpi/powerbutton.sh, put; /sbin/lilo -R "current resume=/dev/hda1" /proc/acpi/sleep
Compile a kernel with suspend-to-swap and acpi.
Install acpid (apt-get install acpid)
in
# your label and swap partition will probably be different
echo "4" >
And that's all. Works perfectly for me, I just tested it.
455fe10422ca29c4933f95052b792ab2