Route standard/system audio or single app audio through Ardour OS X

How do I insert Ardour OS X between the (system or app) output and soundcard, for use as a real time effects unit on either the whole standard/system audio or single app?

I’d like to use Ardour to apply plugins (making complex mixing of several plug-ins) that effects audio from another audio/video software. One main use is to reverse engineer compression and noise reduction on old DVD movies.
I need to split the audio from the moive player, route it through Ardour to set up the chain of plugins needed.

After a lot of experimenting I found it possible to make Ardour get the signal from an app by setting “Audio/Midi settings” “standard output” to JackRouter, then I could get that signal into a input/track (by selecting the signal from that app in that tracks’ input).
The problem is that the audio mixed with the output too, so I can only add to the audio. A workaround was to mix the track to Ardours’ output, 180deg out of phase to cancel the “leakage” and then opening a new track where I again take the audio from the app and do the processing, adding it in phase this time. Now it acts as if Ardour is inserted between the app and output.
It works, but feels more than odd. Is there a right way to do it?

If Ardours inputs would have recognised soundflower, it would be easy, but it seems not to. Any ideas?

@RogerJoensson: first of all you do NOT need to use soundflower and nor SHOULD you use soundflower. Both JACK and soundflower offer very similar capabilities and there is no reason to use both in any situation whatsoever. It will only make things more complex, less reliable and so on. I know several of the developers of soundflower, and suffice it to say that for any moderately complex task, they use JACK for signal routing :slight_smile:

You have somehow misconnected either the other application, or Ardour, or both. The canonical way to do this is to simply tell the other application to use JackRouter for its output, and then have ardour use the appropriate jack ports for input to a track. It sounds as though you have done this, but it appears that you still have pre-existing connections on some level that route sound in a way that is causing your problems. There is absolutely no need to do any phase cancellation. I regret that I can’t suggest what you may have done, but my hunch is that its some combination of (a) leaving the existing Ardour track inputs in place (b) your monitoring setup, either in h/w or Ardour or both.

OK.

Looking in JackPilot, I found that Mplayer (Mplayer extended) was automatically connected to both ardour and system playback. After fiddling (I wish jack Pilot was less frustrating messy…) I managed to turn the signal between mplayer and system playback and it then works with Mplayer.
One annoyong this with Mplayer extended is that is makes a new connection everry time a file is started, so if I change file/movie I have to do the whole procedure all over again, selecting connections and inputs.
What I really want to do is to make the break point at system playback. So that i can process everyting, from all apps and then inject it back to the system playback processed. Then I just set it up and it just works with everything, not disconnecting etc.

The reason for using Soundflower, is that I did not have to do that extra fiddling, connection app by app and reconnecting everytime it drops. When I use it with DSP-quattro (doning the same thing that I am now doing with Ardour), I just have to set OSX standard audio to Soundflower and then select soundflower as input and system playback as output in DSP quattro. That’s it. Very easy to get it working and it works with every standard app!
Standard audio -> Soundflower ->DSP quattro ->computer audio output.

The reason for starting using Soundflower with DSP-quattro instead of Jack is that I didn’t manage to do this with JackPilot, because the system playback is not available as Send Ports. It was a revolution, the first time I managed to insert something after Standard audio…

The question now is, can I make a insert point at “system playback” to grab, process all audio (with ardour) from all apps and then have it sent to the system playback? Then how do I do it?

