Proof Shuffle Play is NOT Truly Random

I’ve noticed a pattern over time and I’m seeing more of it now, in Shuffle Play.

First, I’m wondering if Infused does what I would think for Shuffle Play: Get a random number from the OS random number generator and use that to pick which file, from a list of files, it’ll play next. I don’t know if Shuffle Play keeps track of what has been played to avoid playing it for a while.

I am often playing from the TV Show section of my library. I’ve ripped a number of older TV shows off the DVDs (yes, DVDs I legitimately bought) onto my media server. While I usually leave these on for what I call BGTV (background TV) while I’m working, I do sometimes notice what’s playing. When I started to see what I thought maybe patterns, I started looking more closely. For instance, when I Shuffle Play a show with 3-5 seasons, it looks like a lot of episodes from the last season tend to play a lot.

Recently I set up a Saturday Morning collection, with a folder filled with the shows I used to see as a kid on Saturday mornings - along with a few other animated shows. Most of these shows lasted just one season. I have 35 folders, one per show, in my collection and I’ve put it on for 3 Saturday mornings now - leaving it on for 3-4 hours each Saturday morning. I started by leaving it just playing without doing anything. But then I noticed, even on the first day I did this, that some shows would play 3 or more episodes in one session. After the 2nd episode of a show, I’d FF through to skip the 3rd one.

So although I may have only played from this list for 12 hours, there are many times an episode has shown up that I’ve fast forwarded through or skipped because between 1-4 episodes of that show have already shown up in that session. Now, after 12 hours or so of Shuffle Playing the collection directory (and that includes videos I’ve just skipped when they came up), out of 35 different folders, it has only played videos from 7 folders. 3 of those folders are within the last 1/3 or 1/4 or so of the list.

While I’m not writing down specifically which shows are showing up, this goes along with my observation that when I Shuffle Play a particular series, it often tends to play more videos from the last season than giving some kind of more even distribution.

I know that “random” often results in two shows from the same folder (out of 35 folders) following each other, but when it’s 35 folders, most with roughly the same number of episodes in them (15-22 or so), and I get episodes from the same range of 22 files playing 3 times in a row and 4 times out of 5 (it played one from a folder, went to another folder, then back for the 3-in-row), it makes me wonder if the RNG is really random, especially when it keeps pulling from the same 7 out of 35 folders over and over.

EDIT/ADDENDUM: I’m working out numbers now. I don’t have final figures, but this pretty much backs up that something is wrong and Shuffle Play is NOT truly random. I forgot that I have some folders with shows like The Flintstones and Looney Tunes. Looney Tunes, itself, is about 25% of my collection. The Flintstones is 10%. Together these two make up 1/3 of the collection, yet not one file from either has been played. When I restarted today, it did include an eighth directory, but still sticks with the same directories. Those 8 directories make up 12.5% of my collection. I’ve tried playing and FF’ing through a number of episodes today to see what I’d get. By now I have to have played at least 50 different files and ALL of those 50 are in 12.5% of the collection.

This is NOT random. I don’t know if the issue is in how Infuse handles random numbers in Shuffle Play or if it’s a problem with the TVOS RNG, but something is wrong.

I’m still experimenting. I’m going to go though and play a number of files, tracking what is played,

Here are numbers to back up what I’m saying. I selected my folder “Saturday Morning” in the folder “Collections.” I have 35 folders within “Saturday Morning.” Each is one TV show that I tended to associate with Saturday morning TV (even though some are far later than when I was growing up). Each folder represents one TV series with the episodes as files within it. I think I need to include that these folders do not have the files in them, but symlinks to the actual files elsewhere on the NAS. I have checked to be sure the symlinks are correct, using ‘ls’ and noting the color of each symlink to be sure it was valid and not linking to an invalid file. I also randomly played some files, from symlinks, in folders that were being ignored.

Today I hit “Shuffle Play” and let it play through 50 files. When a file started playing, I noted the series title and file info (usually written as something like S01E12, for Season 1, Episode 12). Then I pressed the button on my remote to pause it and moved to the end of the file and let it go from there to the next file. After 50 files I stopped to look over the data. I want to note that when I have not paused and moved to the end, but just let the files play, I would still get files from only 8 folders.

