Bug 809166 - random ordering does not work correctly
Summary: random ordering does not work correctly
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: audacious
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michael Schwendt
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-02 16:35 UTC by Michal Hlavinka
Modified: 2012-04-12 19:57 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-04-12 19:57:36 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Michal Hlavinka 2012-04-02 16:35:58 UTC
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):
audacious-3.2.2-1.fc17.x86_64

Comment 1 Michael Schwendt 2012-04-02 17:13:26 UTC
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 17:48:36 UTC
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 12:43:16 UTC
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 19:57:36 UTC
Reporters can close their bugs, too. ;)


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