4

So I just installed Ubuntu, and I love it. I don't think it's going to replace Windows 7 for me, and it has a few problems that I'm probably going to end up fixing when I figure out how to use WINE, but it's still awesome.

My main problem now is that whenever I put Ubuntu in to suspend, the entire thing freezes. The monitor is still on, but is only black, and there is no reaction to any buttons.

While I don't mind pressing Shut Down since Ubuntu loads up rather fast in comparison to Windows 7, it can get annoying and inconvenient.

Thanks for any help!

landon
  • 41
  • Pls read this https://wiki.ubuntu.com/PrecisePangolin/ReleaseNotes/UbuntuDesktop.Next time when u reply pls include sys configuration too.Suspend is disabled in 12.04 by default.If u want it back see this http://askubuntu.com/questions/94754/how-to-enable-hibernation-in-12-04. – beeju Apr 30 '12 at 04:49
  • 1
    Welcome to Ask Ubuntu! This question should instead be filed as a bug report, thanks! Instructions here. – Jorge Castro Apr 30 '12 at 21:20
  • @beeju , the first is a broken link. The second, I try to put in the pm-hibernate, it spits back a This utility may only be run by the root user. I don't know how to be the "root user." – landon Apr 30 '12 at 23:45
  • @JorgeCastro Will do! Sorry that I didn't know that's what I had to do! – landon Apr 30 '12 at 23:46
  • To be a root,enter this command first "sudo -i" and enter your password.Now you are root. – beeju May 11 '12 at 15:53
  • Hi landon, I have the same issue. Did you find any solution ? Please let us know. – Manuel Selva Jun 14 '12 at 10:43

4 Answers4

3

OK after a bit of work I modified the scrips above from the other suggestions. Thank you @wangdw! Here is the following bad ass script (don't forget as before to create a file using sudo gedit /etc/pm/sleep.d/20_custom-ehci_hcd and also to set the read permissions using sudo chmod 755 /etc/pm/sleep.d/20_custom-ehci_hcd):

  #!/bin/sh
  #inspired by http://art.ubuntuforums.org/showpost.php?p=9744970&postcount=19
  #...and http://thecodecentral.com/2011/01/18/fix-ubuntu-10-10-suspendhibernate-not-working-bug    
  # tidied by tqzzaa :)

  VERSION=1.1
  DEV_LIST=/tmp/usb-dev-list
  DRIVERS_DIR=/sys/bus/pci/drivers
  DRIVERS="ehci xhci" # ehci_hcd, xhci_hcd
  HEX="[[:xdigit:]]"
  MAX_BIND_ATTEMPTS=2
  BIND_WAIT=0.1

  unbindDev() {
    echo -n > $DEV_LIST 2>/dev/null



  for driver in $DRIVERS; do
    DDIR=$DRIVERS_DIR/${driver}_hcd
    for dev in `ls $DDIR 2>/dev/null | egrep "^$HEX+:$HEX+:$HEX"`; do
      echo -n "$dev" > $DDIR/unbind
      echo "$driver $dev" >> $DEV_LIST
    done

  #for bus in $EHCI_BUSES; do
     echo -n $bus > /sys/bus/pci/drivers/ehci_hcd/unbind
 # done   

  done

}

bindDev() {
  if [ -s $DEV_LIST ]; then
    while read driver dev; do
      DDIR=$DRIVERS_DIR/${driver}_hcd
      #for bus in $EHCI_BUSES; do
          echo -n $bus > /sys/bus/pci/drivers/ehci_hcd/bind
      #done
      while [ $((MAX_BIND_ATTEMPTS)) -gt 0 ]; do
          echo -n "$dev" > $DDIR/bind
          if [ ! -L "$DDIR/$dev" ]; then
            sleep $BIND_WAIT
          else
            break
          fi
          MAX_BIND_ATTEMPTS=$((MAX_BIND_ATTEMPTS-1))
      done 


    done /dev/null

  chvt 1
  chvt 7
}



  EHCI_BUSES="0000:00:1a.0 0000:00:1d.0"
  case "$1" in
    hibernate|suspend)
    unbindDev;;

    resume|thaw)
    bindDev;;

    esac
Eliah Kagan
  • 117,780
