Support for multiple I/O configurations

132 views
Skip to first unread message

Magnus Lidström

unread,
Jul 9, 2011, 5:09:23 PM7/9/11
to Symbiosis AU VST
This is the most pressing issue for Symbiosis. A lot of people think
Symbiosis is buggy when for example a stereo effect is not available
on a mono track in Logic. The reason for this is that Logic itself
will never do mono <-> stereo conversions (unlike some other hosts
like Ableton Live). Instead the plug-in is informed of the situation
and is requested to handle it's own conversion.

Afaik in the VST SDK there are no requests like that. A VST plug-in is
always expected to receive input on all its input buffers and generate
output on all its output buffers. So the Symbiosis design today
explicitly denies any I/O configuration but the one implemented by the
VST plug-in.

To make things more complicated, Logic 8 and onwards groups input and
output into busses (a part of the AU standard that was ignored from
the beginning). Channels within busses are for mono, stereo or
surround formats. Extra outputs, side-chains etc are implemented as
multiple busses.

In VST there is no such clear distinction, but there are some
different calls for querying input and output "pin" properties and
"speaker configuration". In Symbiosis I check the "kVstPinIsStereo"
flag to group I/O into busses (with either mono or stereo formats).

For the next version of Symbiosis I am leaning towards sticking with
mono and stereo support only. No surround, as I have very little
experience of this personally, and I bet it would take some work to
make that fault free with all existing hosts.

My current idea is to add a couple of flags to the Symbiosis
configuration part of the .plist file. The flags will let Symbiosis
know that the VST is prepared to handle either mono or stereo format
on its inputs and / or outputs.

The VST process will receive identical pointers on stereo pairs that
are used as mono. In many cases this means your existing stereo effect
will work as a mono effect, but if you don't pay attention to the
output pointers (in particular) the user may end up with only the left
or right channel output (depending on the order you write to the left
and right pointers).

So, if I go with this design, do make checks in your VST code for left
pointer == right pointer and adapt the plug-in behavior to make sense
when used in a mono configuration.

What do you guys think? Is this a sufficient solution?

Federico Berti

unread,
Jul 11, 2011, 4:00:53 AM7/11/11
to symbiosi...@googlegroups.com
Sounds great to me!
Thanks a lot for working on this feature, I think it is really important.

So, if I got this right, when the plugin is loaded on a Mono track, the input and output pointers I'm going to get into my processReplacing() and processDoubleReplacing() are going to be the same? So inputs[0] points to the same area of inputs[1] and output[0] points to the same area of output[1]?
Looks like a nice solution to me, it's easy to make a check and change the plugin processing accordingly.

How much will it take to have beta version to try, if I may ask? I have 2 plugins coming out very soon, but if it's not going to take too much I'll be glad to wait and help you to test if it works :-)

Regards

2011/7/9 Magnus Lidström <malst...@gmail.com>

Magnus Lidström

unread,
Jul 11, 2011, 6:18:43 PM7/11/11
to Symbiosis AU VST
I have this working since last night on my computer, but with a couple
of quick & dirty hacks. I was fooling around with using get and
setSpeakerArrangement for this feature. Seemed like the VST way of
doing it. It turned out scary because of the same problem as always
with VST: lack of specification and documentation. For example, there
is no way of telling how to use the speaker-arrangement features with
more than a single logical input or output. If I assume too much, my
interpretation might differ from other hosts, and we end up with
compatibility headaches we didn't bargain for.

So I'll probably just add a single flag to the .plist file that tells
Symbiosis your stereo plug-in is ready for mono I/O.

There used to be a "canMono" flag in VST < 2.4 that existed for this
exact purpose. But it's not there in >= 2.4 so I am not going to use
it.

A beta of this will be ready any day now.

Tom Erbe

unread,
Jul 10, 2011, 4:29:02 PM7/10/11
to symbiosi...@googlegroups.com
this will already work for me... i do two things in my vsts to check channel configuration

