Bug 217819 - Often pressing suspend/sleep button does not do anything
Summary: Often pressing suspend/sleep button does not do anything
Status: RESOLVED FIXED
Alias: None
Product: solid
Classification: Frameworks and Libraries
Component: powermanagement-daemon (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Dario Freddi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-08 05:15 UTC by Andrey Borzenkov
Modified: 2010-11-09 20:49 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Borzenkov 2009-12-08 05:15:01 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

KDE 4.3.80/Qt 4.6.0 as shipped by Mandriva

Since updating to KDE 4.4 I often observe that pressing Suspend or Sleep in battery widget is simply ignored - nothing happens. It seems that proper calls are done but ignored. Below is dbus-monitor results during several attempts. I can suspend using pm-suspend just fine.


{pts/0}% dbus-monitor
signal sender=org.freedesktop.DBus -> dest=:1.531 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired                    
   string ":1.531"                                                             
method call sender=:1.531 -> dest=org.freedesktop.DBus serial=3 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch                   
   string "type='method_call'"                                                 
method call sender=:1.531 -> dest=org.freedesktop.DBus serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch                   
   string "type='method_return'"                                               
method call sender=:1.531 -> dest=org.freedesktop.DBus serial=5 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch                   
   string "type='error'"                                                       
method call sender=:1.514 -> dest=org.kde.knotify serial=536 path=/Notify; interface=org.kde.KNotify; member=event                                            
   string "new"                                                                
   string "kwin"                                                               
   array [                                                                     
   ]                                                                           
   string ""                                                                   
   string ""                                                                   
   array [                                                                     
   ]                                                                           
   array [                                                                     
   ]                                                                           
   int32 -1                                                                    
   int64 0                                                                     
method return sender=:1.26 -> dest=:1.514 reply_serial=536                     
   int32 0                                                                     
method call sender=:1.514 -> dest=org.kde.knotify serial=537 path=/Notify; interface=org.kde.KNotify; member=event                                            
   string "activate"                                                           
   string "kwin"                                                               
   array [                                                                     
   ]                                                                           
   string ""                                                                   
   string ""                                                                   
   array [                                                                     
   ]                                                                           
   array [                                                                     
   ]                                                                           
   int32 -1                                                                    
   int64 0                                                                     
method return sender=:1.26 -> dest=:1.514 reply_serial=537                     
   int32 0                                                                     
method call sender=:1.420 -> dest=org.freedesktop.DBus serial=309 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner             
   string "org.kde.kded"                                                       
method call sender=:1.420 -> dest=org.freedesktop.DBus serial=310 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner             
   string "org.freedesktop.DBus"                                               
method call sender=:1.420 -> dest=org.kde.kded serial=311 path=/modules/powerdevil; interface=org.kde.PowerDevil; member=suspend                              
   int32 2                                                                     
method return sender=:1.18 -> dest=:1.420 reply_serial=311                     
method call sender=:1.514 -> dest=org.kde.knotify serial=538 path=/Notify; interface=org.kde.KNotify; member=event                                            
   string "delete"                                                             
   string "kwin"                                                               
   array [                                                                     
   ]                                                                           
   string ""                                                                   
   string ""                                                                   
   array [                                                                     
   ]                                                                           
   array [                                                                     
   ]                                                                           
   int32 -1                                                                    
   int64 0                                                                     
method call sender=:1.514 -> dest=org.kde.knotify serial=539 path=/Notify; interface=org.kde.KNotify; member=event                                            
   string "activate"                                                           
   string "kwin"                                                               
   array [                                                                     
   ]                                                                           
   string ""                                                                   
   string ""                                                                   
   array [                                                                     
   ]                                                                           
   array [                                                                     
   ]                                                                           
   int32 -1                                                                    
   int64 0                                                                     
method return sender=:1.26 -> dest=:1.514 reply_serial=538                     
   int32 0                                                                     
method return sender=:1.26 -> dest=:1.514 reply_serial=539                     
   int32 0                                                                     
method call sender=:1.514 -> dest=org.kde.knotify serial=540 path=/Notify; interface=org.kde.KNotify; member=event                                            
   string "new"                                                                
   string "kwin"                                                               
   array [                                                                     
   ]                                                                           
   string ""                                                                   
   string ""                                                                   
   array [                                                                     
   ]                                                                           
   array [                                                                     
   ]                                                                           
   int32 -1                                                                    
   int64 0                                                                     
method return sender=:1.26 -> dest=:1.514 reply_serial=540                     
   int32 0                                                                     
method call sender=:1.514 -> dest=org.kde.knotify serial=541 path=/Notify; interface=org.kde.KNotify; member=event                                            
   string "activate"                                                           
   string "kwin"                                                               
   array [                                                                     
   ]                                                                           
   string ""                                                                   
   string ""                                                                   
   array [                                                                     
   ]                                                                           
   array [                                                                     
   ]                                                                           
   int32 -1                                                                    
   int64 0                                                                     
method return sender=:1.26 -> dest=:1.514 reply_serial=541                     
   int32 0                                                                     
method call sender=:1.420 -> dest=org.freedesktop.DBus serial=312 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner             
   string "org.kde.kded"                                                       
method call sender=:1.420 -> dest=org.freedesktop.DBus serial=313 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner             
   string "org.freedesktop.DBus"                                               
method call sender=:1.420 -> dest=org.kde.kded serial=314 path=/modules/powerdevil; interface=org.kde.PowerDevil; member=suspend                              
   int32 2                                                                     
method call sender=:1.514 -> dest=org.kde.knotify serial=542 path=/Notify; interface=org.kde.KNotify; member=event                                            
   string "delete"                                                             
   string "kwin"                                                               
   array [                                                                     
   ]                                                                           
   string ""                                                                   
   string ""                                                                   
   array [                                                                     
   ]                                                                           
   array [                                                                     
   ]                                                                           
   int32 -1                                                                    
   int64 0                                                                     
method return sender=:1.26 -> dest=:1.514 reply_serial=542                     
   int32 0                                                                     
method return sender=:1.18 -> dest=:1.420 reply_serial=314                     
method call sender=:1.514 -> dest=org.kde.knotify serial=543 path=/Notify; interface=org.kde.KNotify; member=event                                            
   string "activate"                                                           
   string "kwin"                                                               
   array [                                                                     
   ]                                                                           
   string ""                                                                   
   string ""                                                                   
   array [                                                                     
   ]                                                                           
   array [                                                                     
   ]                                                                           
   int32 -1                                                                    
   int64 0                                                                     
method return sender=:1.26 -> dest=:1.514 reply_serial=543                     
   int32 0                                                                     
method call sender=:1.514 -> dest=org.kde.knotify serial=544 path=/Notify; interface=org.kde.KNotify; member=event                                            
   string "new"                                                                
   string "kwin"                                                               
   array [                                                                     
   ]                                                                           
   string ""                                                                   
   string ""                                                                   
   array [                                                                     
   ]                                                                           
   array [                                                                     
   ]                                                                           
   int32 -1                                                                    
   int64 0                                                                     
method call sender=:1.514 -> dest=org.kde.knotify serial=545 path=/Notify; interface=org.kde.KNotify; member=event                                            
   string "activate"                                                           
   string "kwin"                                                               
   array [                                                                     
   ]                                                                           
   string ""                                                                   
   string ""                                                                   
   array [                                                                     
   ]                                                                           
   array [                                                                     
   ]                                                                           
   int32 -1                                                                    
   int64 0                                                                     
method return sender=:1.26 -> dest=:1.514 reply_serial=544                     
   int32 0                                                                     
method return sender=:1.26 -> dest=:1.514 reply_serial=545                     
   int32 0                                                                     
method call sender=:1.420 -> dest=org.freedesktop.DBus serial=315 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner             
   string "org.kde.kded"                                                       
method call sender=:1.420 -> dest=org.freedesktop.DBus serial=316 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner             
   string "org.freedesktop.DBus"                                               
method call sender=:1.420 -> dest=org.kde.kded serial=317 path=/modules/powerdevil; interface=org.kde.PowerDevil; member=suspend
   int32 2
method return sender=:1.18 -> dest=:1.420 reply_serial=317
method call sender=:1.514 -> dest=org.kde.knotify serial=546 path=/Notify; interface=org.kde.KNotify; member=event
   string "delete"
   string "kwin"
   array [
   ]
   string ""
   string ""
   array [
   ]
   array [
   ]
   int32 -1
   int64 0
method return sender=:1.26 -> dest=:1.514 reply_serial=546
   int32 0
method call sender=:1.514 -> dest=org.kde.knotify serial=547 path=/Notify; interface=org.kde.KNotify; member=event
   string "activate"
   string "kwin"
   array [
   ]
   string ""
   string ""
   array [
   ]
   array [
   ]
   int32 -1
   int64 0
method return sender=:1.26 -> dest=:1.514 reply_serial=547
   int32 0
^C%
Comment 1 Andrey Borzenkov 2009-12-10 18:12:50 UTC
It is probably not widget but kded module problem, because even calling method directly does nothing:

{pts/2}% qdbus org.kde.kded /modules/powerdevil org.kde.PowerDevil.suspend 2

Nothing happens.

method call sender=:1.188 -> dest=org.kde.kded serial=11 path=/modules/powerdevil; interface=org.kde.PowerDevil; member=suspend
   int32 2
method return sender=:1.16 -> dest=:1.188 reply_serial=11
Comment 2 Lengyel Sándor 2010-01-16 07:45:47 UTC
Just for info:
I run kde 4.3.4 on hentoo. pm-utils are installed.
I have the same problem.
I tried it with and without gnome power management.
If I use gnome  and gnome power management, suspend works.
Comment 3 Andrey Borzenkov 2010-01-16 07:53:10 UTC
On Mandriva it has apparently been fixed with consolekit update. At least I have not seen this issue since then.
Comment 4 Lengyel Sándor 2010-01-16 08:09:31 UTC
Thank you for the idea. I works now. But for me I had to do a consolekit downgrade.
 I used consolekit 0.4.1 (Unstable?) and it failed.
Downgraded to consolekit 1.3.0-r2 and now suspend works.
Comment 5 Lengyel Sándor 2010-01-16 11:38:52 UTC
It seems it is not really consolekit 0.4.1 problem, rather it is a question of permitions. 
Taking a comment from gentoo,

"------- Comment  #6 From Thomas Kahle 2009-12-15 20:14:18 0000  -------  
Ok, after some tideous investigation I solved this one.
It is a policy issue. My user is not allowed to suspend the computer. 
This can be changed by root if he starts up the kde system settings and then
under "Advanced->PolicyKit Authorization" identifies the correct entries under
org.freedesktop and sets them to an appropriate value. 
For instance 
org.freedesktop.hal.power-management.suspend 
should have the implicit authorization "anyone -> Yes" to make powerdevil work
again. I have no idea what triggered this change in my systems configuration. 

Now, it seems like a configuration issue, where the package maintainer of these
rules should decide upon standard values, like whether users are allows to
suspend the system." 

and giving an implicit or in my case an explicit permission to suspend, powerdevil works fine for me.
So it is not a real bug. But it would be nice if  the kde program to inform me that I do not have permission, and maybe a recommandation for the solution, so I do not spend 2 days to find a problem. :-)
Comment 6 simply_bugz 2010-01-23 04:59:05 UTC
KDE 4.4 RC1 using ubuntu lucid on Asus eeepc 901

Suspend button  works all the time but when close the lid it might suspend but usually decides not to. Quite often it select wrong profile and locks the system instead of suspend. I have no means to predict its behaviour.

To clarify the situation:
It seems that something is really broken but not sure what. The power applet tells me I have no battery or that power cable is or isn't plugged in which often has nothing to do with the reality and often my netbook dies without warning because it decides I have no battery for no reason. Right on a fresh boot it tells me I have two batteries one 79% charged and the other 100% (I have only one battery)

PS:
none of this was an issue with kde4.3 on ubuntu karmic
Comment 7 Sebastian Kügler 2010-01-30 02:16:18 UTC
*trying* to assign to powerdevil (hi dario!)
Comment 8 Sebastian Kügler 2010-01-30 02:17:04 UTC
and now for real to powerdevil (sorry for the noise guys)