PDA

View Full Version : Why is SlimServer so slow?



DanielTheGreat
2008-03-08, 22:50
On my music server I have about 15,000 flac files. I also have a few hundred playlists, one in particular (all-nDTS.m3u) that contains the paths of most of my non-DTS tracks (about 14,000) - I can't include my DTS files because SlimServer corrupts them when replay gain is enabled.
I mostly play this playlist, in shuffle-by-track mode, through one or more of my Squeezeboxes and/or Squeezeslave. My music server is a 3GHz P4 Win2k PC with 2GB RAM and heaps of HDD space free.
But almost everything I do with SlimServer takes ages! If I change playlists, it takes several minutes before I can play anything from the new list. If I change from sequential to shuffle it also takes several minutes. If I reboot the PC it is several minutes (with much disc-thrashing) before I can play anything from SlimServer. Why is this?
My 'yardstick' for how a music player should perform is Spider Player (I'm currently running V2.104, but they've all been very efficient). If I run Spider (takes about 3 seconds to open), I can drag the all-nDTS.m3u playlist into it and the tracks will appear instantly in its playlist, and can be played instantly. If I use its 'Miscellaneous Actions/Other/Randomise' tool to shuffle the entire 14,000 tracks, it happens instantly and I can start playing the shuffled list instantly.
Why can't SlimServer work this fast? Or is there an alternative solution (retaining the Squeezebox h/w)?
Regards,
Daniel (a frustrated Squeezebox owner :-)

Phil Leigh
2008-03-09, 00:32
I can't include my DTS files because SlimServer corrupts them when replay gain is enabled.


No it doesn't. DTS files have to be passed untouched by any software in order to work properly. This has nothing to do with SS. You would have the same problem with any "media player".

You should upgrade to SqueezeCenter if you haven't already done so...

agentsmith
2008-03-09, 01:22
On a similar note, does the new Controller interface improve the response time at all? Would I get performance similar experience to my iPod? I have an iPod Classic 160GB with about 5,000 songs and the response is pretty much instantaneous.

I agree that the future effort of Slimserver development should concentrate on slimming down its CPU/memory footprint and streamlining its performance.

msherman
2008-03-09, 05:35
DanielTheGreat wrote:
> On my music server I have about 15,000 flac files. I also have a few
> hundred playlists, one in particular (all-nDTS.m3u) that contains the
> paths of most of my non-DTS tracks (about 14,000) - I can't include my
> DTS files because SlimServer corrupts them when replay gain is enabled.

Slimserver isn't designed to handle massive playlists efficiently. For
this usecase, you should instead consider either Random Play built into
the stock SS, or Erland's excellent SqlPlayList plugin.

- Marc

DanielTheGreat
2008-03-10, 03:51
Phil, with all due respect, I have to disagree with your first sentence, while agreeing with your second. When 'Track gain' is selected for volume adjustment, SlimServer/SqueezeCenter DOES 'scale' the audio samples, thereby destroying the integrity of the DTS code stream.
There was some discussion last year about SS being made smarter by recognising DTS bit-streams and disabling gain adjustments for those tracks. It was suggested that the developers would aim for this in Rev. 7, but this clearly hasn't happened (I installed SqueezeCenter 7 yesterday and tested it today, and I still get white noise when volume adjustment is enabled for a DTS track. Disabling volume adjustment ['none'] allows DTS FLAC files to play perfectly through the Squeezebox's Toslink o/p).

agentsmith, the new server (SqueezeCenter) has improved speed in only one or two respects, but is still a dog in most others. While loading a moderate sized playlist still takes minutes, it seems to allow you to start playing (the first track at least) before the full list has loaded into the web interface. And converting it from sequential to shuffled now takes only seconds before play can start.

