InputUsername/rescrobbled

Won't scrobble ncspot if spotifyd is running

wazabees opened this issue · 12 comments

Hi!

I'm running into the issue that seems to have been discussed before.
#10

I am running spotifyd as a systemd user service. If I start up ncspot and start playing music, rescrobbled will state Looking for an active MPRIS player.... If I stop the spotifyd service, then rescrobbled will start scrobbling, Found active player ncspot.

I have player-whitelist = ["ncspot"] in my config.toml. I tried commenting that out, but it made no difference.

I'm using arch linux and the AUR package of rescrobbled.
https://aur.archlinux.org/packages/rescrobbled-git/

Thanks for the report! Unfortunately that AUR package is not maintained by me, and it seems to be stuck at rescrobbled version 0.1.0. Whitelisting was added in version 0.2.0. I recommend getting one of the prebuilt binaries or installing from source.

Maybe you could also try contacting the maintainer of the package to update it? (Not sure how AUR works)

@wazabees just pinging in case you've missed this!

@wazabees just pinging in case you've missed this!

Thanks for the ping! I had indeed missed your reply. I will mark the AUR package out of date. :)

Edit: It looks like the AUR package will pull the latest version of rescrobbled:
==> Making package: rescrobbled-git 0.3.0-1 (Mon 01 Mar 2021 11:56:14 CET)

Thanks for the ping! I had indeed missed your reply. I will mark the AUR package out of date. :)

Edit: It looks like the AUR package will pull the latest version of rescrobbled:
==> Making package: rescrobbled-git 0.3.0-1 (Mon 01 Mar 2021 11:56:14 CET)

Great, thank you so much! Let me know if the updated version works for you.

@wazabees I just noticed the package actually just builds from the upstream (which you also mentioned and I didn't see 🤦), so I'm not sure what's going wrong with the whitelist. Do note that you'll need to restart rescrobbled/the systemd service after changing the config, it's only read once at startup.

So I wanted to return to ncspot again because the "normal" Spotify client is just too bloated and buggy. I've been starting rescrobbled manually, and did so today too, then started up ncspot. For a while, rescrobbled was scrobbling to last.fm just fine, even with spotifyd running in the background. However, when accidentally quit out of ncspot, rescrobbled went back to stating "Looking for an active MPRIS player...", even after starting ncspot and started playing music again.

I checked the status of spotifyd and saw a few error messages, which led me to this Github issue for spotifyd - Spotifyd/spotifyd#271

I have no idea if it's related, but it does mention Dbus. My specific error message:

Apr 01 16:56:31 desktop spotifyd[804]: Unhandled DBus message: (Signal, Some("/org/freedesktop/DBus"), Some("org.freedesktop.DBus"), Some("NameAcquired"))

After starting rescrobbled with systemd, and stopping spotifyd, rescrobbled started scrobbling like normal again.

Apr 01 17:15:32 desktop systemd[791]: Started An MPRIS scrobbler.
Apr 01 17:15:32 desktop rescrobbled[6109]: Authenticated with Last.fm successfully!
Apr 01 17:15:32 desktop rescrobbled[6109]: Looking for an active MPRIS player...
Apr 01 17:16:19 desktop systemd[791]: Stopping A spotify playing daemon...
Apr 01 17:16:19 desktop systemd[791]: spotifyd.service: Succeeded.
Apr 01 17:16:19 desktop systemd[791]: Stopped A spotify playing daemon.
Apr 01 17:16:19 desktop rescrobbled[6109]: Found active player ncspot
Apr 01 17:16:19 desktop rescrobbled[6109]: ----

No clue if this helps or hinders!

@wazabees thank you for the update. It amost seems as if spotifyd is somehow preventing rescrobbled from detecting other media players. Which is strange, as judging from your logs rescrobbled doesn't detect spotifyd as "active" (ie. running and playing music).

Could you try running playerctl --all-players metadata while both spotifyd and ncspot are active?

Also: are both spotifyd and ncspot whitelisted?

Sure! Only ncspot is whitelisted. rescrobbled stopped scrobbling when I started up spotifyd.

╰─❯ playerctl --all-players metadata
ncspot xesam:trackNumber         1
ncspot mpris:artUrl              https://i.scdn.co/image/ab67616d0000b2730142189280c3bff5a8193bd6
ncspot xesam:album               Drag Me the Rain
ncspot mpris:trackid             '/org/ncspot/spotify/track/---
ncspot xesam:title               Drag Me the Rain
ncspot mpris:length              245281000
ncspot xesam:albumArtist         Bloodred Hourglass
ncspot xesam:artist              Bloodred Hourglass
ncspot xesam:discNumber          1
ncspot xesam:url                 https://open.spotify.com/track/---
╰─❯ playerctl --list-all   
chromium.instance8289
ncspot
spotifyd

Very strange, it definitely seems like this has something to do with spotifyd then. Rescrobbled should simply ignore all non-whitelisted players, so it looks like spotifyd is somehow messing with MPRIS. I will make an issue on the spotifyd repo.

@wazabees actually, if it's not too much of a bother, I think it would be easier if you made an issue, as they ask specifics such as OS version and spotifyd features. I would be happy to help if you need to know anything.

I'm not sure it makes sense to report this to spotifyd as it seems they refer to issues upstream. Both spotifyd and ncspot uses the librespot library. It also seems there is a WIP PR in progress regarding MPRIS issues. For now, I will discontinue using spotifyd. Thanks! :)

Ah okay, that makes sense. I'll keep an eye on that for updates then. Hopefully this can be solved sometime in the future!