DBus deadlock with mpris player

Martin Klapetek martin.klapetek at gmail.com
Wed Aug 1 07:53:41 UTC 2012


Hi,

On Wed, Aug 1, 2012 at 4:02 AM, Simon Persson <simonpersson1 at gmail.com>wrote:

> **
>
> Hello!
>
>
>
> I'm the author of BoomBox, a phonon based music player with an mpris2
> interface.
>
>
>
> Lately it was taking ages to start my player, after several attempts at
> debugging this, only today did I find out that kde-telepathy (0.4.1) was
> causing this.
>

Thanks for contacting us about it.


> From the commit to boombox I just did:
>
>
>
> Kde telepathy has a mpris based "now playing" module running in the kded
>
> daemon, during boombox startup it detected a new player and started
>
> probing it. However, BoomBox was not ready to answer.. it was still
>
> going to do creation of other objects before going to the main loop.
>
> This creation (of phonon mediaobject and kio objects) needed to talk to
>
> services in kded, but kded was waiting for boombox. deadlock.
>
>  Resolve by creating mpris interface object last in startup phase.
>

We don't do any probing at all. Our service just sits there and waits for
dbus signals from the player (see the code at [1]) and even then we just
parse the dbus messages and we simply do nothing (and don't block) if we
find there's nothing we want (like song info or player state).

What KDE version are you using? There is a new mpris2 dataengine in Plasma
4.9 afaik, I have zero knowledge about its implementation, but maybe it was
that?

 So, I was able to fix this. Other programs may be trickier to reorganize
> (during debugging I observered that amarok has the same problem).
>
>
>
> I'm not sure where to point the blame here.. applications or ktp.. but
> maybe the kded module could sleep a few seconds after detecting a new mpris
> player before it starts probing it??
>

I'm quite positive that the blame is not on us ;) I will recheck our code
once again just to be sure. But I also think that players shouldn't
advertise themselves on the bus before they are ready to actually
communicate on the bus. So ultimately, it's the player's problem.

[1] -
http://quickgit.kde.org/index.php?p=ktp-kded-module.git&a=blob&h=8386dd9b3a7393e2c5b521452bda7141f7585738&hb=fb1dd9b080038a68ba49a5eca12c07ab1839bff2&f=telepathy-mpris.cpp

Cheers
--
Martin Klapetek | KDE Developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-telepathy/attachments/20120801/5721d652/attachment.html>


More information about the KDE-Telepathy mailing list