motivewave and linux performance improvements

alexjp

Member
Joined
Apr 7, 2021
Posts
19
Likes
15
Hi,

Just registered to say this about motivewave running in linux:

I am testing motivewave ( on trial for about a week ), both in linux and windows. I noticed that on windows it ran much better, especially with the Volume Imprint study in "ladder" style.

After much reading on the web and testing, now I have a much better performance on motivewave on linux, with what was before a very "jerky and slow" movement, into as smooth as in windows. As a bonus, the "mouse wheel" problem in linux is fixed ( i can use mouse wheel to increase and decrease bar width size, before it would not decrease ) !

What is needed is editing the run.sh file and adding these parameters:

-Djdk.gtk.version=2 -Dprism.forceGPU=true -Dsun.java2d.opengl=true -Dprism.order=es2,es1,sw,j2d -Dsun.java2d.pmoffscreen=false -Dprism.vsync=false -Dprism.lcdtext=false -Dawt.useSystemAAFontSettings=false


Notes:
* In my case, prism.forceGPU is necessary because with an amd card (rx580 in my case) it switches to sw rendering mode.

* prism.vsync=false and -Dsun.java2d.pmoffscreen=false seems to make things much smoother in general.

* -Djdk.gtk.version=2, -Dprism.lcdtext=false and -Dawt.useSystemAAFontSettings=false really help in making volume imprint "ladder mode" really smooth.
 

Spin

Well-known member
Joined
May 22, 2019
Posts
361
Likes
121
Hi there @alexjp and thank you for joining the MW-forums to tell us about your findings 😄

I have been struggling with that mouse-issue as well, for quite some time now.
I have also looked for a solution, but came up empty after hours of googling & testing stuff.

You are without a doubt more skilled ;)

I tried to implement your solution, but it does not seem to work.

Can you please be a little more specific ?
Where in that run.sh file should we past those lines ?
Which part is responsible for the weird mouse behavior ? (or is this interwoven with the GPU-stuff ?)

(I'm running Debian 10 with gdm3 by the way)


Thank you for your contribution ! (y)
 

alexjp

Member
Joined
Apr 7, 2021
Posts
19
Likes
15
Thanks @Spin !

Sorry, i should have been cleared:

in the script, the last line:
Code:
# Start the JVM.  For convenience java has been renamed to motivewave so that is easier to identify in the System Monitor
$SCRIPTDIR/jre/bin/motivewave $MAX_HEAP -Djdk.gtk.version=2 -Dprism.forceGPU=true -Dsun.java2d.opengl=true -Dprism.order=es2,es1,sw,j2d -Dsun.java2d.pmoffscreen=false -Dprism.vsync=false -Dprism.lcdtext=false -Dawt.useSystemAAFontSettings=false -Dprism.cacheshapes=all -Dprism.occlusion.culling=true -Dprism.scrollcacheopt=true -javaagent:"$SCRIPTDIR/jar/MotiveWave.jar" -Dname="MotiveWave"  -Djava.library.path="$SCRIPTDIR/lib" -DUserHome="$HOME" -Duser.dir="$HOME" -DappDir="$SCRIPTDIR" -DLibraryDirectory="$HOME/Library" -DDocumentsDirectory="$HOME/Documents" -DCachesDirectory="$HOME/Library/Caches" -DDesktopDirectory="$HOME/Desktop" -DDownloadsDirectory="$HOME/Downloads" -DSharedPublicDirectory="$HOME/Public" -Dprism.verbose=true -Dprism.maxvram=2048M -Dglass.gtk.uiScale=$SCALE -Dsun.java2d.uiScale=$SCALE -p "$SCRIPTDIR/javafx" --add-modules=javafx.controls,javafx.base,javafx.graphics,javafx.media,javafx.web,javafx.swing --add-exports javafx.web/com.sun.webkit.network=ALL-UNNAMED -classpath "$CP" $VM_ARGS MotiveWave

The specific parameter that fixes the mouse, is -Djdk.gtk.version=2, if i am not mistaken. ( yep confirmed, just tested it, and without it mouse doesn't work properly again ).

I didn't find on google a reference to the gtk2 mouse fix, but i saw some people having problems with java's gtk3 and wayland ( which i am using ), and some bugs on it, so decided to try with gtk2. it was just luck !
 

Spin

Well-known member
Joined
May 22, 2019
Posts
361
Likes
121
I confirm the mouse issue is resolved by @alexjp 's fix. What a relief !!! And my trading has already improved by 25% ;)

Thanks again @alexjp (y)(y)
 

Spin

Well-known member
Joined
May 22, 2019
Posts
361
Likes
121
FYI: the file /usr/share/motivewave/run.sh gets overwritten each time you update MW.

So you would have to make the changes after every update :)
 

alexjp

Member
Joined
Apr 7, 2021
Posts
19
Likes
15
FYI: the file /usr/share/motivewave/run.sh gets overwritten each time you update MW.

So you would have to make the changes after every update :)

