Shuffle is not random
In shuffle mode the player is playing the same songs. Can do something to shuffle be random, and not be "shuffle" with same intervals?
#2 Updated by Виктор Пономарёв over 6 years ago
My English is bad. I'll try to explain better.
There is a list of 300 songs. If I turn to play the songs in shuffle mode, play the same songs, but do not play other songs from this list. As if the player chose a certain interval, and includes songs in sequence. But with 300 songs played only a part of them, the other part is not played at all. I watch it about 1 year. I'm tired of hearing the same thing. I want a real change.
#4 Updated by Виктор Пономарёв over 6 years ago
Yes, John. It looks like this:
1...50...100...150...200...250...300 – is number of songs (N=300).
If play with shuffle mode, songs are played in sequence:
It is an intensified model of play. I want to show that, for example, 5 – 45 songs never played.
The situation changes if the playlist is constantly replenished. If the compositions were 300, now is, for example, 400 (N=400):
1...60...120...180...240...300...360...400 – near these numbers player will choose songs for play.
As can be seen from the description, the player chose exemplary interval N/7. Again, my description is only a model for a visual explanation.
I propose to change the function of mixing, adding another a random variable:
S – function of shuffle mode,
N – the number of songs in a playlist,
A – random of N now,
B – additional random variable (from 1 to, for example, 50).
In such a case can be played songs other than 1 and 50, and near these numbers.
It is my suggestion. Perhaps you can find a better solution. I'm just giving an idea.
#9 Updated by michael b almost 6 years ago
I too am having the same issue with the shuffle play. Whatever the method is it is not random.
I have 342 songs and playing and in 8 hours I can hear some songs upto 4 times EVERY day. And other songs are never played.
But if I manually forward to the next song then its does seem to be random and I'm unable to see a repeat easily.
Honestly, you have an issue. I'm now tired of the repeated some and missing on others so bye bye Audacious! sorry
#10 Updated by Thorsten Lisker over 3 years ago
While this is an old thread, I am definitely observing the same issue: the list of actually played songs appears not truly random over the course of ~8 weeks, but is very much like Виктор Пономарёв described (that's what brought me here). If it takes the rand() function, fine - but is this somehow re-using the same seed or re-using a previously generated list!? Just wondering whether more people are having this issue. Thanks!
I am indeed getting closer to what Michael said, "I'm now tired of the repeated some and missing on others..."
This is Audacious 3.7.2 on kubuntu 16.04
#11 Updated by xyz dragon about 3 years ago
I didn't look at the code, but I think one problem could be that audacious does something like this:
songToPlay = rand() % nSongs
But this means, that not only the order, but also the amount each song is played gets randomized. This can be tested easily with the attached file. E.g. For 10 songs to play tack 4 gets played the first time after 44 tracks being played! In the meantime track 2 gets played 8 times. At average each song should have been played 4.4 times already.
Or for the example used above, i.e. 300 songs, the attached program returns:
All songs were played at least one time after 1665 tracks being played.
These are the top ten most often played tracks out of 300 total tracks to play after 1665 tracks being played, i.e. at average each track should have been played 5.55 times!
Track 228 played 13 times
Track 284 played 13 times
Track 290 played 12 times
Track 129 played 12 times
Track 40 played 11 times
Track 297 played 11 times
Track 5 played 11 times
Track 4 played 10 times
Track 225 played 10 times
Track 224 played 10 times
These are the 10 least often played songs:
Track 271 played 2 times
Track 207 played 1 times
Track 48 played 1 times
Track 44 played 1 times
Track 191 played 1 times
Track 175 played 1 times
Track 156 played 1 times
Track 255 played 1 times
Track 266 played 1 times
Track 116 played 1 times
Track 277 played 1 times
If this is really how audacious shuffles the track list, then instead it should preshuffle the tracklist internally using randomized swaps and then play that list. This guarantees that after 300 out of 300 tracks being played each track will be played exactly one time, but with a random order. And then after 300 tracks being played the internal tracklist needs to be shuffled again. This of course means additional work for audacious because it needs to manage the internal shuffled state of the tracklist e.g. in an internal variable or in /tmp/.shuffled-13315.m3u.
#12 Updated by John Lindgren about 3 years ago
xyz dragon, you're the first person in this thread to make a real attempt to understand how the shuffle algorithm works. Thank you for that.
Really though you should have looked at the code; it's not quite that simple. Audacious does keep track of an internally shuffled list so that each song is played once before repeating, but that list is currently not saved when you close the program. So if you have a short playlist and play it to completion, you'll hear each song once. If you play a whole collection of 1000+ songs on shuffle, restarting Audacious every day, you'll hear some songs more often than others, as you observed in your test program.