Commit Graph

35 Commits

Author SHA1 Message Date
Robbert van der Helm 470f4dfaaa Remove the with- prefix from the build options 2022-04-16 21:13:46 +02:00
Robbert van der Helm 1fec4c8860 Change the description in the GPL header 2022-04-16 20:37:10 +02:00
Robbert van der Helm 037d6ad5aa Replace Boost.Process for the Wine plugin host
Now we use our own library for this, so we can drop the Boost.Filesystem
dependency after a couple more changes.
2022-04-16 20:37:10 +02:00
Robbert van der Helm 556b0e38f9 Replace Boost.Asio with standalone Asio library
We had to add an even hackier hack now to get Boost.Process to
interoperate with Asio's IO contexts. This will be replaced later when
we replace Boost.Process.
2022-04-14 23:42:12 +02:00
Robbert van der Helm d2d4cf4ea9 Replace most uses of Boost.{Filesystem,Process}
With the `ghc::filesystem` dependency from the previous commit. If we
can replace the rest of the Boost.Filesystem dependency then we can get
rid the one nasty runtime dependency we have, and it will make
implementing the chainloading simpler since can reuse more code without
bringing in Boost.
2022-04-14 23:42:12 +02:00
Robbert van der Helm 0b9a16cf40 Change the naming scheme for class field members
I'm not a fan of Hungarian notation, but C++ kind of needs it with its
implicit `this`. And of all the common options for this, I find
suffixing members with an underscore the least offensive one.
2022-01-01 21:07:17 +01:00
Robbert van der Helm e0ab24e645 Update copyright headers
Happy new year!
2022-01-01 18:32:10 +01:00
Robbert van der Helm 35244d2c7f Support Wine 6.23's fixed winedbg arg handling
I was about to rebase the patch I've been resubmitting to Wine that
fixed this when I noticed that
https://github.com/wine-mirror/wine/commit/94ca4be2a62cdb05adaee524084875b04b283afb
now does the same thing.
2021-12-07 00:59:07 +01:00
Robbert van der Helm c18332f7d4 Revert back to the detached Konsole window winedbg
This works again, and it's a bit less of a pain than connecting to
gdbserver.
2021-10-02 15:05:59 +02:00
Robbert van der Helm 780d562909 Fix plugin host watchdog treating zombies as alive 2021-06-22 17:15:47 +02:00
Robbert van der Helm 95badeb1bc Add a way to disable pipes for the Wine host
For some reason ujam plugins (and other plugins made with the Gorilla
Engine, like the LoopCloud plugins) will throw a `JS_EXEC_FAILED` error
when trying to load the plugin while either of the STDOUT or STDERR
streams is pointing to a pipe. Simply redirecting the output to a file
fixes this. By default we'll write the output to
`<temporary_directory>/yabridge-plugin-output.log`, but you can also set
the new `disable_pipes` option to `"/dev/null"` to completely throw away
all output.

This addresses #47.
2021-05-18 17:59:43 +02:00
Robbert van der Helm 99428ba28e Unify STDIO redirection in Wine host launching
This may also fix some weird cases where everything appeared to work
fine, but where the file descriptors weren't actually assigned
correctly. Not sure what that happened, but it with carla-single the
Wine host's STDOUT and STDERR would still point to the orignal pty even
though everything still went through the pipes.
2021-05-18 15:35:33 +02:00
Robbert van der Helm 883b6b7700 Manually close descriptors instead of using vfork
With `vfork()` the child process inherits the parents process image and
prevents copying them, but if it outlives its parent then the file
descriptors will still remain open. Manually closing all file
descriptors is the only solution here.

This was only an issue with Ardour since they don't open all of their
files with `FD_CLOEXEC`. Last update's watchdog timer somewhat mitigated
the issue, but Ardour should now no longer freeze when reopening because
of this. The watchdog timer is still necessary, since hanging Wine
processes will still prevent the Wine server from shutting down.
2021-05-16 15:28:53 +02:00
Robbert van der Helm 37257298a1 Add noexcept qualifications on the plugin side
See the last few commits.
2021-05-14 18:22:58 +02:00
Robbert van der Helm b036230067 Work around a regression in Wine 6.5
Killing a Wine process no longer terminates its threads, see the
changelog entry and NOTE for more information.
2021-03-27 17:41:15 +01:00
Robbert van der Helm a1bb522ea0 Move piping stream lines to the log to common 2021-02-12 18:35:07 +01:00
Robbert van der Helm 34f8d3b1d2 Update the copyright notices for 2021 2021-01-01 18:54:02 +01:00
Robbert van der Helm 6b4df4d274 Explicitly include <mutex>
This is an indirect dependency in Boost 1.72/1.73, but not in older
versions.
2020-12-25 21:55:00 +01:00
Robbert van der Helm c1e7f53cd0 💥 Major refactor of initialization plumbing
To account for the differences in VST2 plugins and VST3 modules we had
to wrap most of our old functions from `src/plugin/utils.h` in a new
`PluginInfo` struct that gathers all of this information while taking
into account the differences between VST2 and VST3 plugins.

