No way to advertise an interface?

Anders Feder anders.feder.83 at gmail.com
Tue Sep 28 19:27:21 UTC 2021


MPRIS <https://specifications.freedesktop.org/mpris-spec/latest/> defines a
standard D-Bus interface for controlling media players. For clients to be
able to discover services that implement the interface, the MPRIS
specification requires each media player to request a unique bus name which
begins with the prefix "org.mpris.MediaPlayer2". Clients like playerctl
<https://github.com/altdesktop/playerctl> then invoke the
org.freedesktop.DBus.ListNames method exposed by the message bus daemon to
acquire a list of all currently running services on the bus and filter it
to get all services whose name begin with the aforementioned prefix.

This to me seems like bad practice: The whole purpose of interface
namespaces is to prevent naming collisions. This is supposed to be
accomplished by the notional owner of the namespace controlling which names
are minted in the namespace. But the MPRIS standard relinquishes this
control and tacitly gives anyone permission to take whatever name they want
in the "org.mpris.MediaPlayer2" namespace, without any control for naming
collisions.

Is there no better way to implement this kind of discoverability on D-Bus?
Services can advertise their desired bus name in D-Bus services files. Is
there no similar way to advertise what interfaces they support? If not, is
this something that has been considered and rejected for some reason?

Regards,
Anders Feder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dbus/attachments/20210928/3741f7d3/attachment.htm>


More information about the dbus mailing list