What's Wrong with the Shuffle Algorithm?

Hello all,

When on shuffle, we hear the same songs over and over while never hearing some songs. I have confirmed this problem by looking at the play count in the iTunes from which I am streaming. A whole bunch of songs have high play counts (as high as 22) while a large number of them have a play count of 0!. Adjusting the shuffle settings in iTunes does not make a difference as the ATV seems to be using its own shuffle routine. Any way to fix this annoying problem?

MacBook Pro and Windows XP Box, Mac OS X (10.4.10)

Posted on Feb 10, 2008 11:42 AM

Reply
23 replies

Feb 10, 2008 12:10 PM in response to Alley_Cat

Hi Alley_Cat,

Thanks for the response and I'm sure we could jaw through the night about the true meaning of randomness in the universe but programmers have realized this for some time and have come up with "work arounds". For instance, iPODS do a pretty could job of "random" shuffling and iTunes has the shuffle slider bar you can adjust. Maybe ATV 2.0 will be better... I see on other posts that it is poised for release.

Feb 10, 2008 2:08 PM in response to Andrew Friedman1

Hi Andrew,

Thanks for the response but I am streaming through a box running iTunes. The 40GB ATV internal drive does not do me much good (accept for photos as my screen saver). My box running iTunes has access to over 3 Terabytes (yes, I am bragging). On a side note, I chew up a lot of disk space because I rip music in a lossless format. Anything else sounds like cr@p. Check out how the iPOD killed high fidelity at http://www.rollingstone.com/news/story/17777619/thedeath_of_highfidelity.

Feb 10, 2008 7:23 PM in response to wd5

This is an old problem that goes back to the original iPod. Such algorithms aren't actually true random number generators, they use the device's clock to pick numbers, thus are limited by the clock cycle.

It also appears to me that the song selection is weighted by how many times a particular song has played, which means that the more often a song is played, the more likely it is to be selected again. It essentially creates its own favorites list.

The shuffle algorithm is definitely in need of revision.

Feb 11, 2008 5:55 AM in response to capaho

Just a bit of useless info,

The only true rnadom event is the time between radioactive decay.

But iTunes / iPod doesn't help.
If you shuffle albums, a random track is selected and the rest of its album is played through to the end. So your randomness tends to favour the final tracks on an album.
If you shuffle tracks, you should get fairly good randomness. Not sure what it uses to determine the next track number, but you would need billions of tracks to throw out even the simplest of seeded pseudo-random number generators, ie. using the current track number to generate the next.

Are all the tracks selected, ie. have the little tick next to the track name in iTunes ?

Feb 11, 2008 6:44 AM in response to Simon Teale

Hi Simon,

Ah... Does that not assume that all things expire randomly?

I am shuffling all songs in the library. It certainly doesn't seem like the ATV is using the current track number to "randomly" calculate the next one. It looks like the shuffle order is calculated when I choose shuffle as I can skip forward and back and the song order stays the same. I like the theory that it is using the system clock time to feed a very weak shuffle algorithm. I guess a pure RNG in the unit would have cut into Steve's paycheck.

But Marc's suggestion works great!

Feb 11, 2008 7:11 AM in response to wd5

Check out how the iPOD killed high fidelity at http://www.rollingstone.com/news/story/17777619/thedeath_of_highfidelity.


You're confused between two completely different processes, both of which are called compression. What the article is about is dynamic range compression: reducing the difference between the softer and louder parts of the music, in this case specifically by raising the loudness of the softer parts of the music to make the whole thing sound louder.

MP3 and AAC compression, as used in iTunes, doesn't do that at all: what it does is to reduce the data size of the music by both using standard lossless data compression methods and by taking advantage of psycho-acoustics, in that some sounds will mask (make inaudible) others if both are present at the same time. How noticeable MP3 compression is depends on the nature of the music being compressed and how severely it is compressed.

With regard to how the music sounds, MP3 and AAC compression aren't supposed to make the music sound different (any difference is considered a flaw in the process). Dynamic Range compression, on the other hand, IS supposed to make the music sound different: that's the whole point of doing it.

By introducing MP3 compression into the discussion, the article only confused matters. Dynamic range compression is aimed mainly at radio airplay: in general, the louder a song, the more it tends to capture listener's attention. This causes radio stations to compress everything they air in order to make their station louder and more attention-grabbing, and it causes producers to compress their music in order to make it louder and more attention-grabbing. These loudness wars began long before the iPod appeared on the scene and aren't being done because of it. Further, ripping all your music losslessly does nothing to fix it. Lossless compression may ensure that you don't make the music sound worse by introducing MP3 compression artifacts, but it isn't going to have any effect on problems caused by dynamic range compression in the original recording.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

What's Wrong with the Shuffle Algorithm?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.