motivewave and linux performance improvements

alexjp

Member
Joined
Apr 7, 2021
Posts
20
Likes
16
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
477
Likes
191
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
20
Likes
16
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
477
Likes
191
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
477
Likes
191
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
20
Likes
16
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
283
Likes
152
Alex,

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

cheers.
 

Per

Active member
Joined
Jun 12, 2021
Posts
28
Likes
7
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

Member
Joined
Nov 9, 2021
Posts
6
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

Active member
Joined
Jun 12, 2021
Posts
28
Likes
7
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: 39

Spin

Well-known member
Joined
May 22, 2019
Posts
477
Likes
191
Almost 2 years later and I'm afraid I have to resuscitate this thread: it seems that 'very annoying mouse issue' is back from the dead. ☠️
I tested with 6.8.8 and 6.9.0 on Debian 12, both with and without "-Djdk.gtk.version=2" and 3 and it persists.

Anyone else seeing this ?
Did someone find a solution already ?

Thx, fellow Linux-lovers ! ❤️

EDIT:
just saw that from 6.8.8 onwards MW started using Java / JavaFX 21. Maybe this is the culprit ?
1710499560560.png

SECOND EDIT:
I should have known: "it's not a bug, it's a feature" :sneaky:
My hunch seems to have been correct. According to this (very old) thread this is a limitation of the X12-protocol.
I added this line to the top of my 'run.sh':
1710500531187.png
and away is the demon !!
🥳
 
Last edited:

kally

Member
Joined
Mar 4, 2024
Posts
7
Likes
2
Almost 2 years later and I'm afraid I have to resuscitate this thread: it seems that 'very annoying mouse issue' is back from the dead. ☠️
I tested with 6.8.8 and 6.9.0 on Debian 12, both with and without "-Djdk.gtk.version=2" and 3 and it persists.

Anyone else seeing this ?
Did someone find a solution already ?

Thx, fellow Linux-lovers ! ❤️

EDIT:
just saw that from 6.8.8 onwards MW started using Java / JavaFX 21. Maybe this is the culprit ?
View attachment 2259

SECOND EDIT:
I should have known: "it's not a bug, it's a feature" :sneaky:
My hunch seems to have been correct. According to this (very old) thread this is a limitation of the X12-protocol.
I added this line to the top of my 'run.sh':
View attachment 2260
and away is the demon !!
🥳
Thank you so much @Spin !
This solved the issue!
 

mikrom

Member
Joined
Dec 14, 2022
Posts
12
Likes
6
Thanks a lot for posting that fix @Spin !, I've had the same issue since 6.8.8 and now it works again.
 
Top