Dragon
  • 71
  • Sorry that was a comment within the script from the sources I took it from. You can ignore anything with a # in front as it is a comment. Also yes esac is part of the script. It is the ending. I have changed it now because it took me a while to figure out how this silly editor works. Let me know if it works well for you. – Dragon May 11 '12 at 16:31
  • The script should run now as it is, though I'm not sure if you have the indentation the way you like it, since it's inconsistent throughout the script. As for editing on AskUbuntu, scroll down and there's a dynamically generated preview as you're writing/editing your posts, so you see what it will look like. – Eliah Kagan May 11 '12 at 16:39
  • Yes the indentation got pretty messed up. I shall make another attempt at editing it. I had to add some html tags which don't show but help the script appear better. – Dragon May 11 '12 at 16:47
  • I tried to get this to work but it had a syntax error about a missing fi so I used the 'new' step 2 on this link: http://thecodecentral.com/2011/01/18/fix-ubuntu-10-10-suspendhibernate-not-working-bug (mentioned on this thread) and it worked great. – Brenden May 20 '12 at 17:01
1

I've been experiencing the same problem. It seems that Ubuntu attempts to suspend itself but some hardware doesn't want to comply. Here are some repairs that might work:

1. open a terminal by holding ctrl+alt+t;
2. type: sudo gedit /etc/pm/sleep.d/20_custom-suspend;
3. press Enter and authenticate;
4. put the following text into the created file; save it and exit. 
5. reboot and see if it works. 

This little script comes from somewhere on the Internet but I cannot find the source...

EHCI_BUSES="0000:00:1a.0 0000:00:1d.0"
case "${1}" in
    hibernate|suspend)
        # Switch USB buses off
        for bus in $EHCI_BUSES; do
            echo -n $bus > /sys/bus/pci/drivers/ehci_hcd/unbind
        done
        ;;
    resume|thaw)
        # Switch USB buses back on
        for bus in $EHCI_BUSES; do
            echo -n $bus > /sys/bus/pci/drivers/ehci_hcd/bind
        done
        ;;
esac

Please try this out and tell me your findings!

If that script doesn't work, you might want to try another:

#!/bin/sh
#inspired by http://art.ubuntuforums.org/showpost.php?p=9744970&postcount=19
#...and http://thecodecentral.com/2011/01/18/fix-ubuntu-10-10-suspendhibernate-  not-working-bug
# tidied by tqzzaa :)

VERSION=1.1
DEV_LIST=/tmp/usb-dev-list
DRIVERS_DIR=/sys/bus/pci/drivers
DRIVERS="ehci xhci" # ehci_hcd, xhci_hcd
HEX="[[:xdigit:]]"
MAX_BIND_ATTEMPTS=2
BIND_WAIT=0.1

unbindDev() {
  echo -n > $DEV_LIST 2>/dev/null
  for driver in $DRIVERS; do
    DDIR=$DRIVERS_DIR/${driver}_hcd
    for dev in `ls $DDIR 2>/dev/null | egrep "^$HEX+:$HEX+:$HEX"`; do
      echo -n "$dev" > $DDIR/unbind
      echo "$driver $dev" >> $DEV_LIST
    done
  done
}

bindDev() {
  if [ -s $DEV_LIST ]; then
    while read driver dev; do
      DDIR=$DRIVERS_DIR/${driver}_hcd
      while [ $((MAX_BIND_ATTEMPTS)) -gt 0 ]; do
          echo -n "$dev" > $DDIR/bind
          if [ ! -L "$DDIR/$dev" ]; then
            sleep $BIND_WAIT
          else
            break
          fi
          MAX_BIND_ATTEMPTS=$((MAX_BIND_ATTEMPTS-1))
      done  
    done < $DEV_LIST
  fi
  rm $DEV_LIST 2>/dev/null
}

case "$1" in
  hibernate|suspend) unbindDev;;
  resume|thaw)       bindDev;;
esac
Dawei
  • 81
  • This didn't work. It still simply freezes and doesn't come back on, with the LCD still lit up but black. I'll try it again in a bit, I'll be busy for now! – landon Apr 30 '12 at 23:48
  • here is another script: http://chriseiffel.com/everything-linux/how-i-got-suspend-and-hibernate-working-in-linux-ubuntu-11-04-mint-11/. Try it! – Dawei May 01 '12 at 06:52
  • I'm getting a broken link. – landon May 02 '12 at 02:48
1

i have the same problem. try this: http://thecodecentral.com/2011/01/18/fix-ubuntu-10-10-suspendhibernate-not-working-bug work like a charm for me...

0

I found that installing the "dell firmware addon" package fixed the issue during the development cycle.