Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER for Linux

Reply
 
Thread Tools Display Modes
Old 12-08-2019, 04:12 AM   #1
Celphor
Human being with feelings
 
Join Date: Jan 2013
Location: Austria
Posts: 73
Default Slow VST scanning, project loading with LinVST

Hi,

I am new to Reaper on Linux. I used Reaper for a long time on Windows.
I have Linux experience for almost 20 years and I would really love to do the transition with my music production stuff (amateur level).

I compiled LinVST and got it working well. Low latency with ALSA, everything running sweet so far when processing.

The only thing I can complain about are slow loading/scanning times for the VSTs. It takes 1-2 seconds for one VST instance to process. Scanning all plugins is painfully slow. This wouldn't be a problem, as you rarely do it, but it also happens when loading a project.
In the shell window I see the VSTs being loaded, but some are really slow (e.g. FM8 or Battery 4). It takes 1-2 seconds for each INSTANCE to process.

I see repeating output like

Loading /home/username/.wine/drive_c/VST64/FM8.dll
DSSI VST plugin server v0.986
Copyright (c) 2012-2013 Filipe Coelho
Copyright (c) 2010-2011 Kristian Amlie
Copyright (c) 2004-2006 Chris Cannam
LinVst version 2.8.0

From my windows time I remember huge projects loading in a reasonable time. But now even a fairly small project takes 20 seconds to load.

It's obvious that Wine and the LinVST wrapper will introduce overhead, but that much?

I'm on a i7 4 core with 16GB RAM/SSD on Gentoo Linux x64 up to date.
The machine is performing very well for all other tasks.
ALSA latency is ~5ms without any tweaks

I use

Reaper 6.0.1 Linux native
Wine staging 4.21
Gnome 3.32
Kernel 5.4.1

and set

@users hard memlock 1000000
@users soft memlock 1000000
@users hard rtprio 99
@users soft rtprio 99

in /etc/security/limits.conf to satisfy LinVST

Wineserver is already preloaded.

What is your experience? Any ideas to speed it up?

Greets

Celphor
Celphor is offline   Reply With Quote
Old 12-08-2019, 09:20 AM   #2
Jack Winter
Human being with feelings
 
Jack Winter's Avatar
 
Join Date: Aug 2007
Location: Luxembourg/Spain
Posts: 1,922
Default

I think it's one of the big disadvantages of linvst, not sure if there is anything you could tweak to improve it.

It would probably be better if linvst was a wine vst host running all the time, and presenting the plugins as a vst shell. Like that it wouldn't have to start new processes all the time.

But let's not be too picky, it's already amazing that we can run plugins from a different operating system...!
__________________
Reaper for Linux Documentation (WIP). Software: Archlinux/KDE, Fabfilter FX, Komplete 8, Nebula, Schwa/Stillwell, T-racks Max/Amplitube/SVX, etc. Gear: i7-2600k/4700HQ/16GB, RME Multiface/Babyface, Behringer X32, Genelec 8040, etc. :)
Jack Winter is offline   Reply With Quote
Old 12-08-2019, 12:27 PM   #3
Celphor
Human being with feelings
 
Join Date: Jan 2013
Location: Austria
Posts: 73
Default

Quote:
Originally Posted by Jack Winter View Post
I think it's one of the big disadvantages of linvst, not sure if there is anything you could tweak to improve it.

It would probably be better if linvst was a wine vst host running all the time, and presenting the plugins as a vst shell. Like that it wouldn't have to start new processes all the time.

But let's not be too picky, it's already amazing that we can run plugins from a different operating system...!
I'm not picky, I was just wondering. It's amazing that it exists and is working. A reuse of instances would be great and shouldn't be to hard to implement. I'm a programmer, unfortunately not a C guy.

Maybe Airwave is what we want? Didn't try it
Celphor is offline   Reply With Quote
Old 12-08-2019, 08:20 PM   #4
osxmidi
Human being with feelings
 
Join Date: Feb 2014
Posts: 620
Default

