Coder Social home page Coder Social logo

mpdris2's Introduction

mpDris2

mpDris2 provide MPRIS 2 support to mpd (Music Player Daemon).

mpDris2 is run in the user session and monitors a local or distant mpd server.

Installation

Stable release

Download the latest release at https://github.com/eonpatapon/mpDris2/releases

tar zvxf mpDris2-X.X.tar.gz
cd mpDris2-X.X
./autogen.sh --sysconfdir=/etc
make install (as root)

From git

git clone git://github.com/eonpatapon/mpDris2.git
cd mpDris2
./autogen.sh --sysconfdir=/etc
make install (as root)

Logout/login from your session. Default prefix is /usr/local.

Configuration

By default, mpDris2 will try to connect to localhost:6600.

To set a different host or port copy the example configuration file /usr/[local]/share/doc/mpdris2/mpDris2.conf to ~/.config/mpDris2/mpDris2.conf.

Use the configuration to enable notifications and multimedia keys support (on the GNOME desktop).

You need also to set the music_dir option and have the Python mutagen module installed for mpDris2 to export covers paths in the MPRIS metadata.

Restart your session or mpDris2 after changing mpDris2.conf.

Sample configuration

[Connection]
host = 192.168.1.5
port = 6600
music_dir = /media/music/

[Bling]
notify = False
notify_paused = True
mmkeys = True
cdprev = True

[Notify]
urgency = 0
timeout = -1
summary =
body =
paused_summary =
paused_body =

mpdris2's People

Contributors

9ary avatar ammgws avatar aquaherd avatar arsenarsen avatar aveao avatar barbaross93 avatar bergentroll avatar bluetech avatar dsprenkels avatar eonpatapon avatar expectocode avatar ferdnyc avatar gitter-badger avatar gravemind avatar grawity avatar hdonnay avatar joshuatshaffer avatar kastdeur avatar lilyinstarlight avatar magejohn avatar mic92 avatar mirekdlugosz avatar pietrocarrara avatar pirateland avatar pritambaral avatar sanjayankur31 avatar smcv avatar udf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mpdris2's Issues

Systemd user service doesn't work

I'm trying to set up a systemd user service to work with gnome-shell-extensions-mediaplayer.

I can get mpDris2 to run through systemd, but the extension doesn't pick anything up. It does work when I just run mpDris2 from the command line.

Looking at the service status, the only difference I can see from just running the command is the following extra log:

2016-05-05 13:44:13,100 mpDris2 WARNING: Failed to connect to GNOME Settings Daemon. Media keys won't work.

When I try to monitor the bus:

gdbus monitor --session --dest org.mpris.MediaPlayer2.mpd

Instead of working with the running systemd mpDris2, it starts a new one (which works with the extension). Not sure what this means.

crash on startup when password is wrong

When starting mpDris2 0.7 on Ubuntu Linux 14.04 with 0.18.7-1 I get the following crash:

$ mpDris2 --debug
2016-07-01 21:24:57,026 mpDris2 INFO: Using file:///home/cweiske/Musik as music library path.
2016-07-01 21:24:57,027 mpDris2 INFO: Using Mutagen to read covers from music files.
2016-07-01 21:24:57,027 mpDris2 DEBUG: Using GObject-Introspection main loop.
2016-07-01 21:24:57,028 mpDris2 DEBUG: Initializing GObject.Notify
2016-07-01 21:24:57,040 mpDris2 WARNING: Failed to connect to GNOME Settings Daemon. Media keys won't work.
2016-07-01 21:24:57,043 mpDris2 DEBUG: Sending command 'password' (was idle? False)
2016-07-01 21:24:57,043 mpDris2 DEBUG: Trying to reconnect, got CommandError('[3@0] {password} incorrect password',)
2016-07-01 21:24:57,043 mpDris2 WARNING: Disconnected
Traceback (most recent call last):
  File "/usr/local/bin/mpDris2", line 1290, in <module>
    mpd_wrapper.run()
  File "/usr/local/bin/mpDris2", line 275, in run
    if self.my_connect():
  File "/usr/local/bin/mpDris2", line 290, in my_connect
    self.password(self._params['password'])
  File "/usr/local/bin/mpDris2", line 795, in fn
    return self.call(attr, *a, **kw)
  File "/usr/local/bin/mpDris2", line 810, in call
    self.reconnect()
  File "/usr/local/bin/mpDris2", line 362, in reconnect
    self._dbus_service.release_name()
AttributeError: 'bool' object has no attribute 'release_name'

This also happens with latest git master.

autogen.sh fail on ubuntu 12.04

Hello,

trying to build it on ubuntu 12.04, got this :

0:10 mathieu@kubrick ~/mpDris2 % ./autogen.sh               
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for a Python interpreter with version >= 2.5... python
checking for python... /usr/bin/python
checking for python version... 2.7
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.7/dist-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/dist-packages
./configure: line 2422: syntax error near unexpected token `0.26'
./configure: line 2422: `IT_PROG_INTLTOOL(0.26)'
zsh: exit 2     ./autogen.sh

can you help, please ?

Start through systemd

Hi, not really an issue but a rather a feature request: I'm trying to create a systemd unit file for this, instead of launching it from the autostart dir. However, mpDris2 always starts as root even when specifying a User and Group in the unit file, and thus it does not work.
Is it possible to specify a user and group within a conf file, like mpd or mpdscribble allows us to do? I tried looking into python-daemon but unfortunately I know nothing of python.
Thx in advance.

Autostard mpDris2 scripts

As mentioned here it would be good to have a mpDris2.service for systemd user integration like the below:

Description=Enabling mpDris2

[Service]
Type=dbus
ExecStart=mpDris2

or have information about how to start it from xdg autostart on the README.md

Handle deconnections in idle mode

The polling mode was handling network deconnections but with the idle method mpDris2 does not detect if the connection is lost.

Anyway mpDris2 does not crash on network deconection/reconnection and when network is back an event is sent on the socket so mpDris2 state is updated.

It would be nicer to detect that the network is gone and then release the dbus name close the socket connection etc...

Issue with song displaying

When using "action buttons" in the applet or through an external controller like mpc. The song displayed into applet doesn't change anymore.
But the data pass through the dbus-monitor and the applet create/show a notification about the new song played at the top of the screen.
In addition to that the seek system doesn't work also.

I found nothing interesting into dbus-monitor except maybe instruction for seeking

method return time=1455046443.605539 sender=:1.7 -> destination=:1.15 serial=139 reply_serial=795
   boolean true
