advantages of DeviceKit support
#1
Question 
Hi all, Hi Topfs,

i would know if i have advantages when i am build XBMC with DeviceKit support? Can i use all functions from XBMC now and in the near future also without DeviceKit or is there a plan to make XBMC depend on DeviceKit?
greetings, Stephan

Image

Image
Reply
#2
DeviceKit is just a dbus interface for certain parts. Like HAL

So we use DeviceKit.Power will be used for battery info and Suspend and such.
DeviceKit.Disks is used to get disks and opticaldrives.

The idea is to still be backwards compatbible and all places DeviceKit is used it's abstracted. So for example for HDDs we try devicekit.disks, then HAL then parse pmount. so in last case we won't be able to mount (not coded yet atleast) but nearly all functionality is still there.

Although this abstraction will never force root and must work without root.
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
#3
in the moment i have an alternative automounter based on hal/dbus so it is possible with devicekit to remove this automounter and let xbmc mount all drives that i plugged via usb?

i ask because i try to implement devicekit in my embedded distro, but this is an horror ;-). i have still various problems with xbmc, so i cant provide an almost working "prerelease" at this time. i dont know if i can eventually fix various problems with devicekit.
greetings, Stephan

Image

Image
Reply
#4
Yup exactly, if you have XBMC and run it as --standalone then you can skip the other mounter.

If you have a hard time getting devicekit in, you can use that automounter and let XBMC not mount, it will then parse mount and work the same (except it won't know which are removable and not so none will be autosourced, but all will be available in browse).

There is a bit of a bug in the abstraction, so it won't fallback perfectly, I'm fixing it right now and it will be available before camelot goes stable.
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
#5
ok, that is an answer :-) thank you! i will try to implement devicekit.

one big problem is that i dont can play dvds/cds.
another "problem" is i dont see any output in System-info/Storage,Hard-disk and DVDROM.
because my internal dvdrom has an defect i have an usb dvdrom attached. when it is not attached xbmc dont start, if it attached xbmc starts and run stable - i dont know if this an bug in xbmc or with my distro. do you have an idea? i can test this next week if i have my new internal dvd.
greetings, Stephan

Image

Image
Reply
#6
About USB DVD it's a bug probably, or not used scenerio. DeviceKit and HAL both will fix this, when I get around in adding optical to them (probably won't be for camelot but soon after.)
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
#7
thank you Rolleyes

but xbmc without any optical drive must be working? Huh
greetings, Stephan

Image

Image
Reply
#8
Ofcourse. I explained it abit badly sorry.

HAL can autosource optical drives, which doesn't work perfect (bad implementation by me).

So all cd reading and the sourcing of CDs is done by libcdio which we have used since before hal, so it works to play, browse and all that.

Now we have an abstracted layer so XBMC won't really care if the drives come from HAL, DeviceKit or just parsed via mount. This layer haven't recieved optical support as of yet, so XBMC can still read optical like before (adding via browse dialog and choose CD). but this will change soon were our abstraction wlll support optical. Then HAL and devicekit can provide the optical mount points and such. Then USB Optical will work even if added after xbmc launch. The major work is done it's mostly a bit big of change to add before camelot.

That change will also get us nearer to multiple optical drives support.
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
#9
Question 
Hi Topfs,

the last days i have tryed to include DeviceKit-disks and ConsoleKit in my distro but i have some problems with this. O.k. more later...

because HAL will be depecrated in the Future i am thinking of dropping HAL in my Distro. I have this done with xorg-server successfull. Yesterday i have written an patch to let XBMC build without installed HAL. This is easy but XBMC does not work eventually because ConsoleKit does not work for me. I am becoming errors like:

17:00:41 T:1024 M:2032259072 DEBUG: DBus: Creating message to org.freedesktop.ConsoleKit on /org/freedesktop/ConsoleKit/Manager with interface org.freedesktop.ConsoleKit.Manager and method CanStop

17:01:06 T:1024 M:2031837184 DEBUG: ConsoleKit.Manager: org.freedesktop.DBus.Error.NoReply - Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

17:01:06 T:1024 M:2031837184 DEBUG: DBus: Creating message to org.freedesktop.DeviceKit.Disks on /org/freedesktop/DeviceKit/Disks with interface org.freedesktop.DeviceKit.Disks and method EnumerateDevices

then xbmc exits.