bool spect::setSpeakerArrangement (VstSpeakerArrangement* pluginInput, VstSpeakerArrangement* pluginOutput)
{
setSpeaker = true;
if (pluginInput->numChannels == 1 && pluginOutput->numChannels == 1)
channelMode = kMonoMode;

if (pluginInput->numChannels == 2 && pluginOutput->numChannels == 2)
channelMode = kStereoMode;

return true;
}

// and if that isn't called (setSpeaker == false), i do this in my process call

if(setSpeaker == false)
{
if (inputs[1] == inputs[0] || inputs[1] == NULL)
channelMode = kMonoMode;
else
channelMode = kStereoMode;

Magnus Lidström

unread,
Jul 11, 2011, 8:02:16 PM7/11/11
to Symbiosis AU VST
@Tom, do you have any experience of writing a plug-in that has:

1) more than a single stereo in or out (i.e. multiple busses)

or

2) more than 2 channels (i.e. surround sound)

I'm very curious how setSpeakerArrangement is supposed to work under
these circumstances. E.g., should numChannels be 2 if you have three
stereo outputs in total, or should it be 6?

Magnus Lidström

unread,
Jul 11, 2011, 8:08:37 PM7/11/11
to Symbiosis AU VST
Revision 20 in SVN now contains a preliminary solution. Here is the
commit message:

"Working on Issue 9, supporting variable I/O. New: CanDoMonoIO flag in
SYConfig. Tells Symbiosis that a stereo input and / or output can be
used with a mono signal. Mono I/O can be detected by comparing the
channel pointers. If they are the same for left and right, this means
mono signal."

Thinking of adding support for inputConnected() and outputConnected()
so that the plug-in can detect if it is used on mono or stereo tracks.
The GUI (and possibly DSP code) can then react in advance to a I/O
configuration change. Without this support you would have to "wait"
until next time process is called to check for left-pointer == right-
pointer.

Tom Erbe

unread,
Jul 12, 2011, 2:08:59 PM7/12/11
to symbiosi...@googlegroups.com
I haven't used those cases (just mono, stereo, and mono2stereo in my plugins), but I know that there is an example of a surround delay in the VSTSDK that shows this.

The only reason I use setSpeakerArrangement is that Cubase on Windows calls it - it really doesn't need to be supported inside of Symbiosis I don't think...

Federico Berti

unread,
Jul 13, 2011, 4:25:29 PM7/13/11
to symbiosi...@googlegroups.com
Just compiled 1.29b rev 20 and it works great so far!
Thank you very much for the quick update!

Just a question though, on Logic, in a mono track, I see also the "Mono->Stereo" option but I'm wondering if it really makes sense... since we're loading the plugin on a mono track, the track output will always be mono, so, even if you have some mono-to-stereo DSP algorithm in the plugin, you'll never get a stereo output from the track.
Am I missing something here?

Regards

2011/7/12 Tom Erbe <soun...@gmail.com>

Magnus Lidström

unread,
Jul 13, 2011, 5:28:44 PM7/13/11
to Symbiosis AU VST
Glad to hear it works for you.

When I choose the Mono->Stereo option (on an insert effect) the signal
path changes to stereo so that I can insert stereo effects after that.
Doesn't it work that way for you?

On Jul 13, 10:25 pm, Federico Berti <wildha...@gmail.com> wrote:
> Just compiled 1.29b rev 20 and it works great so far!
> Thank you very much for the quick update!
>
> Just a question though, on Logic, in a mono track, I see also the
> "Mono->Stereo" option but I'm wondering if it really makes sense... since
> we're loading the plugin on a mono track, the track output will always be
> mono, so, even if you have some mono-to-stereo DSP algorithm in the plugin,
> you'll never get a stereo output from the track.
> Am I missing something here?
>
> Regards
>
> 2011/7/12 Tom Erbe <soundh...@gmail.com>