method call time=1455046446.032168 sender=:1.15 -> destination=:1.65 serial=796 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=SetPosition
   object path "/org/mpris/MediaPlayer2/Track/1561"
   int64 254287392
method return time=1455046446.032582 sender=:1.65 -> destination=:1.15 serial=173 reply_serial=796

Crash when processing long song

If some long audio file is playing (e.g. audiobook or podcast) mpDris2 crashes with

Traceback (most recent call last):
  File "/usr/bin/mpDris2", line 551, in check_mpd_status
    root.update_property('org.mpris.MediaPlayer2.Player', 'Metadata')
  File "/usr/bin/mpDris2", line 431, in update_property
    self.PropertiesChanged(interface, {prop: value}, [])
  File "/usr/lib/python2.7/site-packages/dbus/decorators.py", line 309, in emit_signal
    message.append(signature=signature, *args)
OverflowError: Value -1031967296 out of range for Int32

This can be fixed by replacing int with long in allowed_tags or by using Python 3.x ;)

mpDris2 doesn't toggle play/pause

Hi there,

I'm not sure as to where my problem lies, but I noticed that I can start playback using my media keys, however I cannot pause. mpDris says: Got GNOME mmkey "Play" for "mpDris2"
Furthermore it seems that the play/pause icon in gnomes sound menu isn't toggled. I don't know anything about the internals, thus not sure if the problem is a gnome problem or some miscommunication or what not.

If I can help in any way, please tell me what to do.

Im using Ubuntu 12.10 and build mpDris from git today.

Thanks in advance!

Request: Make the "Music Player Daemon" text interactive

I'm not explaining this well, but here it goes anyways.

It'd be great if there was a configuration option for what happens when you click the indicator title. In Unity/Pantheon (at least), you can click the name of the player (in the sound indicator dropdown) and it'll open up that player, which is especially helpful if it's closed.
So if I have VLC installed and listed, and I click on the VLC text, it'll launch/switch to VLC. It'd be good if you could add (for example) player = "sonata [or ncmpcpp]", click "Music Player Daemon" and it'll launch the provided application.

In addition, it'd be a nice aesthetic change to only display the controls when mpd is currently running.
Is this within the scope of MPRIS?

Uncaught exception if gi is installed, but Notify module is not

If gi module is available, but Notify object in gi repository is not, mpDris2 fails to start due to uncaught exception:

$ mpDris2
Traceback (most recent call last):
  File "./mpDris2.in.py", line 55, in <module>
    gi.require_version('Notify', '0.7')
  File "/usr/lib/python3/dist-packages/gi/__init__.py", line 118, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Notify not available

I have found this issue on my Debian box. Debian mpdris2 package recommends gir1.2-notify-0.7 and in description states It can (...) send track-change notifications if gir1.2-notify-0.7 is installed. Since I do not install recommended packages by default and I decided that I do not want notifications, I opted out of installing gir1.2-notify-0.7.

As you can see in trackback, gi.require_version will raise ValueError exception if requested module is not available. mpDris2, however, catches only ImportError - which would be raised by import if gi is not installed.

Doesnt react to all actions asked from gnome-applet

The status of the mpd daemon works well and without any issue.
But it's impossible to do some actions on MPD server.

gdbus monitor -e -d org.mpris.MediaPlayer2.mpd returns nothing for any actions but works well when updating data to display coming from mpd (tested with an mpc on mpd host)

It's the returns from the --debug switch for any command (always the same)

2016-02-01 22:37:18,706 mpDris2 DEBUG: Socket event <flags G_IO_IN of type GIOCondition> on fd <__main__.MPDWrapper object at 0x7f41cb8f3550>
2016-02-01 22:37:18,706 mpDris2 DEBUG: Idle events: []
2016-02-01 22:37:18,707 mpDris2 DEBUG: Entered idle
``

xesam:trackNumber should be signed not unsigned

Hi there,

I've been running mpDris2 for a little while now and kept finding that, after I left it running for a long time, it would become completely unresponsive. I started debugging it and found out that it was failing on a particular track that had an ID3 with a negative tracknumber that was being treated as unsigned somewhere along the way (so 'xesam:trackNumber': 4294967295) giving the following error:

Traceback (most recent call last):
  File "/usr/bin/mpDris2", line 317, in monitor
    metadata = self._dbus_service.update_property('org.mpris.MediaPlayer2.Player', 'Metadata')
  File "/usr/bin/mpDris2", line 558, in update_property
    self.PropertiesChanged(interface, {prop: value}, [])
  File "/usr/lib64/python2.7/site-packages/dbus/decorators.py", line 314, in emit_signal
    message.append(signature=signature, *args)
OverflowError: Value -1 out of range for Int32

I've attached a patch that converts tracknumbers to the signed value that the dbus service expects:

https://gist.github.com/6ad2d8e8b244bf11de58

Please let me know if you have any issues or questions about this patch...

CanGoNext returns false even if it "can go next"

Error:

mpDris tells me that it can't go to next song even though it works sending Next to the MediaPlayer2 object on dbus. (see Example using qdbus)

Expected result:

that mpDris should tell me that i can go to the next song if there is one.

Setup:

I'm running a mopidy mpd service on my local LAN and connected mpDris2 to it.

Versions:

OS: Fedora 22
Mopidy: 1.0.5
mpDris2: 0.4 (From fedora 22 repo) and current master (6295aa9)
python: 2.7
python-mpd: 0.2.1 (from fedora 22 repo) and current master using python-mpd2 (eccee96f)

Example:

$ qdbus org.mpris.MediaPlayer2.mpd /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata
xesam:title: Bad Day
...

$ qdbus org.mpris.MediaPlayer2.mpd /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.CanGoNext
false

$ qdbus org.mpris.MediaPlayer2.mpd /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next

$ qdbus org.mpris.MediaPlayer2.mpd /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata
xesam:title: Running To The Sea
...

Support embedded art

Would be nice to export embedded cover art in the mpris metadata.

I guess we would need to extract the cover in a temporary file then include the temp path in the metadatas

TypeError

