Unplugging the AC adapter causes the computer to suspend

Bug #33952 reported by Niran Babalola
This bug report is a duplicate of:  Bug #33072: Pulling AC plug suspends computer. Edit Remove
14
Affects Status Importance Assigned to Milestone
gnome-power-manager (Ubuntu)
Fix Released
Medium
Daniel Silverstone

Bug Description

This doesn't occur every time, and only started happening a few days ago.

Revision history for this message
Daniel Silverstone (dsilvers) wrote :

Can you please confirm what version of gnome-power-manager you have installed

Also if it occurs on a fresh boot, or only after a suspend via lid close

Also can you please confirm your settings in terms of actions, so lid-close-on-ac, lid-close-on-battery, sleep-button-action etc.

Thanks

Revision history for this message
Richard Hughes (richard-hughes) wrote :

Daniel, you might want to grab the poke-gnome-screensaver-on-hardware-event from CVS, and see if that fixes things. See http://bugzilla.gnome.org/show_bug.cgi?id=333525

Revision history for this message
Niran Babalola (niran) wrote :

I have version 2.13.93-0ubuntu1 installed.

The bug has never occurred on a fresh boot, but it doesn't occur on every subsequent suspend either. For instance, today I went about two suspends without it happening. Over the past few days, I have also run into bugs #32143 and #33991.

lid-close-on-ac: Blank screen
lid-close-on-batt: Suspend
critical battery: Shutdown
sleep-type-when-inactive: Do nothing
sleep-button-action: Suspend

Revision history for this message
Paul Sladen (sladen) wrote :

Is this something like:

  On unplug from AC, battery-level goes to "unknown" which is represented by '0'.

  Zero battery level is less than $crtical_level, therefore g-p-m performs $action

Revision history for this message
Richard Hughes (richard-hughes) wrote :

So telling g-p-m not to do the critical action at 0% would fix the problem?

Revision history for this message
Paul Sladen (sladen) wrote :

Or, if it is zero, take the result with a pinch of salt and try a minute later.

Revision history for this message
Niran Babalola (niran) wrote :

My critical action is set to shutdown, so if this was the cause of the bug, wouldn't it be shutting down rather than suspending?

I hope the suggested change somehow fixes it anyway.

Revision history for this message
Paul Sladen (sladen) wrote :

Funky... Can you try:

  sudo tail -0f /var/log/acpid

when you unplug the AC if it is still reproducible.

Revision history for this message
Niran Babalola (niran) wrote :

This was the second time I unplugged the power and it suspended. Output follows.

Laptop mode enabled, not active.
[Fri Mar 24 16:32:32 2006] received event "ac_adapter ADP1 00000080 00000000"
[Fri Mar 24 16:32:32 2006] notifying client 3947[111:111]
[Fri Mar 24 16:32:32 2006] executing action "/etc/acpi/power.sh"
[Fri Mar 24 16:32:32 2006] BEGIN HANDLER MESSAGES
[Fri Mar 24 16:32:32 2006] END HANDLER MESSAGES
[Fri Mar 24 16:32:32 2006] action exited with status 0
[Fri Mar 24 16:32:32 2006] completed event "ac_adapter ADP1 00000080 00000000"
[Fri Mar 24 16:32:32 2006] received event "battery BAT0 00000080 00000001"
[Fri Mar 24 16:32:32 2006] notifying client 3947[111:111]
[Fri Mar 24 16:32:32 2006] executing action "/etc/acpi/power.sh"
[Fri Mar 24 16:32:32 2006] BEGIN HANDLER MESSAGES
[Fri Mar 24 16:32:32 2006] END HANDLER MESSAGES
[Fri Mar 24 16:32:32 2006] action exited with status 0
[Fri Mar 24 16:32:32 2006] completed event "battery BAT0 00000080 00000001"
yes
Laptop mode enabled, active.
[Fri Mar 24 16:32:51 2006] received event "button/power PWRF 00000080 00000001"
[Fri Mar 24 16:32:51 2006] notifying client 3947[111:111]
[Fri Mar 24 16:32:51 2006] executing action "/etc/acpi/powerbtn.sh"
[Fri Mar 24 16:32:51 2006] BEGIN HANDLER MESSAGES
[Fri Mar 24 16:32:51 2006] END HANDLER MESSAGES
[Fri Mar 24 16:32:51 2006] action exited with status 0
[Fri Mar 24 16:32:51 2006] completed event "button/power PWRF 00000080 00000001"[Fri Mar 24 16:32:52 2006] received event "battery BAT0 00000081 00000001"
[Fri Mar 24 16:32:52 2006] notifying client 3947[111:111]
[Fri Mar 24 16:32:52 2006] executing action "/etc/acpi/power.sh"
[Fri Mar 24 16:32:52 2006] BEGIN HANDLER MESSAGES
[Fri Mar 24 16:32:52 2006] END HANDLER MESSAGES
[Fri Mar 24 16:32:52 2006] action exited with status 0
[Fri Mar 24 16:32:52 2006] completed event "battery BAT0 00000081 00000001"

