The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    6400 + x1400 + (K)Ubuntu Feisty + Hibernate?

    Discussion in 'Linux Compatibility and Software' started by Merritt, May 29, 2007.

  1. Merritt

    Merritt Notebook Geek

    Reputations:
    0
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    15
    I am running Kubuntu Feisty on my Dell Inspiron 6400 with ATI x1400 and flgrx. Not having hibernate is quite aggravating with a laptop, for me. I close my lid and it gives the keyboard a nice little night-light.

    Has anyone been able to get hibernate to work properly?
     
  2. ewhac

    ewhac Notebook Guru

    Reputations:
    17
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    15
    First: The fglrx drivers from ATI have been known to be problematic for suspend. The latest drivers are supposed to be much improved, but you're still probably going to need to tweak settings before things will work.

    Second: Power management in Linux is a complete shambles, and is likely to remain so for some time. I'm on the linux-pm mailing list, and the progress in power management has been glacial.

    That said, there have been some impressive strides made in getting "suspend" to work on PC-compatible systems in the last three or so kernel releases. 2.6.21 is, of course, the best so far.

    There are two flavors of suspend under Linux: Suspend-to-RAM and suspend-to-disk. This latter is often called "hibernate," and it involves basically saving the entire contents of RAM to disk, then shutting the system completely off. When you power the system back on, Linux notices the memory snapshot, reloads memory with the saved contents, and tries to continue where it left off. Suspend-to-RAM involves putting hardware devices into very low-power or off state and stopping the CPU. This is much harder to do well, as it requires complete documentation on the underlying hardware. As such, you have a much better chance of getting suspend-to-disk to work well.

    You need the following to get suspend working well:
    • A recent kernel,
    • The latest drivers for your hardware (see "recent kernel"),
    • A recent BIOS (to have any hope of a usable ACPI implementation),
    • A swap partition (to store the memory snapshot)
    You should also grab the 'uswsusp' or 'hibernate' packages, which contain utilities to drive the suspend process. uswsusp tools are more "primitive" and any problems you experience using them point to problems with the kernel, drivers, and/or BIOS rather than misuse of the tools. The 'hibernate' package offers some automated help with problem drivers, but requires configuration, so it's possible to mess it up and experience problems that way.

    To get suspend working, you should first start on a text console without X running. Use the tool 's2disk' all by itself and see what happens. If it works, try it again (sometimes the first try works but subsequent tries fail). If it still works, congratulations; the only hard part will be the graphics driver.

    Launch X and try the whole thing again. If it fails, well, then the fun begins. You will likely need to play with options with obscure names like 'VBEtool' and 'radeontool' and 'POST on resume' and other wackiness. Fortunately, others have traveled this road before you -- Google is your friend. The search terms "linux suspend hibernate fglrx" should yield some help.

    Schwab
     
  3. Merritt

    Merritt Notebook Geek

    Reputations:
    0
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    15
    It is kind of discouraging to hear that Hibernate doesn't work very well. And I don't much care about Sleep - I can't carry around my laptop like that. It has to really shut down. However, hibernate is the feature I miss most. I liked being able to just close the lid, walk away, and know it would power down but keep all my work.

    And thank you for the info... I'll have to try some of that when I get a chance, and I'll get back to you. :eek:
     
  4. ewhac

    ewhac Notebook Guru

    Reputations:
    17
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    15
    Sorry if I made your prospects sound rather bleak. You will probably have to try a lot of individual settings in various places and reboot a zillion times testing them out. But you in fact have a fair to excellent chance at getting hibernate (suspend-to-disk) working.

    As for triggering hibernate upon closing the lid, you'll may have to do that "by hand." Closing the lid generates an ACPI event, which is captured and processed by acpid(8). You may need to write a simple bash shell script to receive the event and launch the hibernate command. This is much easier than it sounds. Personally, I use bare acpid scripts, but there may be even friendlier facilities packaged with Ubuntu to help you do this.

    Schwab
     
  5. Merritt

    Merritt Notebook Geek

    Reputations:
    0
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    15
    Well... I've been a bit busy lately, but I finally got around to trying this. I went into Adept Manager and searched for 'hibernate'. A package called hibernate came right up, and I downloaded it... lol, I was quite surprised by how well things went. Closed Adept, opened Konsole and typed in 'sudo hibernate' (just hibernate tells you you can't do it)... it went to a terminal screen, a bunch of lines went by and my laptop powered off....... I hit the power switch and it sat at the screen with the kubuntu logo and the loading bar for a while before flashing and bringing up X again. It seemed to hibernate fine... my only concern is this: while it sat at the loading screen for a moment it was making a slightly scary sound. Definitely not the "happy healthy hardware" sound - One of the things that worries me with Linux - there are so many hardware components that do not work properly, and need workarounds, etc.. I just don't want it to kill my hardware by misusing it!

    Sooo... I don't suppose there is a real explanation for that odd, scare me sound?

    Other than that, however... it worked. Now I just need to figure out I guess how to get it to command hibernate when the lid is closed.
     
  6. Bog

    Bog Losing it...

    Reputations:
    4,018
    Messages:
    6,046
    Likes Received:
    7
    Trophy Points:
    206
    I know what sound you are referring to. It is a very fast, repetitive, almost squeeky clicking noise caused by the hard drive working furiously to write the contents of the RAM to the swap. I have the same "problem", but it doesn't cause any trouble. Ubuntu gets it done all right, but not in the prettiest fashion.
     
  7. Merritt

    Merritt Notebook Geek

    Reputations:
    0
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    15
    Well I am glad to hear that using it hasn't fried your laptop :)
    However, I am getting this odd sound when it boots back from hibernate, not when it goes into hibernate... same thing though, writing all that info from the swap back to ram? :p

    I am still quite shocked it worked... I can't seem to find any sort of configuration for the Hibernate package I downloaded, so I'm not entirely sure what it's doing, but I am assuming it is just writing to the 5.5 GB swap I have. I found this guide from google:

    http://www.linux.com/article.pl?sid=06/05/24/1716222

    Which sounds quite promising, but I'm not sure I should do any of it except the automation with the lid-close. If it's not broke, don't fix it, right? It DID hibernate... I checked, it wasn't flashing my power icon as it does with sleep... power was nicely off... it resumed with fine resolution and graphics, and wifi reconnected fine.

    So, aside from the "scary sound", I don't know if I should try to screw with it. lol :p
     
  8. ewhac

    ewhac Notebook Guru

    Reputations:
    17
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    15
    Congratulations. That's exactly what it's supposed to do.

    Without actually hearing it, I can't begin to guess what it might be. (Well, actually, I can begin to guess -- it might be the resumed kernel resetting the ATA/IDE bus a second time, which doesn't normally happen from a normal boot.)

    If you have the package acpi-support installed, you already have the base infrastructure in place to deal with lid events.

    Dive in to /etc/acpi and look at the file lid.sh. There's already some bash code that gets processed every time you open/close the lid. If you look closer, you'll see the script calls out to two other scripts: /etc/acpi/local/lid.sh.pre and /etc/acpi/local/lid.sh.post. "But there's no /etc/acpi/local directory!" you say. Correct; you get to create it yourself and populate it with your local modifications.

    We are moving well into Advanced Topics at this point, so you'll probably want to move cautiously, or search for a canned script that does it already. Basically, you'll want write a lid.sh.post script to fork a subshell that sleeps for a second or two and then invokes hibernate. It might look something like this:

    Code:
    #!/bin/bash
    
    grep -q closed /proc/acpi/button/lid/*/state
    if [ $? = 0 ]; then
        ( sleep 2; hibernate ) &
    fi
    Note that the above is seat-of-the-pants code I just scribbled out. I haven't actually tried it. Use with appropriate cautions and caveats.

    Schwab
     
  9. ewhac

    ewhac Notebook Guru

    Reputations:
    17
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    15
    $ man hibernate.conf

    It doesn't sound like you have any misbehaving devices, since it worked out of the box, but check out the file /etc/hibernate/blacklisted-modules all the same (these are drivers that hibernate will automatically unload before putting the kernel to sleep).

    Schwab
     
  10. Merritt

    Merritt Notebook Geek

    Reputations:
    0
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    15
    Thanks Schwab for all the advice!

    Could you take a look at this link for me?

    http://www.linux.com/article.pl?sid=06/05/24/1716222

    About 1/3 down the page is a section called "Automating Hibernation"... The largest difference I can see being I am using acpi-support, and not acpid. If I altered the folder and file names to match what I have however, do you think this script setup would work? (Assuming I would switch it so that closing the lid does hibernate, not sleep)

    Thanks! :)
    I'm not having great luck finding a script anywhere else, and I am so not ready to write it myself. :D

    Edit: Er, I'm an idiot. It just occurred to me, and I checked Adept Manager... I do indeed already have acpid installed, and assumably running. Sorry... it's late. :eek:
     
  11. ewhac

    ewhac Notebook Guru

    Reputations:
    17
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    15
    Yup, that pretty much describes what I outlined above (only mine is slightly more robust; opening the lid will not also trigger hibernation).

    acpi-support is built on top of acpid, so you're already good to go there. Indeed, if you follow the example at the URL above, you'll see that acpi-support already has event and script files for power button and lid events. The URL describes how to write your own lid.sh, but acpi-support already provides a lid.sh. So it merely falls to you to use the hooks already provided by lid.sh (namely, the callouts to the 'pre' and 'post' scripts).

    Schwab
     
  12. Merritt

    Merritt Notebook Geek

    Reputations:
    0
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    15
    Hmm.. I am trying to kill acpid. But I get this error:

    "Insufficient permissions to kill process"

    Something I found on google said to try "su" first, but I can't get that to work either... tried something about a user group wheel, or something... my brain is just too stupid right now. I need more coffee. :p
     
  13. Pitabred

    Pitabred Linux geek con rat flail!

    Reputations:
    3,300
    Messages:
    7,115
    Likes Received:
    3
    Trophy Points:
    206
    If you're running Ubuntu, try 'sudo killall acpid' :) It'll ask you for your user password.
     
  14. Merritt

    Merritt Notebook Geek

    Reputations:
    0
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    15
    That worked! Thanks a million, pita! Just got back from dinner, and you saved me a headache. :)
     
  15. Merritt

    Merritt Notebook Geek

    Reputations:
    0
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    15
    Alright! So far so good. I edited the guide slightly, ignored the sleep part and set it so lid does hibernate.

    Before setting the script I tried hibernate from Konsole again, and when it came back it had some kind of audio error, and no audio would work. Came back after reboot. First time trying the script it worked well, the system hibernated. System came back up fine, graphics fine... Just two things: No error this time but there was no audio once again, but for some reason.. I paused the song, pressed increase volume button (on the keyboard), played again, and audio was back. So that was an easy fix. And KNetworkManager showed no wireless connections, but using 'Disable Wireless' and then 'Enable Wireless' brought it back just fine.

    All in all, not flawless, but it works just fine for my purposes so far.

    I use hibernate every day (or I will again now that I can), so I will update if there are complications.

    For now: Hibernate works! Thank you to everyone who helped, especially Schwab! Big help, hon! :D I really appreciate how helpful you guys all are.
     
  16. Merritt

    Merritt Notebook Geek

    Reputations:
    0
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    15
    Update: I got the error again here it is...

    Again, pressing the volume button returns sound.

    And one other thing I have noticed is that SuperKaramba does not reload properly. I cannot find the system tray icon, and the widgets on my desktop are black/show what has been on top of them. Kill process/restart karamba fixes, but is there a way to avoid this problem?
     
  17. Pitabred

    Pitabred Linux geek con rat flail!

    Reputations:
    3,300
    Messages:
    7,115
    Likes Received:
    3
    Trophy Points:
    206
    You can add things to your acpi restarting scripts that deal with just restarting these specific applications automatically, rather than you having to manually do it. I don't have any exact instructions, I just know that it's possible. An acpi blacklist or something, I believe.