Marc, now that SqueezeCenter is faster at shuffling (or at least allowing you to start playing before it's finished), the need to use Random Play is diminished. I had a look for Erland's SqlPlayList plugin, but his download page doesn't include that plug-in. I'll have a further look when I get more time.

Another area where SS/SC is abysmally slow, that I forgot to mention in my original post, is (re)scanning the music library. SS was particularly finicky about broken playlist links, so every time I added, deleted or renamed tracks, I needed to rescan the library. This takes well over half an hour, during which I must suffer in silence :-( I'm hoping SC won't be so touchy about broken links, and will just do what any intelligent s/w does, and skip the 'missing' track.

Which brings me to a related question. I create my own playlists outside of SS/SC, using a batch file and a few programs I've written (takes ~24 seconds to create the 'everything' playlist and then derive the artist and other playlists from it). I don't understand why SC needs to 'scan' anything. Why couldn't I just navigate to a ready-made playlist and say 'play this', and off it goes (just like Spider or other players)?
Perhaps I'm missing something, and SS/SC was created for a completely different purpose from what I expect it to do (just play my music, anytime, without delay). I guess what I want is Spider Player with a Squeezebox driver! :-)
I must say it's been a great disappointment to me that SS/SC doesn't handle external playlists well - SS wouldn't even display artist/title information from an extended M3U playlist! I've yet to test SC for this. Playlists seem such a powerful/flexible way to organise and manage what you want to hear. And if SC handled them properly, I wouldn't have to bother editing my 15,000 tracks to add artist/title tags - a task I don't look forward to!
Daniel

y360
2008-03-10, 05:57
If I reboot the PC it is several minutes (with much disc-thrashing) before I can play anything from SlimServer. Why is this?


You seem very knowledgeable so I hesitate to mention the obvious, but have you verified the PC's virtual memory setting ?

y360
2008-03-10, 06:03
Just in case anyone reading this wants to verify their PC's virtual memory:

Start->Settings->ControlPanel->System->Advanced->Performance Settings->Advanced->Virtual Memory Change

It's best to set virtual memory size at 1.5 times the size of physical RAM

Robin Bowes
2008-03-10, 06:08
DanielTheGreat wrote:

> My music server is a 3GHz P4 Win2k PC with 2GB RAM and heaps of HDD
> space free.

That should be more than enough power to run SC.

> If I reboot the PC it is several minutes (with much disc-thrashing)
> before I can play anything from SlimServer. Why is this?

That doesn't sound right.

A few questions...

Are you running anything else on the server?
Are you running any spyware/AV software?
How are you starting SC?
What happens if you disable SC and restart the server - does it still
thrash the disk?

R.

erland
2008-03-10, 09:47
I had a look for Erland's SqlPlayList plugin, but his download page doesn't include that plug-in. I'll have a further look when I get more time.

Sure it does, just select it on the left side of the download page.

Phil Leigh
2008-03-10, 10:19
Phil, with all due respect, I have to disagree with your first sentence, while agreeing with your second. When 'Track gain' is selected for volume adjustment, SlimServer/SqueezeCenter DOES 'scale' the audio samples, thereby destroying the integrity of the DTS code stream.
There was some discussion last year about SS being made smarter by recognising DTS bit-streams and disabling gain adjustments for those tracks. It was suggested that the developers would aim for this in Rev. 7, but this clearly hasn't happened (I installed SqueezeCenter 7 yesterday and tested it today, and I still get white noise when volume adjustment is enabled for a DTS track. Disabling volume adjustment ['none'] allows DTS FLAC files to play perfectly through the Squeezebox's Toslink o/p).
Daniel


Daniel - I think we are actually agreeing!
My point was that SS/SC doesn't "corrupt DTS files" - replaygain does the "corrupting". I agree that making replaygain "DTS aware" would be neat. All I was saying was that any media player that has "replaygain" functionality would cause the same problem.

The obvious solution of course is to fix the problem by disabling replaygain or setting the replaygain tags to 0db (not sure that works but worth a try)
Regards
Phil

smst
2008-03-10, 10:25
Phil, with all due respect, I have to disagree with your first sentence, while agreeing with your second. When 'Track gain' is selected for volume adjustment, SlimServer/SqueezeCenter DOES 'scale' the audio samples, thereby destroying the integrity of the DTS code stream.
There was some discussion last year about SS being made smarter by recognising DTS bit-streams and disabling gain adjustments for those tracks. It was suggested that the developers would aim for this in Rev. 7, but this clearly hasn't happened (I installed SqueezeCenter 7 yesterday and tested it today, and I still get white noise when volume adjustment is enabled for a DTS track. Disabling volume adjustment ['none'] allows DTS FLAC files to play perfectly through the Squeezebox's Toslink o/p).

I'm running SlimServer 6.5.4, so things might be different for me, but I have no problem playing back DTS files with ReplayGain enabled (with the "smart" setting, which I believe uses "track" or "album" based on the current track's relation to the rest of the playlist). None of my DTS files have ReplayGain information embedded in them, so there's nothing for SlimServer to do -- I would have thought that it wouldn't adjust the audio at all if there were no RG tags.