The scanning shouldn't take that long.

Maybe it's a Wine/System thing.

"It takes 1-2 seconds for one VST instance to process."

It also depends on what the plugin does, MT-Powerdrumkit loads it's samples on startup and can have a delay.

I do happen to have a LinVst version in the pipeline that does run all plugins in one Wine process, LinVst-X.

That means that plugins can communicate ie GlissEQ Fabfilter ProQ-3 spectrums and Kontakt libraries not having to load samples for new instances etc.

It also means that new instances and plugins load very fast once the server is up and running.

The downside is that the plugins are not sandboxed and if one goes down then it might take everything down with it.

It hasn't been straight ahead to get a one Wine process LinVst version that works efficiently and it's involved some not straight ahead programming.

I can have the server shut down automagically if no plugins are left or just keep the server going regardless of how many plugins are loaded.

The upside is with keeping the server going is that the scanning would be the fastest possible but the downside is that the user would need to kill the server manually or reboot but seeing that the server doesn't do much if no plugins are loaded then it can be just left to run I suppose.

So I'm not sure about leaving the server running.

I run it with the server always running.

Last edited by osxmidi; 12-09-2019 at 12:12 AM.
osxmidi is offline   Reply With Quote
Old 12-08-2019, 09:01 PM   #5
osxmidi
Human being with feelings
 
Join Date: Feb 2014
Posts: 620
Default

https://github.com/osxmidi/LinVst-X

The convert utilities need to be made (makefiles are in the convert folder) and the linvst convert file is linvstx.so instead of linvst.so for the usual LinVst.

Makefile is in the convert folder or Makefile-linxconverttree for sub dir converting.

Gtk 3 dev packages needed.

If someone doesn't want to go through the above then linvstx.so could be renamed to linvst.so and then the usual LinVst convert utilities included in the LinVst binary release could be used.

For the LinVst-X server the usual X11 and Wine dev packages and multilib are needed (details are in the LinVst Make guide on github,

make

then

sudo make install

It's best to use it with plugins that already work with LinVst and/or use TestVst.

Last edited by osxmidi; 12-09-2019 at 12:12 AM.
osxmidi is offline   Reply With Quote
Old 12-09-2019, 04:48 AM   #6
Jack Winter
Human being with feelings
 
Jack Winter's Avatar
 
Join Date: Aug 2007
Location: Luxembourg/Spain
Posts: 1,922
Default

That's great news osxmidi! Thanks!
__________________
Reaper for Linux Documentation (WIP). Software: Archlinux/KDE, Fabfilter FX, Komplete 8, Nebula, Schwa/Stillwell, T-racks Max/Amplitube/SVX, etc. Gear: i7-2600k/4700HQ/16GB, RME Multiface/Babyface, Behringer X32, Genelec 8040, etc. :)
Jack Winter is offline   Reply With Quote
Old 12-09-2019, 07:32 AM   #7
Celphor
Human being with feelings
 
Join Date: Jan 2013
Location: Austria
Posts: 73
Default

@osxmidi: That's great news. I'm going to give it a try as soon as I can.
Thanks for your efforts in making things as smooth as possible!

FM8 needs 2 seconds on my system and as far as I know it doesn't load big stuff.
Celphor is offline   Reply With Quote
Old 12-09-2019, 08:01 AM   #8
osxmidi
Human being with feelings
 
Join Date: Feb 2014
Posts: 620
Default

Part of the problem is that LinVst needs to start a separate server Wine process for every plugin and that includes scans.

The LinVst-X server can be preloaded

wine /usr/bin/lin-vst-server-x.exe.so for 64 bit plugins

wine /usr/bin/lin-vst-server-x32.exe.so for 32 bit plugins

LinVst-X has the server hang around once it's started and then it just accepts and loads (and scans) whatever plugins.

LinVst runs sandboxed separate Wine processes and LinVst-X doesn't.

Last edited by osxmidi; 12-09-2019 at 10:32 PM.
osxmidi is offline   Reply With Quote
Old 12-09-2019, 08:05 AM   #9
osxmidi
Human being with feelings
 