Federico Berti

unread,
Jul 13, 2011, 6:11:16 PM7/13/11
to symbiosi...@googlegroups.com
Oh, yeah, I've just noticed it. I've only tried that option briefly and didn't notice the path becoming stereo until now.
Logic has some really peculiar features compared to the other DAWs I've tried, I wasn't really imagining such feature/behaviour.

Ok, makes sense now, thanks for the explanation :-)

2011/7/13 Magnus Lidström <malst...@gmail.com>

Tom Erbe

unread,
Jul 28, 2011, 11:37:57 PM7/28/11
to symbiosi...@googlegroups.com
It seems that when selecting mono->stereo in Logic, my plugin still thinks it is
mono (i only have mono to mono and stereo to stereo in these plugins), and i get
repeating unfilled buffers in the right channel.

auval reports 1x1, 2x2 and 1x2... is there any way i can disable 1x2?

- - - - -
tom erbe ~ t...@ucsd.edu ~ studio director - computer music ~ ucsd department of music

Magnus Lidström

unread,
Jul 29, 2011, 5:41:33 PM7/29/11
to Symbiosis AU VST
Ah. I'm looking at your code example from earlier, and yes, if you
only have two modes (mono->mono and stereo->stereo) and you determine
mode on left input pointer == right input pointer, the plug-in will
(naturally) run in mono mode if you use the mono->stereo mode in
Logic.

But why is this a problem really? Is your plug-in assuming that output
left and right pointers are identical just because the input pointers
are? That wouldn't be a very wise assumption. If you have two
different output buffers you should store values in both of them, even
if the output is mono and left and right values are the same.

You can disable mono->stereo with a simple hack (see line 2945), but
although it seems like the right thing to do (if you don't actually
create stereo from mono signals), I'm not sure if it would actually
benefit Logic users. Sure, it may look clearer not having a faux mono-
>stereo option, but it would also remove the facility to transform the
channel strip from mono to stereo.

Tom Erbe

unread,
Jul 29, 2011, 6:03:39 PM7/29/11
to symbiosi...@googlegroups.com
Thanks Magnus,

The advantage to use mono for me is that most of my 17 plugs are pretty CPU hungry. My other consideration (since I have 17 plugins that all run under Mac/Win, VST/AU/RTAS) is to not change my current scheme too much. That much testing for a single developer is daunting.

But I took your advice and modified my channel detection, and this seems to work fine under DP7,Live,Logic,Reaper,PT,Peak (enough testing for this afternoon!)

if(setSpeaker == false)
{
if (outputs[1] == outputs[0] || outputs[1] == NULL)


channelMode = kMonoMode;
else
{
channelMode = kStereoMode;

if(inputs[1] == inputs[0] || inputs[1] == NULL)
in2 = in1;
}
}

This will automatically deal with mono to stereo using stereo processing.


Best, Tom

Paul Davis

unread,
Jun 18, 2013, 8:17:39 AM6/18/13
to symbiosi...@googlegroups.com


On Saturday, July 9, 2011 5:09:23 PM UTC-4, malström wrote:
This is the most pressing issue for Symbiosis. A lot of people think
Symbiosis is buggy when for example a stereo effect is not available
on a mono track in Logic. The reason for this is that Logic itself
will never do mono <-> stereo conversions (unlike some other hosts
like Ableton Live). Instead the plug-in is informed of the situation
and is requested to handle it's own conversion.

Afaik in the VST SDK there are no requests like that. A VST plug-in is
always expected to receive input on all its input buffers and generate
output on all its output buffers. So the Symbiosis design today
explicitly denies any I/O configuration but the one implemented by the
VST plug-in.

To make things more complicated, Logic 8 and onwards groups input and
output into busses (a part of the AU standard that was ignored from
the beginning). Channels within busses are for mono, stereo or
surround formats. Extra outputs, side-chains etc are implemented as
multiple busses.

