I've now found what my problem is with syncing Softsqueeze on Linux, with my Squeezebox (although I'm not sure I can fix it). It's to do with Java doing garbage collection towards the beginning of each track. Read on for the full story...


To recap on the set-up, I am running SlimServer 5.4.0 on a Mandrake Linux 9.2 server, Softsqueeze 1.16 with jre-1.5.0_01-fcs and mp3plugin.jar installed on a Mandrake Linux 10.1 client machine, and a Squeezebox.

On Softsqueeze, I'm using an ALSA sound driver, and the tracks start in sync with my Squeezebox. The problem is that there's usually a half-second drop-out towards the beginning of the track on Softsqueeze which knocks it out of sync with my Squeezebox for the rest of that track... then the same thing happens on the next track, etc.

To look at the Java performance, I ran SoftSqueeze like this:
  java -verbose:gc -jar SoftSqueeze.jar

This outputs debug information about the garbage collection. The half-second drop-outs in the audio coincide directly with when Java does a "Full GC". The Java debug even reports that the "Full GC" took half a second (bingo!). Running the incremental garbage collector instead helps (using -Xincgc on the java command-line starting SoftSqueeze - see the man page for "java"), but it seems like the performance on my Linux client machine is so marginal for doing this that java still doesn't have the time to do *all* the garbage collection in the background, and still does a bigger garbage collection from time to time, resulting in a (much smaller) audio drop-out and consequent loss of sync.

Good old java. This also explains why I get perfect sync using slimp3slave, which doesn't have the garbage collection issues that Java does. So, how to fix this?

I'm at a dead end with this now, because it's down to the performance on my Linux box... unless something can be done in SoftSqueeze to force garbage collection between tracks (not sure if this is even possible). Left to its own devices, Java always does the "Full GC" about ten seconds into each track.

Anyway, I thought people would be interested to know.

Ian

_______________________________________________
Discuss mailing list
Discuss@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/discuss

Reply via email to