(I've already posted this on Arch Linux AUR)

I'm getting this error.
and I have no idea what to do about it.

$ mpDris2
Traceback (most recent call last):
File "/usr/bin/mpDris2", line 829, in
if os.path.exists(path):
File "/usr/lib/python2.7/genericpath.py", line 18, in exists
os.stat(path)
TypeError: coercing to Unicode: need string or buffer, NoneType found

Idea: Use `sendmessage` to raise players

Regarding recent comments on https://extensions.gnome.org/extension/55/media-player-indicator/:

<bru> Hi, I'm using mpd usually managed with ncmpcpp or Sonata. mpdris allows it to communicate with your extension. The recent remark about "clicking on the player name to open the player window" therefore does not apply. Is there a convenient way to fix this, or should it be done on mpdris' side?

<eon> bru: mpdris2 actually doesn't know anything about the player you are using. But yes it might be handled by mpdris2.

It might be possible to implement this using mpd's recently added "message" feature: clients can send messages to a "channel" and subscribe to messages from other clients. mpDris2 could send a raise message to clients-$MACHINEID, and other clients would listen to such a message. (The machine ID – or at least the hostname – should be included to avoid raising clients on other computers.)

The downside: no player currently supports this... :(


mpc subscribe "clients" &

mpc sendmessage "clients" "raise"

autogen.sh fails

Hi,
I got the same problem as #19:

$ ./autogen.sh --sysconfdir=/etc
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for a Python interpreter with version >= 2.5... python
checking for python... /usr/bin/python
checking for python version... 2.7
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.7/dist-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/dist-packages
./configure: line 2601: syntax error near unexpected token `0.26'
./configure: line 2601: `IT_PROG_INTLTOOL(0.26)'

I tried both git clone and downloading it myself.
Same results there.
Not sure how the poster of #19 solved this so I have to ask here again.

Use of deprecated pygobject imports?

I have issues starting mpDris2.
import glib does not work. The new (?) and recommended way seems to be

from gi.repository import GLib

If I add " as glib" everything works.
Until I enable Bling.notify. It does not find pynotify.
Again, the same game

from gi.repository import Notify as pynotify

And here my python skills (and time ;)) ends:

Traceback (most recent call last):
  File "/usr/bin/mpDris2", line 1224, in <module>
    notification = Notify(params)
  File "/usr/bin/mpDris2", line 764, in __init__
    self._notification = pynotify.Notification("", "", "")
TypeError: GObject.__init__() takes exactly 0 arguments (3 given)

It seems Notify is not backwards compatible.
I am running pygobject-3.14.0 on Gentoo.

Multimedia keys cause an MPD disconnect due to idling

Having recently updated mpDris2 after many months, I found that it failed to control MPD using the multimedia keys, and key saying there was an error mid-connection, followed by "no connection" errors for any further media key presses.

It turns out this was due to the idle support that was added, and the multimedia key handling code not entering or leaving the idle state (causing python-mpd to send the play command directly after the idle command, rather than sending a noidle first).

I've created a patch at https://gist.github.com/ikelos/6952321 which solves the problem for me.

Type Error

I saw similiar issue, but it was different kind.

Traceback (most recent call last):
File "/usr/local/bin/mpDris2", line 1081, in
mpd_wrapper.run()
File "/usr/local/bin/mpDris2", line 247, in run
if self.my_connect():
File "/usr/local/bin/mpDris2", line 304, in my_connect
self.socket_callback)
TypeError: argument must be an int, or have a fileno() method.

At least script fetches library dir.
mpDris2 INFO: Using file:///media/Music as music library path.

Please allow notifications to be disabled

I love mpDris2, not least because it connects mpd to the gnome-shell-mediaplayer extension. But I don't like track notifications, and I can't turn them off.

I would be quite happy, in fact, without any notifications. (It's not even obvious that mpDris2 should get involved in notifications; why not leave that to the consumer of the MPRIS dbus events?)

OSError: No such file or directory

Version: Installed from git via Arch Linux AUR February 3rd 2012

Problem: "OSError: Nu such file or directory". Results (?) in no metadata being exposed by service.

Error:

[~] mpDris2 -p /var/lib/mpd/music 192.168.1.66
2012-02-03 23:00:27,072 mpDris2 INFO: Using /var/lib/mpd/music as music library path
Traceback (most recent call last):
File "/usr/bin/mpDris2", line 307, in monitor
metadata = self._dbus_service.update_property('org.mpris.MediaPlayer2.Player', 'Metadata')
File "/usr/bin/mpDris2", line 536, in update_property
value = getter()
File "/usr/bin/mpDris2", line 446, in __get_metadata
return format_metadata(mpd_wrapper.currentsong())
File "/usr/bin/mpDris2", line 677, in format_metadata
for f in os.listdir(basedirpath):
OSError: [Errno 2] No such file or directory: '/var/lib/mpd/music/discotheque/bob dylan/bringing it all back home'

Background:
I'm trying to get mpDris2 to connect to my MPD server on a remote machine in order to expose MPD to the Gnome 3 music integration extension. Command:

mpDris2 -p /var/lib/mpd/music 192.168.1.66

The result is however less than perfect. All metadata are lost and represented as 'Unknown Artist', 'Unknown Title', etc. See screen shot:

http://dl.dropbox.com/u/50373568/mpdris2fail.png

I have checked on the remote machine that the directory given is indeed the mpd.conf directory and that the file is indeed there. I have also tried using some form of 'remote path indication', like 192.168.1.66://var/lib/mpd/music etc. Same error. In any case, the exception should probably be caught.

The mpd server address is correct (and fixed) and mpDris2 does provide the applet with access to the server, just not the metadata. I know this because the controls in the applet work (play, pause, stop, etc.)

Syntax error in mpDris2?

When i try to start mpDris2 via the command line i get the following error:

File "/usr/local/bin/mpDris2", line 1081
Report bugs to https://github.com/eonpatapon/mpDris2/issues""" % params
^
SyntaxError: invalid syntax

[1] + exit 1 mpDris2

This happens with both tonight's git pull and the tarball of 0.4.

I have python-mpd 0.4.3 installed if that helps.

Thanks.

Update Stream Titles

When I play an icecast stream, the title of the currently playing song gets stuck on the first title played. Could this be automatically updated to the currently played title on the the stream?

The paused/playing notification isn’t terribly useful

screenshot from 2015-12-23 00-39-50

Is what being shown currently (one of the notifications is from mpDris2, another is from ario). Maybe it could instead show more useful information (since it is now showing the notification at all), e.g.

Music Player Daemon Playing
Track from Album by Artist

python-mpd is abandoned

python-mpd is abandoned, original website is not even available.

Have you considered using a recent fork of python-mpd?
There are two I'm aware of python-mpd2 and python-musicpd.

http://www.musicpd.org/libs/

Since mpDris seems to be written in python2 I guess python-mpd2 is the only candidate here.

Dbus error when starting mpDris2

I'm using the xdg autostart method to start mpDris2. It always crashes at login. Here's what I collected in logs by modifying the autostart command to include debug output. It looks like two logins. In one, mpd hadn't started yet (I'm using systemd --user to start mpd). In the other, it looks like the notifications daemon, or dbus object or something hadn't yet come up? I'm not quite sure. Any hints?

