How does xbmc call suspend?
#1
Hi All:

Can someone please tell me how xbmc goes into suspend when you push the button on the remote or select suspend from the exit menu?
It must call up a script or something that puts the computer into suspend. I was hoping someone could tell me the name and location of that script.
Ubuntu 14.04 and xbmc Gotham.
Thanks to all.
Reply
#2
/etc/pm/sleep.d

BR
Janusz
Reply
#3
depends on which methods are available on the target system: logind, upower, consolekit...
see https://github.com/yasij/xbmc/blob/login...er.cpp#L73
Reply
#4
okay thanks guys.
I was going to try and create a way for mythtv to use the built in suspend of xbmc but it does not seem that simple.
thanks for the info.
Reply
#5
You can trigger xbmcs suspend function via jsonrpc or xbmc-send.
Reply
#6
(2014-07-21, 17:04)teeedubb Wrote: You can trigger xbmcs suspend function via jsonrpc or xbmc-send.

Okay, but xbmc needs to be running for that to be true yes?
Appreciate the help.
Reply
#7
Most of the ways use dbus. Which you can invoke via dbus-send.
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#8
Okay thanks for the info.
I will try and figure out the dbus method.
Appreciate the info.
Reply
#9
Here is the UPower sleep message as an example. https://github.com/xbmc/xbmc/blob/master...l.cpp#L117
Which if memory serves me correctly
dbus-send --system org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#10
I am testing over ssh right now so I cant be sure but I believe this one will work.
dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend

I get this error but I believe it is caused from using ssh
Error org.freedesktop.UPower.GeneralError: not authorized

With the one you suggest I get the following error.
Must use org.mydomain.Interface.Signal notation, no dot in "/org/freedesktop/UPower"
Reply
#11
This is what works for me in xbmcbuntu13

Code:
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Suspend
Reply
#12
This worked for me.

dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend

Thank you to all for helping out a novice like me. It is really apreciated.
Reply

Logout Mark Read Team Forum Stats Members Help
How does xbmc call suspend?0