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.35k stars 61 forks source link

Opening yabridgectl #61

Closed kristof-linux closed 3 years ago

kristof-linux commented 3 years ago

Hello,

I like to give yabridge a shot, i could download and extract everything: yabridge (latest version for ubuntu 18.04 LTS) and yabridgectl. But now i like to open the yabridgectl for automated installation, but nothing happens in terminal if i typ e.g. "yabridgectl -- help". I'm a linux newbie, so i'm very sorry if this is a "stupid" question. Do i need to open it with another command or first point the location? Or how can i open or start with the yabridgectl.

I don't know of it has to see something with it, but my version of wine right now is 5.0.3. I understand in what i read i have to upgrade to the latest staging version. I used this commands to install wine https://wine.htmlvalidator.com/install-wine-on-ubuntu-18.04.html. Do i understand it well i just have to add "sudo apt install --install-recommends winehq-staging" or do i really have to remove something. If yes, can you tell me exactly what i have to typ in the terminal to achieve this please?

Last question: finally i like to achieve to run very good samples in Bitwig: Arva Children’s Choir (Strezov Sampling)(kontaktplayer) 16 GB or Eric Whitacre Choir (Spitfire Audio)with 192 GB. Do you have any idea if it'll work with this huge library of eg 192 GB for the Eric Whtacre Choir or will this just crash?

Thanks a lot for your help!!! Kristof

robbert-vdh commented 3 years ago

Hi,

You can run yabridgectl from anywhere by just running ./yabridgectl from the directory it's in, but the most common and probably best place for it would be in ~/.local/bin. If that directory does not yet exist then you can create it yourself. On Ubuntu that directory is automatically added to your PATH meaning that you can just run yabridgectl from anywhere, but after creating it you may have to log out for it to detect that you've created the directory.

And yes, for Wine you'll have to add the WineHQ repository as mentioned on this official page, and then install winehq-staging with the command listed on that page. As mentioned on that page, you need faudio for recent Wine builds, and Ubuntu 18.04 doesn't have that in its repositories. The page you linked suggests downloading a copy of that package and installing it directly, but I'd personally just add this this PPA. After adding that PPA you can just install winehq-staging as usual and it will install faudio for you in the process.

And I've never used sample libraries that huge, but if it's usable on Windows (and you have enough RAM to keep the relevant samples loaded into memory haha) then I don't see why that would be an issue. If you run into performance issues with Kontakt then there are a few things you can do as outlined in the performance tuning section of the readme, but on Ubuntu there are sadly no good or user friendly ways to do some of those things that I've found.

Let me know if you need some more help!

kristof-linux commented 3 years ago

Thanks so much Robbert for your clear and fast answer. Splendid service :-)

Some more questions: 1/ what is the best directory to install yabridge itself? 2/ concerning performance tuning: as you said, i can't find a userfriendly wine-version with Proton's fsync patches for ubuntu. But I could find a "multimedia kernel" e.g. https://liquorix.net/#install. Is this also helpful as "stand alone" or only in relation with a good wine version with fsync patches? Thanks for your time and help!

robbert-vdh commented 3 years ago