Join Date: Feb 2014
Posts: 620
Default

btw LinVst-X is beta and I don't guarantee anything about how it performs.
osxmidi is offline   Reply With Quote
Old 12-09-2019, 02:13 PM   #10
Celphor
Human being with feelings
 
Join Date: Jan 2013
Location: Austria
Posts: 73
Default

I can't try it before next weekend :-(
Celphor is offline   Reply With Quote
Old 12-10-2019, 05:59 AM   #11
Celphor
Human being with feelings
 
Join Date: Jan 2013
Location: Austria
Posts: 73
Default

Quote:
Originally Posted by osxmidi View Post

So I'm not sure about leaving the server running.

I run it with the server always running.
A few years ago I did some stuff with the CSurf Interface of Reaper. Here you can get all information about the tracks and VSTs used in the current Reaper project in realtime.
Maybe there's a way to integrate it using the Reaper API.

The downside of my life: I'm not 20 anymore and can not afford anymore to hack all night long ;-)
Celphor is offline   Reply With Quote
Old 12-10-2019, 06:14 AM   #12
Jack Winter
Human being with feelings
 
Jack Winter's Avatar
 
Join Date: Aug 2007
Location: Luxembourg/Spain
Posts: 1,922
Default

FWIW, wineserver takes a few arguments so could be started from a script that starts reaper and then killed when reaper has exited. Try winserver --help at the command line, -p will make it persistent, and -k will kill it.
__________________
Reaper for Linux Documentation (WIP). Software: Archlinux/KDE, Fabfilter FX, Komplete 8, Nebula, Schwa/Stillwell, T-racks Max/Amplitube/SVX, etc. Gear: i7-2600k/4700HQ/16GB, RME Multiface/Babyface, Behringer X32, Genelec 8040, etc. :)
Jack Winter is offline   Reply With Quote
Old 12-10-2019, 03:33 PM   #13
kytdkut
Human being with feelings
 
kytdkut's Avatar
 
Join Date: May 2017
Posts: 95
Default

Quote:
Originally Posted by osxmidi View Post
LinVst-X
this is fantastic, already using it, but...


I think it is not compatible with vsts spread across different wineprefixes, is it?
kytdkut is offline   Reply With Quote
Old 12-10-2019, 08:50 PM   #14
osxmidi
Human being with feelings
 
Join Date: Feb 2014
Posts: 620
Default

Quote:
Originally Posted by kytdkut View Post
this is fantastic, already using it, but...


I think it is not compatible with vsts spread across different wineprefixes, is it?
Yes, because the server hangs around once it's been started and so it can't be redirected to a different wine prefix after it's started.

LinVst can be used together with LinVst-X, some plugins might suit LinVst more and some other plugins might suit LinVst-X.
osxmidi is offline   Reply With Quote
Old 12-10-2019, 09:54 PM   #15
kytdkut
Human being with feelings
 
kytdkut's Avatar
 
Join Date: May 2017
Posts: 95
Default

Quote:
Originally Posted by osxmidi View Post
Yes, because the server hangs around once it's been started and so it can't be redirected to a different wine prefix after it's started.

LinVst can be used together with LinVst-X, some plugins might suit LinVst more and some other plugins might suit LinVst-X.
working great! plug-ins loads super fast with LinVst-X, I'm super happy

thanks for all your work!!
kytdkut is offline   Reply With Quote
Old 12-14-2019, 04:37 AM   #16
osxmidi
Human being with feelings
 
Join Date: Feb 2014
Posts: 620
Default

I've improved some response things, so if anyone is using LinVst-X then I would recommend that they update.
osxmidi is offline   Reply With Quote
Old 12-14-2019, 12:24 PM   #17
kytdkut
Human being with feelings
 
kytdkut's Avatar
 
Join Date: May 2017
Posts: 95
Default

