Bug 3050 - Random Mix uses too much resources
: Random Mix uses too much resources
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Plugins
: 6.2.2
: PC Windows (legacy)
: P2 normal (vote)
: ---
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-02-22 20:34 UTC by treble
Modified: 2008-09-15 14:39 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description treble 2006-02-22 20:34:25 UTC
When I use Random Mix it takes about 15-20 seconds to make a mix and the music to start playing.  Quite long I think.

Also, when going to the next song in the random mix, either by skip or just because the end of the previous song has reached, there is often a break for a couple seconds in the sound after the song has played for about 10 seconds or so.  This seems to be because the buffer has run out (the time stays at 0:00, also buffer fullness stays a 0%).  This seems to be due to the fact that Slimserver needs a lot of resources to find the next song in the random mix.  My CPU usage nor memory usage tops out.  This happens with both the Squeezebox and SoftSqueeze.  When I select stop adding songs the songs run smooth again.

I don't know a solution for the first one (other then making the queries to the database less complicated, for example, an option to select all genres, instead of handpicking them, which would make it easier to find a random song).

For the second problem, maybe Slimserver should not try to find the next song for the mix right away, but wait a couple of seconds for the buffer of Squeezebox to fill up, and then start queriyng the database.

Using:
SlimServer Version: 6.2.2 - 6200 - Windows 2000 - EN - cp1252 with MySQL
My PC is an AMD Athlon XP 1150MHz CPU with 512+256=768M of memory
Comment 1 KDF 2006-02-22 21:43:29 UTC
max, my guess is that this is a repeat of what has been said in bug 2551...?
Comment 2 Max Spicer 2006-02-23 01:50:11 UTC
This certainly isn't a dupe of #2551, which deals with songs being played twice in the same mix.  It does mention http://forums.slimdevices.com/showthread.php?t=20771 though, which seems relevant here.
Comment 3 treble 2006-02-23 20:23:20 UTC
Not sure what to think of the replies.  This seems to be fixed in 6.5?  Can I download the plugin separately, ie. use the 6.5 plugin with 6.2.2?

Maybe I should have split it in two bugs:

1. Random Mix takes a long time to get going...
2. During Random Mix music stops playing after about 10 seconds

Though I think they are due to the same problem: my PC is apparently too slow to select a random song from the database.  Both slim.exe and  mysqld-nt.exe seem to be cranking away during the process (although CPU use barely gets to 100%)

A solution for number one would be to make an option to select 'All genres', so that the query to the database would be a lot simpler.

A solution for number two would be if the Random Mix plugin doesn't look for a new song for the mix right away after the next song started, but would wait until the buffer has filled up.
Comment 4 treble 2006-02-23 20:26:38 UTC
Actually, when startin a new mix, not really slim.exe and the mysql daemon do the work, but the hard disk is being heavily accessed by the sound of it.
Comment 5 treble 2006-02-26 20:52:14 UTC
I actually might have solved this one.  I started tweaking the settings of Mysql Server.  I changed it from a 'Developer Machine' to a 'Server Machine', and probably changed some other settings to give MySQL more memory and give the process higher priority.  This seems to have helped in getting rid of the breaks.  Still though, to me it seems that my PC has to work too hard to just create a simple random mix.
Comment 6 Dan Sully 2006-04-22 13:50:33 UTC
I'm going to close this bug for now, since it seems you have a handle on it.

6.5 will ship with MySQL as the back end, and the split-scanner branch already has an version of Random Mix that is more optimized than trunk.