Tux Guitar

Problems

Subject TG does not close correctly



Author Message
Daisouka
Post: May 18th 2009 at 4:51 PM

it's on ubuntu 9.04. While TG is running it uses 60-70% of CPU. When i close TG by clicking X, the window closes, but after that i need to do _killall tuxguitar_. Another way it still uses CPU (the process still present, but there is no window).
It's real time sequencer and Gervill MIDI port in config. thank you.


Back to Top
 
Julian
Post: May 21st 2009 at 1:08 PM

If you run tuxguitar under a terminal.
when it close, do you see any error log ???

> It's real time sequencer and Gervill MIDI port in config.
if you think it's related with sound
try temporally disable the plugin
go to Menu "Tools -> Plugins" and disable java sound api plugin. ( you'll not have sound until you enable it )
Does the problem still happen after disable it ??
check also please the "60-70%" CPU.. it also shouldn't happen, i beleive that all is related to same issue.


Back to Top
 
Daisouka
Post: May 21st 2009 at 5:13 PM

If run from terminal it writes me "fluidsynth: ALSA driver: Using format s16, rw, interleaved". When I close window by clicking X - it still works in terminal, where it have been run from. Ctrl-C does not help - I have to run another terminal and "killall tuxguitar" there. Disabling java plugin does not help. CPU usage almost 100% sometimes - whn i close window it drops down a to 20-40 % Process tuxguitar don't use cpu, but there is process java with TUX icon - it uses. Java still works too after i close window (plugin is still disabled).


Back to Top
 
Julian
Post: May 21st 2009 at 5:25 PM

Ok, lock
some weeks ago, i upgraded to latest pulseaudio available on debian testing, and i could see some similar problems.
but diffent than yours ( the window don't closes when problem happens ).

as i could see, some times alsa plugin of pulse fails or something happends, and keep "waiting forever".
( by fortune, fluidsynth has released a new version that supports pulseaudio driver, so it will be the best choice on the future )

Now, if you are having same problem
try disable again, but all sounds plugins.,
try disable: Java Sound Api plugon, Fluidsynth plugin, Alsa plugin, and OSS plugin ( ofcourse if you have them installed )
Restart tuxguitar, and start again (to make sure no plugin was loaded ) and then yes, try close and tell me if problem still happens.

If problem don't happen anymore, so yes, it's the pulseaudio issue.
so next time, try to enable only plugin that you use ( Real Time Sequencer and Gervill are both from java plugin, so keep disable fluidsynth, alsa and oss plugins or uninstall them )


If sound wasn't the problem,
i assume you are using openJdk (because gervill)
try install and set it as default Sun's jre
then run tuxguitar with it to test if it also happens.
to make sure that you started tuxguitar with sun's java
exec: tuxguitar -i
and take a look to the JVM name.


Back to Top
 
Daisouka
Post: May 21st 2009 at 10:28 PM

So, ok )

Disabling plugins doesn't help.

So I completely remove openjdk. Install Sun Jre 6. There is no effect (except that there is no sound in tuxguitar now at all, but it's ok - i think i should just install plugins - it doesn't matter). All output plugins still disabled. When i start TG with -i parameter there's also need to do killall tuxguitar to stop the process(it's still running without it).
this is the "TG -i" output if it could help:
System Info:
-> OS-Name: Linux
-> OS-Arch: i386
-> OS-Version: 2.6.28-11-generic
-> JVM-Name: Java HotSpot(TM) Client VM
-> JVM-Version: 11.3-b02
-> JVM-Vendor: Sun Microsystems Inc.
-> Java-Version: 1.6.0_13
-> Java-Vendor: Sun Microsystems Inc.
-> Java-Home: /usr/lib/jvm/java-6-sun-1.6.0.13/jre
-> Java-Class-Path: :/usr/share/tuxguitar/:/usr/share/tuxguitar//tuxguitar.jar:/usr/share/java/itext.jar:/usr/share/java/swt-gtk-3.4.jar:
-> Java-Library-Path: /usr/lib/jni

btw. I've tried to use script:
tuxguitar
killall tuxguitar

After that i need to use "killall tuxguitar" too o_O.


Back to Top
 
Julian
Post: May 21st 2009 at 10:53 PM

Also when you execute with -i it happens ??
so it's very strange.
"-i" argument don't loads anything, just print these values and call exit.

Ok, forget about plugins and java thing..
just restore your openJdk
( you didn't need uninstall the other JVM, just using "sudo update-alternatives --config java" you could set the default )

can you please show me the launcher script available on your distribution ?
it should be /usr/bin/tuxguitar i beleive.


Back to Top
 
Daisouka
Post: May 21st 2009 at 11:37 PM

#! /bin/sh
#@ident "$Id: tuxguitar.sh,v 1.3 2008/04/16 17:04:50 rzr Exp $"
#@Author: www.philippe.coval.online.fr -- revision: $Author: rzr $
#@Licence: LGPL
#@Description: Wrapper script for starting java application tuxguitar
###############################################################################
PACKAGE=tuxguitar
[ ! -z $DEBUG ] && set -e
[ ! -z $DEBUG ] && set -x

#/// guess JAVA_HOME if undefined
java_guess_()
{
d="/opt/java/"
[ -d "$t" ] && d="$t"
d="/usr/local/opt/java/"
[ -d "$t" ] && d="$t"
# windows
t="C:Program FilesJavajre1.6.0_03/"
[ -d "$t" ] && d="$t"
t="Program FilesJavajre1.6.0_03/"
[ -d "$t" ] && d="$t"
t="/Program Files/Java/jre1.6.0_03/"
[ -d "$t" ] && d="$t"
# macosx
t="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/"
[ -d "$t" ] && d="$t"
# opensuse
t="/etc/profile.d/alljava.sh"
[ -r $t ] && . $t && echo ${JAVA_HOME} && return
t="/usr/lib/jvm/java"
[ -d "$t" ] && d="$t"
t="/usr/lib64/jvm/java"
[ -d "$t" ] && d="$t"
# mandriva
t="/usr/lib/jvm/jre-1.6.0-sun/bin/../"
[ -d "$t" ] && d="$t"
# gentoo
t="/opt/sun-jdk-1.5.0.14/"
[ -d "$t" ] && d="$t"
t="/opt/sun-jdk-1.6.0.04/"
[ -d "$t" ] && d="$t"
# debian
if [ -r /etc/debian_version ]; then
t="/usr/lib/jvm/java-gcj/jre/bin/../../"
[ -d "$t" ] && d="$t"
t="/usr/lib/jvm/java-1.5.0-sun/jre/bin/../../"
[ -d "$t" ] && d="$t"
t="/usr/lib/jvm/java-6-sun/jre/bin/../../"
[ -d "$t" ] && d="$t"
t="/usr/lib/jvm/java-6-openjdk/jre/bin/../../"
[ -d "$t" ] && d="$t"
fi
# results
[ -d "$d" ] && echo "$d"
}

swt_guess_()
{
t="/usr/lib/eclipse/plugins/org.eclipse.swt.gtk.linux.*.jar"
[ -r "$t" ] && f="$t"
t="/etc/alternatives/swt.jar"
[ -r "$t" ] && f="$t"
t="/usr/share/java/swt.jar"
[ -r "$t" ] && f="$t"
t="/usr/lib/java/swt.jar"
[ -r "$t" ] && f="$t"
t="/usr/share/java/swt-gtk-3.4.jar"
[ -r "$t" ] && f="$t"
t="/usr/lib/java/swt3.2-gtk.jar"
[ -r "$t" ] && f="$t"
file -L "$f" >/dev/null 2>&1 || f=""
echo "$f"
}

#/// org.eclipse.swt.SWTError: No more handles
#/// [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)]
mozilla_guess_()
{
t="/usr/lib/mozilla"
test -r "$t/libxpcom.so" && d="$t"
t="/usr/lib/iceape/"
test -r "$t/libxpcom.so" && d="$t"
t="/usr/lib/icedove/"
test -r "$t/libxpcom.so" && d="$t"
t="/usr/lib/firefox/"
test -r "$t/libxpcom.so" && d="$t"
t="/usr/lib/iceweasel"
test -r "$t/libxpcom.so" && d="$t"
t="/usr/lib/xulrunner"
test -r "$t/libxpcom.so" && d="$t"
t="/usr/lib/xulrunner-1.9"
test -r "$t/libxpcom.so" && d="$t"
t="`dpkg -L xulrunner-1.9 |grep libxpcom.so|cut -d '/' -f-4`"
test -r "$t/libxpcom.so" && d="$t"
echo "$d"
}

#
env_()
{
# java
[ -z ${JAVA_HOME} ] && t=$(java_guess_) && [ -d "$t" ] && JAVA_HOME=$t
if [ -d "${JAVA_HOME}" ] ; then
export JAVA_HOME
JAVA=${JAVA:=${JAVA_HOME}/jre/bin/java}
[ -x ${JAVA} ] && export JAVA
else
JAVA=${JAVA:=java}
export JAVA
fi

# mozilla
[ -z ${MOZILLA_FIVE_HOME} ] && t=$(mozilla_guess_) && [ -d "$t" ] && MOZILLA_FIVE_HOME=$t
if [ -d "$MOZILLA_FIVE_HOME" ] ; then
export MOZILLA_FIVE_HOME
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$MOZILLA_FIVE_HOME
fi

[ ! -z ${DEBUG} ] && echo "# MOZILLA_FIVE_HOME=${MOZILLA_FIVE_HOME}"
[ ! -z ${DEBUG} ] && echo "# JAVA_HOME=${JAVA_HOME}"}
}

tuxguitar_()
{
local PACKAGE=${PACKAGE:=tuxguitar}
local PACKAGE_HOME=${PACKAGE_HOME:=/usr/share/${PACKAGE}/}
local PACKAGE_MAIN=${PACKAGE_MAIN:=org.herac.tuxguitar.gui.TGMain}
local PACKAGE_LIB=${PACKAGE_LIB:=/usr/lib/jni}
# java env
JAVA=${JAVA:=java}
CLASSPATH=${CLASSPATH}
t="${PACKAGE_HOME}"
[ -d "$t" ] && CLASSPATH=${CLASSPATH}:$t
t="${PACKAGE_HOME}/${PACKAGE}.jar"
[ -r "$t" ] && CLASSPATH=${CLASSPATH}:$t
t="/usr/share/java/itext.jar"
[ -r "$t" ] && CLASSPATH=${CLASSPATH}:$t
t=$(swt_guess_)
[ -r "$t" ] && CLASSPATH=${CLASSPATH}:$t

JAVA_FLAGS=${JAVA_FLAGS:="-Xms128m -Xmx128m"}
JAVA_FLAGS="
${JAVA_FLAGS}
-Djava.library.path=${PACKAGE_LIB}
-D${PACKAGE}.share.path=/usr/share/${PACKAGE}
-cp ${CLASSPATH}:${PACKAGE_CLASSPATH}"
local arg=""
[ -z "$1" ] && arg="/usr/share/tuxguitar/tuxguitar.tg"
# run java
[ ! -z ${DEBUG} ] && ${JAVA} -version
[ ! -z ${DEBUG} ] && ${JAVA} ${JAVA_FLAGS} ${PACKAGE_MAIN} --version

${JAVA} ${JAVA_FLAGS} ${PACKAGE_MAIN} $arg "$@"
}

# main
env_
tuxguitar_ "$@"

#eof


Back to Top
 
Julian
Post: May 21st 2009 at 11:44 PM

Ok, try just open a terminal and exec only this ( it's all one command line ) :
java -cp /usr/share/tuxguitar/tuxguitar.jar:/usr/share/java/swt.jar -Djava.library.path=/usr/lib/jni org.herac.tuxguitar.gui.TGMain

Problem also happens ?


Back to Top
 
Daisouka
Post: May 22nd 2009 at 12:11 AM

It opens TG without icons on the buttons, when i close TG it still works in terminal (no TG process, but this thing is still running)


Back to Top
 
Daisouka
Post: May 22nd 2009 at 12:28 AM

Also there about 15 processes called 'java' which use about 30M of memory(there are smth about TG in description) - it's without loading TG. Some of them are the same. In 'open files' of this processes there are tuxguitar.jar, and TG plugins. I don't really know what is this but maybe it could help.


Back to Top
 
Julian
Post: May 22nd 2009 at 1:19 PM

15 java processes ???
maybe "killall tuxguitar" is killing the script, but not java itselft..
try:
killall -9 java

However, i discard a script problem..
now my questions are..
What hardware do you have ?? how many RAM ?

do you have any other java application ???

do you know anything about programing ??


Back to Top
 
Anonymous
Post: May 23rd 2009 at 10:08 AM

OK. I'm sure that problem is in java. Script starts java and java doesn't close after that (.


Back to Top
 
Daisouka
Post: May 23rd 2009 at 10:09 AM

It was me )


Back to Top
 
Julian
Post: May 23rd 2009 at 1:35 PM

Yes, but it is still very strange..
after you told me it happens also with -i

I still want to know if you know anything about programing, or if you can build a little java "Hello World" application to see if problem is happening allways.
or.. do you have any other java application there ??

what about the java web start...
Try it: http://community.tuxguitar.com.ar/tuxguitar-live/
( you don't need to install nothing.. )
let me know please if problem also happens


Back to Top
 
Daisouka
Post: May 23rd 2009 at 3:29 PM

I've made java HelloWorld - it runs well - there is no such problem.

WebStart also makes this problem - after i close it there is java process.


Back to Top
 
Julian
Post: May 23rd 2009 at 3:45 PM

Maybe it is failing at the System.exit...
try add to your hello world sample

System.exit(0);

at the last line of the main method.


Back to Top
 
Daisouka
Post: May 23rd 2009 at 5:32 PM

No it's ok with system.exit(0)


Back to Top
 
Julian
Post: May 24th 2009 at 6:58 PM

Ok i admit... i don't have idea what can it be...
i need reproduce the problem here, to debug and find the exactly moment when it happens.
The most strange thing, is that nobody reported this problem before.

Why don't you try downloading the native jet version.. maybe you have luck and it works better..


Back to Top
 
Anonymous
Post: May 24th 2009 at 11:08 PM

what is native jet version? It's really strange that nobody reported before ) I really would like to help somehow...


Back to Top
 
Daisouka
Post: May 24th 2009 at 11:12 PM

but i'm newbie in linux, so i don't know what should i check


Back to Top
 
Julian
Post: May 26th 2009 at 1:24 PM

>> what is native jet version?
Java files, are compiled to bytecode (.class) and then a JRE interpret them.
There are some projects, that compile the files to binary ( as if it was built with C/C++ ). and ofcourse it depends on some libraries that contains same classes and functions that jre has.
Allmost times these projects are not open source.
but exelsior jet people, gave us a free license to use jet (because tuxguitar is open source )

So if you download the Jet version, you "don't need" to have a JRE installed.

There is also a GCJ native version ( GCJ also compiles as native ) but the disadventaje is that GCJ don't include al java features, so some plugins don't work with it.

Go to download section of this page, on GNU/Linux release..
you'll see all of these different releases.

>> It's really strange that nobody reported before
I think it's a problem related with java and something you have on your system.
When you told me it happens with -i option.
if you take a look the sources of tuxguitar
there is no enougth code there..
it just verify the input arguments ( -i )
and print the result
it's not a normal thing

>> I really would like to help somehow
The best you can do to help, is get and build the sources of tuxguitar. then add some print lines on the code to see "where it stops"
But first you should try understand how to build it:
http://www.tuxguitar.com.ar/tgwiki/doku.php?id=doc:build
don't build plugins or any extra thing.. it's just for test.
once you know how to build it, let me know and i'll send you
some lines to add/remove to the code.

To your "Hello World" test you did..
can you add swt.jar to your classpath please ??

java -cp /usr/share/java/swt.jar -Djava.library.path=/usr/lib/jni [HereYourHelloWorldClass]


Back to Top
 
Ulukai
Post: Aug 3rd 2009 at 8:30 AM

I experience the same problem, see http://www.tuxguitar.com.ar/forum/5/1295/tuxguitar-and-java-don%27t-quit/

Ubuntu 9.04 fresh install, OpenJDK and Tuxguitar 1.0 from repos. I use it with the Gervill plugin. Plugins I don't use are disabled. Also tested with FluidSynth, same problem.

Is there any possible solution for this already?


Back to Top
 
Julian
Post: Aug 3rd 2009 at 1:45 PM

I tried installing ubuntu 9.04 under VirtualBox to reproduce the problem..
but it don't happens to me.
it's very hard fix this without reproduce the problem.. i don't know if it's a tuxguitar, java or swt bug..


Back to Top
 
Ulukai
Post: Aug 3rd 2009 at 8:19 PM

Hello Julian,

In short: in my case (see config 2 posts up) every time I quit Tuxguitar the java process stays. When opening TG again, an extra Java instance starts. After some playing around with TG plugins or changing soundfonts and restarting TG every time, I end up with a lot of Java processes and little free memory.

Sun JRE 6 has same problem.

Will test with your 1.1 x86 deb file tomorrow and also the JET version. I'll keep you posted.

Thanks already for all the effort.


Back to Top
 
Julian
Post: Aug 3rd 2009 at 10:26 PM

Yes, i understand the issue, the problem is i can't debug it without reproduce..

> When opening TG again, an extra Java instance starts
this is normal..
you can open multiple tuxguitar instances at same time..


Just one question... to see if it's maybe a bug in SWT or the GTK version..
does it also happen if you close tuxguitar from menu "File -> Exit" ??


Back to Top
 
Ulukai
Post: Aug 4th 2009 at 11:19 AM

Yes, also happens from File --> Exit

Today I did some tests with a fresh installation of Ubuntu 9.04 on a spare laptop.

OpenJDK6 + TG 1.1 x86 deb
TG quit --> Java and TG quit normally
OpenJDK6 + TG 1.1 JET
TG quit --> Java and TG quit normally
OpenJDK6 + TG 1.1 Source
TG quit --> Java and TG quit normally

For me this means we can already exclude the problem being in OpenJDK6 or TG 1.1.
Maybe it's only a problem in TG 1.0? Will try tonight to uninstall version 1.0 from the repos and install the 1.1 deb file.

However, I didn't find a possibility to use FluidSynth plugin with version 1.1, since it is not included in the deb file. Can I download this seperately or do I have to compile it from source? If yes, can you provide a small guide how to only compile this one plugin from source?

Thanks in advance, I will also let you know my other test results soon.


Back to Top
 
Julian
Post: Aug 4th 2009 at 1:40 PM

i'm not really sure if it's fixed in 1.1..

I asked to Daisouka to test the java web start version (that is 1.1 ) and he told the problem also happened..

Fluidsynth plugin was not build as default on official GNU/Linux releases ( because it force the user to have libfluidsynth installed ) so you need to manually build the plugin if you want it..
You can see here how to build plugins:
http://www.tuxguitar.com.ar/tgwiki/doku.php?id=doc:build

but you can also use fluidsynth with the Alsa plugin ( as when you start qsynth.. or fluidsynth under a terminal )


Back to Top
 
Ulukai
Post: Aug 5th 2009 at 11:15 AM

Weird things are happening... I think you might be right Julian.

You remember the tests I did on the spare laptop: TG and Java always quit nice, whatever I used or did.

Then, yesterday evening on my home PC where I had 1.0 from the repos installed and TG never quit nice, I removed everything from Tuxguitar including user settings and installed the 1.1 Ubuntu deb file. After testing under various settings, I still had the same problem: TG and Java never quit when I close the program.

Summary:
- Problem happened on Sun Java and OpenJDK
- Happened with TG 1.0 and 1.1
- Using other installers like JET / source don't make any difference.

The only difference between my home PC and my spare laptop is that on my home PC I first installed Ubuntu + updates + all apps I need + new theme and only then Tuxguitar, being the latest app I needed to install and configure.
On the spare laptop, I installed Ubuntu + updates, Java and then immediately Tuxguitar without even changing the theme or other system settings.
==> I will backup all my hidden maps in my home folder, log out and login again, and then test to quit TG again. Maybe it is in some setting I did in the gnome environment...

I'll let you know what happened.


Back to Top
 
Ulukai
Post: Aug 6th 2009 at 10:16 AM

Like I suspected, deleting all the hidden folders from my profile, rebooting and logging in with a clean profile fixed the problem: TG and Java always quit nicely.

HOWEVER, when I make all my profile settings again (changing background, theme engine, fonts, metacity, disabling mounted volumes in gconf, enabling reduced resources in gconf, enabling assistive / accessibility technologies in Gnome menu) and I log in again, the problem RETURNS !!

Could this mean that there is some Gnome bug or is it in any way possible a TG bug? I mean I only change some basic Gconf settings and the appearence of my account and BANG, my apps don't quit anymore... I even had the same with Synaptic: with a modified profile I can't save my Synaptic Preferences, with a clean profile I have no problems. See bugreport of other people with the same problem: https://bugs.launchpad.net/ubuntu/+source/synaptic/+bug/298389 ...

UPDATE: it just turned out that it would be the Accessibility option of Gnome if we can believe what's written here: https://bugs.launchpad.net/gconf/+bug/174570
This really makes me sad, because I only use the Accessibility feature to disable the annoying minimize effect (black border) of Metacity...

Any thoughts of this...?


Back to Top
 
Ulukai
Post: Aug 6th 2009 at 5:43 PM

Hello, the problem is solved for me and I just wanted to let you know what the solution is.

Disable System - Preferences - Assistive Technologies in Gnome menu. Restart the computer.

Peronally I used to turn this on in combination with the gconf-editor key /apps/metacity/reduced_resources to disable the minimize effect of Gnome. However, as appeared, this brings some serious problems like applications hanging (Synaptic) and some programs not quitting (Tuxguitar). So enable Assistive Technologies again if you don't really need it for some other reason to stay out of trouble :-) There is another gconf-editor key I found to disable the minimize effect: /desktop/gnome/interface/enable_animations

Thanks to anyone who tried to help and put a lot of effort in it :-)


Back to Top
 
Ulukai
Post: Aug 6th 2009 at 5:45 PM

I'm sorry, in the post above I meant to DISABLE Assistive Technologies, NOT ENABLING it :-)

This forum reallty lacks an EDIT button :-p


Back to Top
 
Julian
Post: Aug 6th 2009 at 10:04 PM

so, i think it could be an SWT -> GTK related bug.. that can't close the window if this feature is enabled..

thanks for tell us how did you solve it.. (not all users tell us what they did after solve this kind of problems :) )


Back to Top