My Questions:
- for what needs xbmc ConsoleKit
- can xbmc also work without ConsoleKit but with DeviceKit-disks if i have also no HAL support (not installed) in the distro?
- i see no reason to install HAL if i have an working DeviceKit-disks support so can we add an configure option to disable build with HAL support (Patch for this i have created - but xbms dont start with this but i.e. Apple build also dont use HAL)
greetings, Stephan

Image

Image
Reply
#10
Well DeviceKit.Power is used for suspend and hibernate, but to be able to shutdown and reboot we need ConsoleKit.

I guess we can make it so that one of them is only needed, will need to think abit on the implementation for that. I'd still suggest you to add ConsoleKit though Smile

EDIT: XBMC should not need ConsoleKit for disks, so it will generate disks but it won't be able to handle power without console kit.
EDIT2: To not build with hal should only be to undefine HAS_HAL and fix so that the configure doesn't check for it.
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
#11
topfs2 Wrote:Well DeviceKit.Power is used for suspend and hibernate, but to be able to shutdown and reboot we need ConsoleKit.

in the moment i dont need this powersave things...
the problem is when i am build xbmc with hal it starts and works, except when i am unplug an usb device or remove the cd the mountpoint will be not deleted, but when i am build without hal but i have Consolekit/DeviceKit-disks it doesnt start (i see only the splash and xbmc restarts - the last entry in logfile are this from consolekit. i also have this entrys if i build and run with HAL+ CK+DKd but then runs). i think it is because consolekit is not working for me. i tryed this now for days but i cant find my problem with consolekit. devicekit-disks found my devices, but xbmc does they not mount...

topfs2 Wrote:I guess we can make it so that one of them is only needed, will need to think abit on the implementation for that. I'd still suggest you to add ConsoleKit though Smile


because i have no login or any users (except for the services) on my system i dont understand what CK does... the next problem is, because i use busybox i have not all programs for usermanagement on my system or only any "light" versions of this...

topfs2 Wrote:EDIT2: To not build with hal should only be to undefine HAS_HAL and fix so that the configure doesn't check for it.

this i have do but i dont know if there any code that prevents run of xbmc (for me). i can you send my patch later today for an revisit
greetings, Stephan

Image

Image
Reply
#12
The check if DeviceKit.Disks and DeviceKit.Power exists aren't mutually exclusive. So you can for sure have HALDisks and DeviceKit.Power, this is by design.

So if you don't have hal or consolekit but you have DeviceKit.Disks you'll get DiskManagement with devicekit.disks and nothing in the powerdepartment. I'll take a look at not needing ConsoleKit but for your distro it should work as DeviceKit.Disks but nothin in power.

If this doesn't work as supposed please provide a log (and ticket with me cc'd) and I'll take a closer look.

Cheers,
Tobias
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
#13
Question 
Hi Tobias,

i have updated my distro to using udisks as an HAL/DeviceKit-disks replacement. And after the update automounting of USB drives works for me the first time without problems! Very nice!

Now i have an question: It is possible to run my distro from any USB stick or USB drive. if i run from this Stick any other USB drives will be mounted by udisks to /media. But any internally (SATA/IDE) drives will not mount. Is it possible to change XBMC in standalone mode to mount also all not already mounted partitions from internally drives to /media?

thanks
greetings, Stephan

Image

Image
Reply
#14
openelec.tv Wrote:i have updated my distro to using udisks as an HAL/DeviceKit-disks replacement. And after the update automounting of USB drives works for me the first time without problems! Very nice!

Tobias, forgot this. It works now with HAL again, because i have changed to udisks. I think XBMC needs some changes to support udisks too (for example org.freedesktop.DeviceKit.Disks are now org.freedesktop.UDisks)

openelec.tv Wrote:Now i have an question: It is possible to run my distro from any USB stick or USB drive. if i run from this Stick any other USB drives will be mounted by udisks to /media. But any internally (SATA/IDE) drives will not mount. Is it possible to change XBMC in standalone mode to mount also all not already mounted partitions from internally drives to /media?
thanks
greetings, Stephan

Image

Image
Reply
#15
Question 
Tobias and others,

What do you think of support for automount dirctly via udev (libudev) instead support and maintenence HAL, DeviceKit-disk (oldAPI), DeviceKit-disk (newAPI) and udisks?

udev are installed on every recent Linux System and HAL, DeviceKit-disks and udev depends also on HAL.

you can find an standalone automounter based on udev here (for inspiration)

http://sources.openelec.tv/tmp/source/automountd.c
greetings, Stephan

Image

Image
Reply

Logout Mark Read Team Forum Stats Members Help
advantages of DeviceKit support0