Jump to content

Shuffling a large playlist won't select songs later in the playlist?


Recommended Posts

Scarface1
Posted (edited)

I have a very long playlist, with 2000+ songs (I listen to a lot of music, okay) and I've noticed that once you hit Shuffle, the list of queued songs only goes up to around 1000. Fair enough, but I've noticed even after multiple shuffles that songs later on in the playlist aren't sampled by the shuffle. 

It's much more apparent when sorting by Title instead of Playlist Order, because all the songs in the queue have letters in the first half of the alphabet.

Basically it results in me only hearing the first half of my long playlist whenever I shuffle it, which is a shame because I'd like to hear my newly added stuff also.

Any ideas for a solution or a fix? If you need any more information just ask. Thanks.

Edited by Scarface1
  • Sad 1
Posted

Hello Scarface1,

** This is an auto reply **

Please wait for someone from staff support or our members to reply to you.

It's recommended to provide more info, as it explain in this thread:


Thank you.

Emby Team

  • Facepalm 1
Posted

Hi, we are looking into this. Thanks for reporting.

  • Facepalm 1
  • Thanks 1
visproduction
Posted

Just a guess:
modules/common/playback/playbackmanager.js 
IsNotFolder

getItems use of AlbumID... If AlbumID is missing in playlist data, does that stop the max number at the last valid song with an AlbumID value? Does the shuffle function get a lower max variable?  This would explain only the first part of a playlist being recognized because item #98 out of 200 has no AlbumID, so max variable =97 instead of =200.

Snip
===
mergePlaybackQueries({ParentId:firstItem.Id,Filters:"IsNotFolder",Recursive:!0},queryOptions),signal):"Audio"===firstItem.Type&&firstItem.AlbumId&&firstItem.SupportsResume&&1===items.length&&!getPlayer(firstItem,options).isExternalPlayer?promise=(serverId=_connectionmanager.default.getApiClient(firstItem.ServerId)).getItems(serverId.getCurrentUserId(),{Fields:PlaybackItemFields,ParentId:firstItem.AlbumId,Recursive:!0,IncludeItemTypes:"Audio"},signal).then(function(episodesResult){return updateResultSetStartingPoint(episodesResult,firstItem,options,isQueueing)}):

 

If a lower max variable is made, then the playback list shuffle will be limited.  The return Math.floor math works fine, but it requires a correct max variable.

Snip
===
function(min,max){return Math.floor(Math.random()*(max-min+1)+min)}(0,items.length):0);var firstItemApiClient,firstItem=items[playStartIndex];firstItem=firstItem

 

  • 1 year later...
EmilioGarcia
Posted

Sorry to bump, but I've been noticing this as well. I have ~5.5K songs, but shuffle only plays songs at the beginning of the alphabetized list (songs starting with a number or symbol, or the letter 'A').

I'm running version 4.9.1.90, and I've noticed this in both the browser and the android app.

  • Agree 1
TheFarCyanide
Posted

First off, I would like to state that I really like the functionality of the rest of the application/server/software. But, and I don't mean to be a d***, but give up man, this is a very well known and persistent issue which the devs have chosen to ignore for years. It's my ONLY complaint about Emby - but it's bloody maddening! I have thought about migrating to Plex or Jelly because of this issue, and I have steered 3-5 people away from Emby - it sucks to say that.

The normal deflection by support is to "either install a third party add-on, or purchase a separate app, Symfonium"
My guess is Symfonium was potentially produced by the same dev team as Emby. I wouldn't be surprised if they are purposely funneling business to their other app to grab some more $$
Sweet, thanks for the help.
I'm sure they will have you share your logs, why bother...?

Emby's shuffle function is garbage in general. Multiple simple apps handle music better than Emby... I have a rather large collection, but nothing crazy.
If there is more than a 5k (or so) songs, shuffle will "think" for minutes before spitting out some crap selection.

Music on Emby: Android straight up crashes - Shield sucks - Windows Crap (both app and browser).

Also what you stated,

Quote

only plays songs at the beginning of the alphabetized list (songs starting with a number or symbol, or the letter 'A').

TheFarCyanide
Posted (edited)