Some simple things to check (which you may have already tried):

1. Check that there are no ReplayGain values set for your DTS files. I use foobar2000: I can ask for a track's properties and, on the "Properties" tab (as opposed to "Metadata") I can see RG values. fb2k can clear RG values too.

2. Check that the Digital Volume Control setting is "fixed" (or similar; I don't remember the exact setting name and it may have changed for SC).

3. Check that there's no bitrate limiting enabled.

If you can play DTS back with RG disabled, I imagine the last two are okay, but check anyway. Perhaps things have changed between SS 6.5.4 and SS 7, but I can't see why the server would apply RG with no RG tags set.

Phil Leigh
2008-03-10, 10:27
Doh! - yes of course...didn't think of that - simply remove the RG tags!

smst
2008-03-10, 13:52
There was some discussion last year about SS being made smarter by recognising DTS bit-streams and disabling gain adjustments for those tracks.

I forgot to mention earlier: I've previously requested that some tag (perhaps the community could decide upon one) could be recognised by SlimServer as meaning "the contents are for SPDIF output only". One could tag the relevant files without requiring that SlimServer recognise the various bitstreams (two types of DTS, AC3, etc). The tag's meaning would be "do not apply RG, do not adjust volume, do not limit bitrate, and do not use analogue outputs".

I'd find a variation on the latter helpful. I intend to buy a new SB for my kitchen and won't be using digital outputs. I'd like it if the SB would refuse to play tracks marked as SPDIF-only, especially to avoid a nasty white-noise surprise during random mix.

Pale Blue Ego
2008-03-10, 14:34
I believe there is a feature request for Squeezecenter to treat *.dts files as a separate file format. That way, any players not connected to a DTS decoder could be told to ignore any .dts files that might be sent as part of a larger playlist.

DanielTheGreat
2008-03-11, 18:08
Thanks Phil, yes, I think we're on the same wavelength. I too had considered changing the tag gains to 0dB, but haven't yet got round to testing it (didn't have a good tag editor for a start - most don't seem to allow gain editing!). SMST's suggestion to kill the gain tags is even better. I eventually found a version of foobar2k that supposedly works under Win2k, and will try to install/test it over the next few days.

Y360, my virtual memory was/is set at a little over 6GB; should be heaps.

Robin, I'm running lots of other stuff on my music 'server' - it's my 'work' PC (I work from home) running Outlook, Skype, ZoneAlarm, POW, and various other applications (IE6, Word, programming environments/compilers, etc) as the need arises. But I don't run any anti-virus/spyware background tasks (they slow the PC too much). ZoneAlarm would be the main background cycle-stealer, with POW coming into play when I run IE6.

SC is started automatically at boot-up from the Startup directory. I did notice that if I stop SS/SC before I reboot, the startup 'thrashing' time is much reduced, but I'll have to do some more tests to quantify this (I can't right now; I'm in the middle of a big processing job). I found this disappointing too - I would have thought SC would shut down correctly when commanded by Windows, without me having to manually intervene. To me, anything in the System Tray can be ignored during shutdown - only programs in the Taskbar should be first closed (especially Outlook, which suffers from the same problem if not closed before rebooting - probably validating its .pst file which wasn't properly closed).

Erland, my apologies! I probably looked late at night and just looked at the main (central) page content. I've downloaded the 2 plugins now, and will read the wikis when I have more time, to decide whether to instal and try your additions.

This is absolutely no reflection on Erland and the many other people who have contributed to the Slim product, but I tend to shy away from products that need lots of 'add-ons' to make them work properly. I guess I've been 'conditioned' by the many commercial products that you just install and they do (more or less) what they're supposed to, so I'm not used to products that have grown like topsy from a band of enthusiasts, and are still (effectively) in development. But we're slowly getting there!

