33

Ubuntu 10.10/11.04 Freezing on Battery Power – Fix!

* Update 23/08/2011 – in the comments below Carl Parkinson has an interesting fix that doesn’t require reverting the pm-utils package. It may be worth trying it first before doing the below.

I wrote a post several months back regarding a problem with my Dell Studio 15 laptop (with ATI graphics and Broadcom wireless adapter) and Ubuntu 10.10. When running the laptop from the mains all was well. However, if I unplugged the charger, and ran the laptop from the battery (as designed!) it would freeze within a couple of minutes. At the time I reverted back to Ubuntu 9.10.

Another release on (11.04) and the problem still exists! Something I find quite shocking as it’s a show-stopping bug. Thankfully after googling around I found a simple fix, in that most people suggest downgrading the pm-utils package to the “Lucid” 9.10 version.

  1. Open up Synaptic Package Manager
  2. Settings > Repositories > Other Software, then add the following:
  3. deb http://us.archive.ubuntu.com/ubuntu/ lucid main
  4. “Reload” the package list
  5. Find “pm-utils” then go to Package > Force Version.. and select 1.3.x
  6. Install the downgraded package
  7. Find “pm-utils” again, go to Package > Lock Version

All done, I no longer have any freezes. The issue from reading around is two-pronged. One issue seems to be around the wireless card, and putting it into powersaving mode. The other seems to be something wrong with xserver, or the ATI drivers. I did try turning on power saving on my wireless card by adding “iwconfig eth1 power off” to “/etc/rc.local” (before the exit 0 line), which reduced how quickly freezing occurred, but it still did occur at some point.

Since downgrading pm-utils though, my laptop has been running Ubuntu 11.04 happily. The fan was running full blast (and laptop quite hot) at first, but this was fixed by installing the fglrx drivers via the “System > Administration > Additional Drivers” tool.

