Systemd Power Management (Arch Linux users are currently screwed)
#1
Hey there,

currently XBMC uses the long unmaintained ConsoleKit for shutting down and rebooting. Arch Linux has recently dropped ConsoleKit from the official repositories, so power management doesn't work at all for Arch Linux users.

Unfortunately I could find neither a bug report nor any talk about this. Are there any plans to support systemd, or more specifically logind, for power management? More and more distributions will drop ConsoleKit in the long-term, so imho it would make perfect sense to support this.

see also:
https://www.archlinux.org/news/consoleki...by-logind/
http://www.freedesktop.org/wiki/Software/systemd/logind
https://bbs.archlinux.org/viewtopic.php?id=152113

thanks and best regards,
mus
Reply
#2
You'll very likely need to open a ticket on the bug tracker for a dev to see and know about this if it isn't there already.
Need help programming a Streamzap remote?
Reply
#3
While we don't use trac for feature requests anymore, this could be fairly seen as a bug since it will break usage in Arch Linux. So putting this up on Trac wouldn't be a bad idea.
Reply
#4
thanks for the responses, I created a ticket: http://trac.xbmc.org/ticket/13499
Reply
#5
we *can* use ConsoleKit, sure. but we can also use upower, devicekit-power, HAL, +++. we are already fed up with all the 10 gazillion version of this god damn dbus binding distros keep tossing into the mix. until a standard emerges, *for real*, you can carry your distro-specific version yourself.
Reply
#6
(2012-11-05, 19:31)spiff Wrote: we *can* use ConsoleKit, sure. but we can also use upower, devicekit-power, HAL, +++. we are already fed up with all the 10 gazillion version of this god damn dbus binding distros keep tossing into the mix. until a standard emerges, *for real*, you can carry your distro-specific version yourself.
I agree that there is kind of a mess regarding all the different *kit/whatever implementations, but I want to make a few points:

- systemd/logind is actually trying to standardize the linux desktop, it is in no way Arch Linux specific. It's just that Arch Linux is afaik the first distro which actually dared to completely drop ConsoleKit. A lot of other distros are switching to systemd and some linux software is even starting to depend on it (Gnome, polkit, udev etc.). Ubuntu is actually the only major distribution who said they don't want to switch (imho: the only reason being that they put a lot of effort into Upstart and don't want to admit that systemd is better). They will have no choice at some point, they can't keep patching ConsoleKit/Gnome and dozens of other packages forever. My point is: XBMC is going to have to support logind sooner or later, because more and more distributions will drop ConsoleKit over time.
- while I don't know if XBMC uses other features of upower, logind can replace its suspend/hibernate functionality. That would be one less dependency for distros running systemd/logind. Wink
- imho: devicekit and HAL have been deprecated for a long time and afaik neither is used by any current distribution, so you might just as well drop the code to clean up some of the mess.
Reply
#7
Hmm, I'm not 100% sure but I don't think there will be major churn here.

polkit (provided it's compiled against systemd) gives the correct info regarding suspend and resume and upower can talk to logind to trigger the suspend process.

Without knowing the code, most of the churn is in middleware. I doubt there will be too much impact here (obviously some changes are needed, I just don't think it'll be huge - and there are still some bugs in upower still shelling out to pm-* stuff even when it's compiled against systemd)
Reply
#8
(2012-11-09, 16:04)coling Wrote: Hmm, I'm not 100% sure but I don't think there will be major churn here.

polkit (provided it's compiled against systemd) gives the correct info regarding suspend and resume and upower can talk to logind to trigger the suspend process.

Without knowing the code, most of the churn is in middleware. I doubt there will be too much impact here (obviously some changes are needed, I just don't think it'll be huge - and there are still some bugs in upower still shelling out to pm-* stuff even when it's compiled against systemd)
In theory, suspend and hibernate should work since it is handled by upower. The problem is that the XBMC code checks for the existence of ConsoleKit and if it doesn't exist, it won't even try to use upower, although it would work.
logind could actually replace both ConsoleKit and upower regarding power management, since it provides dbus calls for poweroff, reboot, suspend and hibernate (and with the next version also the new hybrid-sleep mode introduced with kernel 3.6).

Reply
#9
Well we actually check for both ConsoleKit and UPower. Mostly since I was not aware there was an alternative to ConsoleKit. Ideally these providers should be decoupled then.
https://github.com/xbmc/xbmc/blob/master...l.cpp#L199

If you wish to do that (decouple them) then adding in systemd/logind or whatever would probably be easier. Could also put in hooks for python to make it even easier to handle distro specifics.
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
(2012-11-20, 11:27)topfs2 Wrote: If you wish to do that (decouple them) then adding in systemd/logind or whatever would probably be easier.

Please take a look at the pull request, it implements logind + UPower interface: https://github.com/xbmc/xbmc/pull/1801
Reply
#11
There is a PR on github for logind + upower https://github.com/xbmc/xbmc/pull/1801

So pull/merge that patch and compile to test.

uNi
Reply
#12
I noticed that this has been merged with beta2, thanks a lot for this, I didn't think this would still make it into Frodo. Smile
Reply

Logout Mark Read Team Forum Stats Members Help
Systemd Power Management (Arch Linux users are currently screwed)0