Robbert van der Helm
cde7b4ec67
Properly move the sockets to the handler threads
...
At times like this you really wish you were writing Rust right now.
2020-10-26 15:48:57 +01:00
Robbert van der Helm
8d7826f1df
Handle incoming events from off-threads separately
...
On the Wine side we want to handle most events on the main UI thread.
We'll assume any events coming in from a secondary socket are safe and
can be handled directly.
2020-10-26 13:45:37 +01:00
Robbert van der Helm
81efa6febe
Listen for incoming secondary event requests
2020-10-26 12:58:03 +01:00
Robbert van der Helm
2f6883977f
Create secondary sockets for sending nested events
2020-10-26 12:13:27 +01:00
Robbert van der Helm
d82f8463d9
Use simple numerical IDs for plugins in groups
...
We'll be using a similar approach to identify threads for event
handlers.
2020-10-26 11:51:13 +01:00
Robbert van der Helm
74c3cab046
Move event handling logic to a dedicated class
...
Now all pieces are in place to allow handling events over multiple
socket connections.
2020-10-26 11:40:38 +01:00
Robbert van der Helm
54ed69c408
Merge events.h into communication.h
2020-10-25 21:37:04 +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
a1162c2256
Print invalid and unknown options on startup
2020-10-13 15:04:33 +02:00
Robbert van der Helm
7fbbb48c54
Fix parsing order of yabridge.toml #37
...
Since tomlplusplus uses `std::map` instead of `std::unordered_map`
internally the tables were actually being read in lexicographical order.
2020-09-27 19:42:07 +02:00
Robbert van der Helm
f1b1f20fdb
Update tomlplusplus
2020-09-27 17:48:43 +02:00
Robbert van der Helm
504102ef79
Increase the maximum number of audio channels #35
...
Not sure why it's doing this, but Renoise seems to report 112 speakers
per audio channel, so the 256 audio channel limit would be exceeded when
using more than 2 output channels.
2020-08-31 23:42:24 +02:00
Robbert van der Helm
8198a73742
Add support for double precision audio #34
...
So far I've only seen REAPER running iZotope Rx plugins utilize this.
2020-08-24 16:13:29 +02:00
Robbert van der Helm
b452f961db
Add option to work around bugs in REAPER/Renoise
...
This is not ideal since it requires the user to know about this option
and to create a config file, but I think it's the best we can do without
compromising on yabridge's transparency and 'zero hacks' philosophy.
See #29 and #32 .
2020-08-17 15:49:16 +02:00
Robbert van der Helm
c64fdb21d7
Don't print calls to effIdle with debug level 1
...
REAPER seems to be the only DAW that uses this.
2020-08-11 15:26:11 +02:00
Robbert van der Helm
e3282df7cd
Lower the realtime priority to 5
...
JACK runs with priority 10 by default, so that should probably be
getting priority here.
2020-07-24 23:27:37 +02:00
Robbert van der Helm
6f5dae90a6
Set realtime priorities if available
...
This significantly reduces the latency with no real drawbacks from what
I've noticed. Wineserver is still run using the normal scheduling
policies because from my testing running that with realtime priority
that can actually increase latencies, although doing so will greatly
reduce the variance in processing time.
2020-07-23 19:57:50 +02:00
Robbert van der Helm
967856fc1b
Add a configuration option for double embedding
...
Only plugin that needs this so far is PSPaudioware's E27 (and likely
other PSP plugins with expandable GUIs).
2020-07-23 15:59:00 +02:00
Robbert van der Helm
523f77d334
Use designated initializers for complex structs
...
This was one of the main reasons why I wanted to switch to C++20, I just
forgot to do it.
2020-07-23 14:12:07 +02:00
Robbert van der Helm
44044324f3
Add serialization support for plugin configuration
2020-07-22 17:05:24 +02:00
Robbert van der Helm
479852a4d0
Add a bitsery extension for serializing paths
2020-07-22 17:05:05 +02:00
Robbert van der Helm
2e77c03464
Move the configuration object to src/common/
2020-07-22 13:55:29 +02:00
Robbert van der Helm
8202a6b250
Add missing const qualifiers to member functions
2020-06-06 13:44:26 +02:00
Robbert van der Helm
33777d2876
Use same style for optional and avoid double check
...
I did not know that `std::optional::value()` did checked access. And I
still prefer a more explicit .has_value() over boolean conversion, but
this seems to be the accepted way to do this.
2020-06-05 22:35:56 +02:00
Robbert van der Helm
ff298f3f46
Remove redundant conditions
...
As mentioned in C++ Core Guidelines ES.87.
2020-06-05 22:18:40 +02:00
Robbert van der Helm
1c44a2f2cb
Also filter audioMasterGetCurrentProcessLevel
...
Some plugins call this every time they process audio.
2020-05-25 14:38:30 +02:00
Robbert van der Helm
5b4b62d7c4
Use pid_t instead of ints for PIDs
2020-05-22 19:06:43 +02:00
Robbert van der Helm
9b50bac179
Reply with the group process's PID after a request
2020-05-22 19:06:43 +02:00
Robbert van der Helm
dd843519ce
Rename PluginParameters to GroupReuqest
2020-05-22 19:06:43 +02:00
Robbert van der Helm
8eb01cb519
Listen on the group socket and handle requests
2020-05-20 18:45:33 +02:00
Robbert van der Helm
c2fceb6e4a
Add a thread safety warning to write_object()
2020-05-19 11:33:34 +02:00
Robbert van der Helm
0ad849a42f
Fall back to /dev/stderr instead of std::cerr
...
This allows us to remap STDIO internally in the group process.
2020-05-18 16:15:07 +02:00
Robbert van der Helm
994f3c9e38
Add a plugin group host application
2020-05-18 16:15:07 +02:00
Robbert van der Helm
d9ff98de84
Move everything configuration related to plugin
...
If it's tied to the .so file rather than the .dll file it wouldn't make
any sense to use it directly from the Wine host.
2020-05-15 16:35:18 +02:00
Robbert van der Helm
9a82e82c87
Factor out directory finding from prefix detection
...
This will also be used to locate the `yabridge.tmol` configuration file.
2020-05-15 16:35:18 +02:00
Robbert van der Helm
4351b03e18
Mention that WantsVstRect can return nothing
2020-05-12 13:14:10 +02:00
Robbert van der Helm
901d985080
Fix potential issue with plugins reporting size
...
I thought this was a problem for a plugin when it was not, but I can
still see this being a source of segfaults.
2020-05-11 22:54:42 +02:00
Robbert van der Helm
686ca11ba8
Work around improperly late initializing plugins
...
This fixes the Roland Cloud plugins.
2020-05-10 13:42:20 +02:00
Robbert van der Helm
ba91971829
Simplify object reading
...
No longer needs to read into an existing object after the last change,
and reusing that function here too makes it less error prone.
2020-05-10 13:10:58 +02:00
Robbert van der Helm
e762a57c0d
Move AEffect updating to a function
2020-05-10 13:03:41 +02:00
Robbert van der Helm
ded12379f9
Fix typo
2020-05-10 00:48:45 +02:00
Robbert van der Helm
99ecb2803e
Add logging for the input speaker configuration
2020-05-07 18:23:54 +02:00
Robbert van der Helm
868b0fd357
Finally implement eff{Set,Get}SpeakerConfiguration
...
As mentioned in #1 . This also indirectly allows yabridge to work under
Renoise.
2020-05-07 18:23:41 +02:00
Robbert van der Helm
92f0d95357
Rename EventResponsePayload to be clearer
2020-05-07 17:23:22 +02:00
Robbert van der Helm
a3aad51e41
Also add a second payload value to event responses
...
This will only be used for `effGetSpeakerArrangement`.
2020-05-07 17:23:22 +02:00
Robbert van der Helm
044b7fa9a2
Add a second payload value to events
...
This is for data passed through the `value` `intptr_t` parameter. The
only two events that use this are `effSetSpeakerArrangement` and
`effGetSpeakerArrangement`. Since this is such a rare occurrence we'll
leave the regular `value` field as it is.
2020-05-07 17:19:34 +02:00
Robbert van der Helm
3202239a93
Add speaker arrangement to event payload types
2020-05-07 16:47:30 +02:00
Robbert van der Helm
384805ac41
Add serialization for speaker arrangements
2020-05-07 16:47:30 +02:00
Robbert van der Helm
ee5a4e6b50
Move the serialization function for VST events
2020-05-07 16:47:30 +02:00
Robbert van der Helm
a82c3ac08c
Add a dynamic wrapper for VstSpeakerArrangement
...
Similar to `DynamicVstEvents`, so we can serialize the object to binary
data transfer it over our sockets.
2020-05-07 16:45:04 +02:00