@rogerjoensson: JACK and SoundFlower overlap a lot in terms of functionality, but not implementation. JACK appears to the system and other apps as an addition CoreAudio hardware (pseudo)device called JackRouter that can be used for input & output just like any other device. SoundFlower is a kernel driver that redirects its input back to its output. SoundFlower was specifically designed to interpose between system output and other apps, whereas JACK was designed for sharing the device and providing inter-app routing as well. Consequently, the way to use JACK for this is simply to make every app use JackRouter as its output (most easily accomplished by making it (temporarily) the default system output in Audio/MIDI setup. Then the signal from all such apps will be accessible to any other JACK app, and be routed anywhere that JACK permits (include a hardware output).

What happens when I do this (set system output to Jack) is that individual apps are routed through jack to the output (I can see that in Jack pilot) and that Ardour find/shows the indiviudal apps. The system audio does not show as a connection output to grab from. So even if I break the connections of all the individual apps, THERE IS NO SYSTEM AUDIO OUTPUT TO GRAB THE SIGNAL FROM available in neither Jack Pilot (send ports) nor Ardour.
System audio appears only as an input (receive port) where I can connect individual apps to, not grab from. Only the soundcard audio input is available as Send Port in both ardour and Jack Pilot, not the system audio mix.

Ardour only show the individual apps, not the system audio, when system audio is set to Jack:
If I start Mplayer and look at an inputchannels’ temporary connections in Ardour, the choices are Ardour, System (Internal sound card audio input sound source) and Mplayer. There is no choice to grab the signal from system audio output.*

What am I doing it wrong? Do I need an other tool than Jack Pilot?
Or is it simply not possible to grab the signal from the system audio mix with Jack?

*The only way to get the sound from Mplayer to an Ardour input channel seems to be to connect Mplayer individually in Ardour, the BIG PROBLEM with this is that the CONNECTION DROPS EVERY TIME MPLAYER IS STOPPED and then I have to open Jack Pilot to break the connection to the ouput that is automatically done when Mplayer is again started and then go and select Mplayer as an input source in Ardour once again and this is not convenient. That is why I would like to grab the system audio, process it and then output it through the system audio.

looks like you want to have a loopback interface ?

What is a loopback interface, something that exist, that i can use with Ardour?

I can do what I want with DSP-quattro, since it supports Soundflower, but I never managed to get it working with Jack.

Each channel of each app using JACK remains a separate signal until it is mixed by something, and it doesn’t go to the audio h/w unless something sends it there (by connecting its own output ports to the (JACK) inputs of the audio h/w). Ardour does see the system audio output- it consists of a set of ports called “system:playback_1”, “system:playback_2” etc. It also sees the system audio input, as a set of ports called “system:capture_1”, “system:capture_2” etc.

But by using JACK you are no longer sending audio direct to the system audio output, you’re sending it to JACK. You don’t need to grab a signal from the system audio output - all the audio that goes there goes through JACK first. It is true that you need to connect each application to the “mixing target” (i.e. ardour), rather than just grab a single signal (e.g. from the system audio output).

You are right that if you have apps sending to the “normal” system output, you cannot grab the output without using either SoundFlower or Audio Hijack (these both work in different ways too). My point was you don’t need to do this, and it complicates things because you now have 2 layers of virtual devices in the signal path. However, I have heard of people who use SoundFlower, have their apps send to SF, and then tell JACK to use SF as its input and the audio h/w (not the default system out, which is SF) for output. I’ve even heard reports of this working. This is “simpler” in that you do not have to make a connection from each application to ardour - SF mixes it all down to a single stereo stream. Its more “complex” in that you now have two virtual audio devices, more latency and more potential for routing mistakes that could lead to feedback or missing signals.

And yes, the problem you describe with mplayer applies to any application that opens/closes the audio device it uses whenever it starts/stops. mplayer is not alone in this. if you had mplayer with JACK support, this would be avoidable because you can tell it what to connect to, or not to connect to anything, so that it would do the same thing every time it starts/stops.

  • you can avoid “automatic connection to system in/out” by unchecking the corresponding item in JackPilot preferences

  • JackRouter device normally restore connections when a given application (like MPlayer in your case) is removed and reappear later on. So if MPlayer was connected to Ardour, it should stay connected when a new file is started.

@rogerjoensson: it might be a LOT quicker to resolve this if you joined us on IRC at #ardour (see http://ardour.org/support). forums are really bad places for solving problems that require an actual dialog to clarify meanings and goals etc.

-After some more hours of fiddling I found one way make an insert point on system audio that seems to be stable :

  1. System audio output is set to Soundflower (16ch).
  1. In Soundflowerbed app, set Soundflower (16ch) to Built-in Output.
  2. Channel 3/4 are connected to built in outputs 1/2.
  1. When starting Ardour, Soundsettings/Unit is set to Soundflower (16ch).
  2. The input stereo channel is set to: In 1+2.
  3. The Master output is set to: Out 3+4

Viola!
-Hope this is helpful to someone else…