Spotify stops publishing artists and song titles to Dbus

Reply

Spotify stops publishing artists and song titles to Dbus

ninjapold
Casual Listener

Plan

Premium

Device

ThinkPad T480

Operating System

Ubuntu 19.04

 

The Linux Spotify client has a bad habit of suddenly not publishing the artist and song title to Dbus sometimes. I have tried deleting caches and restarting Spotify a bunch, nothing helps. A full reboot seems to fix the issue most of the time.

 

An example of a broken state:

 

$ dbus-send --print-reply --session \
          --dest=org.mpris.MediaPlayer2.spotify \
          /org/mpris/MediaPlayer2 \
          org.freedesktop.DBus.Properties.Get \
          string:'org.mpris.MediaPlayer2.Player' \
          string:'Metadata'

method return time=1568710876.511629 sender=:1.1185 -> destination=:1.1190 serial=59 reply_serial=2
   variant       array [
         dict entry(
            string "mpris:trackid"
            variant                string "spotify:track:6RNdmlEXWrxdq0qUaBxcqR"
         )
         dict entry(
            string "mpris:length"
            variant                uint64 257024000
         )
         dict entry(
            string "mpris:artUrl"
            variant                string ""
         )
         dict entry(
            string "xesam:album"
            variant                string ""
         )
         dict entry(
            string "xesam:albumArtist"
            variant                array [
                  string ""
               ]
         )
         dict entry(
            string "xesam:artist"
            variant                array [
                  string ""
               ]
         )
         dict entry(
            string "xesam:autoRating"
            variant                double 0
         )
         dict entry(
            string "xesam:discNumber"
            variant                int32 0
         )
         dict entry(
            string "xesam:title"
            variant                string ""
         )
         dict entry(
            string "xesam:trackNumber"
            variant                int32 0
         )
         dict entry(
            string "xesam:url"
            variant                string "https://open.spotify.com/track/6RNdmlEXWrxdq0qUaBxcqR"
         )
      ]

It's publishing other information, and that "xesam:url" is correct.

 

3 Replies

Re: Spotify stops publishing artists and song titles to Dbus

Avis
Casual Listener

I've found this reproducable by playing music on another device through spotify connect.

I can play one song locally, use dbus to see all info just fine, then ask my google home to "play some music" and it'll just take over on the same song. Now Dbus only gives me mpris:trackid and xesam:url, all other information fields are empty.

Re: Spotify stops publishing artists and song titles to Dbus

ninjapold
Casual Listener

I have noticed similar situations with my Google Home (or just playing it on my phone) but it's not consistent for me. I can sit a whole day controlling music playing on my Google Home from my Ubuntu laptop and it'll work fine and update the Dbus just fine. Other times it breaks and I can't get it working (sometimes not even after a reboot, clearing cache seems to help though).

 

Highlighted

Re: Spotify stops publishing artists and song titles to Dbus

Avis
Casual Listener

Yeah, sadly it stopped being predictable for me after I wrote the post... I started writing a shell utility in ruby though that uses the web api to get song / artist when dbus only publishes song ID, I'll try to link it here when it's ready. 

SUGGESTED POSTS