Bugzilla – Bug 1160
Problem with shuffle modes
Last modified: 2009-09-08 09:19:31 UTC
I found problems with the 03/21 nightly that caused the sever to crash when selecting Shuffle by Album. That seems to have been fixed in 03/22 but now I'm seeing that with a playlist of 9000 songs, switching between shuffle off and shuffle by song takes around 3 seconds but switching to shuffle by album takes over 2 minuets of 100% cpu.
Craig - this happens because Shuffle by Album needs to hit the database. I'm looking at where it can be optimized, but I'm not sure how much I'll be able to do here.
Dan - I don't remember seeing this before and I'm sure that the crash only appeared on the 22/1 build. I don't use shuffle by album much but if you are using the remote and are in 'shuffle by song' then you have to go through 'shuffle by album' to turn shuffle off, thus is how I came across the problem. "I'm not sure how much I'll be able to do here." - you seem to have worked plenty of other miracles lately :-) Craig
I can confirm this as a crashing bug when I tried it with 6.0/6.0.1 -- large playlist (400+ tracks) in the now playing, multi-seconds to toggle to shuffle off, and toggling into shuffle by song crashed the server.
jason, can you supply the crash message that you saw? how about this for one idea: shuffle = shuffle_toggle (song/off) shuffle.hold = shuffle_album_toggle (album/off) this way, if album is a hit, there is an option to avoid it.
Well that would be a good workaround until the problem is fixed ;-) Actually it might be a better way to handle the shuffle mode either way.
Vidur is working on a rework of the Player UI browsing code. This is somewhat related, in that we'll be returning objects instead of strings, so going to the database again won't happen. I'm also going to be reworking the Playlist code all about the server to be more streamlined and to use the database. Targetting for 6.1
A first cut of an optimization has been checked into 6.1/trunk as subversion change 3007. Vidur will make a second pass to optimize further.
Using the 04-21 windows exe I see a halfing of the time taken although I'm still getting the 'Lost contact' message. Also a few times when selecting Shuffle by Album on the player UI, the server has quit. I've not seen this when changing modes from the web UI.
*** Bug 1407 has been marked as a duplicate of this bug. ***
I've checked in a further improvement to Shuffle by Album. Craig, could you try the 4/28 nightly build and let me know if you seen an improvement?
That's another halving Vidur, It's now down to 30 seconds, still getting the loss of contact though. Would it be much work to include KDF's suggestion of shuffle = shuffle_toggle (song/off) shuffle.hold = shuffle_album_toggle (album/off) ? I think that would make the whole function much better.
I"m not sure that changing the UI because the backend is slow is the right solution. Do note that lots of folks accidentally press-and-hold when they mean to press. Press-and-hold should be a superset of whatever a simple press is.
Vidur: what's the status of this?
dan has some performance tweaking he's working on.
This should be much faster now with the new playlistdb code in the 6.1 tree.
That's almost instant now, even with a playlist of 9500 songs. Great work guys Thanks
This bug was marked resolved in Slimserver 6.1, which is several versions ago. If you're still seeing this bug, please re-open it. Thanks!