You'll want to extract the archive you've downloaded (yabridge-2.1.0-ubuntu-18.04.tar.gz) into ~/.local/share, such that the actual .so and .exe.so files are in ~/.local/share/yabridge/. That way both yabridgectl and yabridge itself will pick those files up without any additional setup (otherwise you'd have to tell both where they can find the files).

Liquorix will contain the fsync kernel patches, but like you mentioned that on its own won't make a difference unless your Wine version also supports it. Whether it will perform better than the linux-lowlatency kernel in Ubuntu's own repositories will depend very much on your situation, so you could just try both.

robbert-vdh commented 3 years ago

(given that you removed your post I assume you already figured it out, but the solution was to either quote the entire path since arguments are split on spaces, or to prepend a backslash to the space in 'Program Files' so it becomes 'Program\ Files' :grin:)

Also, in your screenshot you have extracted the archive to ~/.local/bin such that ~/.local/bin/yabridgectl/yabridgectl exists. If you instead only put the actual yabridgectl binary and not the entire directory in ~/.local/bin, then you can run it from anywhere by just running yabridgectl.

kristof-linux commented 3 years ago

Hey Robbert, indeed i could figure myself by adding " " , anyway thanks a lot for your help! Thanks for your extra tip concerning the location! When i try to change the location by copying, it says: can't copy over directory. Please how can i manage that?

Besides of that, everything works fine, i have to say: much better and easier than carla. Thanks a lot for your work!

Still one question if i can: i'm running bitwig, the instrument samples in bitwig itself runs without crackling sound or "stuttering" sound if i play on my midi keyboard. But when i play the vts-plugins, i have a lot more of "stuttering" sound while playing. I'm using a JACK audio server by QjackCtl. Any idea how i can solve this? Has this to see with the performance tuning-section in your manual? Do i need something else than jack to make this better? Thanks!!

robbert-vdh commented 3 years ago

When i try to change the location by copying, it says: can't copy over directory. Please how can i manage that?

Since both the directory and the binary are named the same (they're both called yabridgectl), you'd first have to move the directory somewhere else, move the yabridgectl binary within the directory to ~/.local/bin, and then remove the now empty directory.

As for performance, the first thing of course is to verify that you have the right permissions to do real time audio. If you already have qjackctl open, then the 'RT' text should be blinking, and running chrt -f 15 whoami from a terminal should print your username. Also of course make sure you're using either the linux-lowlatency kernel or Liquorix (or something similar). Laslty, a lot of spikes in performance with plugins running under Wine can be tracked down to multithreading synchronization issues. fsync really is the best solution to this problem, but you can also try esync to see if that improves anything. Simply run wineserver -k; env WINEESYNC=1 bitwig-studio from a terminal to kill any still existing Wine processes and to then launch Bitwig Studio with esync enabled for Wine.

kristof-linux commented 3 years ago

Thanks Robbert.

Concerning performance: Realtime is activated in qjackctl, but i'm running chrt -f 15 whoami, it says chrt: instellen van beleid voor PID 0 is mislukt: Actie is niet toegestaan (you speak Dutch, do you -:) ?). If i do sudo chrt -f 15 whoami , i get (i think) my username, but what i have to with this username? I have to use it for sth?

As for the linux-low-latency kernel: is there an easy way to activate that in ubuntu 18.04 LTS, you know that? I'm a linux newbie, so the more it's easy, the more it's better for me...

As we discussed yesterday, i do'n't f-sync possibilities with wine on my system 18.04 LTS. But is there an easy way to enable esync in my current wine version staging 5.22?

Thank you very much for your patience and good help!

robbert-vdh commented 3 years ago

So for audio production you basically want a few things. I couldn't find any resources specific to Ubuntu that don't also list a bunch of things you don't really need (or that can potentially harm your system), so I'm just typing it out here.

For esync you'll have to set the WINEESYNC environment variable. If you add export WINEESYNC=1 to ~/.profile and then log out and back in again you'll use esync for all Wine processes by default. You can check by running wineboot in a terminal, which should now output esync: up and running.. Keep in mind that while esync works fine in most cases, I did run into some situations where it caused issues, and if you're getting crashes with esync enabled then you might have to increase the open file limit. That's part of the reason why fsync is the better solution, but it's not yet part of Wine Staging.

kristof-linux commented 3 years ago

Thanks Robbert for your explanation, i learn a lot by that! It took some time, but i achieved most of what you said. I installed a low-latency kernel (liquorix, but also ubuntu) and i add myself to the audiogroup and i could add esync to wine. The sound seems, in combination with the liquorix kernel, to be good now with bitwig and vts-plugins, great! With the ubuntu low latency-kernel, it's not better.

Concerning installing cpupower for the liquorix-kernel, i think it's impossible if i read this: https://github.com/damentz/liquorix-package/issues/31. Do you see any alternatives, or should it be ok like that?

Thanks a lot Robbert! I'm really happy the sound, thanks to you, is already better with the liquorix-kernel!

robbert-vdh commented 3 years ago

I haven't used Liquorix myself and it's been years since I've used Ubuntu on the desktop, but that sounds more like a packaging issue with Ubuntu's cpupower package. You'd have to look up what the recommended way to set frequency scaling governors on Liquorix would be. An alternative way to set the scaling governor to performance manually would be to run the following from a terminal, but this will of course only last until you reboot:

echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
kristof-linux commented 3 years ago

Hey Robbert, on this forum i found a topic concerning liquorix and cpu power package. They speak about "That's a packaging issue, and could probably be fixed by removing that dependency from the package before installing it." I asked them, but maybe you can help me even better...do you know how i can remove that dependency (i don't know which dependency) from the package? Which code do i need to do that?

robbert-vdh commented 3 years ago

I hadn't looked into how Ubuntu packages cpupower, and it's not that it has a dependency on linux-tools, but rather it's part of a linux-tools package that's packaged per kernel version. Some of the utilities included in those package might not work correctly with other kernel versions so ideally Liquorix would provide their own variant of it. I don't use Ubuntu myself so I'm not sure if it would work, but you can try just installing the linux-tools-generic package to see if that version of cpupower works for you.

If that doesn't work then you can still change the scaling governor manually without cpupower, but it would of course be best if cpupower just works.

kristof-linux commented 3 years ago

Thanks Robbert. I could indeed install linux-tools-generic-package. If i now follow your steps: i edit /etc/default/cpupower (it's a blank file, is that normal??) and add governor='performance' to that file. Then run sudo systemctl enable --now cpupower Nevertheless:

sudo systemctl enable --now cpupower
Failed to enable unit: Unit file cpupower.service does not exist

Can you help me with that?

Besides of that i read this concerning cpu and liquorix: Liquorix is configured to use performance by default. By changing the governor, you'll get worse behavior due to the way MuQSS schedules threads on your processor. Here is the article where i found that. What do you think?

robbert-vdh commented 3 years ago

It should not be a blank file! I'd remove /etc/default/cpupower again just to make sure that doesn't cause any issues in the future. And if Liquorix sets the scaling governor to performance by default then you also won't need to change anything. You can check the current scaling governors by running:

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

That should print performance once for every core/hardware thread you have.

kristof-linux commented 3 years ago

I've deleted the files as you said, thanks for the tip. Concerning liquorix: i see it's not set by default on performance, it's set on ondemand. echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor is working. Do i understand that, with the information we have right now, it's not possible to make this change permanent? Thanks for your final advice!

robbert-vdh commented 3 years ago

One way to do this on startup would be to first create a script over at /usr/local/sbin/set-performance-governor that sets the governor with the same command as above. You could create this anywhere else, but keeping custom things like this in /usr/local is usually good practice. The script should contain the following:

#!/usr/bin/env bash

echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

You'll have to make this executable with sudo chmod +x /usr/local/sbin/set-performance-governor or else neither you nor systemd will be able to run it. Next you can create a systemd unit for this so it can be run on startup as a service. If you create a file over at /etc/systemd/system/set-performance-governor.service with the following contents:

[Unit]
Description=Enable the performance frequency scaling governor

[Service]
Type=oneshot
ExecStart=/usr/local/sbin/set-performance-governor
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Then you should be able to start that script and enable it on startup with sudo systemctl enable --now set-performance-governor. If everything went correct systemctl status -performance-governor should now tell you that the service is enabled and currently active.

kristof-linux commented 3 years ago

Thanks Robbert! I've tried a lot, but i'm afraid i need your help.

The name of the script has to be: set-performance-governor, right? If i try to create that script with that name in/usr/local/sbin, i can not, because i have no access...i think it needs root permission...What do i need for that please?

I tried already sudo chmod 775 /usr/local/sbin but it did'n't help. Did i do sth wrong with that? If yes, how can i reverse this please?

Similar questions for the next thing: /etc/systemd/system/set-performance-governor.service

Sorry for my dummie questions!

robbert-vdh commented 3 years ago

/usr/local/sbin should have permissions 755, so you should revert it back to that. On regular Ubuntu you should have gedit installed, so that should be a bit easier to use than vim or nano. If you use sudo gedit /usr/local/sbin/set-performance-governor and sudo gedit /etc/systemd/system/set-performance-governor.service then you can create, edit and save those files.

kristof-linux commented 3 years ago

Thanks for your very fast reaction. Everything worked, but after a reboot, cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor gives 'ondemand`. Is that normal? Is sth wrong?

robbert-vdh commented 3 years ago

What does systemctl status set-performance-governor say? Did you enable the unit?

kristof-linux commented 3 years ago

It says it's running...see screenshot... Schermafdruk van 2020-12-01 15-12-11

robbert-vdh commented 3 years ago

You forgot the set-performance-governor part!

kristof-linux commented 3 years ago

The set-performance governor gives this - it says active, but this cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor gives `"ondemand", is that normal? I don't understand...

Schermafdruk van 2020-12-01 15-21-10

robbert-vdh commented 3 years ago

If you run sudo systemctl restart set-performance-governor then the check scaling governor again, it's set back to performance, right? In that case the unit might need to be delayed a bit. I've also had to do that for changing the power limit on my GPU. First disable the existing service again with sudo systemctl disable set-performance-governor, and then create this timer unit over at /etc/systemd/system/set-performance-governor.timer:

[Unit]
Description=Enable the performance frequency scaling governor on boot

[Timer]
OnBootSec=5

[Install]
WantedBy=timers.target

And then run sudo systemctl enableset-performance-governor.timer` to have the script run five seconds after booting. That should work.

kristof-linux commented 3 years ago

I did all what you said...but still cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor gives "ondemand"...

robbert-vdh commented 3 years ago

I did all what you said...but still cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor gives "ondemand"...

After restarting that service? Does running sudo /usr/local/sbin/set-performance-governor manually also not work?

But anyways, if you don't have any performance issues with the ondemand governor, then you also don't really have to worry about this stuff.

kristof-linux commented 3 years ago

Manually it works...just for understanding: why is the script not working automatically...it would be nice if it just works, if possible of course... Thanks anyway

robbert-vdh commented 3 years ago

The governor is probably overridden by something else, but I don't use Ubuntu and I have no clue what it could be.

kristof-linux commented 3 years ago

Thanks anyway a lot for all your efforts!

kristof-linux commented 3 years ago

Just to be complete: i've tested it with several kernels. With ubuntu (low-latency and generic) the script works perfect. With the liquorix-kernel it doesn't, but sound quality is best, without crackling. Liquorix doesn't support intel p-state - as far as i can see and i understand. I'm happy we could clarify all this new things for me. Thanks a lot Robbert!

robbert-vdh commented 3 years ago

Yeah as long as you don't experience any issues then there's nothing to worry about. I'm on Manjaro and I have done zero tweaking or special configuration, and since everything performs great here so I also haven't had a need to.

kristof-linux commented 3 years ago

Hello Robbert, just another question. I installed manjaro and try to get it working. I downloaded yabridge 2.2.1-1 from the package manager in Manjaro and when i click on install for yabridgectl with "optionele afhankelijkheden", installations fails and says: "doel niet gevonden". Can you help please? By the way i have still one other problem with the spitfire audio lab exe installing with wine in manjaro...i don't know if you have experience with that, but the installation fails because "can not connect"...maybe you can help or you have a solution. Thanks a lot Robbert!

robbert-vdh commented 3 years ago

I don't use Pamac myself, but if you just run yay -S yabridgectl from the command line then that should work, right? And I've never seen Spitfire's installer fail like that, so I'm not sure what could cause that. Only thing with the Spitfire plugins is that you'd often have to install them to their own prefix because they don't like the native .dll overrides you'd normally install to a regular prefix.

kristof-linux commented 3 years ago

Thanks! Just this: what should i do with: remove make dependencies after install...yes or no please??? ...from a manjaro newbie...:-)

robbert-vdh commented 3 years ago

If you answer yes it will remove the things it needed to install to build yabridgectl (probably Rust) again after you install yabridgectl. That saves a bit of SSD space now, but you'll have to reinstall those things again to update yabridgectl again later. So that's up to you.

kristof-linux commented 3 years ago

Thanks Robbert. Now i get this as message...i really don't understand that...please what do i have to choose now? N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4) see also screenshot Schermafdruk van 2020-12-26 13-50-57

robbert-vdh commented 3 years ago

Hit Enter or N+Enter to continue installing, or A+Enter to view what you're actually building.

kristof-linux commented 3 years ago

Everything is build well now, thank you. Just one last question: if i understand well and read your manual well, next thing i have to do is: Next, you'll want to tell yabridgectl where it can find your plugins. For this you can use yabridgectl's add, rm and list commands. For instance, to add the most common VST2 plugin directory,...or do i forget still something, e.g. creating a directory?

robbert-vdh commented 3 years ago

No, you just have to tell yabridgectl where your Windows VST2 plugins are installed, run yabridgectl sync, and tell your DAW to search for the plugins in the directory you just added.

robbert-vdh commented 3 years ago

You'll have to either copy the entire prefix from your old installation, or install the Spitfire Audio software from scratch (in this prefix or in a new prefix). The installer works just fine on my computer (just tested with version 3.2.17), so I can't really help you with that.

kristof-linux commented 3 years ago

Thanks Robbert. I tried to copy the entire prefix, also rebuild the presets and patches, following this instructions: [but](https://spitfireaudio.zendesk.com/hc/en-us/articles/360005196074--Error-1-Something-went-wrong-in-Spitfire-instrument, no success :-(. I also did again yabridgectl sync but also that didn't work...should i do another command with yabridgectl?? If that doesn't work, only solution is to install from scratch. Please can you tell me which version of wine you use and how i can update from my version, hopefully this will fix it then. My version is 5.22...By the way: can you explain "in this prefix or in a new prefix"? How can i achieve that please?

robbert-vdh commented 3 years ago

I'm using wine-tkg 6.0-rc3 right now, but those plugins have been working fine with every Wine (Staging) version from at least 5.0 onwards. You can read more about Wine prefixes on the Wine wiki here:

Don't forget to unset WINEPREFIX before you open Bitwig, or yabridge will use that prefix for all plugins.

kristof-linux commented 3 years ago

I really apologize for all my question Robbert...but i really like to get this working...so i'm searching further on. Thanks for the information about wineprefixes. I did unset WINEPREFIX in terminal, but nothing changed. It stays saying "failed to load patch..." - see screenshot. Do you see the solution for that please?

In case i like to upgrade wine on manjaro, can you give me a tip how i can do that? deleting the old one (in software manager) and installing the new in terminal? It's all new for me, and i don't want to make mistakes :-)

Schermafdruk van 2020-12-26 22-33-29

robbert-vdh commented 3 years ago

You really need to reinstall the Spitfire plugins in a new prefix (e.g. ~/.wine-spitfire, that's what I use), remove the plugin .dll files from the old prefix (to prevent confusion), add $HOME/.wine-spitfire/drive_c/Program\ Files/VstPlugins/ in yabridgectl, run yabridgectl sync, and then use the plugins from that directory in the new prefix.

Other than for fsync patches there's no reason to use any other Wine version. Wine Staging 5.22 works great, and 6.0 will come to Manjaro's and Arch's repos when it's ready.

kristof-linux commented 3 years ago

Hello Robbert. Good news: i could finally figure why the installer was not working properly: there was missing pacman -Syu lib32-gnutls. (now i used the wine uninstaller, that way i could see what was missing in terminal :-) And now everything works as on my ubuntu-configuration. What i don't understand that good is to use/install a new prefix. I figured out and can manage it with the winetricks...but then everything comes in .local/share I also read that i can manage it with

export WINEPREFIX=~/.wine-new
wine winecfg 

Which way i have to go?

And after the creation of that prefix, what i have to do 1/ copy the old .wine (with the plugins spitfire) to the new one? 2/ delete all the plugins from the old .wine? 3/ remove the plugin .dll files from the old prefix (to prevent confusion), add new location in yabridgectl, run yabridgectl sync? 4/ change in bitwig the location to the new on? 5/ you said also sth about unset WINEPREFIX each time i login in bitwig??

Is that correct? Or this the steps?

And one last question for the future: i have to reinstall everything, is it sufficient to build everything with yay -S yabridgectl or do i also need the download the yabridge 2.2.1-1 from the package manager in Manjaro?

Thanks so much, this way i learn a lot!!

robbert-vdh commented 3 years ago

Just set WINEPREFIX to whatever directory you want to use for the prefix. You can either use export WINEPREFIX=/path/to/prefix and unset it when you're done, or add env WINEPREFIX=/path/to/prefix before the Wine command you're running to set it temporarily for only the next command (e.g. env WINEPREFIX=$HOME/.wine-spitfire wine ~/Downloads/SpitfireAudioWinSetup-3.2.17.exe). Since the Spitfire plugins now work in your normal prefix you don't have to change anything. Just be aware that if you start installing more software and plugins that LABS might at some point not work anymore because of those issues with LABS and certain overrides.

You'll need to install both yabridge and yabridgectl through yay to completely (re)install yabridge. You can do the same thing (or run yay -Syu) to update everything in the future.

kristof-linux commented 3 years ago

Thank you so much for helping me that much. Everything is clear now. I'm happy. Great support, really!

robbert-vdh commented 3 years ago

I'll close this since everything works now, but feel free to open a new issue or to come join is in the yabrdige Discord of you run into any more issues!

kristof-linux commented 2 years ago

Hello Robbert, I'm stuck on same same things as we discussed before here. Now, first of all ...goal is to let the spitfire lab work on my manjaro...After downgrade wine version to 6.14 staging and probably also after i noticed the spitfireaudio software is not working anymore after i had to upgrade the app - the starting screen is just freezing, i get always the same error as described here before: error 1...failed to load patch. I followed al the steps you gave me...

What i did "You really need to reinstall the Spitfire plugins in a new prefix (e.g. ~/.wine-spitfire, that's what I use), remove the plugin .dll files from the old prefix (to prevent confusion), add $HOME/.wine-spitfire/drive_c/Program\ Files/VstPlugins/ in yabridgectl, run yabridgectl sync, and then use the plugins from that directory in the new prefix."

Also changed the path in Bitwig....nothing helps...i didn't really reinstall the plugins (because software is not working), i just copied everyhing (the whole drive C of wine) to new location... I tried also the change wineprefix with WINEPREFIX="/home/kristofallaert/.wine-spitfire/" winecfg

But now i get this failure - see screenshot below.

Please can you help, i guess i do a lot wrong?

Schermafdruk van 2021-11-14 16-49-49

robbert-vdh commented 2 years ago

Copying the files obviously won't work. Installing software on Windows does a lot more than just copying over some files. These plugins for instance also need to know where they can find their sound libraries, and if you just copy around some files then they obviously won't be able to know that. If you don't mind redownloading things then the easiest thing to do is to just start over. Rename/remove (be careful that you didn't install anything else important there) ~/.wine-spitfire, let Wine recreate the prefix, and install the Spitfire software again.