Jack ports mixed up, AudioDeviceSelectorComponent not workin

Jules,

jack audio has stopped working since commit c16c3a7. Attempting to connect jack ports in JuceDemo results in errors:

Cannot connect output port 0 (system:capture_1), error -1 Cannot connect output port 1 (system:capture_2), error -1
It looks like a terminology mix-up. From the perspective of jackd, JUCE’s output ports are input ports and vice versa. So when JUCE is looking for output ports to send audio data to, it should call jack_get_ports() with flags JackPortIsInput.

It’s confusing, and also specially mentioned in the sample-client provided by jack-audio sources.

I suggest this fix, which afaiks solves everything, makes JuceDemo work and shows the correct ports in the correct box in AudioDeviceSelectorComponent:

[code]diff --git a/modules/juce_audio_devices/native/juce_linux_JackAudio.cpp b/modules/juce_audio_devices/native/juce_linux_JackAudio.cpp
index a956986…cc3461f 100644
— a/modules/juce_audio_devices/native/juce_linux_JackAudio.cpp
+++ b/modules/juce_audio_devices/native/juce_linux_JackAudio.cpp
@@ -107,7 +107,7 @@ namespace
static const char** getJackPorts (jack_client_t* const client, const bool forInput)
{
return juce::jack_get_ports (client, nullptr, nullptr,

  •                             forInput ? JackPortIsInput : JackPortIsOutput);
    
  •                             forInput ? JackPortIsOutput : JackPortIsInput);
    

}

//==============================================================================
[/code]

Doh! That really is confusing, I was looking at it from the wrong direction… Thanks, I’ll get that checked in!