Shairport-sync: Problem with D-Bus interface [Resolved]

Created on 13 Aug 2018  ·  19Comments  ·  Source: mikebrady/shairport-sync

Hi,

today I built shairport-sync with D-Bus inerface enabled. When I start shairport I get the following error:

Could not acquire a Shairport Sync native D-Bus interface "org.gnome.ShairportSync.i790" on the system bus.

On a different system with an older version of shairport-sync it is working.

Thomas

All 19 comments

Hi Thomas. I presume you followed the normal sequence ending with make and sudo make install. Apart from installing Shairport Sync, a set of permissions is installed to allow Shairport Sync to provide the D-Bus service on the system bus, but only if it is running under the user and group shairport-sync. It doesn't need any permission to start a service on the session bus of the logged-in user, but many Linuxes (e.g. Raspbian Lite) do not provide a session bus.

Hi,

thank you for your hint. After I did the following:

# cp /usr/local/etc/dbus-1/system.d/shairport-sync-dbus.conf /etc/dbus-1/system.d/

it is working now.

Regards
Thomas

Thanks. What OS are you running on, please?

I am running the latest version of Raspbian.

$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"

Many thanks. I must look into that oddness.

Is is possible that you did not set the sysconfdir to /etc in the ./configure step?

I checked my history and you are right I did not set the sysconfigdir. Because of that I also had to create the /usr/local/etc/dbus-1/system.d/ dir in order to run make install without errors.

That's great thanks -- mystery solved.

@mikebrady I didn't do the build locally; I pulled down the package on my Ubuntu raspberry pi install. I am receiving this message. Any thoughts on where to go from here? I don't have any content under the /usr/local/etc/... folder.

shairport-sync.service - ShairportSync AirTunes receiver
     Loaded: loaded (/lib/systemd/system/shairport-sync.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2020-10-21 20:33:07 UTC; 5min ago
       Docs: man:shairport-sync(7)
             file:///usr/share/doc/shairport-sync/README.md.gz
             https://github.com/mikebrady/shairport-sync
   Main PID: 5005 (shairport-sync)
      Tasks: 16 (limit: 4436)
     CGroup: /system.slice/shairport-sync.service
             └─5005 /usr/bin/shairport-sync

Oct 21 20:33:07 audio-server systemd[1]: Started ShairportSync AirTunes receiver.
Oct 21 20:33:07 audio-server shairport-sync[5005]: Could not acquire a Shairport Sync native D-Bus interface "org.gnome.ShairportSync.i5005" on the system >
Oct 21 20:33:07 audio-server shairport-sync[5005]: Could not acquire an MPRIS interface named "org.mpris.MediaPlayer2.ShairportSync.i5005" on the system bu

Thanks for the post. Can I ask if you tried restarting the device? The D-Bus system needs to read the security policy for Shairport Sync before it is allowed to provide the service and the only way I know to force it is to restart.

@mikebrady I just did a restart and get the same message. It doesn't, outwardly, appear to affect operations. Is this something that is impacting functionality?

Thanks for the update. It does not affect functionality at all, unless you wish to use some of the remote control facilities, so I wouldn't worry about it. It might be worth checking back through some of the closed issues -- it rings a faint bell -- but it is harmless.

Just by the way, does the file /etc/dbus-1/system.d/shairport-sync-dbus.conf exist? And if so, could you post its contents here, please?

...and maybe the output from $ ps aux | grep shair, please?

That file does not exist. Here is the output from the above request.

shairpo+    1762  0.6  0.2 638772 11128 ?        Ssl  07:59   0:18 /usr/bin/shairport-sync
<redact>       4936  0.0  0.0   7684   648 pts/0    S+   08:46   0:00 grep --color=auto shair

Thanks. If you felt like it, you could try creating the file /etc/dbus-1/system.d/shairport-sync-dbus.conf with the following contents in it -- it's the security policy, and it should have been installed:

<!-- initial version, based on /etc/dbus-1/system.d/avahi-dbus.conf, with thanks -->
<!DOCTYPE busconfig PUBLIC
          "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
          "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>

  <!-- Allow users "root" and "shairport-sync" to own the Shairport Sync service -->
  <policy user="root">
    <allow own="org.gnome.ShairportSync"/>
  </policy>
  <policy user="shairport-sync">
    <allow own="org.gnome.ShairportSync"/>
  </policy>


  <!-- Allow anyone to invoke methods on Shairport Sync server -->
  <policy context="default">
    <allow send_destination="org.gnome.ShairportSync"/>
    <allow receive_sender="org.gnome.ShairportSync"/>
  </policy>

</busconfig>

You'll have to have supervisor privileges, and its permissions and ownership should look like this:

-rw-r--r-- 1 root root 747 Sep 30 14:55 shairport-sync-dbus.conf

As I mentioned previously, the fault is harmless, but this might just make it work properly.

That fixed one of the two issues! 👍 Thank you! Here is the output from systemctl.

● shairport-sync.service - ShairportSync AirTunes receiver
     Loaded: loaded (/lib/systemd/system/shairport-sync.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2020-10-22 09:05:01 PDT; 5s ago
       Docs: man:shairport-sync(7)
             file:///usr/share/doc/shairport-sync/README.md.gz
             https://github.com/mikebrady/shairport-sync
   Main PID: 6033 (shairport-sync)
      Tasks: 10 (limit: 4436)
     CGroup: /system.slice/shairport-sync.service
             └─6033 /usr/bin/shairport-sync

Oct 22 09:05:01 audio-server systemd[1]: Started ShairportSync AirTunes receiver.
Oct 22 09:05:01 audio-server shairport-sync[6033]: Could not acquire an MPRIS interface named "org.mpris.MediaPlayer2.ShairportSync.i6033" on the system bu

Excellent. The other problem is very similar -- the MPRIS service policy document is missing for some reason.
If you create another, similar, file at /etc/dbus-1/system.d/shairport-sync-mpris.conf with the following contents:

<!-- initial version, based on /etc/dbus-1/system.d/avahi-dbus.conf, with thanks -->
<!DOCTYPE busconfig PUBLIC
          "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
          "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>

  <!-- Allow users "root" and "shairport-sync" to own the Shairport Sync MPRIS service -->
  <policy user="shairport-sync">
    <allow own="org.mpris.MediaPlayer2.ShairportSync"/>
  </policy>
  <policy user="root">
    <allow own="org.mpris.MediaPlayer2.ShairportSync"/>
  </policy>

  <!-- Allow anyone to invoke methods on Shairport Sync MPRIS server -->
  <policy context="default">
     <allow send_destination="org.mpris.MediaPlayer2.ShairportSync"/>
    <allow receive_sender="org.mpris.MediaPlayer2.ShairportSync"/>
  </policy>

</busconfig>

With luck, that will resolve the second issue.

Done! :) All working! Thanks for the quick response and resolve 💯

Was this page helpful?
0 / 5 - 0 ratings

Related issues

janlei0524 picture janlei0524  ·  8Comments

Bazmundi picture Bazmundi  ·  6Comments

pawpawhe picture pawpawhe  ·  6Comments

jeong840 picture jeong840  ·  3Comments

choppedfish picture choppedfish  ·  8Comments