Rockbox

Tasklist

FS#2381 - Song gets repeated at random playlist

Attached to Project: Rockbox
Opened by Thomas Kobler (kobler) - Friday, 05 November 2004, 07:15 GMT
Last edited by Daniel Stenberg (bagder) - Wednesday, 09 March 2005, 10:32 GMT
Task Type Bugs
Category Playlists
Status Closed
Assigned To No-one
Operating System
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Recorder 8MB, (flashed) Rockbox (daily build 041001)

Since about four months Rockbox repeats (playes twice
at once) - I guess - about every 50th song from a 9000
songs random played list.

Another thing with random play is, that I've got the
impression, that some files are prefered and some never
gets played. To be more precise: I usually only come up
to the first few hundred shuffled songs of my 9000
songs playlist before it gets reshuffled and some songs
are played very often, and others I'll never hear.
Is there any chance, that the randomizer has only a
limited resolution (less than 2^15 ?) or the maping to
the playlist index is incorrect?

Thank you.
This task depends upon

Closed by  Daniel Stenberg (bagder)
Wednesday, 09 March 2005, 10:32 GMT
Reason for closing:  Fixed
Comment by Linus Nielsen Feltzing (linusnielsen) - Friday, 05 November 2004, 07:31 GMT

We've had several reports about repeated songs and badly
weighted shuffle, but so far nobody has been able to back
their claims. It has always turned out to be duplicate
entries in the playlist or just bad (human) memory.

Are you sure that some songs never get played? Have you ever
played the entire 9000 song playlist and remembered that a
certain song never got played?

I'll try to investigate this as well.
Comment by Linus Nielsen Feltzing (linusnielsen) - Friday, 05 November 2004, 15:45 GMT

I have investigated the code and I have indeed found a bug
that was introduced about 4 months ago. I'm working on a
solution.
Comment by Thomas Kobler (kobler) - Friday, 05 November 2004, 17:46 GMT

Thank's again, for all your efforts!

>Are you sure that some songs never get played?

This isn't what I wanted to say. I have the impression, that
in the first few (let's say 200 of the 9000) there are
always a couple of songs, which gets prefered in the
shuffling to be at the upper/earlier position. I'm sure the
algorythm plays all files in the list, but several more
often at first. I noted down a few shuffles of nine songs:

754619328
864573921
582769143
936528417
914687235
854763192
619573248
475692831
457682931
435267891
435267918
568193247
375691428
354968217
264987315
765918432
946782135
786912345
796582314
439761825
398562147
759632841
458297316
278561943
479562318
649578132
895279146

All songs gets played, but e.g. never the first song at
first. Is there special code to achive this?

To realy be sure, one would need a method to get the list(s)
and make a histogram..

I guess a solution would be to only create a new seed for
the random generator and reshuffle, if the list is played
completely. I think now a new seed is generated every time
shuffle is switched on or a different playlist or another
file get's played. If we could keep the seed and a bookmark
for every playlist, every song would be played once, I think.
Comment by Linus Nielsen Feltzing (linusnielsen) - Friday, 05 November 2004, 22:54 GMT

We (re)seed the generator when starting a playlist/directory
playback. The bookmarks store the seed, otherwise we
wouldn't be able to regenerate the exact same shuffle when
we resume. So the solution to the 9000-file playlist problem
would be to bookmark the position every time you want to
play something else.

BTW, I found a bug in the shuffle code that could make an
uneven distribution, and possibly even duplicates. I'm
working on it.
Comment by Linus Nielsen Feltzing (linusnielsen) - Monday, 08 November 2004, 01:22 GMT

I believe this is fixed in the daily builds. Please try the
latest daily build and tell me if it works.
Comment by Björn Stenberg (zagor) - Monday, 08 November 2004, 11:17 GMT

Even if the distribution was poor, I don't see how it could
cause duplication (repeat). Since the list is shuffled by
swapping tracks with each other, each track can only ever be
listed once no matter how bad random function is used.
Comment by Linus Nielsen Feltzing (linusnielsen) - Monday, 08 November 2004, 11:32 GMT

The (supposed) duplication wasn't caused by the poor random
distribution, but a bug in the playlist shuffle code, that
could read outside the index array.

However, that bug could only cause at most 1 single
duplicate in the entire list, and only under special
circumstances.

I'd like to see if Thomas can verify if there really is a
repeat.
Comment by Thomas Kobler (kobler) - Monday, 08 November 2004, 20:24 GMT

Test the whole day with great pleasure :-)
No songs played twice at once and I'VE GOT A NEW DJ! ALL NEW
MUSIC ON MY ARCHOS :-)!! Thank you! None of the usual
suspects came to my ears today! Rockbox played songs I've
never heared before. But I just managed to hear less than
100 songs from my big playlist this time, so I'll keep
testing .. :-)
Comment by Thomas Kobler (kobler) - Tuesday, 09 November 2004, 12:38 GMT