SMST, you've made some great suggestions about special tags for surround tracks - I heartily agree. Indeed, I'd like to see it go one step further and include a new gain tag (perhaps call it 'SurrGain'?) that is NOT used by replay gain players, but is broadcast (when it's present) along with the file header at the start of each track. [I know nothing about how SC 'broadcasts' the music stream via Wi-Fi, but I'm assuming there's some sort of 'header' sent at the start of each track, with the tag info etc). With such a SurrGain tag, I could (when I learn how to program network-aware DOS applications) reprogram my DOS6.22 touch PC that controls most functions of my (overly complex) surround system. It could then adjust my system's 'pre-volume' so that the DTS tracks sounded the same loudness as the replay-gain-adjusted stereo tracks. Of course I would need to empirically determine the values and tag the SurrGain for each album, but with only a few dozen DTS CDs, that wouldn't be arduous.
Daniel

Honva
2008-03-11, 18:52
I can't include my DTS files because SlimServer corrupts them when replay gain is enabled.


Slimserver has no problem handling DTS files. As mentioned before, DTS files need to be sent to the receiver straight through without altered. You do not need to turn replay gain off for other files. Just make sure that you do not include replaygain info in your DTS files. If slimserver does not find the replaygain tag, it will not apply replaygain to them. Just remove the replaygain tags on those DTS files, set digital out to 100% and you will have no problem.

funkstar
2008-03-12, 02:50
[I know nothing about how SC 'broadcasts' the music stream via Wi-Fi, but I'm assuming there's some sort of 'header' sent at the start of each track, with the tag info etc).
SC sends the FLAC stream completely intact to the SqueezeBox, alothough the only thing the SqueezeBox does is decompress and play the audio sctream. Information on the screen is not derived from the tags inside the SB, that is sent as seperate data from SC (all screen information is supplied by the server, the SB knows nothing). Equally, the SB doesn't look at any gain that needs to be applied, the server just tells the device to increase or lower the volume by x amount for each track.

smst
2008-03-12, 04:31
SMST's suggestion to kill the gain tags is even better. I eventually found a version of foobar2k that supposedly works under Win2k, and will try to install/test it over the next few days.
You can use metaflac to remove RG tags from FLAC files. (I don't know if metaflac is distributed with SlimServer or not; it's available from the FLAC website though.)

metaflac.exe --remove-replay-gain "My DTS File.flac"

SMST, you've made some great suggestions about special tags for surround tracks - I heartily agree. Indeed, I'd like to see it go one step further and include a new gain tag (perhaps call it 'SurrGain'?) that is NOT used by replay gain players, but is broadcast (when it's present) along with the file header at the start of each track. [I know nothing about how SC 'broadcasts' the music stream via Wi-Fi, but I'm assuming there's some sort of 'header' sent at the start of each track, with the tag info etc). With such a SurrGain tag, I could (when I learn how to program network-aware DOS applications) reprogram my DOS6.22 touch PC that controls most functions of my (overly complex) surround system. It could then adjust my system's 'pre-volume' so that the DTS tracks sounded the same loudness as the replay-gain-adjusted stereo tracks. Of course I would need to empirically determine the values and tag the SurrGain for each album, but with only a few dozen DTS CDs, that wouldn't be arduous.
Interesting idea. You'd need a server plugin to read that tag and pass it on to your other PC, and to send a "revert to normal" tag if the tag wasn't present on the next track. Calculating the value might be tricky, but ultimately I guess you could use some utility (BeSweet might do it; I don't know if it has a DTS plugin) to downmix the DTS file to a stereo WAV, and calculate the gain values using that.

Phil Leigh
2008-03-12, 06:26
Daniel, IF SC doesn't shutdown properly (and very quickly!) durng a normal windows shutdown, you have a setup issue somewhere. Have you looked at the windows event log (admin tools) recently?

DanielTheGreat
2008-03-13, 03:05
funkstar, thanks for the explanations about the SC/SB conversations. Is there a central repository for such pearls of wisdom, or does one just acquire them through osmosis?
smst, thanks very much for the metaflac code (metaflac came with my FLAC download). Using your command I created rrg.bat with just one line:
for %%f in (*.flac) do metaflac.exe --remove-replay-gain %%f
Then I just had to open a DOS box in each of my DTS sub-directories (a simple right-click operation for each one) and issue the RRG command, and all flacs in that directory were 'ungained'! It's done, and now I look forward to listeneing to my surround tracks shuffled in with the stereo gain-adjusted stuff. I'm prepared to wait a few years for the SurrGain tag :-)))
Phil, I hadn't looked at the Windows log (never do), but I have now, and found heaps of errors every day. The most common one is an event 7000 for 'Service Control Manager', but a look at its properties suggests it's related to my WinFast TV2000 Tuner (which I no longer use) looking for a lost file. Some similar errors relate to other services not finding files - the scary thing is some of those applications (e.g. AVG7) were uninstalled years ago, but are still doing something on my system!
I suspect these errors are a result of the resizing partitions on my RAID5 virtual drive (after adding an extra HDD) that I did a week ago, when Partition Magic crashed in the middle of the process. Scandisk 'repaired' lots of errors, and I was eventually able to complete the resizing, but it looks like lots of files were lost in the crash. However the slow start-up of SS after a reboot predates that event by a long shot. Neverthelss I guess I'm going to have to identify all the applications/services that are missing files, and reinstall (or uninstall) them. Surprisingly, so far I haven't noticed any bad behaviour (I mean no worse than the usual Windoze bad behaviour :-) since the resizing catastrophe.
Incidentally (smst), how do you create the little box around your code fragment? [You can see I'm a complete novice to this forum stuff.]
Daniel

Robin Bowes
2008-03-13, 03:25
DanielTheGreat wrote:

[lots of stuff about a poorly Windows box]

IMHO you should do a clean re-install of your Windows box.

R.

smst
2008-03-13, 03:35
Incidentally (smst), how do you create the little box around your code fragment? [You can see I'm a complete novice to this forum stuff.]

Like so:
insert code here


insert code here

As a general tip, if you click the "Quote" button under any reply you can see the exact content of somebody's post, including tags.

funkstar
2008-03-14, 05:02
funkstar, thanks for the explanations about the SC/SB conversations. Is there a central repository for such pearls of wisdom, or does one just acquire them through osmosis?
Osmosis generally. I've been a follow of SlimDevices since before the first hardware was released back in 2001. I used to subscribe to the mailing list but moved across to the forums back in November 2005. I guess there is a lot of information a few of us just know, without realising where it comes from :)


[lots of stuff about a poorly Windows box]

I'll second Robin on this one. Nuke windows and re-install, I'd put a small wager on it being a lot slicker after that :)

DanielTheGreat
2008-03-15, 16:34
Like so:
insert code here


insert code here

As a general tip, if you click the "Quote" button under any reply you can see the exact content of somebody's post, including tags.

Thanks smst, that's neat. I guess there's a sticky post somewhere in the Beginners section that explains this stuff, but I haven't yet got round to looking for it :-)


Osmosis generally. I've been a follow of SlimDevices since before the first hardware was released back in 2001. I used to subscribe to the mailing list but moved across to the forums back in November 2005. I guess there is a lot of information a few of us just know, without realising where it comes from :)

OK, when I get the time to write something for my touch PC to eavesdrop on the SB3 broadcasts (it'll be a year or two, when I retire), I'll know where to come for advice :-)


I'll second Robin on this one. Nuke windows and re-install, I'd put a small wager on it being a lot slicker after that :)

