dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Re: randomness and playlists

Re: randomness and playlists

From: Daniel Stenberg <>
Date: Thu, 2 May 2002 13:35:39 +0200 (MET DST)

On Thu, 2 May 2002, Andrew Jamieson wrote:

[I'll just fill in some more, even though Linus already replied]

> * What are you planning to use as the entropy source for the random seed?
> The least significant digits on keystroke timing and hard disk spin-up
> timing is sometimes used in crypto circles. Also there are the A/D inputs
> (that go somewhere, and may not be usable, I'll check this).

I don't think we need a very complicated way to get a seed. We can get it
from a timer or whatever.

> * What algorithm are you thinking of for the iterations (something like
> SHA-1 would be indistingushible from random for our purposes, but is
> probably overkill)?

As we will use the rand() function to sort the list of tracks in memory, we
will need to use fast one, and again, we don't need state of the art
randomness, just pick a fairly random one.

> And how do we stop songs repeating?

Since we're using a list of (scrambled order) tracks we just advance the
index in the table to find the next track to play. The previous track is the
one with the previous index.

Since we scramble the same way always with the same seed, we can use back
even though you just powered up your Archos. Then it'll play the track you
last played when you had it on!

We won't repeat the same track until we reach the end of the list and start
over again from the beginning. Or if you re-scramble the list.

> Just trying to make myself feel useful (or at least annoying) ;)

Bouncing ideas and thoughts around is a great way to help out!

  Daniel Stenberg -- Hacking Archos =>
Received on 2002-05-02

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy