robbert-vdh / yabridge

A modern and transparent way to use Windows VST2, VST3 and CLAP plugins on Linux
GNU General Public License v3.0
2.36k stars 61 forks source link

bitwig stopped loading yabridge plugins #354

Closed pololevu closed 2 months ago

pololevu commented 2 months ago

Thanks for giving yabridge a shot!

Problem description

I've been using bitwig on Linux for a while with yabridge to enable me to run mainly Arturia but also other plugins with good results. However recently bitwig reports the plugins no longer respond and it gives a time-out message. I have tried re-installing a fresh copy of bitwig after removing it's config files, I also completely removed yabridge and wine (and created a fresh .wine tree) and re-installed them and the plugins fresh too. This didn't change anything. I see this on another computer also running Linux and I'm not sure where the problem is. I' have tried logging as per the troubleshooting guide but it didn't create the logfile or emit much information at all.

What did you expect to happen?

I expected bitwig to load my plugins and to be able to open and use them.

What actually happened?

Bitwig tries to 'index' it's plugins on startup and sits at a cursor for a while then pops up a dialog box that says the plugin is unresponsive. There is an option to skip the plugin and clicking that moves to try the next plugin with the same result. This happens for vst, vst3 and clap. It does report the names of the plugins correctly but just fails. There isn't much in the BitwigStudio.log, it complains of not being able to read metadata I think:

image

Each plugin gets a stanza like this in the ~/.BitwigStudio/logs/BitwigStudio.log file

[2024-07-16 14:03:42.058 float-library-metadata info] Starting plugin host process with command: /opt/bitwig-studio/bin/BitwigPluginHost-X64-SSE41 metadata 1234 7 2 PluginHost: Connecting to metadata service with id 7 on port 1234 using id 2 PluginHost: Metadata connection established [2024-7-16 14:3:42.105 BITWIG_PLUGIN_HOST info] PluginHost: Reading VST 3 plugin metadata for /home/simon/.vst3/yabridge/Rev PLATE-140.vst3 [2024-07-16 14:04:02.067 float-library-metadata error] Plugin host not responding reading metadata from file /home/simon/.vst3/yabridge/Rev PLATE-140.vst3 [2024-07-16 14:04:02.068 notifications warning] Rev PLATE-140 is taking a long time to scan: Please check that the plug-in does not have a dialog open that is obscured by Bitwig Studio's user in terface [2024-07-16 14:04:04.660 float-library-metadata info] Closing connection with plugin host: The user chose to abort after timeout [2024-07-16 14:04:04.660 indexer info] Could not read metadata for yabridge/Rev PLATE-140.vst3 com.bitwig.flt.library.metadata.reader.exception.CouldNotReadMetadataException: could not read meta data: com.bitwig.flt.library.metadata.reader.exception.CouldNotReadMetadataException: could not read metadata: Plugin host did not respond for 20.0 seconds stdout: [2024-7-16 14:3:42.105 BITWIG_PLUGIN_HOST info] PluginHost: Reading VST 3 plugin metadata for /home/simon/.vst3/yabridge/Rev PLATE-140.vst3

Operating system

Debian Linux testing (trixie)

How did you install yabridge?

Directly from the releases page

yabridge version

5.1.0

yabridgectl version

5.1.0

Wine version

wine-9.13 (Staging)

Plugin

Any I've tried including Arturia, Cherryaudio, some free ones.

Plugin type

both VST2 and VST3

Plugin architecture

64-bit

Host

Bitwig Studio 5.1.9 and Bitwig Studio 5.2 Beta 11

Desktop environment or WM

XFCE

GPU model

NVIDIA Corporation GP108 [GeForce GT 1030]

GPU drivers and kernel

NVidia 535.183.01

Debug log

The file is created but it is empty.

When I issue the command above I get:

$ rm -f /tmp/yabridge.log; env YABRIDGE_DEBUG_FILE=/tmp/yabridge.log YABRIDGE_DEBUG_LEVEL=2+editor bitwig-studio [2024-7-16 14:15:14.261 info] About to start the following process: /opt/bitwig-studio/bin/show-splash-gtk /opt/bitwig-studio/resources/splash-bitwig-studio.png [2024-7-16 14:15:14.262 info] Child process launched with PID 3594067 [2024-7-16 14:15:14.262 info] Backing up log file "/home/simon/.BitwigStudio/log/BitwigStudio.log" to "/home/simon/.BitwigStudio/log/BitwigStudio-previous-run.log" [2024-7-16 14:15:14.262 info] About to start the following process: /opt/bitwig-studio/bin/BitwigStudio -cp /opt/bitwig-studio/bin/bitwig.jar:/opt/bitwig-studio/lib/cp:/opt/bitwig-studio/bin/libs.jar -Dorg.sqlite.lib.path=/opt/bitwig-studio/lib/bitwig-studio -XX:+UseZGC -XX:+ZGenerational -Xms300m -Xmx3g -Djava.io.tmpdir=/tmp/bitwig-simon -DinstallationRoot=/opt/bitwig-studio -DsplashPid=3594067 -Djava.awt.headless=true -XX:ErrorFile=/home/simon/.BitwigStudio/bitwig-studio-jvm-crash.log com.bitwig.flt.app.BitwigStudioMain [2024-7-16 14:15:14.262 info] Redirecting stdout to /home/simon/.BitwigStudio/log/BitwigStudio.log [2024-7-16 14:15:14.262 info] Redirecting stderr to /home/simon/.BitwigStudio/log/BitwigStudio.log [2024-7-16 14:15:14.262 info] Child process launched with PID 3594068 [2024-7-16 14:18:6.629 error] Child process with PID 3594068 exited with error code: 1

where bitwig ran as usual, failed to load the plugins and then I manually exited it (hence the last line).

BitwigStudio.log engine.log

Anything else?

As mentioned, all this was working well for some time so I am suspicious it may be a change in Debian but it is really hard to tell since I am having difficulty getting any real debug logs. I had a grub around in the syslogs but didn't find anything there either. I'm at a bit of a loss and would appreciate some help.

pololevu commented 2 months ago

I forgot to say that several of the plugins have stand-alone versions (eg minifreak-V and Pigments) and If I run those via Wine they work perfectly, just not in BitWig. Also, native Linux plugins do load into Bitwig no problem (eg the Linux version of Dexed).

marben-olvbar commented 2 months ago

Hi, I experience what I think might be the same issue, but on Ardour 8.6.0~ds (as shipped by Debian Trixie).

I seem to have a really similar setup to pololevu, i.e., same operating system version, same wine version (even though I tried to downgrade wine, which did not change anything).

In case of Ardour, I did not observe any logging output, but instead I see lots of memory allocations when waiting for a plugin to be scanned, until Ardour is killed due to OOM.

I also tried Carla as plugin host, which seemed to work with the Yabridge-synced plugins.

noisecode3 commented 2 months ago

Ardour 8.6.0 is kind of old right? Its from april. Do we think a dependency introduced the bug? You all have tried with Wine 9.4 ? I think it was the last one the worked

noisecode3 commented 2 months ago

You can set you wine path right before you run the daw so you can use you're other broken wine for the other broken applications we still love :)

pololevu commented 2 months ago

I tried a few versions of wine and I get the same problem. Also, I'm pretty sure this was working with the versions of wine and yabridge i have installed up until recently which make me suspicious of a dependency change in Debian. Biggest PITA is not getting debug info so if anyone can help me get some meaningful logs we should be able to find the issue.

pololevu commented 2 months ago

Just to be sure I explicitly installed wine-9.4 staging and the result is exactly the same.

noisecode3 commented 2 months ago

That looks like you're problem [2024-07-16 14:04:02.067 float-library-metadata error] Plugin host not responding reading metadata from file /home/simon/.vst3/yabridge/Rev PLATE-140.vst3 You can build yabridge with that debug environment variable I don't remember now, its in the readme but that is for the wine part, then you can use carla and start with --gdb flag then you have good debug output options. Where the plugin updated automatically with some other software?

You want know exactly why it failed now, so you can get more clues from gdb You can also just look at the metadata in the plugin an see if t looks alright? There is the VST3PluginTestHost or you can try rebuild yabridge with newer vst3sdk.

I feel like the plugin was updated and broke for you. So try rebuild with new vst3sdk first. I did not take my medication today Im all over the place sorry XD

pololevu commented 2 months ago

I don't have carla and don't know how to use it - a different person mentioned carla. I tried specifying the debug environment variables for both yabridge and wine and neither helped - I specified the env vars on the same command line I executed bitwig-studio from (from a shell).

The plugins do update ocassionally so that could be the issue but since I was seeing exactly the same problem regardless of the plugin vendor, and some had definitely not updated then it seems unlikely to be the plugin.

I don't know how to look at the metadata in the plugin and again why would it be a problem for all plugins? (ie multiple vendors, some plugins unchanged for a long time).
I had the same issue with vst2 plugins too (I omitted them from the log for simplicity) so I doubt this is related to the vst3 sdk - surely that would need to be backwards compatible anyway.

marben-olvbar commented 2 months ago

You can get Carla here: https://kx.studio/Applications:Carla , but as I mentioned, I could not reproduce the issue there. It loads plugins without any problems, while showing in the log that it uses yabridge for that.

To add to @pololevu's comment, I also do not believe that an individual plugin is at fault. I played around with the ardour-vst3-scanner shipped with Ardour, and it correctly parses my plugins and generates the Ardour plugin cache, but once I try to open a project, I experience the same crash as outlined above.

I did not change the plugin versions, so I too doubt that this is the issue.

I am in the process of trying a more recent Ardour build, but if the same issue occurs with Bitwig, I do not have high hopes for that.

noisecode3 commented 2 months ago

carla don't even use vst3sdk, just rebuild with better vst3sdk cus bugs like this was present there, I remember the change log.

pololevu commented 2 months ago

I just grabbed the latest VST3sdk source from github and built it. The Linux version doesn't seem to have the VST3PluginTestHost (I think that is only built for Windows and Mac) but it does build the validator app. If I run that against one of my yabridge hosted plugins all tests succeed.

I think I might be missing something - when you say "just rebuild with better vst3sdk" are you suggesting I rebuild yabridge?

noisecode3 commented 2 months ago

Yes look at how its build, do you need help whit this? If you where building from git it will download hes modified vst3sdk. But there should be a patch for the vst3sdk. If you need help all the way to paradise I can tell you everything. https://github.com/robbert-vdh/yabridge/blob/master/subprojects/vst3.wrap

pololevu commented 2 months ago

Ok thanks. I cloned yabridge and was able to build that as a first test. That is version 5.1.0 (same version as from the releases builds). This seems to be using vst3sdk version 3.7.7 where the latest version of vst3sdk is 3.7.11. So what I need to do now is to patch the 3.7.11 vst3sdk code to work with winegcc, there is no existing patch on the yabridge/tools directory for that version. I was going to try to apply the 3.7.7 patch to 3.7.11 and see where it fails and then fix that but if there is an easier way, please let me know.

noisecode3 commented 2 months ago

Steps to Update VST3 SDK for yabridge:

Navigate to Subprojects Directory: Open a terminal and navigate to the subprojects directory within your yabridge project:

cd /path/to/yabridge/subprojects

Clone the Latest VST3 SDK: Clone the latest VST3 SDK from the official repository.

git clone https://github.com/steinbergmedia/vst3sdk.git

Rename the Cloned Folder: Rename the cloned vst3sdk folder to vst3:

mv vst3sdk vst3

Add Meson Build File: Download the meson.build file from Robbert-vdh's repository and place it in the vst3 folder. You can download it directly using wget or curl:

wget https://github.com/robbert-vdh/vst3sdk/raw/master/meson.build -O vst3/meson.build

Edit the Meson Build File: Open the meson.build file and make any necessary modifications. Change the version in the head part of the file.This step ensures that the build process is correctly configured to use and patch the VST3 SDK.

Patch the VST3 SDK: Review the patching script provided by Robbert-vdh in yabridge. But it should work out of the box from here. You can view the patching script here:

https://github.com/robbert-vdh/yabridge/blob/master/tools/patch-vst3-sdk.sh

Build yabridge

marben-olvbar commented 2 months ago

I just rebuilt yabridge, and apparently that really did the trick!

Thanks @noisecode3 for the help :D In my case, I did not need to manually mess with the VST3 SDK, it was enough to just follow the build steps.