Actually, I think the problem originates in a slight misunderstanding of AU, perhaps when you started writing Symbiosis:

/*
Instruments may have a variable number of channels on it's output buses if we return an "unsupported" error
on kAudioUnitProperty_SupportedNumChannels. Effects need to support this though (or they will be required to
take any number of inputs -> any number of outputs), which also means effects need the same number of
channels on all output buses. This is simply a limitation in the AU design. Not much we can do about it.
According to Apple, this choice of design was made for historical reasons.

Furthermore, Logic 7 (or older) doesn't support a mixture of mono and stereo on instruments either.
*/

This isn't true. It is entirely possible for a plugin to support a variable number of channels even though it supports kAudioUnitProperty_SupportedNumChannels, and there is no requirement for the plugin to accept any number of inputs or outoutputs. The Apple docs are not 100% clear on this, but you can see my interpretation of their rules here:

https://github.com/Ardour/ardour/blob/master/libs/ardour/audio_unit.cc#L1051

I suppose I should say hello. I got pointed at Symbiosis by the developers of Addictive Drums.

I'm the lead author of Ardour, a cross-platform open-sourfce DAW that is also the basis of Harrison Mixbus and another under-development DAW from another very well know audio technology company.

I've been investigating issues reported by our users who are attempting to use AD with the most recent version of Ardour.