2005-01-07 13:58:02,352 mpDris2 INFO: Using file:///mnt/Miscellaneous/Music as music library path.
2005-01-07 13:58:02,359 mpDris2 ERROR: Could not connect to MPD: [Errno 111] Connection refused
2005-01-07 13:58:07,343 mpDris2 DEBUG: Sending command 'commands' (during idle? False)
2005-01-07 13:58:07,344 mpDris2 DEBUG: Sending command 'urlhandlers' (during idle? False)
Traceback (most recent call last):
  File "/usr/bin/mpDris2", line 266, in my_connect
    notification.rnotify(identity, _('Reconnected'))
  File "/usr/bin/mpDris2", line 612, in rnotify
    self._notification.show()
glib.GError: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface `org.freedesktop.Notifications' on object at path /org/freedesktop/Notifications
mpDris2: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.
2005-01-07 20:37:08,523 mpDris2 INFO: Using file:///mnt/Miscellaneous/Music as music library path.
2005-01-07 20:37:08,684 mpDris2 DEBUG: Sending command 'commands' (during idle? False)
2005-01-07 20:37:08,686 mpDris2 DEBUG: Sending command 'urlhandlers' (during idle? False)
2005-01-07 20:37:08,686 mpDris2 DEBUG: Connected to MPD server.
2005-01-07 20:37:08,687 mpDris2 DEBUG: Sending command 'status' (during idle? False)
2005-01-07 20:37:08,688 mpDris2 DEBUG: Sending command 'currentsong' (during idle? False)
2005-01-07 20:37:08,689 mpDris2 DEBUG: Sending command 'status' (during idle? False)
2005-01-07 20:37:08,690 mpDris2 DEBUG: Updated property: PlaybackStatus = Paused
2005-01-07 20:37:08,690 mpDris2 DEBUG: Updated property: Metadata = dbus.Dictionary({'xesam:album': 'Absolute Hair Metal Vol. 5', 'xesam:title': "Damned If We Do, Damned If We Don't", 'xesam:trackNumber': 6, 'xesam:contentCreated': '2006', 'mpris:trackid': dbus.ObjectPath('/org/mpris/MediaPlayer2/Track/66'), 'mpris:length': 230000000L, 'xesam:artist': ['Sleeze Beez'], 'xesam:url': "file:///mnt/Miscellaneous/Music/Discographies/Absolute Hair Metal Vol. 01-55/Absolute Hair Metal Vol. 05/06 Sleeze Beez - Damned If We Do, Damned If We Don't.mp3"}, signature=dbus.Signature('sv'))
Traceback (most recent call last):
  File "/usr/bin/mpDris2", line 1168, in <module>
    mpd_wrapper.run()
  File "/usr/bin/mpDris2", line 236, in run
    if self.my_connect():
  File "/usr/bin/mpDris2", line 297, in my_connect
    self.timer_callback()
  File "/usr/bin/mpDris2", line 379, in timer_callback
    self._update_properties()
  File "/usr/bin/mpDris2", line 482, in _update_properties
    notification.notify(title, _('by %s') % artist, uri)
  File "/usr/bin/mpDris2", line 606, in notify
    self._notification.show()
glib.GError: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface `org.freedesktop.Notifications' on object at path /org/freedesktop/Notifications

Multimedia Keys

Hi again,

I have a hard time getting my multimedia keys to work. Using GNOME 3.4 on ArchLinux, I get this in my xsession-errors:

2012-10-13 12:44:52,861 mpDris2 INFO: Using /home/alucryd/Music as music library path
2012-10-13 12:44:52,862 mpDris2 ERROR: Failed to connect to GNOME Settings Daemon. Disabling multimedia key support

I can confirm gnome-settings-daemon is running. Can you reproduce this?

Thx in advance.

Does not support non-ascii songurl with Python 2

Due to different handling of string and bytes, mpDris running with Python 2 does not support non-ascii chars in song_url:

$ python2 ./mpDris2.in.py --debug
2016-09-12 23:07:36,558 mpDris2.in INFO: Using file:///home/hexchain/Music as music library path.
2016-09-12 23:07:36,559 mpDris2.in INFO: Using Mutagen to read covers from music files.
2016-09-12 23:07:36,559 mpDris2.in DEBUG: Using GObject-Introspection main loop.
2016-09-12 23:07:36,559 mpDris2.in DEBUG: Initializing GObject.Notify
2016-09-12 23:07:36,560 mpDris2.in WARNING: Failed to connect to GNOME Settings Daemon. Media keys won't work.
2016-09-12 23:07:36,562 mpDris2.in DEBUG: Sending command 'commands' (was idle? False)
2016-09-12 23:07:36,563 mpDris2.in DEBUG: Sending command 'urlhandlers' (was idle? False)
2016-09-12 23:07:36,563 mpDris2.in DEBUG: Connected to MPD server.
2016-09-12 23:07:36,564 mpDris2.in DEBUG: Sending command 'status' (was idle? False)
2016-09-12 23:07:36,564 mpDris2.in DEBUG: Sending command 'currentsong' (was idle? False)
2016-09-12 23:07:36,565 mpDris2.in DEBUG: Sending command 'status' (was idle? False)
2016-09-12 23:07:36,565 mpDris2.in DEBUG: _update_properties: current song = {'album': '\xe7\xb5\xb6\xe5\xaf\xbe\xe9\x9b\xb6\xe5\xba\xa6\xce\xb8\xe3\x83\x8e\xe3\x83\xb4\xe3\x82\xa1\xe3\x83\x86\xe3\x82\xa3\xe3\x83\x83\xe3\x82\xaf/\xe7\xa0\xb4\xe6\xbb\x85\xe3\x81\xae\xe7\xb4\x94\xe6\x83\x85', 'title': '\xe9\xa2\xa8\xe3\x81\xaf\xe4\xba\x88\xe5\x91\x8a\xe3\x81\xaa\xe3\x81\x8f\xe5\x90\xb9\xe3\x81\x8f', 'track': '3/0', 'artist': '\xe3\x83\xaf\xe3\x83\xab\xe3\x82\xad\xe3\x83\xa5\xe3\x83\xbc\xe3\x83\xac', 'pos': '4', 'last-modified': '2016-08-22T13:55:34Z', 'disc': '0/0', 'file': '\xe9\xa2\xa8\xe3\x81\xaf\xe4\xba\x88\xe5\x91\x8a\xe3\x81\xaa\xe3\x81\x8f\xe5\x90\xb9\xe3\x81\x8f.mp3', 'time': '364', 'id': '5'}
2016-09-12 23:07:36,565 mpDris2.in DEBUG: _update_properties: current status = {'songid': '5', 'playlistlength': '5', 'playlist': '2', 'repeat': '1', 'consume': '0', 'mixrampdb': '0.000000', 'random': '0', 'state': 'stop', 'volume': '-1', 'single': '0', 'nextsong': '0', 'song': '4', 'nextsongid': '1'}
2016-09-12 23:07:36,565 mpDris2.in DEBUG: Updated property: PlaybackStatus = Stopped
Traceback (most recent call last):
  File "./mpDris2.in.py", line 1307, in <module>
    mpd_wrapper.run()
  File "./mpDris2.in.py", line 279, in run
    if self.my_connect():
  File "./mpDris2.in.py", line 354, in my_connect
    self.timer_callback()
  File "./mpDris2.in.py", line 442, in timer_callback
    self._update_properties(force=False)
  File "./mpDris2.in.py", line 704, in _update_properties
    self.update_metadata()
  File "./mpDris2.in.py", line 565, in update_metadata
    song_url = os.path.join(params['music_dir'], song_url)
  File "/usr/lib/python2.7/posixpath.py", line 73, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 1: ordinal not in range(128)

