This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 809166 - random ordering does not work correctly
random ordering does not work correctly
Product: Fedora
Classification: Fedora
Component: audacious (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Michael Schwendt
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-04-02 12:35 EDT by Michal Hlavinka
Modified: 2012-04-12 15:57 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-04-12 15:57:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Michal Hlavinka 2012-04-02 12:35:58 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):
Comment 1 Michael Schwendt 2012-04-02 13:13:26 EDT
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.
Comment 2 Michael Schwendt 2012-04-02 13:48:36 EDT
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.
Comment 3 Michal Hlavinka 2012-04-03 08:43:16 EDT
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.
Comment 4 Michael Schwendt 2012-04-12 15:57:36 EDT
Reporters can close their bugs, too. ;)

Note You need to log in before you can comment on or make changes to this bug.