Hi, I created a plugin that can share signal among daw tracks (a sender-receiver connector that the only thing doing is a buffer copy) and here the problem.
In cubase I loaded it as an instrument in an Instrument track as sender that send a sine, in another Audio track I insert it in a FX insert slot as a receiver:
if the two tracks are boh not armed and not live monitoring sine is sent perfectly from instrument track to audio track, but if instrument track is armed and audio track is not armed and not live monitoring, or instrument track is not armed and Audio track is live monitoring, sine seems to go out if sync (below two images of what happens to sine). If instrument track is armed and audio track is live monitoring fine is sent and received perfectly as in case they are both not armed and in sync but sometimes some glitches come out.
THIS HAPPENS FOR BUFFER SIZE BELOW 384, ABOVE 384 ALL IS IN SINC PERFECTLY
How to fix it?
you have no way of knowing which plugin will be processed first so you need to have some latency
The DAW does not know anything about your signal connection, so it assumes it can run both plugin instances in parallel, on different threads, and with different buffer sizes. It may even suspend a plugin instance if it assumes that a plugins output signal is not routed anywhere.
At the same time, the plugin can’t make any assumptions about the inner workings of the DAWs signal routing. For example, in Reaper you can run plugins at different sample rates to apply oversampling to plugins that don’t support it internally. And what happens if there is latency anywhere on the routing path? What about cyclic routing?
Since the common plugin standards don’t support what you want to do, the “correct” solution is to not do this at all, and instead use the DAWs routing facilities: Create a send from a particular plugin output bus to an input bus of another plugin instance, and let the DAW build its signal graph accordingly.