Quote:
Originally Posted by osxmidi View Post
I've improved some response things, so if anyone is using LinVst-X then I would recommend that they update.
I updated from X 2.7 to latest master and GUI rendering is really choppy now. In X 2.7 I get perfectly smooth GUI rendering (and this is new for me in LinVst in general, I was pleasantly surprised). Will be back with a screen capture.

What response things you updated? I allways look at your code to see what changes and understand nada. Also I love changelogs. I know those take time to write though.

Edit: here are the screen captures
Using 2.7
https://www.dropbox.com/s/sy530pnciu...X_2.7.mov?dl=0

Using git master
https://www.dropbox.com/s/c423e0mh7m...aster.mov?dl=0

Last edited by kytdkut; 12-14-2019 at 12:40 PM.
kytdkut is offline   Reply With Quote
Old 12-14-2019, 07:38 PM   #18
osxmidi
Human being with feelings
 
Join Date: Feb 2014
Posts: 620
Default

Quote:
Originally Posted by kytdkut View Post
I updated from X 2.7 to latest master and GUI rendering is really choppy now. In X 2.7 I get perfectly smooth GUI rendering (and this is new for me in LinVst in general, I was pleasantly surprised). Will be back with a screen capture.

What response things you updated? I allways look at your code to see what changes and understand nada. Also I love changelogs. I know those take time to write though.

Edit: here are the screen captures
Using 2.7
https://www.dropbox.com/s/sy530pnciu...X_2.7.mov?dl=0

Using git master
https://www.dropbox.com/s/c423e0mh7m...aster.mov?dl=0
Bummer, I thought that that might happen for some plugins although I couldn't see it with the plugins I tested.

I'll change it back.

The changes were for how much time the server idles.

Last edited by osxmidi; 12-14-2019 at 07:44 PM.
osxmidi is offline   Reply With Quote
Old 12-15-2019, 01:55 PM   #19
Celphor
Human being with feelings
 
Join Date: Jan 2013
Location: Austria
Posts: 73
Default

I gave LinVST-X a try now and was really impressed by the speed.

Until I restarted Reaper. Reaper hung and didn't do anything after showing the splash screen.
I killed my ~/.config/REAPER, killed all wineservers but no way.

I saw no linvst processes or wineservers running.

Rescanning VSTs also hung Reaper.

After treeconverting with the non-X linvst.so everything started again as it should.

What might have made things hanging?
Celphor is offline   Reply With Quote
Old 12-15-2019, 08:10 PM   #20
osxmidi
Human being with feelings
 
Join Date: Feb 2014
Posts: 620
Default

Quote:
Originally Posted by Celphor View Post
I gave LinVST-X a try now and was really impressed by the speed.

Until I restarted Reaper. Reaper hung and didn't do anything after showing the splash screen.
I killed my ~/.config/REAPER, killed all wineservers but no way.

I saw no linvst processes or wineservers running.

Rescanning VSTs also hung Reaper.

After treeconverting with the non-X linvst.so everything started again as it should.

What might have made things hanging?

I havn't had that happen.

The lin-vst-server-x hangs around once it's started and restarting reaper or doing a rescan should just use the already running lin-vst-server-x server just like it initially did after the server was first started.

So if the server just vanishes without a trace then I don't know what is causing that as the server usually needs to be killed to exit.

If someone is trying to kill the server and the server is not killed properly then some shared memory can linger and that can interfere with future scans but a reboot will set it back to normal.

Use htop to kill the server properly (when no plugins are loaded) and that deletes the shared memory as well.

But usually the server should be just left to run and not be killed.

There will be some changes soon as it's still in beta at this point.

Last edited by osxmidi; 12-16-2019 at 12:23 AM.
osxmidi is offline   Reply With Quote
Old 12-16-2019, 01:19 AM   #21
Celphor
Human being with feelings
 
Join Date: Jan 2013
Location: Austria
Posts: 73
Default

My problem is not the fact that something has crashed. It's software ;-) And I appreciate your work very much.

The strange fact is that there has been no indicator where the problem was. No stdout/stderr output, nothing. Just a Reaper hanging in the ropes.

