Jump to content

[Technical] New SLS not scrobbling, Poweramp not applying PlaybackState on track end when repeat in "One Track" mode?


Recommended Posts

There was a new release of SLS (Simple Last.fm Scrobbler) for Android 10.
I raised the issue with SLS but after looking at its source code, I believe the issue could be with Poweramp

New SLS version no longer uses Implicit Broadcast as those are banned for Oreo and up and, looks like it uses "Media Session Manager Google" code (via Notification Listener permission).

Looking at the SLS code a bit further, we can see it uses MediaController/PlaybackState etc classes to keep up with music track changes.
For example, if music track state changes to STATE_SKIPPING_TO_NEXTSTATE_SKIPPING_TO_PREVIOUS or STATE_SKIPPING_TO_QUEUE_ITEM - it will consider the track to be "complete" as seen on SLS github

The issue is however that playing track in "Repeat One Track" mode (loops same track) DOES NOT CHANGE STATE on track completion, before restarting it again,
scrobbling does happen only first time (as per SLS setting to do it when reaches 50% of the track) but not again, unless I manually change track to the next one.

I have tried with clean data of both apps and the issue still persisted.
I just had a quick check with "adb shell dumpsys media_session" and it seems it is kept at:

state=PlaybackState {state=3, .....

(although I tried to run adb as quickly and as many times I could, maybe I missed it changing to state=10 .. or maybe Poweramp didn't do it because it starts playing back same song without changing Playback state)


I suspect that something is wrong with REPEAT in "one track" mode not setting PlaybackState correctly? I would imagine in the repeat one track, it should fire STATE_SKIPPING_TO_NEXT on the track completion?
Would appreciate if someone can take a look at Poweramp code and confirm? 

Link to comment
Share on other sites

scrobbling keeps track of each and any songs played, therefore at the moment it's not really working

for me "repeat one" would be like having a playlist of one song that keeps getting queued at the end.

and that's probably the only workaround at the moment, each song I have to add to separate playlist and play in "repeat list" mode

Link to comment
Share on other sites

  • 3 weeks later...

just wanted to ask if it will be fixed, otherwise there's no way to know end of track (for anything that relies on Android MediaController)

even if it's still same song repeating, it's not seeking to the beginning but playing again, so there should be end of track

Link to comment
Share on other sites

Poweramp properly sends its state. Playback state is not related to the tracks at all. Playback state can be playing or paused. Tracks can change in any state, or not change. So these are 2 parallel states, and it's not correct to assume player will change states when track changes (Poweramp doesn't - there is no gap or anything to make it paused between tracks).

I'll check how new SLS works, I guess it just tested/polished for stock media player which pauses/resumes on each track change.

PS Checked the code. Poweramp sends PlaybackStateCompat.STATE_PLAYING on track repeat to confirm it's in playing state. Unfortunately Poweramp doesn't have STATE_SKIPPING_T* states and thus it can't send them (due to many issues arising in other parts, like Android Auto support). Also, on repeat there is no skipping to anything anyway.

Link to comment
Share on other sites

i was using Simple LastFM a few months ago, then it started to have a bunch of scroobles i didnt listened to

i thought it was Poweramp too, but it was the Simple LastFM.... i'm using "Scroball" and it works wonders ! i suggest you to change your scrobbler app... or send a bug report to their devs

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...