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.42k stars 79 forks source link

Connection to player failed: No players found #107

Closed LinArcX closed 4 years ago

LinArcX commented 5 years ago

Hello. i want to control rhythmbox from i3 config file. add these two lines to that file, but i can not control it's behaviour.(like stop, start, play next track and so on..):

/mnt/D/music ❯❯❯ playerctl play-pause
Connection to player failed: No players found
acrisci commented 5 years ago

Try listing the names on the bus and see if rhythmbox shows up in the list.

dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames
LinArcX commented 5 years ago
method return time=1542741051.178321 sender=org.freedesktop.DBus -> destination=:1.37 serial=3 reply_serial=2                                          
   array [                                                                                                                                             
      string "org.freedesktop.DBus"                                                                                                                    
      string ":1.7"                                                                                                                                    
      string ":1.8"                                                                                                                                    
      string "org.freedesktop.network-manager-applet"                                                                                                  
      string ":1.9"                                                                                                                                    
      string "org.Nemo"                                                                                                                                
      string "org.freedesktop.systemd1"                                                                                                                
      string "org.gtk.vfs.Daemon"                                                                                                                      
      string "org.pulseaudio.Server"                                                                                                                   
      string "com.deepin.terminal"                                                                                                                     
      string "org.gtk.vfs.mountpoint_12298"                                                                                                            
      string "org.mpris.MediaPlayer2.rhythmbox"                                                                                                        
      string "org.a11y.Bus"                                                                                                                            
      string "org.gtk.vfs.UDisks2VolumeMonitor"                                                                                                        
      string ":1.22"                                                                                                                                   
      string ":1.23"                                                                                                                                   
      string ":1.24"                                                                                                                                   
      string ":1.25"                                                                                                                                   
      string ":1.26"                                                                                                                                   
      string ":1.27"                                                                                                                                   
      string "org.gtk.vfs.GPhoto2VolumeMonitor"                                                                                                        
      string "ca.desrt.dconf"                                                                                                                          
      string ":1.29"
      string "org.freedesktop.ReserveDevice1.Audio0"
      string "org.freedesktop.FileManager1"
      string "org.PulseAudio1"
      string "org.gnome.Synapse"
      string "org.gnome.zeitgeist.Engine"
      string "org.gtk.vfs.Metadata"
      string ":1.30"
      string ":1.32"
      string ":1.10"
      string "org.gnome.Rhythmbox3"
      string ":1.33"
      string ":1.11"
      string ":1.34"
      string ":1.12"
      string ":1.35"
      string ":1.0"
      string ":1.13"
      string ":1.36"
      string "org.mozilla.firefox.ZGVmYXVsdA__"
      string ":1.1"
      string ":1.14"
      string ":1.37"
      string ":1.15"
      string "org.gnome.zeitgeist.datahub"
      string ":1.3"
      string "org.gtk.vfs.MTPVolumeMonitor"
      string ":1.4"
      string ":1.17"
      string "org.gnome.zeitgeist.SimpleIndexer"
      string ":1.5"
      string ":1.18"
      string ":1.6"
      string ":1.19"
      string "org.freedesktop.Telepathy.Client.Zeitgeist"
   ]
acrisci commented 5 years ago

You have the right name listed on the bus: string "org.mpris.MediaPlayer2.rhythmbox".

One thing that might go wrong is if the player doesn't set CanPlay or CanControl correctly. New in 2.0.1 is the player will be considered not present if it cannot support the command.

Try this command to see if those properties are set correctly:

dbus-send --print-reply --type=method_call --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.GetAll string:'org.mpris.MediaPlayer2.Player'
LinArcX commented 5 years ago
method return time=1542879478.482391 sender=:1.37 -> destination=:1.39 serial=129 reply_serial=2                                                       
   array [                                                                                                                                             
      dict entry(                                                                                                                                      
         string "PlaybackStatus"                                                                                                                       
         variant             string "Playing"                                                                                                          
      )                                                                                                                                                
      dict entry(                                                                                                                                      
         string "LoopStatus"                                                                                                                           
         variant             string "None"                                                                                                             
      )                                                                                                                                                
      dict entry(                                                                                                                                      
         string "Rate"                                                                                                                                 
         variant             double 1                                                                                                                  
      )                                                                                                                                                
      dict entry(                                                                                                                                      
         string "Shuffle"                                                                                                                              
         variant             boolean false                                                                                                             
      )                                                                                                                                                
      dict entry(                                                                                                                                      
         string "Metadata"                                                                                                                             
         variant             array [                                                                                                                   
               dict entry(                                                                                                                             
                  string "mpris:trackid"                                                                                                               
                  variant                      string "/org/mpris/MediaPlayer2/Track/75"                                                               
               )                                                                                                                                       
               dict entry( 
string "xesam:url"
                  variant                      string "file:///home/linarcx/Downloads/Telegram%20Desktop/Ali%20Lohrasbi%20-%20Khodahafez.mp3"
               )
               dict entry(
                  string "xesam:title"
                  variant                      string "Khodahafez"
               )
               dict entry(
                  string "xesam:artist"
                  variant                      array [
                        string "Ali Lohrasbi"
                     ]
               )
               dict entry(
                  string "xesam:album"
                  variant                      string "Unknown"
               )
               dict entry(
                  string "xesam:genre"
                  variant                      array [
                        string "Unknown"
                     ]
               )
               dict entry(
                  string "xesam:lastUsed"
                  variant                      string "2018-11-20T19:13:27Z"
               )
               dict entry(
                  string "mpris:length"
                  variant                      int64 227000000
               )
               dict entry(
                  string "xesam:trackNumber"
                  variant                      int32 0
               )
dict entry(
                  string "xesam:useCount"
                  variant                      int32 4
               )
               dict entry(
                  string "xesam:userRating"
                  variant                      double 0
               )
            ]
      )
      dict entry(
         string "Volume"
         variant             double 0.888885
      )
      dict entry(
         string "Position"
         variant             int64 5000000
      )
      dict entry(
         string "MinimumRate"
         variant             double 1
      )
      dict entry(
         string "MaximumRate"
         variant             double 1
      )
      dict entry(
         string "CanGoNext"
         variant             boolean true
      )
dict entry(
         string "CanGoPrevious"
         variant             boolean true
      )
      dict entry(
         string "CanPlay"
         variant             boolean true
      )
      dict entry(
         string "CanPause"
         variant             boolean true
      )
      dict entry(
         string "CanSeek"
         variant             boolean true
      )
      dict entry(
         string "CanControl"
         variant             boolean true
      )
   ]
acrisci commented 5 years ago

Everything looks fine and I can't reproduce it on my machine, but I don't doubt there is an issue somewhere. I'll need to add debug logging to the cli to investigate further

pvx- commented 5 years ago

I have the same problem on dwm with mpv and playerctl 2.0.2; it may be something window manager related in new version, playerctl 0.6.x works without problems. When running playerctl status I also get segmentation fault after the No players found message.

My dbus command output (properties output looks almost exactly the same as above)

$ dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames
method return time=1560522469.956742 sender=org.freedesktop.DBus -> destination=:1.75695 serial=3 reply_serial=2
   array [
      string "org.freedesktop.DBus"
      string "org.a11y.Bus"
      string ":1.3"
      string ":1.75695"
      string "org.mpris.MediaPlayer2.mpv"
      string ":1.75666"
      string ":1.4"
      string ":1.1"
      string "org.gnome.GConf"
      string ":1.2"
   ]

If you need any other info to debug this, just let me know.

Vaishnavikumara commented 5 years ago

I am facing the same issue . Please help

timmc commented 4 years ago

Note: I had the same "No players found" problem, but did not see the appropriate application listed from the dbus call (only org.gnome.Rhythmbox3). After enabling the "MPRIS D-Bus Interface" plugin in Rhythmbox, org.mpris.MediaPlayer2.rhythmbox also appeared. Maybe that will help someone get a little further.

richardpickett commented 4 years ago

playerctl 2.0.2, ubuntu 20.04.

my rhythmbox has "CanPlay" as true, but playerctl cannot "play" it.

If rhytmbox is playing, playerctl can stop/next/previous just fine. Just can't "play" if not playing.

This does start the play: dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause

acrisci commented 4 years ago

@richardpickett the latest version is 2.1.1.

I cannot reproduce this with rhthmbox 3.4.4, the play-pause command works fine.

Try with the latest playerctl version. If it doesn't work, open a new issue and provide a debug log for further discussion.

acrisci commented 4 years ago

This issue is kind of old so I'm going to close it. Open a new issue if you have this problem and I'll help you there.