I do not really understand why this fixed anything, since the vst3sdk was still on the same version (3.7.7), but apparently it helped.

Maybe you can try the same thing @pololevu ?

I only needed to perform these steps (after installing wine-staging-dev and some other things that were missing for the build process):

git clone https://github.com/robbert-vdh/yabridge.git
cd yabridge
meson setup build --buildtype=release --cross-file=cross-wine.conf
ninja -C build
mv ~/.local/share/yabridge ~/.local/share/yabridge.bak
mkdir ~/.local/share/yabridge
cp build/libyabridge-chainloader-clap.so build/libyabridge-chainloader-vst2.so build/libyabridge-chainloader-vst3.so build/libyabridge-clap.so build/libyabridge-vst2.so build/libyabridge-vst3.so build/yabridge-host.exe.so build/yabridge-host.exe ~/.local/share/yabridge

# build the yabridgectl tool
cd tools/yabridgectl
cargo build --release
cp target/release/yabridgectl ~/.local/share/yabridge

# refresh plugins
 ~/.local/share/yabridge/yabridgectl sync -p -f

Afterward, I could load the plugins again.

pololevu commented 2 months ago

Awesome! I didn't think to try yabridge after I built it (ie with vst3sdk 3.7.7), I'll do that and update here later.

pololevu commented 2 months ago

Ok, I can confirm this as working with bitwig! The couldn't build the 32 bit bitbridge due to a missing header file (bits/c++config.h) but I don't think I need that anyway, certainly the plugins I have seem to work now, Perfect :-)

Liquidruffian commented 2 months ago

@ marben-olvbar Can you upload on github or other place your patched build please? I'm in the same trouble and I'm not enough skilled to do it myself (I'm on Debian Trixie). Thank you.

marben-olvbar commented 2 months ago

Hi @Liquidruffian, I do not want to "force" you to execute random BLOBs some stranger on the internet gave to you, so I created a Docker container that builds the required files for you: Docker Container (GIST)

You only need to install Docker (you can use the one shipped with Debian, i.e., sudo apt install docker.io, download the two files in the gist (best put them into a new directory, this directory will be populated with the compiled yabridge files!), and build/run the container (you might need sudo, depending on your configuration):

docker build -t comp-yabridge .
docker run -it -v "$(pwd)":/out comp-yabridge

Afterwards, you should see all these files: libyabridge-chainloader-clap.so libyabridge-chainloader-vst3.so libyabridge-vst2.so yabridge-host.exe libyabridge-chainloader-vst2.so libyabridge-clap.so libyabridge-vst3.so yabridge-host.exe.so

You now need to copy them to your yabridge folder (replace the existing ones), and then perform a sync (not sure if needed, but you can do a ~/.local/share/yabridge/yabridgectl sync -p -f to make sure they are freshly synced).

The container does not build the yabridgectl executable (it is Rust based and I did not want to add the whole Rust setup to the container), but as far as I have seen, it was the shared objects that produced the issue.

You can also clean up the space that the docker files use up by running sudo docker system prune --all.

I hope this helps, if you run into any problems, feel free to let me know.

Best, Marben

noisecode3 commented 2 months ago

Say what? You don't need a patch just clone it and build it like it says in the README. I just wanted to see if upgrade vst3sdk would solve the problem... Its not random its publicly how we all build it ? Its safe, you are just over complicating now

Liquidruffian commented 2 months ago

@marben-olvbar Thank you very much for your time! Later I'll try it and I'll update this post. Have a nice sunday.

Liquidruffian commented 2 months ago

@marben-olvbar Unfortunately didn't work. It's my bad, I can't do it, after running the command <docker build -t comp-yabridge .> I don't see any of those files and the folder didn't poulate with compiled yabridge files. Thank you anyway for your time

marben-olvbar commented 2 months ago

@Liquidruffian Can you show me the error(s) you are getting?

Something I forgot to mention is that you should make the entrypoint.sh script executable, i.e., chmod +x entrypoint.sh.

Liquidruffian commented 2 months ago

@marben-olvbar Once I put in terminal <chmod +x entrypoint.sh> it worked! Thank you so much for your patience, you did a great job and hopefully next yabridge release will be update according to your patches. CIAO e GRAZIE from Italy.