With Python 3:

$ ./mpDris2.in.py --debug
2016-09-12 23:07:33,288 mpDris2.in INFO: Using file:///home/hexchain/Music as music library path.
2016-09-12 23:07:33,288 mpDris2.in INFO: Mutagen not available, covers in music files will be ignored.
2016-09-12 23:07:33,288 mpDris2.in DEBUG: Using GObject-Introspection main loop.
2016-09-12 23:07:33,289 mpDris2.in DEBUG: Initializing GObject.Notify
2016-09-12 23:07:33,290 mpDris2.in WARNING: Failed to connect to GNOME Settings Daemon. Media keys won't work.
2016-09-12 23:07:33,291 mpd INFO: Calling MPD connect('localhost', 6600, timeout=None)
2016-09-12 23:07:33,293 mpDris2.in DEBUG: Sending command 'commands' (was idle? False)
2016-09-12 23:07:33,293 mpd DEBUG: Calling MPD commands()
2016-09-12 23:07:33,293 mpDris2.in DEBUG: Sending command 'urlhandlers' (was idle? False)
2016-09-12 23:07:33,293 mpd DEBUG: Calling MPD urlhandlers()
2016-09-12 23:07:33,293 mpDris2.in DEBUG: Connected to MPD server.
2016-09-12 23:07:33,294 mpDris2.in DEBUG: Sending command 'status' (was idle? False)
2016-09-12 23:07:33,294 mpd DEBUG: Calling MPD status()
2016-09-12 23:07:33,294 mpDris2.in DEBUG: Sending command 'currentsong' (was idle? False)
2016-09-12 23:07:33,294 mpd DEBUG: Calling MPD currentsong()
2016-09-12 23:07:33,295 mpDris2.in DEBUG: Sending command 'status' (was idle? False)
2016-09-12 23:07:33,295 mpd DEBUG: Calling MPD status()
2016-09-12 23:07:33,295 mpDris2.in DEBUG: _update_properties: current song = {'artist': 'ワルキューレ', 'file': '風は予告なく吹く.mp3', 'disc': '0/0', 'track': '3/0', 'album': '絶対零度θノヴァティック/破滅の純情', 'title': '風は予告なく吹く', 'last-modified': '2016-08-22T13:55:34Z', 'time': '364', 'id': '5', 'pos': '4'}
2016-09-12 23:07:33,295 mpDris2.in DEBUG: _update_properties: current status = {'nextsongid': '1', 'state': 'stop', 'playlistlength': '5', 'song': '4', 'playlist': '2', 'consume': '0', 'single': '0', 'nextsong': '0', 'volume': '-1', 'songid': '5', 'repeat': '1', 'random': '0', 'mixrampdb': '0.000000'}
2016-09-12 23:07:33,295 mpDris2.in DEBUG: Updated property: PlaybackStatus = Stopped
2016-09-12 23:07:33,296 mpDris2.in DEBUG: Updated property: Metadata = dbus.Dictionary({'xesam:album': '絶対零度θノヴァティック/破滅の純情', 'xesam:title': '風は予告なく吹く', 'mpris:trackid': dbus.ObjectPath('/org/mpris/MediaPlayer2/Track/5'), 'xesam:artist': ['ワルキューレ'], 'mpris:length': dbus.Int64(364000000), 'xesam:url': 'file:///home/hexchain/Music/風は予告なく吹く.mp3', 'xesam:discNumber': 0, 'xesam:trackNumber': 3}, signature=dbus.Signature('sv'))
2016-09-12 23:07:33,296 mpd DEBUG: Calling MPD idle[]
2016-09-12 23:07:33,296 mpDris2.in DEBUG: Entered idle
^C2016-09-12 23:07:34,606 mpDris2.in DEBUG: Caught SIGINT, exiting.
2016-09-12 23:07:34,607 mpd DEBUG: Calling MPD close()
2016-09-12 23:07:34,608 mpd INFO: Calling MPD disconnect()
2016-09-12 23:07:34,609 mpDris2.in DEBUG: Exiting

mpd skips songs when seeking through mpDris2

I use KDE and its media controller applet. When I seek through that applet mpd skips every song in the playlist (after finishing the current song) and right away continues with the last song in the playlist.
The issue then remains: starting the playlist will always jump to the last item in the playlist.
NOTE: I can see that every single item in the PL gets selected, until it reaches the last one. So it looks like someone notices a "run_next" command, and reacts on that by triggering itself "run_next" until there is no more "next" item.
As soon as I stop the mpDris2 service the behaviour sets back to normal.
I checked with cantata mpd client (which offers an own mpris2-interface) that the issue does not come from the kde applet. And indeed seeking through the applet does not trigger this issue.