A browser's AI reply to the query: "Emby shuffle music is terrible" ...Good lord, even the robots know.... /s
 

"Users have reported significant issues with the shuffle functionality in Emby, particularly regarding a lack of true randomness in music playback across multiple platforms. After upgrading to version 4.9.1.80, users noted that the shuffle feature no longer selects songs from across their entire music collection but instead appears to limit selections to a narrow range of titles, such as those starting with letters from "A" to "H" when the list is sorted alphabetically. This behavior has been observed on both the web app and Android client, with users reporting that shuffle often produces repetitive sequences and fails to include songs from later in the alphabetical list.

A recurring complaint is that the shuffle algorithm seems to favor a small subset of songs, leading to repeated playback of the same tracks and a lack of variety, especially in large libraries. One user described the shuffle as "fundamentally flawed" and noted that it affects all platforms and media types, not just Android. The issue has been reported multiple times over several years, with developers acknowledging the problem but no definitive fix having been implemented as of December 2025.

Additionally, there are reports of inconsistent behavior when manipulating the playback queue. On the Android app, moving a song within the queue has been observed to trigger a complete re-shuffle of the playlist, which disrupts the intended order. On iOS, the shuffle function fails to recursively flatten nested folders, resulting in only songs from a single sub-folder being played, despite the web client functioning correctly.

While some users have suggested that the issue may stem from Emby's use of a non-uniform randomization algorithm—potentially based on C#'s Random class—there is no public confirmation of the underlying implementation. The community has proposed solutions such as maintaining a history of played items to prevent repeats, but these have not been adopted by the development team. As of December 24, 2025, the shuffle functionality remains a persistent source of frustration for many Emby users."

Edited by TheFarCyanide
  • Agree 2
nospotify
Posted

This is a good reminder of another unfinished business item with the music module, which is that even when a shuffled playlist is generated completely, playback starts somewhere in the middle of the shuffled list, not from the top.

  • Agree 1
TheFarCyanide
Posted

Yeah, no s***... I don't mean to be disrespectful to the devs, but this has been handled terribly. I am a paid player in their game.

I don't have many chances to dissuade others from deciding between Emby vs. the competitors, but when I do, I do.
My dad was asking me for recommendations last week, which is why I'm here posting. I wanted to give him an answer over Christmas.

I already paid for Emby, and will continue to enjoy what I can, but I can also make sure others don't have to deal with this.
So, I guess there's that  :(

 

TheFarCyanide
Posted

Well, how about that.
The new Windows application seems to be working quite well! So far, it quickly sets up a queue of what also seems to be a good randomization!
Thank you for the improvement.


Now if this could be rolled over to other platforms (android, browsers), we'd be in business.
Good on ya :)

  • Like 1
  • 1 month later...
radioactivesqrl
Posted

This issue isn't limited to songs. I try to shuffle my movies ~1500 and it will only every select movies that begin with 0-9,A,B,C. That's a lot of options missing :(. I have tried going to the next movie close to 100 times and never saw any later movies come up. I'm running 4.9.1.16 in case it's been fixed later.

yaksplat
Posted

Shuffling isn't good.  While doing construction on my house, I had a 3-day long playlist going.  My friend knew what songs were going to be on after certain songs.

Please implement true randomness without replacement.

public static int[] GetTimeSeededShuffledRange(int maxInclusive)
{
    if (maxInclusive < 0)
        throw new ArgumentOutOfRangeException(nameof(maxInclusive));
    {
        long ticks = DateTime.UtcNow.Ticks;
        long highRes = System.Diagnostics.Stopwatch.GetTimestamp();
        long env = Environment.TickCount64;

        int seed = (int)(ticks ^ highRes ^ env);

        var rng = new Random(seed);

        var arr = Enumerable.Range(0, maxInclusive + 1).ToArray();

        for (int i = arr.Length - 1; i > 0; i--)
        {
            int j = rng.Next(i + 1);
            (arr[i], arr[j]) = (arr[j], arr[i]);
        }

        return arr;
    }
}

 

  • Like 1
  • 2 weeks later...
Posted

hi, we are looking into this. Thanks.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...