altdesktop / playerctl

🎧 mpris media player command-line controller for vlc, mpv, RhythmBox, web browsers, cmus, mpd, spotify and others.
GNU Lesser General Public License v3.0
2.47k stars 80 forks source link

mopidy : no player found #231

Open cedricdekimpe opened 3 years ago

cedricdekimpe commented 3 years ago

The player I am using is mopidy.

I installed the mopidy-mpris plugin and it is enabled

# mopidyctl config
...
[mpris]
enabled = true
bus_type = session # i aslo tried "system" 
...

When I try a playerctl command, i receive the "No players found" error.

Mopidy doesn't appear in the result of the following command :

dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames

method return time=1616756171.755657 sender=org.freedesktop.DBus -> destination=:1.69 serial=3 reply_serial=2
   array [
      string "org.freedesktop.DBus"
      string "org.freedesktop.Notifications"
      string ":1.50"
      string ":1.62"
      string ":1.51"
      string ":1.52"
      string "org.a11y.Bus"
      string "org.freedesktop.systemd1"
      string ":1.64"
      string ":1.53"
      string ":1.20"
      string ":1.65"
      string ":1.54"
      string ":1.10"
      string "org.gnome.keyring"
      string ":1.55"
      string "org.awesomewm.awful"
      string ":1.45"
      string ":1.46"
      string ":1.0"
      string "org.gtk.vfs.Daemon"
      string ":1.69"
      string ":1.47"
      string "org.PulseAudio1"
      string "org.pulseaudio.Server"
      string "org.freedesktop.secrets"
      string ":1.48"
      string ":1.49"
      string ":1.4"
      string ":1.5"
      string ":1.19"
   ]

Versions :

mopidy 3.1.1-1 Mopidy-MPRIS 3.0.3 playerctl 2.3.1-1

acrisci commented 3 years ago

If it doesn't show up in that list, there's no way I can interact with the player. Check your configuration and if you still think it's an issue, open it up on the project for the player.

Jarvvski commented 3 years ago

@cedricbousmanne

You need to run it on the system bus_type, then setup the config file as described in the readme

Specifically (but always check the above URL as it could always change):

To solve this, create the file /etc/dbus-1/system.d/org.mpris.MediaPlayer2.mopidy.conf with the following contents:

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
  <!-- Allow mopidy user to publish the Mopidy-MPRIS service -->
  <policy user="mopidy">
    <allow own="org.mpris.MediaPlayer2.mopidy"/>
  </policy>

  <!-- Allow anyone to invoke methods on the Mopidy-MPRIS service -->
  <policy context="default">
    <allow send_destination="org.mpris.MediaPlayer2.mopidy"/>
    <allow receive_sender="org.mpris.MediaPlayer2.mopidy"/>
  </policy>
</busconfig>

If you run Mopidy as another user than mopidy, you must update user="mopidy" in the above file accordingly.

image