is it possible to change the volume of mpd

as i see in mpris2 spect there'e a volume attribute, but i have never seen a second volume slider in ubuntu's sound indicator.

but for me mpDris2 is quite useless if i need to have annother mpd client to change the volume.

systemd unit make systemd crash?

I understand that it sounds weird, so it might totally be the case that I am wrong here.

Anyway, that's my bug report:

  • mpDris2 works fine for me. I can run it from a terminal and it works. yay.
  • If I enable the provided mpDris2.service, it will crash, and... will make the whole systemd crash. Here is some log:
lug 28 08:58:07 systemd[2971]: Started Sound Service.
lug 28 08:58:08 mpDris2[3153]: Traceback (most recent call last):
lug 28 08:58:08 mpDris2[3153]:   File "/usr/bin/mpDris2", line 304, in my_connect
lug 28 08:58:08 mpDris2[3153]:     notification.notify(identity, _('Reconnected'))
lug 28 08:58:08 mpDris2[3153]:   File "/usr/bin/mpDris2", line 809, in notify
lug 28 08:58:08 mpDris2[3153]:     self._notification.show()
lug 28 08:58:08 mpDris2[3153]: GLib.Error: g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Notifica
lug 28 08:58:21 org.a11y.Bus[3484]: Activating service name='org.a11y.atspi.Registry'
lug 28 08:58:21 org.a11y.Bus[3484]: ** (process:3490): WARNING **: Failed to register client: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: Th
lug 28 08:58:21 org.a11y.Bus[3484]: Successfully activated service 'org.a11y.atspi.Registry'
lug 28 08:58:21 org.a11y.atspi.Registry[3503]: SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry
lug 28 08:58:23 awesome[3472]: restack_win(0x0080000b, 0x01000003): Failed to found new above window.
lug 28 08:58:23 awesome[3472]: restack_win(0x0080000b, 0x01000003): Failed to found new above window.
lug 28 08:59:19 systemd[2971]: Stopped target Default.
[omit some more Stopping/Stopped]
lug 28 08:59:19 systemd[2971]: Stopped target Timers.
lug 28 08:59:19 systemd[2971]: Stopped target Sockets.
lug 28 08:59:19 systemd[2971]: Closed D-Bus User Message Bus Socket.
lug 28 08:59:19 systemd[2971]: Closed Sound System.
lug 28 08:59:19 systemd[2971]: Reached target Shutdown.
lug 28 08:59:19 systemd[2971]: Starting Exit the Session...
lug 28 08:59:19 systemd[2971]: _Receied_ SIGRTMIN+24 from PID 4323 (kill).
lug 28 08:59:19 systemd[3108]: pam_unix(systemd-user:session): session closed for user user

I think that this is related to how systemd manages BusName directive, which I don't know

Randomly stops responding to multimedia keys

Usually at least once a day, especially after resuming from a suspend, mpDris2 will appear to be working but not respond to multimedia keys. Interestingly enough I can still send commands to it via D-Bus.

I often use MPD's single mode to pause an album, and have Shift-Xf86AudioPlay bound to mpc single and Shift-Xf86AudioPrev bound to mpc seek 0 to restart a song (via Openbox). Could that be part of the problem? Using a modifier on the other multimedia keys doesn't seem to send the signal to mpDris2, even though the plain key will.

I'm using MATE desktop environment on Arch Linux x86-64, with Openbox as my window manager. I always get warnings about a failure to connect to GNOME Settings Daemon, but it seems to work.

Here's a typical debug log, if that will shed some insight:

$ mpDris2 --debug
2014-05-13 11:22:47,743 mpDris2 INFO: Using file:///mnt/music as music library path.
2014-05-13 11:22:47,743 mpDris2 INFO: Using Mutagen to read covers from music files.
2014-05-13 11:22:47,790 mpDris2 WARNING: Failed to connect to GNOME Settings Daemon. Media keys won't work.
2014-05-13 11:22:47,792 mpDris2 DEBUG: Sending command 'commands' (was idle? False)
2014-05-13 11:22:47,806 mpDris2 DEBUG: Sending command 'urlhandlers' (was idle? False)
2014-05-13 11:22:47,806 mpDris2 DEBUG: Connected to MPD server.
2014-05-13 11:22:47,814 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:22:47,815 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:22:47,816 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:22:47,816 mpDris2 DEBUG: Updated property: PlaybackStatus = Playing
2014-05-13 11:22:47,997 mpDris2 DEBUG: Updated property: Metadata = dbus.Dictionary({'xesam:album': 'The Brink', 'xesam:title': 'No Country', 'xesam:trackNumber': 6, 'xesam:contentCreated': '2014', 'xesam:discNumber': 1, 'mpris:trackid': dbus.ObjectPath('/org/mpris/MediaPlayer2/Track/40'), 'mpris:length': dbus.Int64(274000000L), 'mpris:artUrl': 'file:///mnt/music/Jezabels, The/2014 - The Brink/cover.jpg', 'xesam:artist': ['The Jezabels'], 'xesam:url': 'file:///mnt/music/Jezabels, The/2014 - The Brink/06. No Country.flac'}, signature=dbus.Signature('sv'))
2014-05-13 11:22:47,998 mpDris2 DEBUG: Entered idle
2014-05-13 11:22:57,288 mpDris2 DEBUG: Left idle
2014-05-13 11:22:57,288 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:22:57,289 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:22:57,290 mpDris2 DEBUG: Entered idle
2014-05-13 11:22:57,327 mpDris2 DEBUG: Left idle
2014-05-13 11:22:57,327 mpDris2 DEBUG: Sending command 'status' (was idle? True)
2014-05-13 11:22:57,328 mpDris2 DEBUG: Entered idle
2014-05-13 11:22:57,367 mpDris2 DEBUG: Left idle
2014-05-13 11:22:57,367 mpDris2 DEBUG: Sending command 'pause' (was idle? True)
2014-05-13 11:22:57,431 mpDris2 DEBUG: Entered idle
2014-05-13 11:22:57,433 mpDris2 DEBUG: Socket event 1 on fd <__main__.MPDWrapper object at 0x2b59550>
2014-05-13 11:22:57,434 mpDris2 DEBUG: Idle events: [{'changed': 'player'}]
2014-05-13 11:22:57,434 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:22:57,435 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:22:57,436 mpDris2 DEBUG: Updated property: PlaybackStatus = Paused
2014-05-13 11:22:57,436 mpDris2 DEBUG: Entered idle
2014-05-13 11:22:57,437 mpDris2 DEBUG: Socket event 1 on fd <__main__.MPDWrapper object at 0x2b59550>
2014-05-13 11:22:57,437 mpDris2 DEBUG: Idle events: [{'changed': 'mixer'}]
2014-05-13 11:22:57,438 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:22:57,438 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:22:57,439 mpDris2 DEBUG: Entered idle
2014-05-13 11:22:58,801 mpDris2 DEBUG: Left idle
2014-05-13 11:22:58,801 mpDris2 DEBUG: Sending command 'status' (was idle? True)
2014-05-13 11:22:58,802 mpDris2 DEBUG: Entered idle
2014-05-13 11:22:58,840 mpDris2 DEBUG: Left idle
2014-05-13 11:22:58,841 mpDris2 DEBUG: Sending command 'play' (was idle? True)
2014-05-13 11:22:58,842 mpDris2 DEBUG: Entered idle
2014-05-13 11:22:58,845 mpDris2 DEBUG: Socket event 1 on fd <__main__.MPDWrapper object at 0x2b59550>
2014-05-13 11:22:58,845 mpDris2 DEBUG: Idle events: [{'changed': 'player'}]
2014-05-13 11:22:58,845 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:22:58,847 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:22:58,848 mpDris2 DEBUG: Updated property: PlaybackStatus = Playing
2014-05-13 11:22:58,848 mpDris2 DEBUG: Expected pos 81.782, actual 80.805, diff -0.9769999999999897
2014-05-13 11:22:58,849 mpDris2 DEBUG: Old position was 80.782 at 1399944177 (1 seconds ago)
2014-05-13 11:22:58,849 mpDris2 DEBUG: Seeked to 80805000
2014-05-13 11:22:58,849 mpDris2 DEBUG: Entered idle
2014-05-13 11:22:58,849 mpDris2 DEBUG: Socket event 1 on fd <__main__.MPDWrapper object at 0x2b59550>
2014-05-13 11:22:58,849 mpDris2 DEBUG: Idle events: [{'changed': 'mixer'}]
2014-05-13 11:22:58,850 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:22:58,850 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:22:58,851 mpDris2 DEBUG: Entered idle
2014-05-13 11:23:03,297 mpDris2 DEBUG: Left idle
2014-05-13 11:23:03,297 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:23:03,298 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:23:03,299 mpDris2 DEBUG: Entered idle
2014-05-13 11:23:18,309 mpDris2 DEBUG: Left idle
2014-05-13 11:23:18,309 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:23:18,309 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:23:18,310 mpDris2 DEBUG: Entered idle
2014-05-13 11:23:33,309 mpDris2 DEBUG: Left idle
2014-05-13 11:23:33,309 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:23:33,310 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:23:33,311 mpDris2 DEBUG: Entered idle
2014-05-13 11:23:48,307 mpDris2 DEBUG: Left idle
2014-05-13 11:23:48,307 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:23:48,308 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:23:48,309 mpDris2 DEBUG: Entered idle
2014-05-13 11:24:00,599 mpDris2 DEBUG: Left idle
2014-05-13 11:24:00,599 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:24:00,600 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:24:00,601 mpDris2 DEBUG: Entered idle
2014-05-13 11:24:00,640 mpDris2 DEBUG: Left idle
2014-05-13 11:24:00,641 mpDris2 DEBUG: Sending command 'next' (was idle? True)
2014-05-13 11:24:00,694 mpDris2 DEBUG: Entered idle
2014-05-13 11:24:00,735 mpDris2 DEBUG: Socket event 1 on fd <__main__.MPDWrapper object at 0x2b59550>
2014-05-13 11:24:00,735 mpDris2 DEBUG: Idle events: [{'changed': 'player'}]
2014-05-13 11:24:00,735 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:24:00,745 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:24:00,748 mpDris2 DEBUG: Updated property: Metadata = dbus.Dictionary({'xesam:album': 'The Brink', 'xesam:title': 'The End', 'xesam:trackNumber': 7, 'xesam:contentCreated': '2014', 'xesam:discNumber': 1, 'mpris:trackid': dbus.ObjectPath('/org/mpris/MediaPlayer2/Track/41'), 'mpris:length': dbus.Int64(241000000L), 'mpris:artUrl': 'file:///mnt/music/Jezabels, The/2014 - The Brink/cover.jpg', 'xesam:artist': ['The Jezabels'], 'xesam:url': 'file:///mnt/music/Jezabels, The/2014 - The Brink/07. The End.flac'}, signature=dbus.Signature('sv'))
2014-05-13 11:24:00,749 mpDris2 DEBUG: Entered idle
2014-05-13 11:24:02,087 mpDris2 DEBUG: Left idle
2014-05-13 11:24:02,087 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:24:02,088 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:24:02,089 mpDris2 DEBUG: Expected pos 2.0, actual 1.37, diff -0.6299999999999999
2014-05-13 11:24:02,089 mpDris2 DEBUG: Old position was 0.0 at 1399944240 (2 seconds ago)
2014-05-13 11:24:02,089 mpDris2 DEBUG: Seeked to 1370000
2014-05-13 11:24:02,090 mpDris2 DEBUG: Entered idle
2014-05-13 11:24:02,127 mpDris2 DEBUG: Left idle
2014-05-13 11:24:02,127 mpDris2 DEBUG: Sending command 'previous' (was idle? True)
2014-05-13 11:24:02,217 mpDris2 DEBUG: Entered idle
2014-05-13 11:24:02,228 mpDris2 DEBUG: Socket event 1 on fd <__main__.MPDWrapper object at 0x2b59550>
2014-05-13 11:24:02,228 mpDris2 DEBUG: Idle events: [{'changed': 'player'}]
2014-05-13 11:24:02,228 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:24:02,230 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:24:02,234 mpDris2 DEBUG: Updated property: Metadata = dbus.Dictionary({'xesam:album': 'The Brink', 'xesam:title': 'No Country', 'xesam:trackNumber': 6, 'xesam:contentCreated': '2014', 'xesam:discNumber': 1, 'mpris:trackid': dbus.ObjectPath('/org/mpris/MediaPlayer2/Track/40'), 'mpris:length': dbus.Int64(274000000L), 'mpris:artUrl': 'file:///mnt/music/Jezabels, The/2014 - The Brink/cover.jpg', 'xesam:artist': ['The Jezabels'], 'xesam:url': 'file:///mnt/music/Jezabels, The/2014 - The Brink/06. No Country.flac'}, signature=dbus.Signature('sv'))
2014-05-13 11:24:02,235 mpDris2 DEBUG: Entered idle
2014-05-13 11:24:03,295 mpDris2 DEBUG: Left idle
2014-05-13 11:24:03,296 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:24:03,296 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:24:03,297 mpDris2 DEBUG: Entered idle
2014-05-13 11:24:18,307 mpDris2 DEBUG: Left idle
2014-05-13 11:24:18,307 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:24:18,308 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:24:18,309 mpDris2 DEBUG: Entered idle
2014-05-13 11:24:33,307 mpDris2 DEBUG: Left idle
2014-05-13 11:24:33,307 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:24:33,308 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:24:33,309 mpDris2 DEBUG: Entered idle
2014-05-13 11:24:48,307 mpDris2 DEBUG: Left idle
2014-05-13 11:24:48,307 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:24:48,308 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:24:48,309 mpDris2 DEBUG: Entered idle
2014-05-13 11:25:03,307 mpDris2 DEBUG: Left idle
2014-05-13 11:25:03,307 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:25:03,308 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:25:03,309 mpDris2 DEBUG: Entered idle
2014-05-13 11:25:18,307 mpDris2 DEBUG: Left idle
2014-05-13 11:25:18,307 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:25:18,308 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:25:18,309 mpDris2 DEBUG: Entered idle
2014-05-13 11:25:33,307 mpDris2 DEBUG: Left idle
2014-05-13 11:25:33,307 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:25:33,308 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:25:33,309 mpDris2 DEBUG: Entered idle
2014-05-13 11:25:48,307 mpDris2 DEBUG: Left idle
2014-05-13 11:25:48,307 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:25:48,308 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:25:48,309 mpDris2 DEBUG: Entered idle
2014-05-13 11:26:03,307 mpDris2 DEBUG: Left idle
2014-05-13 11:26:03,307 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:26:03,308 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:26:03,309 mpDris2 DEBUG: Entered idle
2014-05-13 11:26:18,307 mpDris2 DEBUG: Left idle
2014-05-13 11:26:18,307 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:26:18,308 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:26:18,309 mpDris2 DEBUG: Entered idle
2014-05-13 11:26:33,307 mpDris2 DEBUG: Left idle
2014-05-13 11:26:33,307 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:26:33,308 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:26:33,308 mpDris2 DEBUG: Entered idle
2014-05-13 11:26:35,549 mpDris2 DEBUG: Socket event 1 on fd <__main__.MPDWrapper object at 0x2b59550>
2014-05-13 11:26:35,549 mpDris2 DEBUG: Idle events: [{'changed': 'options'}]
2014-05-13 11:26:35,549 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:26:35,550 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:26:35,551 mpDris2 DEBUG: Updated property: LoopStatus = None
2014-05-13 11:26:35,551 mpDris2 DEBUG: Entered idle
2014-05-13 11:26:45,320 mpDris2 DEBUG: Socket event 1 on fd <__main__.MPDWrapper object at 0x2b59550>
2014-05-13 11:26:45,320 mpDris2 DEBUG: Idle events: [{'changed': 'options'}]
2014-05-13 11:26:45,320 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:26:45,321 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:26:45,322 mpDris2 DEBUG: Updated property: LoopStatus = None
2014-05-13 11:26:45,323 mpDris2 DEBUG: Entered idle
2014-05-13 11:26:48,297 mpDris2 DEBUG: Left idle
2014-05-13 11:26:48,297 mpDris2 DEBUG: Sending command 'currentsong' (was idle? False)
2014-05-13 11:26:48,298 mpDris2 DEBUG: Sending command 'status' (was idle? False)
2014-05-13 11:26:48,299 mpDris2 DEBUG: Entered idle