Revision history for this message
Richard Hughes (richard-hughes) wrote :

Can you try CVS HEAD for me please? It now ignores values == 0.

Revision history for this message
Paul Sladen (sladen) wrote :

The useful stuff out of that log is:

16:32:32 received event "ac_adapter ADP1 00000080 00000000"
16:32:32 received event "battery BAT0 00000080 00000001"
16:32:51 received event "button/power PWRF 00000080 00000001"
16:32:52 received event "battery BAT0 00000081 00000001"

Do you remember pressing the PowerButton on the laptop? There's an event coming in, which is the laptop sending a power-button event; 'hald-addon-acpi' then punts this across the D-Bus, which g-p-m then presumbly catches and starts the suspend from.

So... something is making the laptop send a spurious PowerButton press. (Or was that you pressing "POWER" to wake the laptop up again after it had gone to sleep?)

Revision history for this message
Niran Babalola (niran) wrote :

That was me pressing POWER to wake the laptop up after suspending.

Revision history for this message
Matt Zimmerman (mdz) wrote :

Are the relevant changes from CVS now in Dapper? Are you still having the problem?

Changed in gnome-power-manager:
assignee: nobody → dsilvers
status: Unconfirmed → Needs Info
Revision history for this message
Niran Babalola (niran) wrote :

I was about to reply saying that I hadn't noticed it recently, then I unplugged the cable and my computer suspended. I have the latest package (2.14.0-1) installed, but I haven't restarted in almost three days, and g-p-m's about window says 2.13.93. I'll reboot soon and see if the bug still persists.

Revision history for this message
Richard Hughes (richard-hughes) wrote :

I've fixed the hal side of the problem:

See the first entry here: http://live.gnome.org/GnomePowerManager/Faq

Revision history for this message
Daniel Silverstone (dsilvers) wrote :

gnome-power-manager (2.14.3-0ubuntu2) dapper; urgency=low

  * Patches added in this version:
    - 20-enable-xfce-startup.patch
      Enable XFCE in the .desktop file so that it starts up for xubuntu too.
      Closes: launchpad #43077
    - 30-transparent-notification-icon.patch
      Enable the eggtrayicon stuff to do transparency.
      Closes: launchpad #40446
    - 95-lid-state-tracking.patch
      Augment lid state tracking to use hal if hal reports it is capable
      of tracking the lid state.
      If hal reports an acpi_LID with button.has_state == true then we use
      that state information whenever we want to consider the lid switch
      This should deal with LP #33072 and thus its duplicates #42988,
      #42823, #40730, #40662, #37442, #36459 and #33952
    - 96-disable-session-save-on-shutdown.patch
      Disable the saving of the session during critical power shutdown.
      This confuses too many people for now.
      Closes: launchpad #35691
  * Patches changed in this version:
    - 40-ubuntu-schema-defaults.patch
      Alter screen lock defaults to always lock, regardless of screensaver.
      Closes: launchpad #39448
  * Related fixes: #35591 -- We believe this is caused by the hal and
    gnome-power-manager interaction wrt. lid status. The new hal and the
    2.14.3 gnome-power-manager should fix it all.

Changed in gnome-power-manager:
status: Needs Info → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.