Red Hat Bugzilla – Bug 809166
random ordering does not work correctly
Last modified: 2012-04-12 15:57:36 EDT
Description of problem:
I had 990 songs in the play list, then I've added another 30 songs. After two days of listening I did not remember any of the new song being played at at all.
There are 990+30=1020 songs, 30 of them are new. So there should be 2.9 % chance that next song is one of the new ones, or worded differently every 34th (in average) song should be one of the new ones. I've tried to hit the "next" button again and again until I get one of the new songs. Well... after 350 clicks it did not choose any of them and I gave up. Mathematically speaking, the chance that there is no new song in the 350 of 1020 is 0.0029 %. And that's only what I'm sure of, more songs were played during last two days and I'm pretty sure none of them was the new one.
So my conclusion is that the algorithm choosing the next song does not work well.
Version-Release number of selected component (if applicable):
Could you attach file "$HOME/.config/audacious/playlist-state"?
What you describe sounds to me as if you may have listened to those 30 tracks before activating "Shuffle" mode.
"Shuffle" is not brute-force random of all playlist entries, but a more sophisticated implementation where Previous/Next continues to work for the played sequence of tracks. It marks every played track with a number and picks a random track from the remaining tracks. So, you would need to press "Next" 1020 times for the sequence to repeat.
playlist-state file isn't used anymore compared with F-16, but the shuffle implementation hasn't changed. Source file src/audacious/playlist-new.c (search for "shuffle_"). Random selection of previously unplayed tracks is in line 2079, "rand() % choice" where "choice" is the number of unplayed tracks.
Seems you are right. There is some kind of list. I chose 900th song and with random=off hit next till the end of the playlist. Then I turned random=on again. Now, every 10th song should have number above 900, but in next 100 (+-) there were only those with lower numbers.
So it seems it works the way it was designed after all. I thought the list gets cleared once you turn random on/off (at least with random off, it won't skip songs it played already I guess). Anyway, I can achieve the behavior I want by randomizing the list and starting with 1st song together with random=off (restarting the application works too).
You can close this bug report.
Reporters can close their bugs, too. ;)