release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Wiki > Main > ShuffleExplained (compare)

Difference: ShuffleExplained (r2 vs. r1)

How Shuffle Works in Rockbox

Goals

When we designed and created the Rockbox shuffle concept, we had a few goals:

  • true shuffle that won't repeat a single song until all songs in the list/dir have been played
  • resumable - when the box has been switched off and is later turned on, we should resume the same song at the same index in the shuffled playlist/dir
  • support limitless back - at any time, even after resuming, you can always go back to the previously played song(s)

General Playing

All song playing in Rockbox works on a list of songs. When you play a dir, it builds a list of song internally and plays that. If you play a playlist, it loads that list and plays it. (Playlists are stored internally as a long list of indexes into a file on disk where the actual song name is stored.)

Playing Shuffled

Rockbox generates a random seed and re-orders the internal list with the random function (Mersenne ( Twister). When storing resume info, the random seed is stored and thus later re-used again when the same random order is wanted. Mersenne Twister). When storing resume info, the random seed is stored and thus later re-used again when the same random order is wanted.

r2 - 19 Jun 2008 - 12:59:12 - EddyComan

Revision r2 - 19 Jun 2008 - 12:59 - EddyComan
Revision r1 - 31 Mar 2005 - 08:51 - DanielStenberg
Copyright by the contributing authors.