Help - Search - Members - Calendar
Full Version: How Does iPod Shuffle Songs?
Hydrogenaudio Forums > CD-R and Audio Hardware > Audio Hardware
Iggy64
Does anyone know how the iPod's "shuffle" feature works?

If I tell iPod to play a certain playlist, but to do so in "shuffle" mode, does iPod fill up its buffer by pulling songs from the playlist in a random order?

Or does it choose one song at random, play it, and then go off and choose another song, without using the buffer?

Obviously, the first method would be much better for the battery life, since the hard disc would start up, get filled, and then rest for quite a while. The second method would require the disc to be restarted every three minutes or so, when a new song is loaded.

So which way does it work?

And, if it does it the first way (filling the buffer), does shuffle play yield battery life that is comparable to non-shuffle play?
mat128
There is no hard disk in the shuffle, only flash memory. That way, battery doesnt take a hit even if you read directly from the flash memory, that's how you can switch songs so fast on a nano/shuffle, something you can't so without experiencing delays on hd based ipods (regular/mini/photo/video)
canadiandude
For the 4th and 3rd gen iPod having owned both they use the method in which about 4-6 songs are read and stored in the memory (probably just the memory's capacity). I know this because if you skip the songs fast the iPod freezes for a second, spools the HD, reads then fills the memory back up. I would assume this is how all the HD based iPods work. As for the flash based shuffles and mini's I have no insight into this.
mat128
Exactly, same goes for my video ipod, except it only stores 3 songs in memory. I believe nanos read directly from the flash memory, having much less memory, since the power required to read from flash is normally about the same as reading from ram.
Iggy64
Thanks for the responses, everyone.

I guess I should have pointed out that the new iPod I received is a 5th generation unit with an 80GB hard disk. My understanding is that it has 64MB of memory, and that most of this is used to buffer the audio stream. (A few MB is used to upload the operating system at startup.)

In normal play, the operating system reads the selected playlist, and fills the buffer (~60MB) with songs, copying them from the hard disc. The hard disc then spins down and is dormant until the buffer is close to needing a refill. This way, the iPod conserves battery energy (by minimizing disc spinups) and keeps playback skip-free.

What I'm wondering about is - when I ask iPod to play back my playlist in random order ("shuffle mode"), does it utilize the buffer in exactly the same way, except that it now loads the buffer with songs chosen in random order, rather than in the sequence stored in the playlist? If so, then using the "shuffle mode" would not cause the battery to run down faster than in normal play.

I guess the bottom line question is: Does using random play (shuffle mode) use up the battery faster than standard (non-shuffle) mode?
canadiandude
QUOTE(Iggy64 @ Mar 18 2007, 17:32) *

I guess the bottom line question is: Does using random play (shuffle mode) use up the battery faster than standard (non-shuffle) mode?


They should use the battery at the same rate, shuffle may use a *tiny* bit more battery to run the random number generation script but I doubt that is very significant.
mat128
Sorry to the original poster, I thought you had an ipod shuffle. As far as the randomization is done, I think its very lightweight and shouldn't impact your battery life, the only bad thing about shuffling is that you are probably gonna skip more tracks, which means more buffering --> less battery life.
Mike Giacomelli
It determines the shuffle order in advance. It has to, your battery would only last a couple hours if it spun up the disk every time you finished a track.
TREX6662k6
^ Indeed, I figure it must create a playlist which has the tracks shuffled.
Theres also no RAM in the shuffle. Just flash.

BTW there is no fixed amount to how much an Ipod can buffer. It depends on the file.
Plus it doesnt only buffer full songs, it does as much as the RAM can allow.
Iggy64
Thanks, everyone.

It sounds like I can create my playlists with iTunes or MediaMonkey, or whatever - - and then use iPod's shuffle feature to randomize the play order if I so choose - - without worrying about running the battery down too fast.

It's really helpful hearing from all of you.
blip
A bit off topic, but has anyone else noticed that their iPod's shuffle mode is far from random? I have ~2000 songs right now, and sometimes I'll find that within the first 50 or so songs I'll listen to, I'll hear 5 or 6 from one album, 5 or 6 from another album, etc., as it keeps focusing on certain artists or albums. Just curious as to how their shuffling works, and why it's not random.
Thanks!
chelgrian
QUOTE(blip @ Mar 19 2007, 01:59) *

Just curious as to how their shuffling works, and why it's not random.


There are several possible answers.

Answer 1:

We have two long sequences of numbers and we take six consecutive numbers from some point in both sequences

...123456...

...314265...

Does the fact we have pulled out the natural numbers in increasing order mean the first sequence is less random than the second sequence? Surprisingly the answer is no both sequences are as random as each other but the first one looks less random as it has an additional meaning to us, the numbers are in their natural increasing order, it's how we were taught to count.

However within any sequence of random numbers there will be subsequences which appear to follow a pattern. Humans are very good at extracting patterns from noisy data however we have evolved to be so sensitive to trying to pick patterns out of the noise that we will frequently see patterns that aren't actually there.

Answer 2:

Believe it or not it's very difficult to get a computer to generate a really random number, there are various sources of entropy that can be exploited such as time between user input, certain properties of transactions across peripheral buses but in the end you usually generate a sequence of pseudo random numbers using a seed value and a pseudo random function. Now if you feed the same seed value into a pseudo random number function then it will give you the same sequence of numbers every time.

Answer 3:

Apple may have purposely written a weighted song selection algorithm which groups songs from the same album together on playback.
kornchild2002
I know that, in iTunes, you can make playlists appear more random. That is why I always make a playlist in iTunes and randomize it, then sync it with my iPod. I can look through the playlist in iTunes and make sure that everything is randomized to my liking. Even with the random features of iTunes set to most random, I still find that iTunes will clump some songs together.
sbooth
QUOTE(blip @ Mar 18 2007, 16:59) *
Just curious as to how their shuffling works, and why it's not random.

I don't know if iPods use the same shuffling algorithm as iTunes, but http://msnbc.msn.com/id/6854309/site/newsweek/ and http://www.omninerd.com/2005/08/25/articles/34 are interesting reads.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.