juce-framework / JUCE

JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, LV2 and AAX audio plug-ins.
https://juce.com
Other
6.65k stars 1.75k forks source link

JACK channel number assignment #332

Open umlaeute opened 6 years ago

umlaeute commented 6 years ago

building a plugin as a standalone application with JACK support, it seems that the channel assignment logic is ~bogus~ conflicting with JACKs idea of channel management:

the withOutput resp withInput assignments for a plugin are simply ignored.

instead, the user can select another running jack-client, and the number of output (resp input) ports of that other jack-client determines the number of channels of the JUCE application.

this makes it really awkward to setup a chain of multi-channel JUCE plugins where the number of channels varies between links.

e.g. consider a 64 channel soundcard, where i want to spatialize one (1) input using ambisonics (3rd order), with both the ambisonics encoder and decoder being JUCE plugins. In theory we would have a pipeline like:

 input (mono)
   | (1 channels)
   V
encoder (3rd order ambisonics)
   | (16 channels)
   V
decoder (3rd order ambisonics)
   | (64 channels)
   V
 output

in the pristine system (without any applications but jackd running), we only have a single jack-client, namely system (the soundcard) with 64 inputs and outputs.

In order to properly setup the pipeline with JUCE standalones, we first must start a dummy application with 16 inlets and 1 outlet (for the sole purpose of getting the input/output channels right) Only after that we can start the ambisonics encoder, and configure it to connect to the dummy application. Then we can start the ambisonics decoder and hook it up to the encoder and the system output.

Using proper jack tools (e.g. qjackctl) one can then connect the encoder to the (first) input channel of the soundcard (or whichever channel you really want).

umlaeute commented 6 years ago

also, for what it is worth: as soon as i configure the second JUCEclient to use the first JUCEclient as input, one of them disappears from the list of running jack clients (monitored via qjackctl).

Since they are all named JUCEclient (see #331) it's hard to know which one vanished.

However, this makes it practically impossible to chain any JUCE standalone plugins in JACK.