Commit Graph

31 Commits

Author SHA1 Message Date
Robbert van der Helm 466fe3abcf Run $WINELOADER --version under the correct env
This makes the initialization message reflect the correct Wine version
when using a `WINELOADER` script to change between Wine versions
depending on the Wine prefix.
2021-06-21 13:00:05 +02:00
Robbert van der Helm a7496fae77 Add thread names 2021-06-06 23:45:47 +02:00
Robbert van der Helm 68d5d33cba Add a warning for low RLIMIT_RTTIME values
This will make it much easier to spot issues caused by PipeWire.
2021-05-27 14:22:58 +02:00
Robbert van der Helm e4ca520b64 💥 Redo all higher order template functions
This does what we did for a few functions in the last few commits for
every function. We now use either the `std::invocable` concept or our
own `invocable_returning` concept wherever possible to make sure we pass
function types to these template functions, since constraint errors are
a lot more readable than template deduction errors. And instead of
having to specify the return type as a template argument, we now just
use `std::invoke_result_t<F>` instead. The VST3 message handling
functions are still using the good old `typename F` since those are
overloaded polymorphic functions. This was also a good moment to modify
`AdHocSocketHandler::send()` to allow functions returning void (this got
rid of an old fixme where we had to return some dummy value from a
function instead of just not returning anything).
2021-05-20 01:03:58 +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 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 757fb6d372 Pass the PID of the native host to the Wine hosts
We need this for our watchdog.
2021-05-01 17:13:16 +02:00
Robbert van der Helm 7881e0116e Rename host_guard_handler to host_watchdog_handler
To keep the terminology consistent.
2021-05-01 15:46:27 +02:00
Robbert van der Helm 383b0c3f10 Remove the cache_time_info option
The new time info caching behaviour supersedes this by getting rid of
callbacks altogether.
2021-04-29 00:46:43 +02:00
Robbert van der Helm 93f089eca7 Always set FTZ instead of gating it behind a flag
After a quick round of testing it seems like REAPER doesn't always
enable this on the audio thread, but Bitwig, Ardour, Carla and Renoise
do. So it should be safe to just get rid of the option and to leave this
enabled all the time.
2021-04-28 12:07:14 +02:00
Robbert van der Helm 2be41da9b6 Add compatibility option to force flushing to zero
This prevents Kush Audio REDDI from taking down the DAW when the host
passes it denormalized audio to process. I've discovered that the issue
with this plugin had to do with denormals in the issue linked below, but
I didn't realize that we can just enable the FTZ flag for plugins that
don't already do so.

https://github.com/osxmidi/LinVst/issues/174
2021-04-27 23:33:50 +02:00
Robbert van der Helm 3a73fb9689 Allow hiding the DAW name for VST2 plugins
This can be useful when plugins have (broken) host-specific behaviour
that you want to avoid. I'll later add a list of host/plugin
combinations where this may be useful to the readme.
2021-04-27 18:41:36 +02:00
Robbert van der Helm a297866d45 Add way to use 32-bit VST3 when both are installed
Otherwise we would always use the 64-bit version and there would be no
way to use the 32-bit version, if version for some reason works better.

Relates to #80.
2021-04-13 19:28:36 +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 260aba393c Fix alignment in initialization message 2021-02-14 13:50:55 +01:00
Robbert van der Helm f07503b9b6 Print the matched config file section
To make it more obvious where settings are being set from.
2021-02-14 13:50:53 +01:00
Robbert van der Helm 0adca3e33c Revert "Remove cache_time_info and always cache time info"
This reverts commit cfb171c991.

No idea why, but this cache breaks SPL Transient Designer Plus. Perhaps
it overwrites the time info?
2021-01-30 02:37:27 +01:00
Robbert van der Helm cfb171c991 Remove cache_time_info and always cache time info
It sort of goes against yabridge's principles to not do these
unnecessary `audioMasterGetTime()` calls if the plugin does that, but it
also hurts the user experience to not have this as a default.
2021-01-30 00:20:35 +01:00
Robbert van der Helm ffe46e225c Relay Wine STDIO with SCHED_OTHER
I haven't seen this cause issues myself, but it would not surprise me if
a plugin that produces a constant stream of FIXMEs would steal resources
from audio processing if the threads that are relaying those messages
are set to SCHED_FIFO.
2021-01-24 17:02:56 +01:00
Robbert van der Helm 96511ca8a3 Make realtime priority setting more granular
On the plugin side.
2021-01-23 14:43:06 +01:00
Robbert van der Helm dac817323b Add an option to force drag-and-drop under REAPER
This works around a long standing bug in REAPER itself that would
prevent you from dragging files onto any plugin editor window.
2021-01-19 15:11:27 +01:00
Robbert van der Helm 5dcedbace5 Add an option to disable VST3 content scaling
This might be necessary when using a HiDPI screen as plugin GUIs often
don't scale correctly under Wine.
2021-01-14 17:36:00 +01:00
Robbert van der Helm bf3a4e7296 Allow changing the event loop tick rate
This also changes the refresh rate for most plugins. You can now lower
this setting if your computer is struggling to keep up with rendering a
certain heavy plugin.
2021-01-11 23:38:21 +01:00
Robbert van der Helm e3ea1dd2fe Allow an option set_realtime_priority() to revert 2021-01-11 14:04:54 +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 49eeee99fa Add an XEmbed compatibility option 2020-12-25 19:49:47 +01:00
Robbert van der Helm 9439a62d94 Fix formatting 2020-12-11 16:56:46 +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 b9e63ea335 Move the host guard handler to PluginBridge 2020-12-07 18:28:16 +01:00
Robbert van der Helm c2d2ac8fbf Inherit Vst3PluginBridge init from PluginBridge 2020-12-07 18:28:16 +01:00
Robbert van der Helm 6b9ae78b27 Factor out all plumbing in Vst2PluginBridge
So we can reuse it in Vst3PluginBridge later.
2020-12-07 18:28:16 +01:00