Here’s my folder list, including how many files are in each folder and what percentage of the total files in the Saturday Morning folder and subfolders are in that particular subfolder:

(Note a typo for WackyRaces as JrackyRaces. I first saw that when I was Shuffle Playing this for the first time and, on seeing what was going on, left it like that to not change what I was observing.)

I’ve highlighted, in red, the directories that Infuse is picking from for Shuffle Play. Note that out of 1,535 files, the folders it’s playing from are a total of 151 files, or less than 10% of all the files available! I know I only played 50 files, but when I’ve Shuffle Played this group of files before, the results were the same: EVERY file it played was in those 8 directories, or from less than 10% of the total files.

Here is a list of the 50 files it played:

I had originally listed all the files in the order they were played in, but when I created Categories to help me total up how many were played from each directory, it sorted them out. I copied the totals to the 1st page of the spreadsheet (1st photo) and then realized if I undid the categories, that would undo copying the totals as well.

I do note that within the 10% of files it’s playing, it’s not repeating the same files over and over. Also, when you look at the totals in each folder, one has 36 files, but the rest have from 13-22. So, just on ROUGH guestimates, I’d expect Aquaman (with 36 files) to show up twice as often as the others, and it comes close to that (when you check the percentages in the first page). It seems, within the limited range of numbers Shuffle Play uses, it’s fairly evenly distributed, but it still ignores over 90% of the available files.

I’d like to add I’ve seen this when using Shuffle Play with single folders, instead of a folder with subfolders in it. I haven’t done anything as rigorous as this, but one example is the show Get Smart, which ran for 5 seasons. I played this show in Shuffle Play a fair amount and found that each day I did that, the same episodes tended to show up and many were from the 1st and last season. If you just look at Page 1, you can see that clusters of folders toward the end and the start. When I had left Get Smart on Shuffle Play for a number of days, and for long times, I scanned the folder in Infuse and saw that there were clusters of areas where a lot of files were played (including ones I know were played many times) and large clusters of files that never showed up in Infuse as played.

I don’t know if this is an issue with Apple’s RNG, or with how Infuse is handling RNGs in Shuffle Play, but this is NOT random and this shows a serious flaw in Shuffle Play on Infuse.

Can you provide a bit of info on how you have these items organized?

One thing to keep in mind is that Shuffle and Loop will not work recursively (IE subfolders) so only items that are in the current folder will be selected. This can get a little confusing with TV shows since a folder of items may be flattened into a season item, and that would be included.

One thing you can try is to use the Shuffle option on one of the Library categories (EG All TV Shows) and see what kind of playback results you get.

PS - There is a suggestion thread for recursive folder shuffling, but this isn’t very high on our list right now.

It is recursive. I have a folder, “SaturdayMorning,” and in there, I have the folders for all 35 of the shows I’ve mentioned.

A few thoughts on this:

  1. If recursive Shuffle Play is not supported, then when someone attempts to shuffle play a folder with subfolders, a warning would be appropriate. Something like, “There are subfolders in this folder. Shuffle Play does not work properly with subfolders.”

  2. It seems to me this would be an fairly easy to add - depending on whether Infuse generates one long list and uses it throughout the Shuffle Play process, or if it generates a new list each time it picks an item to play.

  3. I get that there are other things more pressing. (Although I’ve still never seen much improvement over my minutes-long-waits when stepping through folders to find what I want to play…), but this seems to be a feature people want and that would be easier for the developers to add than it is for users to create work-arounds.

  4. I’m not sure about what is needed to get it to work properly with recursion, but it seems to me that it only picking about 20% of the directories still indicates an RNG issue. As I also mentioned, I have shows that have, say, 5 seasons, and I’ve found that after Shuffle Playing those shows (each show in its own folder, but not with subfolders for seasons or anything like that), I’ve found many episode unplayed. I’m wondering if I’d have to do something similar to support that concern.

1 Like