osxmidi / LinVst

Linux Windows vst wrapper/bridge
GNU General Public License v3.0
682 stars 41 forks source link

Not working with flathub flatpak wine #218

Closed David-Else closed 2 years ago

David-Else commented 2 years ago

Hi, wine (7 stable) is now on flatpak: https://github.com/flathub/org.winehq.Wine

I have made an alias that works in the terminal:

alias wine="flatpak run org.winehq.Wine"

Right now Reaper does not find any windows plugins when I have followed all the instructions to make LinVST work. Could this be because it can't find wine? How can I find out? Thanks :)

osxmidi commented 2 years ago

Hi, wine (7 stable) is now on flatpak: https://github.com/flathub/org.winehq.Wine

I have made an alias that works in the terminal:

alias wine="flatpak run org.winehq.Wine"

Right now Reaper does not find any windows plugins when I have followed all the instructions to make LinVST work. Could this be because it can't find wine? How can I find out? Thanks :)

I think I'll need to find out more about it.

The only thing I can come up with at the moment is it seems to be something like this to start a Wine program

flatpak run org.winehq.Wine /path/to/.exe

you can add ~/.local/share/flatpak/exports/bin and /var/lib/flatpak/exports/bin in your PATH so you can just type org.winehq.Wine args in the terminal, without flatpak run.

echo 'alias wine="flatpak run org.winehq.Wine"' >> ~/.bashrc

David-Else commented 2 years ago

The first of those two dirs you mentioned doesn't exist, the 2nd does and has all the executables linked, here is what I am seeing:

Screenshot from 2022-06-27 10-05-48

I have my converted Windows VSTs Elephant and ValhallaVintageVerb in the .vst dir:

Screenshot from 2022-06-27 10-13-42

DecentSampler (native Linux) is detected, but not the others. ** I noticed the other .so files were not executable, so made them executable and it made no difference :(

I have all the lin-vst-server* files in /usr/local/bin

I already added alias wine="flatpak run org.winehq.Wine", that does not work.

Does LinVst look for the wine executable in the PATH? If so it should find it? How do I know what the problem is, is there a log file? Thanks!

osxmidi commented 2 years ago

The first of those two dirs you mentioned doesn't exist, the 2nd does and has all the executables linked, here is what I am seeing:

Screenshot from 2022-06-27 10-05-48

I have my converted Windows VSTs Elephant and ValhallaVintageVerb in the .vst dir:

Screenshot from 2022-06-27 10-13-42

DecentSampler (native Linux) is detected, but not the others. ** I noticed the other .so files were not executable, so made them executable and it made no difference :(

I have all the lin-vst-server* files in /usr/local/bin

I already added alias wine="flatpak run org.winehq.Wine", that does not work.

Does LinVst look for the wine executable in the PATH? If so it should find it? How do I know what the problem is, is there a log file? Thanks!

The linvst wine based server looks for wine in /usr/bin by default.

I read somewhere that there seems to be a Flatpack /usr/bin issue.

The linvst server needs to be altered to look for where the Flatpack wine is.

I'll test it out soon.

osxmidi commented 2 years ago

I can get LinVst to start with flatpak Wine using the Release Debian-Bulleye version, I can't get a arch version LinVst running for some reason.

I'll do more testing.

flatpak run org.winehq.Wine /home/user/Downloads/LinVst-4.77-Debian-Bullseye/lin-vst-servertrack.exe [user@user-travelmate5742 ~]$ 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 4.7.7

David-Else commented 2 years ago

I tried your example directly on the downloaded files in my Download directory, and it works, but with an error! Does that give you a clue?

$ flatpak run org.winehq.Wine lin-vst-servertrack.exe
002c:err:winediag:getaddrinfo Failed to resolve your host name IP                     <<<<<<<<<< Error!
[david@gigabot LinVst-4.77-Debian-Bullseye]$ 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 4.7.7
osxmidi commented 2 years ago

I tried your example directly on the downloaded files in my Download directory, and it works, but with an error! Does that give you a clue?

$ flatpak run org.winehq.Wine lin-vst-servertrack.exe
002c:err:winediag:getaddrinfo Failed to resolve your host name IP                     <<<<<<<<<< Error!
[david@gigabot LinVst-4.77-Debian-Bullseye]$ 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 4.7.7

The error is ok I think, it's just an error about your host name.

I've had a look and flatpak's Wine seems to run differently to WineHQ's wine.

I've read that flatpak runs apps in a sandbox which means that communication between a Linux process (like a Linux Daw) and a sandboxed Wine process is likely to have problems.

The flatpak version of Bitwig has the same sandbox problems from what I've read.

So for now, WineHQ's Wine is compatible, but flatpak's Wine doesn't seem to be.

David-Else commented 2 years ago

Flatpack has various permissions that can be set, and there is a GUI called flatseal https://flathub.org/apps/details/com.github.tchx84.Flatseal that makes it easy to set them.

Often you need to add permissions for it to access the file system, here is a screen shot from my system, I have not touched the defaults. Maybe it just needs another directory adding? This has cured problems I have had with other programs:

Screenshot from 2022-06-29 12-48-58

osxmidi commented 2 years ago

Flatpack has various permissions that can be set, and there is a GUI called flatseal https://flathub.org/apps/details/com.github.tchx84.Flatseal that makes it easy to set them.

Often you need to add permissions for it to access the file system, here is a screen shot from my system, I have not touched the defaults. Maybe it just needs another directory adding? This has cured problems I have had with other programs:

Screenshot from 2022-06-29 12-48-58

Interesting.

As far as I can make out, each app has it's sandboxing permissions that the app developer controls.

I don't know if someone could change flatpak's Wine permissions, maybe they could, I'm not sure, I don't know much about flatpak in a user way.

https://docs.flatpak.org/en/latest/sandbox-permissions.html

LinVst would need the flatpak Wine to have these permissions, when I currently use flatpak Wine and LinVst, I get either a shared memory (IPC) error or a thread crash, which are probably due to flatpak's Wine permissions.

--share=network - access the network
--socket=x11 - show windows using X11
--socket=fallback-x11 - show windows using X11, if Wayland is not available, overrides x11 socket permission. Note that you must still use --socket=wayland for wayland permission
--share=ipc - share IPC namespace with the host (necessary for X11)
--socket=wayland - show windows with Wayland
--device=dri - OpenGL rendering
osxmidi commented 2 years ago

If you want to start LinVst (for 64 bit vst's only) using flatpak Wine then replace line 493 (and line 494) in remotevstclient.cpp with

if(execlp("flatpak", "flatpak", "run", "org.winehq.Wine", "/home/user/Downloads/linvst/LinVst-master/lin-vst-servertrack.exe", argStr, (char *) NULL))

change the "/home/user/Downloads/linvst/LinVst-master/lin-vst-servertrack.exe" part to where your compiled lin-vst-servertrack.exe is.

I couldn't get lin-vst-servertrack.exe to run if it was placed in /usr/bin

and then make LinVst and then install it.

Maybe playing around with flatpak permissions might let it run ok.