Tauon icon indicating copy to clipboard operation
Tauon copied to clipboard

Shuffle algorithm.

Open mihnt81 opened this issue 1 year ago • 11 comments

So I've noticed a weird, I don't know if it's a bug, but it's definitely undesired behavior. Just added a few new albums to the collection this past week and I did what I normally do and put my whole library on shuffle when I'm listening to music. I leave it running at night for sleep time music in the same manner.

Today I was looking through play counts and on one of the new albums I added, one track has 30 times played and another from the same album has 10. None of the other tracks in my library have a playcount higher than 7. No, I have not manually played the songs as I literally just leave it on shuffle whenever I am using it.

What's up with this behavior? Is it intended? RNG bad luck?

Screenshot from 2023-12-31 11-18-49

Here's that album isolated:

Screenshot from 2023-12-31 11-23-02

mihnt81 avatar Dec 31 '23 16:12 mihnt81

The intended behavior is that every track in the playlist should play exactly once before repeating (excluding any tracks you manually play). So if you run this experiment unattended from scratch then no track should have a higher playcount than one than any other track.

So it does seem like a bug from what you've said. Are you able to determine more of what is going on, like:

  • Did it randomly play a track in full 30 times in a row
  • Did it spontaneously record 30 plays but didn't actually play that much
  • Did it just bias those tracks a lot but otherwise was random (doubt this was the case, it was probably one of the above)
  • Did it record more playtime but over a period of time of the track

Taiko2k avatar Jan 02 '24 01:01 Taiko2k

The intended behavior is that every track in the playlist should play exactly once before repeating

This did not happen even without this anomaly. I had lots of tracks that had played multiple times with about, I'd say, 40% of my library not played yet.

Did it randomly play a track in full 30 times in a row

It didn't happen while I was awake as I would have noticed that happening, lol. Could have happened when I was asleep.

Did it spontaneously record 30 plays but didn't actually play that much

Would the file not being in that location cause it to do this?

I have no idea on your last two of your list there.

mihnt81 avatar Jan 02 '24 19:01 mihnt81

Hi,

I can confirm this behaviour. My thought was that the algorithm needs improving, but of course, it can be a bug as well.

I can't exactly tell the pattern by which some tracks play more than others. I'll try to keep a closer look and report back.

I wonder if something like an option to have a track be disabled automatically after it played could be a momentary workaround if this algorithm bug seems difficult to solve?

agichim avatar Feb 07 '24 12:02 agichim

So was just having a look. I sorted the songs by playing count. Here's a good example. image

  • the song "I Do This" plays quite often, doesn't have a count number but does have a Starline.
  • songs "Auntie Diaries", "The Heart part 1" and "Alright" never played, though Auntie Diaries has a Starline.
  • Song "X" played 3 times in the last 1 hour and doesn't have a play count.

These songs are among 253 songs in a playlist. There are other songs that never played as well.

Using Tauon version 7.7.1 from AUR.

agichim avatar Feb 07 '24 12:02 agichim

@agichim were you also playing from Jellyfin or are these local tracks?

Also some clarification on what the intended behavior is assuming no bugs:

  • A play count only counts for every total cumulative playtime of the track duration.
  • A starline first appears when ~90% of the track duration has cumulatively played.
  • On standard shuffle every track in a playlist should play once before repeating, excluding manual intervention. This effect resets on app restart.

Taiko2k avatar Feb 07 '24 22:02 Taiko2k

All tracks are local.

Thanks for the specifics on how shuffle and play counts works. It's good to know. I'm not sure about the first two, I need to pay attention when playing music, but the last one, where each track should play once before repeating doesn't seem to happen. But I understand that I can't base it off of the play counts to know whether a track is being repeated and other is not being played at all.

I will make a new playlist with less tracks and try to diagnose it.

Will let you know.

agichim avatar Feb 17 '24 13:02 agichim

So, here are some news.

The playlist is 1 album which contains 18 songs. The option for the playlist to "Stop playback" after all songs were played was checked or activated but it didn't do that, it kept playing. This list is the shuffled order in which the songs played. Will explain what I marked.

  • The first song in bold was repeated (see no. 14 in bold) before the playlist played each song once.
  • The asterisk (see no. 19) is where finally all the songs played once (except for Mother I Sober which played twice) and I assumed the playlist would stop playing.
  • Then, obviously, if the playlist doesn't end, it would repeat the songs again, so Crown was the first one to repeat after all songs played.
  • The playlist kept playing and didn't stop.
  1. Mother I Sober
  2. Auntie Diaries
  3. Rich Spirit
  4. Rich (Interlude)
  5. Mr. Morale
  6. Worldwide Steppers
  7. Savior
  8. Father Time
  9. Crown
  10. Die Hard
  11. N95
  12. United in Grief
  13. Savior (Interlude)
  14. Mother I Sober
  15. Purple Hearts
  16. Count Me Out
  17. Silent Hill
  18. We Cry Together
  19. *Mirror
  20. Crown

agichim avatar Feb 18 '24 14:02 agichim

Just now played a playlist with 1 song only and it repeats instead of "Stopping playback".

agichim avatar Feb 18 '24 14:02 agichim

Another update.

I played this 5 songs which are in the same folder. Double-clicked on the playlist, the first song marked in the screenshot played twice in a row.

image

agichim avatar Feb 18 '24 14:02 agichim

Currently shuffle plays continuously and overides "Stop at end of playlist", that's expected behavior as it is.

Currently shuffle only avoids repeats for songs selected by song transitions, so the first song you play won't count for shuffle avoidance. The feature was intended to generally avoid playing the same track but not strictly so. One could argure this should be changed as a bug/feature request so that user selected tracks do count.

Taiko2k avatar Feb 18 '24 23:02 Taiko2k

I understand. So it would seem in my playlist of 18 songs no song was repeated. Interesting. When I used to have Windows I was using AIMP. I only have a general feeling the shuffle was good and perhaps the first song that would play when first playing a playlist wouldn't get repeated. I think that behaviour is more favourable.

I will try now a playlist with more songs, see what happens.

agichim avatar Feb 19 '24 00:02 agichim