still current buildt 041107 on Recorder8MB, shuffling big
playlist

Bad luck. I had two dublicates today. When the song started
the second time, I checked the display and saw it was song
number 32 of the playlist. Then I shortly pressed rewind
twice to go to the previous song. It displayed 31 and showed
the name of the same song and played it, too. Then I skiped
again to the next - and suprisingly I got a different song
(dis)played!! Strange..
I'll recheck this next time and try to get more info. With
the playlist viewer I can't see any dublicates at all.
But anyhow, the new shuffling/random is still very good!!
Comment by Linus Nielsen Feltzing (linusnielsen) - Tuesday, 09 November 2004, 12:42 GMT

OK. This means that the duplicates don't come from a bug in
the shuffling, but from a bug in the code that fetches the
songs from the playlist.
Comment by Thomas Kobler (kobler) - Wednesday, 10 November 2004, 08:38 GMT

still current buildt 041107 on Recorder8MB, shuffling big
playlist
It is even more strange: Song played twice, I paused, and
skipped back and forth through the songs:
14+15 are the same, 13 doesn't get played at all (always
skipped when skipping) 12 and 16 are normal. In the playlist
viewer the double played song (14/15) is only showed on pos.
14! 13 and 15 are different songs. If i selet the song 13
from the playlist viewer, it doesn't get played. If I select
it from file browser, it playes. I can even bookmark and
resume this twisted playlist. 12 playes, 13 is skipped, 14
playes, for 15 song 14 gets played, and 15 plays normal again.
This is all I'm able to figure out.
Comment by Linus Nielsen Feltzing (linusnielsen) - Wednesday, 10 November 2004, 08:49 GMT

Can you save the current playlist and send it to me, along
with the original, unshuffled playlist?

linus at haxx.se
Comment by Thomas Kobler (kobler) - Wednesday, 10 November 2004, 09:45 GMT

/RockPop/Neil Young/Decade/22 Heart Of Gold.mp3
gets played
/RockPop/DZihan & Kamien - Gran Riserva/01 Stiff Jazz.mp3
gets skipped
/RockPop/Frank Zappa/ahead of their time/12 help im a
rock.mp3 plays
/RockPop/Queen/Live Killers/09 Now I'm Here.mp3
not played, but above one again
/RockPop/Alice/Non Ti Confondere Amico.mp3 ok
/RockPop/Heather Nova/Glow Stars/05 Glow Stars.mp3 ok

you cold generate all the mp3 files by copying a (very
small) mp3 file for every playlist file, if you need it for
testing:

for /F "tokens=*" %f in (RockPop.m3u) do copy small.mp3 "%f"
Comment by Thomas Kobler (kobler) - Wednesday, 10 November 2004, 09:49 GMT

Sorry, forgot the checkmark for the file upload..
Comment by Thomas Kobler (kobler) - Wednesday, 10 November 2004, 09:53 GMT

Sorry, attachment didn't work, next try..
Comment by Linus Nielsen Feltzing (linusnielsen) - Monday, 15 November 2004, 00:49 GMT

I believe I have fixed the repeat bug now. Can you try the
latest bleding edge and tell me if it works for you. It
should no longer repeat any files.
Comment by Thomas Kobler (kobler) - Friday, 19 November 2004, 18:31 GMT

Version 041119, Recorder 8MB

Created a long Playlist with every second song missing and
first tested with the buildt 041107 and bookmarked a
repeatedly played song. Than I roloed into 041119 and
started the bookmark. The song didn't got repeated anymore
and every missing song seems to be skiped without a problem.

THANK YOU!
Comment by Linus Nielsen Feltzing (linusnielsen) - Friday, 19 November 2004, 19:52 GMT

Thank *you* for helping us find and fix these 3(!) bugs.

Loading...