you can copy the file to somewhere else, like you home folder and run it from there. As long as the "SCRIPTDIR" variable is correct, there will be no issues.
 

igor.s

Well-known member
Joined
May 22, 2019
Posts
213
Likes
99
Alex,

good finding! the graphics redraw is faster and the system monitor shows less CPU consumption.

cheers.
 

Per

Member
Joined
Jun 12, 2021
Posts
23
Likes
5
Cheers for that. One can only hope that one day MW will wake up and give the startup script some much needed time, love and tender care.

It's been a while coming now, innit.
 

Hermann

New member
Joined
Nov 9, 2021
Posts
2
Likes
2
Thanks @Spin !

Sorry, i should have been cleared:

in the script, the last line:
Code:
# Start the JVM.  For convenience java has been renamed to motivewave so that is easier to identify in the System Monitor
$SCRIPTDIR/jre/bin/motivewave $MAX_HEAP -Djdk.gtk.version=2 -Dprism.forceGPU=true -Dsun.java2d.opengl=true -Dprism.order=es2,es1,sw,j2d -Dsun.java2d.pmoffscreen=false -Dprism.vsync=false -Dprism.lcdtext=false -Dawt.useSystemAAFontSettings=false -Dprism.cacheshapes=all -Dprism.occlusion.culling=true -Dprism.scrollcacheopt=true -javaagent:"$SCRIPTDIR/jar/MotiveWave.jar" -Dname="MotiveWave"  -Djava.library.path="$SCRIPTDIR/lib" -DUserHome="$HOME" -Duser.dir="$HOME" -DappDir="$SCRIPTDIR" -DLibraryDirectory="$HOME/Library" -DDocumentsDirectory="$HOME/Documents" -DCachesDirectory="$HOME/Library/Caches" -DDesktopDirectory="$HOME/Desktop" -DDownloadsDirectory="$HOME/Downloads" -DSharedPublicDirectory="$HOME/Public" -Dprism.verbose=true -Dprism.maxvram=2048M -Dglass.gtk.uiScale=$SCALE -Dsun.java2d.uiScale=$SCALE -p "$SCRIPTDIR/javafx" --add-modules=javafx.controls,javafx.base,javafx.graphics,javafx.media,javafx.web,javafx.swing --add-exports javafx.web/com.sun.webkit.network=ALL-UNNAMED -classpath "$CP" $VM_ARGS MotiveWave

The specific parameter that fixes the mouse, is -Djdk.gtk.version=2, if i am not mistaken. ( yep confirmed, just tested it, and without it mouse doesn't work properly again ).

I didn't find on google a reference to the gtk2 mouse fix, but i saw some people having problems with java's gtk3 and wayland ( which i am using ), and some bugs on it, so decided to try with gtk2. it was just luck !
Great thanks!
I struggled if i want Motivewave because of the mouse wheel bug.
You saved my day! It is clearly visible that MW runs much smoother and faster with the added parameters.
Great bugfix and boost for the linux version!
 

Per

Member
Joined
Jun 12, 2021
Posts
23
Likes
5
It looks like the most recent version of Motivewave have adopted the settings suggested here.

However, they still have the defective scripting dealing with the VM Args settings file in place.

If you are interested in dabbling with VM settings then you need to apply the attached patch. I do this by making a copy of the motivewave startup script in my personal bin directory and then use that going forward (including updating the desktop icon target).

If you update motivewave you'll have to keep updating this as the original launcher cannot deal with multiple VM setting arguments.

That's because the original script cannot extract multiple arguments correctly.

So in summary:

$ mkdir ~/bin
$ cp /usr/bin/motivewave ~/bin/motivewave
$ patch -p0 < motivewave.txt

After that you can modify the VM args as you wish using the launcher, but it must be quoted:

1648394897701.png
 

Attachments

  • motivewave.txt
    1.4 KB · Views: 6
Top