PDA

View Full Version : Softsqueeze performance help?



junk@180glencoe.com
2005-03-01, 21:48
Folks,

I'm a big slim devices fan (running an old slimp3 and a wireless
squeezebox), and I just tried softsqueeze for the first time. I love
the idea, but the performance on my system is barely acceptable.
Unless I can figure out how to make it snappier, I may have to go back
to XMMS and lose the ability to see the scrolling song information,
the cool remote control interface etc. :-(

I'm running a fairly recent two processor (1.4GHz Xeon) linux (Debian)
system based on the 2.6 kernel with plenty of memory (>1GB). I'm
using the latest jre (1.5.0_01) from sun. I'm using the softsqueeze
version (1.12) that it packaged with the current slimserver (5.4.0).

There are several indications of a problems:

* Using "top" to watch CPU usage per process, softsqueeze (actually
java, but softsqueeze is the only java process running)
consistantly takes at least 20% of a CPU, and often nearly 100% of
one. In contrast, playing from the slimserver with XMMS rarely
takes more than 1% of a CPU.

* When the system doing only moderately stressful other tasks, there
are often buffer underruns.

* GUI redraws are slow enough to be clearly visible, and occasionally
really painfully slow. Painting the preferences dialog seems to
take an especially long time (seconds).

I don't doubt this is a java problem rather than a softsqueeze one,
but I don't really speak java. Anyone have any tips about better ways
to profile this, or, better yet, improve it?

Thanks!

Larry Hunter
junk at 180glencoe dot com

mherger
2005-03-02, 00:07
[..]
> I don't doubt this is a java problem rather than a softsqueeze one,
> but I don't really speak java. Anyone have any tips about better ways
> to profile this, or, better yet, improve it?

Did you download the mp3 plugin (see the docs) and a recent build from
http://softsqueeze.sourceforge.net?

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
SlimString Translation Helper (http://www.herger.net/slim/)

Phil Karn
2005-03-02, 01:21
Michael Herger wrote:
> [..]
>
>> I don't doubt this is a java problem rather than a softsqueeze one,
>> but I don't really speak java. Anyone have any tips about better ways
>> to profile this, or, better yet, improve it?
>
>
> Did you download the mp3 plugin (see the docs) and a recent build from
> http://softsqueeze.sourceforge.net?
>

If the problem is slow MP3 decoding in Java, then I would expect the
problem to go away whenever the Slimserver transcodes to raw PCM, as
opposed to sending MP3 to the Squeezebox/Softsqueeze client.

This suggests a quick and easy test: play a WAV, FLAC, Ogg Vorbis, AIFF,
m4a or anything *but* a .mp3 file and see if Softsqueeze no longer
gobbles up so much CPU. Make sure you don't have rate limiting
configured for your player, or else Slimserver will transcode back into MP3.

Michael has already mentioned the Java MP3 plugin; I assume that's a MP3
decoder in C that can be called from Java. That should definitely fix
the problem if it's due to a fall back to a slow MP3 decoder in Java.

--Phil

junk@180glencoe.com
2005-03-02, 23:12
Michael Herger writes:

> Did you download the mp3 plugin (see the docs) and a recent build
> from http://softsqueeze.sourceforge.net?

I'm sorry to be dense, but this wasn't as easy at you make it sound.
I'm going to describe my attempt to do what you suggest in a lot of
detail, just in case anyone in my position (of ignorance) also wants
to address this performance issue. And I still don't have it
working.

To start with, where in the docs does it say anything about an mp3
plugin? I tried:

http://localhost:9000/html/docs/index.html
http://softsqueeze.sourceforge.net/faq.html

and even googled "plugin site:softsqueeze.sourceforege.net" with no
joy.

I eventually found mp3 plugin information in

http://forums.slimdevices.com/gforum.cgi?post=28536#28536

Now that is not what I would call "in the docs" -- how about putting
it in http://softsqueeze.sourceforge.net/faq.html or someplace else
actually findable?

OK, so now I download the mp3 plugin from Sun, install subversion
(boy, I do love synaptic! Thanks, Debian), and run

svn co http://svn.slimdevices.com/repos/slim/trunk/softsqueeze

in some reasonable place, which I will call <installdir>. OK, readme
says I need ant, so I install that, too. Whoops, it doesn't actually
say anywhere, but the readme appears to imply I need jdk 1.5, so I go
to java.sun.com and find J2SE(TM) Development Kit 5.0 Update 1, and
install that too. 45MB later, I get to try

export ANT_HOME=<where I installed apache ant>
export JAVA_HOME=<where I installed JDK 1.5>
cd <installdir>/softsqueeze
ant

Now, I get some warnings about

[signjar] Warning: The signer certificate has expired.

but it does end up with

slimserver:
[copy] Copying 21 files to <installdir>/server/HTML/EN/html/softsqueeze

Alas, that is not a very good place for those files, but I can copy
them to

<slimserverdir>/HTML/EN/html/softsqueeze

backing up my old files, of course. Now I restart softsqueeze from
the slimserver web pages, and.... I get a webstart error :-(

"Unable to launch Softsqueeze CVS_BUILD." in a dialog titled "Java Web
Start Launch File Error". I click on details, and see (under a
"general" tab):

An error occurred while launching/running the application.

Title: Softsqueeze CVS_BUILD
Vendor: Richard Titmuss, et.al.
Category: Launch File Error

JAR resources in JNLP file are not signed by same certificate

There are two other tabs of information. Under "Launch File" I get:

<?xml version="1.0" encoding="utf-8"?>

<!-- JNLP File for Softsqueeze -->

<!-- ** This file is configured for the slimserver ** -->

<!-- To use this jnlp file from another webserver or your local file -->
<!-- system you must edit the 'codebase' and 'slimserver' attributes. -->
<!-- Note you must make sure that the webserver returns the MIME -->
<!-- type 'application/x-java-jnlp-file'. -->

<jnlp
spec="1.0+"
codebase="http://localhost:9000/html/softsqueeze/"
href="softsqueeze.jnlp">
<information>
<title>Softsqueeze CVS_BUILD</title>
<vendor>Richard Titmuss, et.al.</vendor>
<homepage href="http://softsqueeze.sourceforge.net"/>
<description>Softsqueeze Slim Devices Squeezebox Emulator</description>
<description kind="short">Softsqueeze Slim Devices Squeezebox Emulator</description>
<icon width="400" height="200" kind="splash" href="icons/splash.gif" />
<icon width="64" height="64" href="icons/icon64.gif" />
<offline-allowed />
<shortcut online="false">
<desktop />
<menu submenu="SlimServer" />
</shortcut>
</information>
<offline-allowed/>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.4+"/>
<jar href="SoftSqueeze.jar"/>
<jar href="lib/log4j-1.2.8.jar"/>
<jar href="lib/tritonus_share.jar"/>
<jar href="lib/tritonus_mp3.jar"/>
<jar href="lib/jl1.0.jar"/>
<jar href="lib/jflac-1.0.jar"/>
<jar href="lib/jsch-20040429.jar"/>

<!-- Set the following properties to configure the server and firmware -->

<property name="slimserver" value="localhost"/>
<property name="serverversion" value="5.4"/>
</resources>
<application-desc main-class="com.slim.softsqueeze.Application"/>
</jnlp>

And under "Exception" I see

JNLPException[category: Launch File Error : Exception: null : LaunchDesc:
<jnlp spec="1.0+" codebase="http://localhost:9000/html/softsqueeze/" href="http://localhost:9000/html/softsqueeze/softsqueeze.jnlp">
<information>
<title>Softsqueeze CVS_BUILD</title>
<vendor>Richard Titmuss, et.al.</vendor>
<homepage href="http://softsqueeze.sourceforge.net"/>
<description>Softsqueeze Slim Devices Squeezebox Emulator</description>
<description kind="short">Softsqueeze Slim Devices Squeezebox Emulator</description>
<icon href="http://localhost:9000/html/softsqueeze/icons/splash.gif" width="400" kind="splash"/>
<icon href="http://localhost:9000/html/softsqueeze/icons/icon64.gif" width="64" kind="default"/>
<shortcut online="false">
<menu submenu="SlimServer"/>
</shortcut>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.4+"/>
<jar href="http://localhost:9000/html/softsqueeze/SoftSqueeze.jar" download="eager" main="false"/>
<jar href="http://localhost:9000/html/softsqueeze/lib/log4j-1.2.8.jar" download="eager" main="false"/>
<jar href="http://localhost:9000/html/softsqueeze/lib/tritonus_share.jar" download="eager" main="false"/>
<jar href="http://localhost:9000/html/softsqueeze/lib/tritonus_mp3.jar" download="eager" main="false"/>
<jar href="http://localhost:9000/html/softsqueeze/lib/jl1.0.jar" download="eager" main="false"/>
<jar href="http://localhost:9000/html/softsqueeze/lib/jflac-1.0.jar" download="eager" main="false"/>
<jar href="http://localhost:9000/html/softsqueeze/lib/jsch-20040429.jar" download="eager" main="false"/>
<property name="slimserver" value="localhost"/>
<property name="serverversion" value="5.4"/>
</resources>
<application-desc main-class="com.slim.softsqueeze.Application"/>
</jnlp> ]
at com.sun.javaws.LaunchDownload.checkSignedResources Helper(LaunchDownload.java:1031)
at com.sun.javaws.LaunchDownload.checkSignedResources (LaunchDownload.java:933)
at com.sun.javaws.Launcher.continueLaunch(Launcher.ja va:766)
at com.sun.javaws.Launcher.handleApplicationDesc(Laun cher.java:468)
at com.sun.javaws.Launcher.handleLaunchFile(Launcher. java:218)
at com.sun.javaws.Launcher.run(Launcher.java:165)
at java.lang.Thread.run(Thread.java:595)

But I have no idea how to do the various suggested things, e.g.

<!-- system you must edit the 'codebase' and 'slimserver' attributes. -->

or

<!-- Set the following properties to configure the server and firmware -->

<property name="slimserver" value="localhost"/>
<property name="serverversion" value="5.4"/>

which seem right to me at any rate.

OK, so I see on the discussion list that it might be possible to
launch this application without going through the slimserver. I try

java -jar <installdir>/softsqueeze/dist/common/SoftSqueeze.jar

and get....

$ java -jar <installdir>/softsqueeze/dist/common/SoftSqueeze.jar
java.lang.UnsupportedOperationException
at java.security.cert.X509Certificate.getIssuerX500Pr incipal (X509Certificate.java:586)
at java.util.jar.JarFile.verify (JarFile.java:678)
at java.util.jar.JarFile.readSignatures (JarFile.java:569)
at java.util.jar.JarFile.getEntry (JarFile.java:414)
at kaffe.lang.AppClassLoader$JarSource.findClass (AppClassLoader.java:123)
at kaffe.lang.AppClassLoader.findClass (AppClassLoader.java:289)
at java.lang.ClassLoader.loadClass (ClassLoader.java:344)
at java.lang.ClassLoader.loadClass (ClassLoader.java:295)
at kaffe.jar.ExecJarName.main (ExecJarName.java:54)
at kaffe.jar.ExecJar.main (ExecJar.java:75)

OK, I give up. This looks maybe like some kind of certificate or
security problem with the CVS release compared to the slimserver 5.4.0
distributed version. Please, help this clueless newbie make his
softsqueeze run faster!

Larry

mherger
2005-03-03, 00:08
> > Did you download the mp3 plugin (see the docs) and a recent build
> > from http://softsqueeze.sourceforge.net?
>
> I'm sorry to be dense, but this wasn't as easy at you make it sound.
> I'm going to describe my attempt to do what you suggest in a lot of
> detail, just in case anyone in my position (of ignorance) also wants
> to address this performance issue. And I still don't have it
> working.

I should have written it the other way round: first download the latest
build, then the plugin. Because recent builds will give you some
information about the plugin.

> To start with, where in the docs does it say anything about an mp3
> plugin? I tried:

Nowhere, I guess.

[..]
> Now that is not what I would call "in the docs" -- how about putting
> it in http://softsqueeze.sourceforge.net/faq.html or someplace else
> actually findable?

As some might say: "Patches mostly welcome" ;-)


> OK, so now I download the mp3 plugin from Sun, install subversion
> (boy, I do love synaptic! Thanks, Debian), and run

Why subversion? This stuff might be broken. There are stable builds on
SourceForge:
https://sourceforge.net/project/showfiles.php?group_id=105169

It's as simple as downloading a zip file and uncompress it.

[..]
> OK, I give up. This looks maybe like some kind of certificate or
> security problem with the CVS release compared to the slimserver 5.4.0
> distributed version. Please, help this clueless newbie make his
> softsqueeze run faster!

Let's forget about using webstart for now. After uncompressing the zip
file to some folder, try running it manually from that folder using some
command like

java -jar SoftSqueeze.jar

If this is working, we can continue the quest for the single click
webstart problem.

Regards,

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
SlimString Translation Helper (http://www.herger.net/slim/)

rtitmuss
2005-03-03, 16:49
Larry,

Firstly, I am sorry you've had trouble getting Softsqueeze to work. Your
right some of the information you needed should be in the Softsqueeze
FAQ, it is well overdue an update now.

It does sound like something has gone very wrong with Softsqueeze when
you run it. As a comparison at work I have one 1.2GHz Athlon with WinXP
and Softsqueeze uses between 2% - 5% CPU during playback. In answer to
Phil Karn's assumption about being able to call a C based mp3 decoder
from Java - well at the moment that's not possible. So Softsqueeze will
use more resources than xmms, but it should not be significant on a
machine of your spec.

So how to fix this? Can you start Softsqueeze from the command line
(instructions for this are on the website), and see if any error
messages are reported on the console. If not then email me offlist a
thread dump (on the command line press Ctrl + \). This will hopefully
give some clues to the problem. Also does the 100% only occur between
tracks?

Regards,
Richard


junk (AT) 180glencoe (DOT) com wrote:

>Folks,
>
>I'm a big slim devices fan (running an old slimp3 and a wireless
>squeezebox), and I just tried softsqueeze for the first time. I love
>the idea, but the performance on my system is barely acceptable.
>Unless I can figure out how to make it snappier, I may have to go back
>to XMMS and lose the ability to see the scrolling song information,
>the cool remote control interface etc. :-(
>
>I'm running a fairly recent two processor (1.4GHz Xeon) linux (Debian)
>system based on the 2.6 kernel with plenty of memory (>1GB). I'm
>using the latest jre (1.5.0_01) from sun. I'm using the softsqueeze
>version (1.12) that it packaged with the current slimserver (5.4.0).
>
>There are several indications of a problems:
>
> * Using "top" to watch CPU usage per process, softsqueeze (actually
> java, but softsqueeze is the only java process running)
> consistantly takes at least 20% of a CPU, and often nearly 100% of
> one. In contrast, playing from the slimserver with XMMS rarely
> takes more than 1% of a CPU.
>
> * When the system doing only moderately stressful other tasks, there
> are often buffer underruns.
>
> * GUI redraws are slow enough to be clearly visible, and occasionally
> really painfully slow. Painting the preferences dialog seems to
> take an especially long time (seconds).
>
>I don't doubt this is a java problem rather than a softsqueeze one,
>but I don't really speak java. Anyone have any tips about better ways
>to profile this, or, better yet, improve it?
>
>Thanks!
>
>Larry Hunter
>junk at 180glencoe dot com
>

junk@180glencoe.com
2005-03-03, 23:01
Michael Herger writes:
> Let's forget about using webstart for now. After uncompressing the zip
> file to some folder, try running it manually from that folder using some
> command like
>
> java -jar SoftSqueeze.jar

No joy :-(

hunter@basement:/usr/local/src/softsqueeze$ unzip SoftSqueeze-1.17.zip
Archive: SoftSqueeze-1.17.zip
creating: lib/
creating: icons/
inflating: lib/jnlp.jar
inflating: lib/log4j-1.2.8.jar
inflating: lib/tritonus_share.jar
inflating: lib/tritonus_mp3.jar
inflating: lib/jl1.0.jar
inflating: lib/jflac-1.0.jar
inflating: lib/jsch-20040429.jar
inflating: lib/xml-apis.jar
inflating: lib/dtd-xercesImpl.jar
inflating: SoftSqueeze.jar
inflating: MiniSqueeze.jar
inflating: webstart.html
inflating: icons/checked.gif
inflating: icons/screenshot.png
inflating: icons/icon64.gif
inflating: icons/unchecked.gif
inflating: icons/icon32.gif
inflating: icons/splash.gif
inflating: applet.html
inflating: softsqueeze.jnlp
inflating: LICENSE.txt
hunter@basement:/usr/local/src/softsqueeze$ java -j SoftSqueeze.jar
java.lang.ClassNotFoundException: SoftSqueeze.jar
at java.lang.Class.forName (Class.java)
at java.lang.Class.forName (Class.java:44)


Thanks for the help. What next?

Larry

rtitmuss
2005-03-03, 23:17
junk (AT) 180glencoe (DOT) com wrote:

> hunter@basement:/usr/local/src/softsqueeze$ java -j SoftSqueeze.jar
> java.lang.ClassNotFoundException: SoftSqueeze.jar
> at java.lang.Class.forName (Class.java)
> at java.lang.Class.forName (Class.java:44)
>
>
>Thanks for the help. What next?
>
>
>
What do you get when you run these commands:

which java
java -version


Thanks,
Richard

rtitmuss
2005-03-03, 23:20
junk (AT) 180glencoe (DOT) com wrote:

> hunter@basement:/usr/local/src/softsqueeze$ java -j SoftSqueeze.jar
> java.lang.ClassNotFoundException: SoftSqueeze.jar
> at java.lang.Class.forName (Class.java)
> at java.lang.Class.forName (Class.java:44)
>
>
>Thanks for the help. What next?
>
>
Sorry I'll try again - it's _much_ too early in the morning for me. Got
woken up on an emergency call out for work :(

It should be '-jar' not '-j'.

Regards,
Richard