I could not understand why you chose to use a multi-element architecture for Symbiois, rather than just using N channels of output. The hosting requirements for this plugin design are significantly more complex than a simple multichannel plugin, and it is even more suprising to me since VST really does not support this model (or at least it didn't the last time I looked at VST, which was some time ago). Other multichannel plugins that I've tested (Pianoteq being one example) simple declare a suitable number of outputs and then deliver data to each one of them. Is there some specific user-oriented benefit that you see to using AU's capability for multiple elements? I ask because if I can see the benefit I will implement support for it, but at present it appears that only Symbiosis-based plugins use this design and I see little or no benefit for users in the approach you've taken.

This thread is a bit old, but I was wondering what the status of this change over is? The demo version of AD that I downloaded is still using a multi-element (bus) model.

Thanks for any thoughts.
 

Admiral Quality

unread,
Jun 18, 2013, 1:39:38 PM6/18/13
to symbiosi...@googlegroups.com
This is of particular interest to me as well.

And VST 2.4 *can* negotiate number of channels with the host, though not all hosts support this. For example our SCAMP plug-in (which is still VST 2.3) supports up to 6 channels of input and output, but detects when it's been inserted on a stereo track and disables the remaining 4 channels. (Or whatever.)

I can provide some more details/examples a little later when I'm by my development machine, if you'd like.

And yes, I've been a bit confused about how Symbiosis wraps this aspect of plug-ins. There's a new flag in the latest/greatest Symbiosis that tells Symbiosis to allow mono connections for stereo plug-ins. So that issue is fixed. However, my plug-in is still running as stereo internally. I'd like to optimize this so that both for VST and AU (and for hosts that support it) it negotiates a minimum number of channels and processes only those.

Let me know if you have any questions on the VST side or need some sample code.

- Mike/AQ

--
You received this message because you are subscribed to the Google Groups "Symbiosis AU VST" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symbiosis-au-v...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Magnus Lidström

unread,
Jun 18, 2013, 1:54:31 PM6/18/13
to symbiosi...@googlegroups.com
A bit short on time right now, but let me just say that everything in Symbiosis is designed with Logic compatibility as priority. This does not always mean that you simply follow the "proper" AU spec. Logic is a mess. For version 8 they made a change that broke basically all multiple output plug-ins in that they required separate outputs to be implemented with separate busses as opposed to a single multi-channel bus as in Logic <= 7. In Logic 8, channels within a bus just exist to allow stereo, surround etc. Not for individual outputs for mixing. There is a hefty amount of glue code in Symbiosis to make this work with the VST architecture. I should try and find the correspondence between me, Apple and Emagic about all the weird design details concerning the AU spec vs Logic's implementation. It's pretty hysterical.

/ Magnus

Magnus Lidström

unread,
Jun 18, 2013, 2:08:07 PM6/18/13
to symbiosi...@googlegroups.com
As far as I recall (but I need to check on this when I have more time), we can't detect which buses Logic requires output on. (Unlike in Logic 7 where, as I said, all outputs where crammed into a single bus.). What we can and do detect is if the host sets the format of a bus to mono or stereo (with the new flag you mention). If it sets either input or output format to mono, Symbiosis will give you the same sample pointers for left and right channel (on input and / or output), so this is an easy way to detect mono processing if you want to save some cpu.

/ Magnus

Admiral Quality

unread,
Jun 18, 2013, 2:56:38 PM6/18/13
to symbiosi...@googlegroups.com
Thanks Magnus.

Could Symbiosis, when presented with a mono connection to the AU host, negotiate a single channel connection to the VST? (If the VST responds appropriately -- again it's been a while since I dealt with this but it's definitely possible with VST 2.4 -- many products do it. However not all hosts support it so I've found I've had to make work-arounds like an .ini setting to optionally limit the number of channels to a certain maximum so hosts that are afraid to negotiate will still allow them to be inserted on stereo or mono channels. If the plugin won't negotiate then it could fail over to the behavior it has now -- copying the mono data to the other channel.)

It's a big can-o-worms, that's for sure.

Let me know if you need an example of a VST that negotiates number of channels. I have a SCAMP update coming soon that will need to do this.

Cheers,

Magnus Lidström

unread,
Jun 18, 2013, 3:09:39 PM6/18/13
to symbiosi...@googlegroups.com
Yes, please provide an example of what you mean with "negotiate". There are the "pin connected" calls that was supported in older Symbiosis, before Logic 8, but I think they were also deprecated in VST 2.4. You are probably talking about the "speaker arrangement" calls, right? Never used those myself as I've never done surround plug-ins etc (and Symbiosis does not really support it). Do you know which hosts support these calls?

/ Magnus

Admiral Quality

unread,
Jun 18, 2013, 3:33:49 PM6/18/13
to symbiosi...@googlegroups.com
Let me get back to you on that one shortly, Magnus. It's been a while. It may very well be deprecated in 2.4 (my plugin that does it is still in 2.3) I'm not remembering offhand, but it's already on my todo list.

I'll be doing host testing again soon too and will be happy to share what I learn from that. It's been a few years since I focused on that stuff so I don't want to unnecessarily badmouth any hosts that might have improved over that time.

Will keep you posted. Thanks!

- Mike/AQ

Paul Davis

unread,
Jun 18, 2013, 5:05:19 PM6/18/13
to symbiosi...@googlegroups.com


On Tuesday, June 18, 2013 2:08:07 PM UTC-4, malström wrote:
As far as I recall (but I need to check on this when I have more time), we can't detect which buses Logic requires output on. (Unlike in Logic 7 where, as I said, all outputs where crammed into a single bus.).

What was the symptom of this design (all output channels on a single output bus element) failing in Logic 8?

i have no idea why or how Logic or any other host would try to set up the output busses to be any different than they are reported by the plugin/symbiosis, since symbiosis explicitly does *not* support the SupportedNumChannels property, which is where wild-carding and variable I/Os are specified.

My understanding of the current design of Symbiosis is that the only way the host can get I/O configuration information is via the StreamFormat property, and this doesn't provide "mono or stereo" as possible answers.

if a plugin supports SupportedNumChannels, then it can report (for example) in:1 out:-4 meaning "1 input and any number of outputs up to 4". but for the host to try to override the reported format of an output bus "just because" seems totally screwy.
not that certain, ahem, hosts are know to avoid "total screwiness" all the time :)

Reply all
Reply to author
Forward
0 new messages