mpDris2 not working

I have the latest version of mpDris2 on Arch whith AUR
If I run :

/usr/bin/mpDris2

i get :

  File "/usr/bin/mpDris2", line 275
    except ValueError, e:
                     ^
SyntaxError: invalid syntax

Ability to change DesktopEntry

It looks like DesktopEntry is used by clients to launch proper application. For example, your awesome GS extension does that. So there must be the option to specify DesktopEntry, not just mpdris2 which leads to launch of another instance of mpdris2.

mpDris2 freezes Gnome Shell

Hi,

recently I've switched from Unity to Gnome-Shell. I noticed some problems wih mpDris2. When logging in, it would crash. So I then updated to the newest git commit, but now have the problem that when I try to launch it from the commandline (with or without -d) it freezes my whole desktop. I have to restart my X Session, it isn't even enough to kill mpDris2 as it respawns...

I basically get this error in .xsession-errors on startup:
Traceback (most recent call last):
File "/usr/local/bin/mpDris2", line 1168, in
mpd_wrapper.run()
File "/usr/local/bin/mpDris2", line 236, in run
if self.my_connect():
File "/usr/local/bin/mpDris2", line 297, in my_connect
self.timer_callback()
File "/usr/local/bin/mpDris2", line 379, in timer_callback
self._update_properties()
File "/usr/local/bin/mpDris2", line 482, in _update_properties
notification.notify(title, _('by %s') % artist, uri)
File "/usr/local/bin/mpDris2", line 606, in notify
self._notification.show()
glib.GError: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Keine derartige Schnittstelle »org.freedesktop.Notifications« des Objekts im Pfad /org/freedesktop/Notifications

I hope I got all the relevant errors, the last error loosely translates to: No such interface org.freedesktop.Notifications of the object in Path....

Hope this helps

bug getting song length?

Traceback (most recent call last): File "/usr/bin/mpDris2", line 528, in check_mpd_status root.update_property('org.mpris.MediaPlayer2.Player', 'Metadata') File "/usr/bin/mpDris2", line 405, in update_property if callable(getter): value = getter() File "/usr/bin/mpDris2", line 314, in __get_metadata return FormatMetadata(mpd_wrapper.currentsong()) File "/usr/bin/mpDris2", line 198, in FormatMetadata metadata['mpris:length'] = metadata['time'] KeyError: 'time'

Got this, using your gnome shell extension.
Also, the extension doesn't correctly show the artist, song, etc, and volume does nothing =)

Crash when processing internet stream URL

Cover searching part of the program (lines 236-247) expects that current file is local and crashes when one isn't. To prevent crashing you can set a guard before the part, e.g.

if os.path.dirname(file).startswith('file://'):

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.