Commit Graph

602 Commits

Author SHA1 Message Date
Robbert van der Helm c5afb7f215 Append a link to the plugin to the notifications 2021-06-28 13:05:32 +02:00
Robbert van der Helm 388d9739a9 Move XML escaping to a separate function 2021-06-28 12:53:51 +02:00
Robbert van der Helm e0713c5fe7 Define the deprecated VST<2.4 main entry point
This should allow @AVLinux to use yabridge under EnergyXT.
2021-06-26 15:02:49 +02:00
Robbert van der Helm 20638b7349 Fix missing autoformatting
At some point Doom Emacs broke on-save formatting with lsp-mode in
certain circumstances, and I made these changes with wgrep so apparently
they were never formatted.
2021-06-26 12:27:01 +02:00
Robbert van der Helm e5187db9ef Mark 32-bit yabridge libraries
So we're able to immediately spot that someone is using them from the
logs.
2021-06-24 13:48:23 +02:00
Robbert van der Helm 3b06634e33 Escape HTML in desktop notification messages 2021-06-23 17:23:45 +02:00
Robbert van der Helm 553b4474a7 Respect $XDG_DATA_HOME when looking for binaries
Since we're using the XDG base dir package in yabridgectl we were
already doing this there, so it makes sense to also do this in yabridge
itself even though it's very unlikely the user will have this set.
2021-06-23 01:53:18 +02:00
Robbert van der Helm 15e271f70a Fix unity builds after reintroduction of vfork
Boost.Process was being included before this flag was set. Seems safer
to set it in the build anyways.
2021-06-22 19:00:21 +02:00
Robbert van der Helm a3d34f8197 Use vfork() for quick running commands
We can't use it for the Wine plugin host process, but it's perfectly
suitable for these things.
2021-06-22 18:38:49 +02:00
Robbert van der Helm 418cd7b381 Switch to normal urgency desktop notifications
These critical notifications don't expire under KDE Plasma, which would
mean that you'd get absolutely flooded with notifications you have to
manually close when something is wrong.
2021-06-22 18:10:44 +02:00
Robbert van der Helm 5ffe4773e9 Show startup errors in a desktop notification
This should make it much easier to spot what goes wrong if you're new to
yabridge and don't know where to look yet.
2021-06-22 17:41:08 +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 0156b61e64 Show notification when plugin host fails to start
This one's a bit generic since the relevant output from the Wine process
will have already been printed to the logger before this point.
2021-06-22 17:13:30 +02:00
Robbert van der Helm 437a4dc5ec Add a function for sending desktop notifications 2021-06-22 17:12:31 +02:00
Robbert van der Helm 98c4cc170e Actually use the correct environment 2021-06-21 13:06:26 +02:00
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 736b223af8 Set the audioMasterGetTime flags
Apparently this is a thing, and Ardour is the only DAW that respects
them.
2021-06-12 20:36:22 +02:00
Robbert van der Helm 8a754b08cf Only initialize VST2 audio buffers on activation
Ardour apparently always calls `effMainsChanged()` with a value argument
of 0 when unloading the plugin, regardless of whether it has actually
initialized audio processing before that point.
2021-06-12 20:15:20 +02:00
Robbert van der Helm 71cb421032 Reformat the REAPER host functions warning
So it's a bit nicer to look at.
2021-06-12 17:31:15 +02:00
Robbert van der Helm 9c439b62e3 Ignore REAPER host function API requests
Apparently there is a plugin that uses these.
2021-06-12 17:22:47 +02:00
Robbert van der Helm 75dee9991c Don't ignore read/write results
For some reason this only issues warnings on the CI.
2021-06-12 00:02:22 +02:00
Robbert van der Helm aaf3e7438c Use unordered maps for VST3 plugin instances
The better algorithmic time complexity should help when using many (say,
hundreds) of instances of a single VST3 plugin.
2021-06-11 14:48:28 +02:00
Robbert van der Helm dec19dc12a 💥 Reimplement VST3 audio processing
In the same way as 50c25c1cf0 did it for
VST2 plugins. Input and output audio data is now stored in a shared
memory buffer instead of being sent over the sockets. This reduces the
bridging overhead to a minimum since copying data was the most expensive
operation we were doing and we now only need to copy the entire buffer
once per processing cycle.
2021-06-11 13:59:37 +02:00
Robbert van der Helm 14e3ed2cd3 Add shared audio buffers config to IAudioProcessor::setupProcessing() 2021-06-10 21:37:42 +02:00
Robbert van der Helm 50c25c1cf0 💥 Reimplement VST2 audio processing
We now use shared memory to store the input and output audio buffers.
This means that we have to copy less data every processing cycle, since
a single copy to and a single copy from the shared memory object
suffices now. This should reduce the DSP load for VST2
plugins (especially when used in a plugin group) marginally to
significantly depending on the plugins used and the system
configuration.
2021-06-10 17:31:32 +02:00
Robbert van der Helm 80fa010af5 Prevent unnecessary copies in VST2 event handling 2021-06-10 17:31:32 +02:00
Robbert van der Helm 53d59f74d1 Reduce the VST2 events small vector capacities
Every DAW will just send all events in one go (and I think that's the
only way you should do it, but the VST2 spec is a bit leaky so who
knows). It wouldn't make much sense to preallocate more capacity,
because when DAWs do send all of those events individually they might
end up sending more than four of these anyways.
2021-06-10 12:43:54 +02:00
Robbert van der Helm e36a7e7e72 Add the effSetProcessPrecision opcode 2021-06-09 18:41:34 +02:00
Robbert van der Helm d1badcb589 Prevent exceptions in IndividualHost::running
Apparently this might otherwise throw in some situations.
2021-06-09 13:09:57 +02:00
Robbert van der Helm 65c05aac88 Indicate cached IPlugView::canResize() calls
We apparently forgot to pass the flag here after implementing it in the
log function.
2021-06-09 12:07:29 +02:00
Robbert van der Helm a7496fae77 Add thread names 2021-06-06 23:45:47 +02:00
Robbert van der Helm 2bf1c4c5eb Use C++20 [[unlikely]] instead of BOOST_UNLIKELY 2021-05-31 17:50:02 +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 206b528075 Rename the VST2 audio processing scratch buffer
Since we also have input and output audio buffers, plain 'buffer' is a
bit too overloaded here.
2021-05-23 16:26:54 +02:00
Robbert van der Helm 8429919dfe Reuse VST2 audio processing buffers on plugin side 2021-05-23 15:25:36 +02:00
Robbert van der Helm 4e81c1c2b3 Reuse request on Wine side during VST2 processing
The object was constantly being recreated, resulting in memory
allocations caused by creating and destroying the audio buffer vectors.
2021-05-23 15:02:53 +02:00
Robbert van der Helm 6f321649c4 Do small vector optimization for all communication
I once read years ago somewhere on Stack Overflow that `std::vectors`
with that are preinitialized to a default size would allocate the
initial capacity on the stack. This of course doesn't make any
sense (run time sized stack allocations can cause all kinds of issues),
so we were still allocating with our default 64-byte sized buffers, but
just not as often.
2021-05-23 14:43:02 +02:00
Robbert van der Helm 235fb9a6e2 Remove accidental duplication
This didn't do anything bad. It also didn't do anything good.
2021-05-23 13:44:30 +02:00
Robbert van der Helm df93944f3b Prevent allocations caused by Logger::log_trace
C++ would always construct an `std::string` from the string constant
every iteration. Since this also happened when `YABRIDGE_DEBUG_LEVEL` is
not set to 2, this ended up causing unnecessary allocations.
2021-05-23 00:21:21 +02:00
Robbert van der Helm e700678a11 Also preallocate small buffers for VST2 events 2021-05-23 00:10:03 +02:00
Robbert van der Helm bd0dd63ad2 Rename the EventResult struct to Vst2EventResult 2021-05-20 15:53:16 +02:00
Robbert van der Helm 2bf41c6fe1 Move EventPayload to Vst2Event::Payload 2021-05-20 15:52:40 +02:00
Robbert van der Helm b1c9d75112 Rename the Event struct to Vst2Event 2021-05-20 15:50:09 +02:00
Robbert van der Helm ccfda51a69 Clarify the DefaultDataConverter method names 2021-05-20 14:49:11 +02:00
Robbert van der Helm c2186fa55b Use the std::derived_from concept when applicable
This probably makes things much clearer at a glance instead of using a
blanked typename.
2021-05-20 14:31:59 +02:00
Robbert van der Helm 626c31beb3 Update documentation on mutual recursion functions 2021-05-20 14:00:03 +02:00
Robbert van der Helm a194765696 Rename EventHandler to Vst2EventHandler 2021-05-20 13:54:31 +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 398ae789e0 Use MutualRecursionHelper in the VST3 plugin
We should tidy all of these functions up a bit and then implement this
for the VST2 bridging on the Wine side.
2021-05-19 19:57:21 +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