mpdas icon indicating copy to clipboard operation
mpdas copied to clipboard

Scrobbled tracks not saving

Open sprtm opened this issue 6 years ago • 11 comments

"Scrobbling now" updates correcty after each track change, but scrobbled tracks are never saved to the last.fm site.

(11:28:53) [INFO] Using Last.fm service URL (11:28:53) [INFO] Connected to MPD. (11:28:54) [INFO] Last.fm handshake successful. SessionID: TqyraLxkocHe57A6N1WvCR5ssT_w2mVN (11:28:54) [INFO] New song: Charles Bronson - Debate Team Bake Sale (11:28:55) [INFO] Updated "Now Playing" status successfully. (11:28:56) [INFO] Scrobbling: Charles Bronson - Debate Team Bake Sale (11:28:56) [INFO] Scrobbled successfully.

Using Raspbian 8.

sprtm avatar Nov 18 '18 11:11 sprtm

There is nothing in the logs indicating a problem, esp. on mpdas' side, as the server returned "ok" ("Scrobbled successfully").

If you want to dig further, you could log the responses sent by Last.fm, however, that would require some manual code edits, e.g. by logging the server's response after this call: https://github.com/hrkfdn/mpdas/blob/master/audioscrobbler.cpp#L177

Like such: iprintf("%s", _response.c_str());

To be honest, though, I think this is a problem on Last.fm's side, as the server accepted our submission.

hrkfdn avatar Nov 19 '18 16:11 hrkfdn

This is the response. Not so detailed, unfortunately. But it looks like the scrobble is ignored by the service.

(17:03:18) [INFO] New song: Neil Young - War of Man (17:03:19) [INFO] Updated "Now Playing" status successfully. (17:03:20) [INFO] Scrobbling: Neil Young - War of Man (17:03:20) [INFO] <?xml version="1.0" encoding="UTF-8"?> <lfm status="ok"> <scrobbles ignored="1" accepted="0"> <scrobble> <track corrected="0">War of Man</track> <artist corrected="0">Neil Young</artist> <album corrected="0">Harvest Moon</album> <albumArtist corrected="0"></albumArtist> <timestamp>1542646999</timestamp> <ignoredMessage code="1"></ignoredMessage> </scrobble> </scrobbles> </lfm>

sprtm avatar Nov 19 '18 17:11 sprtm

It was filtered by the service (code 1):

https://www.last.fm/api/scrobbling#filtered-requests

hrkfdn avatar Nov 19 '18 17:11 hrkfdn

Very strange. This happens with every track. Same tracks scrobble fine with mpd-scrobbler.

sprtm avatar Nov 19 '18 17:11 sprtm

Huh, that is strange indeed. So it's probably submitting tracks differently. It would be interesting to see and compare what mpdas and mpd-scrobbler are submitting to Last.fm. Maybe a different albumArtist tag?

hrkfdn avatar Nov 20 '18 15:11 hrkfdn

I discovered that it is when playing tracks over UPnP (Audirvana+ on a Mac) to mpd (Volumio on a RPi) that all scrobbles are returend with scrobbles ignored="1".

If I play the same tracks directly from Volumio, they'll scrobble correctly.

When playing over UPnP the tracks are scrobbled immediately when started (and therefore rejected by last.fm?), but when playing in Volumio they are scrobbled after half(?) of the track as intended. And accepted by last.fm.

Maybe track duration isn't working correctly over UPnP (but for some reason it's working in mpd-scrobbler).

sprtm avatar Nov 20 '18 19:11 sprtm

Hi, Any solutions for this issue? I have the same situation on Tidal > UPnP > Moode on RPi

lukas12p avatar Feb 06 '19 16:02 lukas12p

I would need more input to debug this as I don't run this configuration, e.g. captures of what is posted to Last.fm compared to Volumio's communication.

hrkfdn avatar Feb 18 '19 12:02 hrkfdn

I fixed this issue and added a pull request some time back. However the code I wrote is probably not the nicest. It fixes the UPNP issue however. IIRC: The problem was that mpd does not have all the required information immediately when starting to scrobble, so it has to be queried when available. Furthrmore the track length has to be queried in a different way, otherwise it is reported wrong and the scobbling fails.

helohe avatar Apr 28 '20 22:04 helohe

I'm trying to solve this with Audirvana and MoodeAudio. My scrobbling worked with Volumio but now it stopped. How do I proceed with your fix?

frantathefranta avatar Jul 08 '20 21:07 frantathefranta

@frantathefranta I think you can either checkout this version and then add my pull request or checkout the fork in my repository and compile that one.

helohe avatar Jul 13 '20 11:07 helohe