• Status Closed
  • Percent Complete
  • Task Type Bugs
  • Category Playlists
  • Assigned To No-one
  • Operating System SW-codec
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by Paul Louden - 2009-06-06
Last edited by Jonathan Gordon - 2010-01-21

FS#10288 - Resume after "Insert Shuffled" incorrect.

This one's easy to reproduce. With music stopped, do "Insert Shuffled" on a folder. You're in playlist position 1 at this point (first song out of however many you just inserted). Stop playback. Resume playback. You'll be in the same song, but it will now be in an entirely different location in the playlist.

Still occurs as of 21199

Closed by  Jonathan Gordon
2010-01-21 07:28
Reason for closing:  Accepted
Additional comments about closing:  

thanks! in r24303.

Paul Louden commented on 2009-06-06 19:43

To clarify: the playlist is apparently rotated. The order is the same, but the playlist positions are rotated.

Dave Hooper commented on 2009-07-12 12:32

I can't reproduce this on ipod5g sim. The dynamic playlist appears to be the same after folder insert shuffled, as it does after subsequently stopping and resuming.

Tomasz Kowalczyk commented on 2010-01-16 11:10

I can reproduce it on real fuze and on fuze sim as well.

Jonathan Gordon commented on 2010-01-18 07:49

Right, well im confused tired and wondering WTF?

guarenteed repro:
stop playback, "insert shuffled" on a folder. not the playlist order. stop playback, resume playback, not the order.

recreating the playlist by hand from the .playlist_control gives me the correct order (unsurprising really) which means I think the issue is that the files arnt being inserted where the playlist_control thinks they are.

edit: well creation looks correct also :(

Tomasz Kowalczyk commented on 2010-01-18 08:26

Order is disturbed during playback stop before resume. Please take a look at playlist after playback stop.

Other observation based on inserting directory with 3 songs and .playlist_control |position| value after directory insertion:
000, 001, 010, 002 - error after playback stop
011, 012 - everything ok
It's looks like error happens only when any song is inserted before first song in playlist.

Is there any .doc about playlist concept and implementation? I've found only few lines in playlist.c but nothing in deep.
Can playlist→index and playlist→first_index have negative value?

Jonathan Gordon commented on 2010-01-18 08:35

what gives you the idea that its breaking between stop and resume? (and on which side of the "no audio" gap?)

I dont think there is any docs for this, its all pretty old code :/

I *think* playlist→index is the index of the current tack, and first_index is the index of the first track in the playlist. neither should be <0 if thats correct.

Tomasz Kowalczyk commented on 2010-01-18 09:14

I think it happens during stopping playback. Test it as follows:
1. turn on sim/device
2. insert_shuffled directory
3. Take a look at: Main_Menu→Playlists→View_Current_Playlist - everything is ok and in line with .playlist_control content
4. Turn back to Main_Menu→Playlists
5. Stop playback pressing Home for fuze/fuze sim or something else for other players
6. Again take a look at: Main_Menu→Playlists→View_Current_Playlist - you will see rolled playlist not in sync with .playlist_control

I agree with playlist→index and first index meaning but concerning negative values i found following code

797 : if (insert_position < playlist→last_insert_pos ||
798 : (insert_position == playlist→last_insert_pos && position < 0))
799 : playlist→last_insert_pos++;

Position can be negative?

Jonathan Gordon commented on 2010-01-18 18:04

if position is still negative at 798 then its a bug… I don't tihnk it should be able to be.
position can be negative (PLAYLIST_INSERT* are defined to negative values)

Tomasz Kowalczyk commented on 2010-01-20 16:52

Got it and here is the patch.

Jonathan Gordon commented on 2010-01-20 17:07



Available keyboard shortcuts


Task Details

Task Editing