With this change things are also a lot more organized. We can just query
the plugin information we need rather than having to store things
separately or having to recalculate things. This also moved the
responsibility of all the weird `WINEPREFIX` behaviour to a single place
instead of having it spread around `utils.pp`, the initialisation
message, and `host-procoess.cpp`.
2020-12-07 18:28:16 +01:00
Robbert van der Helm f9a1bcd7bd Split VST2 specific functionality into Vst2Logger 2020-12-07 18:28:16 +01:00
Robbert van der Helm 2230b5099f Move logger to common/logging/common.h 2020-12-07 18:28:16 +01:00
Robbert van der Helm 278cd2e710 Spawn all hosts directly using HostRequest
This way we can set the plugin type inside of the `Vst*PluginBridge`
instance.
2020-12-07 18:28:16 +01:00
Robbert van der Helm 47baef3107 Rename architecture related functions and structs 2020-12-07 18:28:16 +01:00
Robbert van der Helm 7fc7a51a46 Move PluginArchitecture to common
Along with the accompanying function to parse a PE32 file. We're going
to have to define some common tags for different plugin types.
2020-12-07 18:28:16 +01:00
Robbert van der Helm fa719c286d Create base class for sockets and derive from that
Now the host launching procedure can be agnostic of the socket
implementation.
2020-12-07 18:28:16 +01:00
Robbert van der Helm bb85d99657 Rename 'Sockets' to 'Vst2Sockets' 2020-12-07 18:28:16 +01:00
Robbert van der Helm 2fbd14908a Split communication/vst2.h into common and VST2
So we can reuse the generic bits for our VST3 implementation.
2020-12-07 18:28:16 +01:00
Robbert van der Helm 46bc0301af Move communication.h to communication/vst2.h 2020-12-07 18:28:16 +01:00
Robbert van der Helm abb2206970 Fix typos in the word 'Boost'
Apparently I type very quickly.
2020-11-20 01:15:51 +01:00
Robbert van der Helm acdbcaca6a Fix plugin host fallover behaviour
GroupHost::running() would sometimes cause plugins to get terminated
prematurely when connecting to another plugin's group host process since
the plugin's own group host process has exited.
2020-11-07 23:11:49 +01:00
Robbert van der Helm 28886e7073 Replace all threads with Win32Thread in Wine host 2020-10-27 18:29:38 +01:00
Robbert van der Helm 4b53342514 💥 Encapsulate and rework all socket logic
This is a pretty huge change that will be important for being able to
handle nested or mutually recursive `dispatch()` and `audioMaster()`
calls. This sadly all had to be done in a single commit, so here's a
summary:

- `src/common/sockets.h:Sockets` contains all sockets on both the plugin
  and the Wine host side, and is used to both listen on and connect to
  the sockets.
- Sockets and other temporary files respect `$XDG_RUNTIME_DIR` instead
  of being dumped in `/tmp`.
- All sockets now have a unique endpoint in
  `/run/user/<uid>/yabridge-<plugin_name>-<random_id>/`. This is
  important for when we want to have multiple socket connections for
  handling `dispatch()` and `audioMaster()`.
- Because of the above, we no longer clean up the socket endpoint files
  after the connection gets established during initialization. Instead
  we'll remove the socket base directory when shutting down.
2020-10-25 21:24:56 +01:00
Robbert van der Helm ce385f39d3 Use vfork() for spawning processes #45 2020-10-21 22:30:50 +02:00
Robbert van der Helm 61cde0bd43 Use std::jthread 2020-06-20 16:16:12 +02:00
Robbert van der Helm b379708b21 Encapsulate individual/group handling differences
This cleans up the PluginBridge significantly by getting rid of all
fields and handling that was only needed for connecting to plugin
groups. This was also the last thing I wanted to refactor before
releasing the plugin groups feature with yabridge 1.2.
2020-05-29 18:08:44 +02:00