If you find the time it would be great to have some debug output and a debug option in the makefile.

Btw: What development environment are you using? I earn my money with Java developement and can read C/C++ well enough to understand what's going on. But I have to setup a toolchain as I want to do some Reaper development again in the future (did some OSC-Bot stuff years ago). I ditched my last Windows machine at home now and it's a good time to move on
Celphor is offline   Reply With Quote
Old 12-16-2019, 02:15 AM   #22
osxmidi
Human being with feelings
 
Join Date: Feb 2014
Posts: 620
Default

Quote:
Originally Posted by Celphor View Post
My problem is not the fact that something has crashed. It's software ;-) And I appreciate your work very much.

The strange fact is that there has been no indicator where the problem was. No stdout/stderr output, nothing. Just a Reaper hanging in the ropes.

If you find the time it would be great to have some debug output and a debug option in the makefile.

Btw: What development environment are you using? I earn my money with Java developement and can read C/C++ well enough to understand what's going on. But I have to setup a toolchain as I want to do some Reaper development again in the future (did some OSC-Bot stuff years ago). I ditched my last Windows machine at home now and it's a good time to move on
If a plugin crashes then it might take down the server so I generally suggest to use the TestVst utility first with the plugins.

One of the common problems is an unimplemented function in Wine.

The vst might call some windows function and it hasn't been added to Wine and so --> crash.

If TestVst is run from a terminal then Wine output can be seen and if the error is an unimplented function in xxxx.dll then that dll can be "overriden" with a real Windows dll by placing the real Windows dll into system32 (syswow64 for32 bits) and then the dll name gets added to the winecfg Libraries section.

Some plugins run without a problem but there are going to be some plugins that don't because of various reasons ie the current state of Wine and what it can handle etc.

Debugging needs to be done through WineDebug.

On Linux I just use g++ (Wine has wineg++) for C++.

btw I've made some updates to the LinVst-X code.

Last edited by osxmidi; 12-16-2019 at 02:33 AM.
osxmidi is offline   Reply With Quote
Old 12-16-2019, 12:42 PM   #23
Celphor
Human being with feelings
 
Join Date: Jan 2013
Location: Austria
Posts: 73
Default

I tried again with the lastest sources from today. Same problem.

After reboot, first start with Reaper, everything ok.

Fired Reaper up a second time: Hangs and display message "LinVst server not found" after around one minute.

If I preload the server it works again.

So it seems to be a problem with the automatic start of the LinVst-server if it is not running.

No biggie, but a little confusing ;-)
Celphor is offline   Reply With Quote
Old 12-16-2019, 07:35 PM   #24
osxmidi
Human being with feelings
 
Join Date: Feb 2014
Posts: 620
Default

Quote:
Originally Posted by Celphor View Post
I tried again with the lastest sources from today. Same problem.

After reboot, first start with Reaper, everything ok.

Fired Reaper up a second time: Hangs and display message "LinVst server not found" after around one minute.

If I preload the server it works again.

So it seems to be a problem with the automatic start of the LinVst-server if it is not running.

No biggie, but a little confusing ;-)
It's not supposed to do that, maybe it's crashing for some reason.

After the server is started it's not supposed to exit.

On the systems I've tested, Manjaro, Debian Buster/Stretch, the server sticks around after closing Reaper and then on reopening Reaper the server is already available to load plugins etc.
osxmidi is offline   Reply With Quote
Old 12-17-2019, 07:49 AM   #25
Celphor
Human being with feelings
 
Join Date: Jan 2013
Location: Austria
Posts: 73
Default

Quote:
Originally Posted by osxmidi View Post

On the systems I've tested, Manjaro, Debian Buster/Stretch, the server sticks around after closing Reaper and then on reopening Reaper the server is already available to load plugins etc.
I use Gentoo, Kernel 5.4.2 PREEMPT, Wine Staging 4.21

Gonna give it another try during the holidays
Celphor is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:40 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.