No doubt you're both right, but it's a several days job to rebuild my C: drive - reinstalling dozens of applications, reconfiguring them for the way I work, downloading/installing web updates, etc. I don't really have the time for that right now (this is my work PC too [I work from home], and I'm still working!). But I have considered it previously, and if I get really desperate I'll have to bite the bullet.

Daniel

Zaragon
2008-03-16, 04:44
Daniel it is probably worth you spending time un-installing all the applications that you don't use. Not just to stop any errors you may have picked up from the RAID resize.

It is surprising how many applications install all those little helper things in odd places like the system tray to make it 0.25 seconds quicker to start up. Or have additional utilities like iTunes that has the device synchroniser to sync up the iPod which you don't have. All of which need time to start up and shut down and their potential to cause instability. Not to mention how the registry gets bloated.

All of which shouldn't have much effect on performance unless you are overloading available real memory. It would be worth looking at the process list when SC is running slow to see if anything else is hogging the CPU or memory.

One thing that just occurred to me that perhaps others with more knowledge can comment on. You get thrashing on startup if SC isn't closed down before you shut down the PC. I'd hazard a guess at that being the database doing a consistency check (I don't know mySQL.) on startup because it has found it to be in an inconsistant state. That sort of thing I'd expect if it was unexpectedly terminated or if data wasn't flushed before shutdown. Way back when the issue for external RAID arrays was always ensuring write cache data was flushed to all relevant array disks before shutting down the array, if it wasn't you got RAID resyncs on startup as the array checked itself for consistency and then DB consistency checks if the RAID didn't adjust properly.

Since Windows asks apps to close and doesn't force terminate them they should all shut down cleanly and it should also be aware to flush all the disc caches. So it shouldn't be a problem. But...something is.