Slashdot Mirror


ACPI and S3 Sleep on the Linux Desktop?

niko9 asks: "After reading that development would be ramped up in the ACPI department of the 2.6 kernel series, I was hoping to finally get the one feature that Mac and Windows users have been enjoying for more than a few years: S3 Sleep, also known as Suspend-To-Ram. How important is ACPI and the sleep states on the desktop to you? Are there any ACPI S3 success stories on the Linux desktop out there? If yes, what hardware are you guys using? I would also welcome comments from Mac and Window users concerning their use of sleep on the 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."

20 of 104 comments (clear)

  1. Sleep on an x86 machine by josefcub · · Score: 3, Informative

    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...
    1. Re:Sleep on an x86 machine by mdielmann · · Score: 3, Informative

      I'm supplied with an IBM laptop through work, previous was Win2KPro, current is WinXPPro. I didn't have (many) problems with the 2K box - about once a week, it would require a full reboot, and certain (non-standard) apps would fail in one way or another after S3 or suspend-to-disk. Overall, it was worth the more-regular-than-I-hoped-for reboots. My WinXP works fine for both S3 and suspend-to-disk, no noticeable issues requiring reboots, and same issues with the non-standard apps. I only reboot once or twice a month now, mostly to clean up the garbage from apps that don't quite behave (which probably isn't a suspend issue).

      Not to say your experience is an exception. These are the first two computers where I've had it work, and only in the last 3 years. There were others where I work that didn't behave sufficiently to do S3 at all.

      --
      Sure I'm paranoid, but am I paranoid enough?
    2. Re:Sleep on an x86 machine by AKnightCowboy · · Score: 2, Interesting
      I have never, ever, in all the years of using Windows or Linux had suspend, either S3 or suspend-to-disk work properly.

      I've got a generic AMD Athlon machine I built from pieces with a recent MSI motherboard running Windows XP Pro that goes in and out of S3 perfectly. Press the power button or select suspend and the system saves the state to memory in a couple of seconds and powers off all the peripherals including the fans. Press power again (don't have a USB keyboard to try, but PS/2 keyboard doesn't seem to be able to wake it, nor does a PS/2 mouse) and the machine powers up and is ready to use in a couple of seconds. For a Windows box that I use primarily for gaming and browsing the web there's no need for it to be on all the time. The only time I reboot it is applying patches or installing software that force me to. The machine runs rock solid. Windows XP Pro is awesomely stable on my box, but I'm sure people will chime in with their horror stories. YMMV. Same thing goes for my Apple iBook. I never shut it off or reboot it unless I'm applying updates. I just let it suspend to ram when I close the lid. Wakes up just fine all the time. As for Linux boxes.. I couldn't tell you I ever tried. All my Linux boxes are setup as servers and I never logon to the console unless they're crashed. Unfortunately one of my loudest systems is a Linux box in a rackmount case. I probably should replace it with a Via Epia system. ;-)

    3. Re:Sleep on an x86 machine by FattMattP · · Score: 3, Informative
      Interesting. That doesn't reflect my experience at all. I have an IBM Thinkpad T30 running WinXP. I suspend it all the time. It's better than rebooting and I rarely have a problem.

      I suspend two or three times a day: I suspend it before I go to sleep, and before I leave work to take it home. Sometimes I listen to MP3s in the morning while I'm getting ready for work and I suspend it when I leave to go to work. I reboot maybe once every month, sometimes I go longer without a reboot. This is using a real mix of software: Cygwin, xemacs, resin, Oracle 9, Mozilla, SecureCRT, Winamp, Photoshop, MS Outlook, Cisco VPN client, OpenOffice, Propellerheads Reason, ACID Pro, and even some games (Warcraft III, Diablo II, Dungeon Siege). All work without causing any problems and without needing to reboot.

      I'd say that you have faulty hardware if you haven't been able to get anything to suspend with all of those operating systems.

      --
      Prevent email address forgery. Publish SPF records for y
  2. Dell Latitude C610 Sucess(mostly) by kdm · · Score: 5, Informative

    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.

    1. Re:Dell Latitude C610 Sucess(mostly) by blixel · · Score: 3, Funny

      I use "echo 3 > /proc/acpi/sleep" to put it to sleep

      Is that a requirement?

      I can just hear myself on the phone with my mom "OK ... click on your K menu, go to system, tools, now click on Konsole. Now type "su" and hit enter. Now type your root password. No, your *root* password, not your user password. Of course I don't know what *your* root password is." .... an hour later ... "OK now type echo, that's e like edward, c like cat, h like house, o like oliver. Now press the space bar, now type the number 3, now press space again, now type the greater than sign. Hold down shift and press the period key. Now press space again. Now forward slash. That's the one on the same key as the question mark. Now type proc. That's p like postal, r like romeo, o like oliver, c like cat. Now type another forward slash, again that's the one with the question mark. No mom, no space. Now type acpi. That's a like apple, c like cat, p like postal, i like illusion. Now type another forward slash. No mom, no space. Now type sleep. That's s like scott, l like linda, e like edward, e like edward - yes mom - 2 e's, p like postal. Now press enter." ..... "OK. You must have made a typo. Let's try again..."

  3. Powerbook users experience by Zorton · · Score: 3, Informative

    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.

  4. Not for me, personally... by Chasing+Amy · · Score: 4, Informative

    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
  5. Save your Mozilla tabs (OT) by OldMiner · · Score: 2, Insightful

    You can use Tab Browser Extentions to save your tab session, either on log off automatically, or manually. Be warned, there is some slightly weird menu placement, partially due to the fact that the author is not a native English speaker. I believe Opera does this automatically, with Nordic instead of Japanese authors.

    --
    You like splinters in your crotch? -Jon Caldara
  6. As with Win95, so with Linux now by OldMiner · · Score: 3, Informative

    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
  7. Use APM suspend, not ACPI suspend by swillden · · Score: 2, Informative

    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.
    1. Re:Use APM suspend, not ACPI suspend by Profane+MuthaFucka · · Score: 4, Informative

      I've got a brand spanking new T30 with 2.4 Ghz P4 and 60 gig disk. It's my work laptop, provided by my company, about 6 months old.

      apm -s works perfectly for me. The thing will sleep all weekend just like that, and power up instantly when the top is opened.

      --
      Fascism trolls keeping me up every night. When I starts a preachin', he HITS ME WITH HIS REICH!
    2. Re:Use APM suspend, not ACPI suspend by Tux2000 · · Score: 2, Informative

      APM is only defined for single CPU machines. APM + SMP (Hyperthreading counts as a secondary CPU!) simply does not work with Linux (except for power-off via APM) last time I checked (2.4.20+n).

      I wish my old Dell dual CPU machine had ACPI so I could shut it down using the power button. But alas, APM does not "hook" the power button like ACPI does, so pressing the power button is just like unplugging the power cord - a bad idea. For now, ca::ctrlaltdel:/sbin/shutdown -t5 -h now in /etc/inittab must do the job.

      Tux2000

      --
      Denken hilft.
  8. Macs don't sleep to disk by eyeball · · Score: 3, Interesting

    Someone please correct me if I'm wrong, but I don't think you can call what Mac laptops do "sleep to disk". I have a G4 Powerbook, and when the lid shuts, it suspends, but from what I understand the power manager uses just a bare minimum of power to keep the data in ram, and nothing goes to disk. The whole process is instantaneous -- sleeping as soon as the lid is shut, and returning before I can get the lid fully open. I haven't even managed to fake it out by closing and opening quickly.

    I'm also impressed that included in this is logic to notice hardware changes when the system is asleep (ok, more like cat-napping). For example, I typically shut the lid and disconnect my network cable at work, then bring it home and wake it to my WiFi router, OSX will automatically sense and join the new network (same in reverse). The network libraries are robust enough to not cause terrible application-level errors or crashes.

    Same goes for recognizing the plugging in or removal of an external monitor during sleep, as well as all the USB devices I've tried.

    I can't say I tried disconnecting a Firewire drive or PCMCIA device during sleep, which I won't try since they probably should be properly dismounted. But I bet it would mount a device while asleep (or very shortly after waking).

    Granted if you took the battery out it would probably dump everything in ram, unless there's some kind of internal backup battery specifically for last minute graceful shutdown everything. But I guess that's the trade-off for not having to wait while half a gig of ram transfers to and from the disk.

    Personally I would say Linux is a good year from this level of sleep mode, but then I don't follow kernel dev too closely, so who knows.

    --

    _______
    2B1ASK1
    1. Re:Macs don't sleep to disk by drsmithy · · Score: 4, Insightful
      I'm also impressed that included in this is logic to notice hardware changes when the system is asleep (ok, more like cat-napping). For example, I typically shut the lid and disconnect my network cable at work, then bring it home and wake it to my WiFi router, OSX will automatically sense and join the new network (same in reverse). The network libraries are robust enough to not cause terrible application-level errors or crashes.

      Same goes for recognizing the plugging in or removal of an external monitor during sleep, as well as all the USB devices I've tried.

      FY(and others)I XP also does all this quite well IME. Win2k somewhat less so. I've no experience using Windows 9x on laptops.

      The only thing that gets a bit flaky IME is detecting external monitors when multi-monitor (ie: spanning) is being used. My D600 used to often either not detect the monitor had been unplugged (hence leaving the bit of the Desktop that had been spanned inaccessible) and/or not detect when a new monitor had been plugged in (hence requiring eith er a visit to Display Properties or another Sleep/wake cycle).

      Granted if you took the battery out it would probably dump everything in ram, unless there's some kind of internal backup battery specifically for last minute graceful shutdown everything. But I guess that's the trade-off for not having to wait while half a gig of ram transfers to and from the disk.

      PBs seem to have a backup battery to keep the RAM refreshed while the main battery is not present. How long it lasts I never checked accurately, but my old PB 667 certainly used to survive the typical trip through the X-Ray machine suspended - so at least a few minutes (it won't keep for a day, however).

  9. Tecra 8000 Success by Time+Doctor · · Score: 2, Informative

    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!
  10. Inspired me.. by zcat_NZ · · Score: 5, Informative

    I just decided to see what would be invloved in getting this to work, and was surprised to find that it's remarkably simple.

    Compile a kernel with suspend-to-swap and acpi.

    Install acpid (apt-get install acpid)

    in /etc/acpi/powerbutton.sh, put; /sbin/lilo -R "current resume=/dev/hda1"
    # your label and swap partition will probably be different
    echo "4" > /proc/acpi/sleep

    And that's all. Works perfectly for me, I just tested it.

    --
    455fe10422ca29c4933f95052b792ab2
  11. S3 on several linux boxes by R@Bastard · · Score: 3, Interesting

    I've tried it under 2.6 on a couple of laptops (Fujitsu w/Transmeta and a big ugly Sony). No dice. I tried it under 2.4 with acpi patch on both. No dice. I tried it on a couple of non-laptops, too. No dice.

    The word on the Fujitsu is that it is actually working properly, but that the PCI bus and/or radeon card doesn't refresh properly upon wake-up.

    This is not a version of "working properly" that works very well for me. No screen, no network. Tough to work with. I think swsusp is the stand-in du jour.

    I was hoping that the new Knoppix would help me get this going.

    Good luck to you. I'm sure that those smart kernel hackers will bring us this good stuff eventually.

    --
    Mucous membranes are the part of your brain that, like, make you think about mucous. --Beavis
  12. I don't like S3 by Rufus88 · · Score: 3, Interesting

    I run Win2K, and I never use suspend-to-RAM. The reason is that the CPU actually halts and does not start up again unless the user takes some explicit action. This makes it impossible to set up scheduled tasks (like backups that I run every day) to wake up the system from sleep mode.

  13. Re:S3 is a bad idea IMHO by TheLink · · Score: 2, Funny

    Re: your sig
    "Suicide prevention put me on hold."

    You said you were going to hang yourself and they told you to hold the line? ;).

    Hang in there...

    --