Related Posts

  • Cork975

    Bril took a bit of time to find this fix. after installing Lubuntu on my Advent Millano Elite the wirless lan used to disconnect after unplugging power source. all happy now thanks

  • Egarretsen

    Hi Robert,

    I exerience the same problems but for me your sollution did not help. Please help me give this bug more importance by clicking on

    “This bug affects 1 person. Does this bug affect you?” in the bug i reported using launchpad. And everyone who is affected by this problem too. So that this bug report gets more importance and to increase the change that it is fixed.

    https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.15/+bug/13957

  • Egarretsen

    Sorry i posted the wrong link. This is the correct one:

    https://bugs.launchpad.net/ubuntu/+source/pm-utils/+bug/787809

  • Carlosfratini

    Thanks man, this is really helpful. Problem solved.

  • David

    If my power was disconnected, I would freeze upon power reconnect.  This fixed it.  Thanks!

  • Nomail

    This resolve my wifi lag problem on battery mode on the msi wind U100 and ubuntu 11.04 !
    Thanks ! ;)

  • Nomail

    This resolve my wifi lag problem on battery mode on the msi wind U100 and ubuntu 11.04 !
    Thanks ! ;)

  • alican

    Really helped thanks. no freezes so far.

    i am using ubuntu 11.04 on my dell studio 1558.

  • alican

    Really helped thanks. no freezes so far.

    i am using ubuntu 11.04 on my dell studio 1558.

  • Jo

    You’re my god!! Thanks

  • Anonymous

    Thanks for the fix… I’ve been hung on AC since Christmas trying to figure out what the problem is. I also have a Dell, looks like they are prone to ubuntu-madness.

    However, the CPU is through the roof now when running on battery power, which I suppose has a lot to do with the downgraded pm-utils. fglrx has been installed long ago… any other ideas for cutting down on the CPU without conflicting the pm-utils downgrade?

    • http://robertbeal.com Rob

      That’s odd. Did you have the CPU problem when running an older version of Ubuntu?

      What version of fglrx are you running? I have seen cases where that causes the laptop fan to go crazy. Is it definitely the CPU? Trying running “top” via the command line and see if you can identify what is causing the spike.

      • Anonymous

        I don’t actually know if the same was happening on 10.10, because I never ran later versions on battery power on this laptop, as it was always crashing (which I thought was due to the Windows 7 installation – which it wasn’t and which I have removed now though).

        top had returned npviewer.bin using 22% of the CPU so I changed the flashplugin to libflashplayer.so for 64-bit – have let the laptop run for a while on battery power and it seems to be better now. Will check what happens when using flash.

        I am running the latest fglrx-version, 2:8.840-0ubuntu4

      • Anonymous

        Well, now firefox is taking up 85% CPU and Xorg is following with a strong 22%…
        When restarted on AC power, this does not happen. Weird.

        • http://robertbeal.com Rob

          That sounds like a common flash problem. It’s notoriously bad on Linux, especially 64-bit.

          It may not happen on AC power as your CPU will be running at full frequency. On battery power it may be in power-save or on-demand mode which might be why it spikes.

          Try Flash-Aid, a firefox plugin, it’s great for installing the right and stable version of flash.

          • Anonymous

            I understand, however, Flash-aid is installed.

            Well, the important thing for now is that the laptop does not freeze when it is used on battery power, which I want to thank you for again.

  • Carl Parkinson

    Hi,

    I have been having problems with my Dell Studio 15 freezing intermittently when on battery for months. I have read many, many posts on this topic and tried many different tweaks to no avail. Reverting to an earlier version of pm_utils worked, but I lost the ability to put my laptop on standby, so that was no good. I decided it was time for me to do some analysis and try a few tweaks of my own. Well, it looks like I have come up with a successful work around that should work for any type of wireless card.

    I run Mint 10 and have the latest version of pm-utils installed – 1.4.1. tailing /var/log/pm-powersave.log reveals that /usr/lib/pm-utils/power.d/wireless is called to put the wireless card into powersave mode when the power cord is removed. I found the specific section of code that makes that change is at the end of the script:

    case $1 in
        true) wireless_powersave on;;
        false) wireless_powersave off ;;
        *) exit $NA ;;
    esac

    I simply changed it to:

    case $1 in
        true) wireless_powersave off;;
        false) wireless_powersave off ;;
        *) exit $NA ;;
    esac

    This results in the card never being put into powersave mode and has stopped the freezing. This change does not appear to affect the power consumption either. So, all is well and I have said goodbye a very frustrating problem. I hope it works for you too.

    FYI, my wireless card is a Broadcom Corporation BCM4312 802.11b/g LP-PHY (rev 01) 

    • http://robertbeal.com Rob

      Wow cheers, that’s a pretty cool solution. I’ll add it to the post, I can’t check it myself as the laptop that is affected is sat at home (I’m travelling).

      • Anonymous

        how can i edit that line? i have opened that in text editor but it does not let me change it.

        • http://robertbeal.com Rob

          Open a terminal, and type the following, then press Enter:

          sudo gedit /usr/lib/pm-utils/power.d/wireless

          • Carl Parkinson

            Hi Rob,

            I have done a little more digging and it appears that all that you need to do is execute the following:

            sudo touch /etc/pm/power.d/wireless

            The existence of this file (with the execute bit not set) stops any power commands from making any changes to the card’s power settings. I believe this will also solve the problem, but I’ll need to do a little more testing before I’m 100 certain.

            Regards
            Carl

          • Shreyas Ravindra

            Hey Rob, this change in the lines script didn’t work for me. Although it did appear to work for a while but then my PC Hanged :(. .. (I am talking about the solution proposed by Carl Parkinson)

            This is a show stopper Bug! I have the latest graphics drivers as well now! I hope these changes doesn’t heat my Laptop much!

          • Vic

             Hi guys, thanks for looking into this issue. I’m being affected as well. I’ve just run the “touch” command. Let’s see how it goes. I’ll keep you posted! Thanks!

          • Vic

             Hey Shreyas, try running “iwconfig” in order to check whether power management is on or off. I’ve run it before and after going on battery power and it’s always off since I ran the “touch” command. Cheers

          • Shreyas Ravindra

            Vic, the Power Management is always off.

    • Roman

      Worked for me.  Thank you!

      • Wicho Anaya

        Worked for me too. Thank you very much.

  • AJ

    Just followed the steps. Will report on performance after a week.

  • Pingback: Ubuntu 10.10/11.04 se bloquea al desconectar portátil de la corriente | FicusPC Blog

  • Adam Dziedzic

    Carl Parkinson’s fix has helped me. Thanks a lot!

  • Stoaninger

    Thanks a million, that has fixed the problem on my Dell, and your instructions are clear and easily followed. Great post :)

  • Toby Fox

    For those who don’t have or don’t want to install Synaptic with which to use Force Version and Lock Version, you can do these things from the command line. Add the Lucid repository however you like and update/reload packages, then run ‘apt-cache policy pm-utils’ to see what versions you have available. You can then install whichever version you want. You want 1.3.something – for me it was ‘sudo apt-get install pm-utils=1.3.0-1ubuntu1′ but maybe the exact version might change. To hold the package so that it doesn’t upgrade in the future, you can run ‘echo pm-utils hold | sudo dpkg –set-selections’. If, later, you do want to upgrade it, replace ‘hold’ with ‘install’.

    • http://robertbeal.com Rob

      Thanks, when I get a minute I’ll update the article with those commands!