Hi; creator of Captain Jack here.
The problem with the new AudioServerPlugin model is that, as Stéphane quite accurately pointed out, all of the plugins are run in the system bootstrap within the coreaudiod process. Because of this, things like UNIX pipes, FIFOs, and most other forms of IPC are blocked off. However, there is a blanket permission on network functionality, which is what I'm using to do all of the IPC between the plugin (coreaudiod) and the launchctl daemon.
There were two other problems that were faced: XPC, Apple's "we can do it better" IPC framework, requires a main loop to plug into to handle the events since it's asynchronous. Whereas XPC would allow us direct communication with the daemon, there's nowhere to put the main loop; sticking it just anywhere causes coreaudiod to freeze since the implemented functionality in an AudioServerPlugin is via callback functions - there is no 'main' entry point.
Lastly, the reason why the AudioServerPlugin doesn't use libjack directly is because whatever form of IPC libjack requires doesn't work within the system bootstrap context. I'm sure there's a way to use JACK's networking functionality (I haven't dived too far into that) but I believe it would require configuration of the AudioServerPlugin itself - something I wanted to avoid for experience concerns.
Hence why captain jack looks like the following:
AudioServerPlugin <==TCP/loopback==> LaunchDaemon <=> JACK
Believe me, it's not ideal.
However, this achieves two things: first, a loopback audio device isn't incredibly helpful since we have to handle both input and output. Plus, it's easily misconfigured to cause feedback loops. Secondly, Apple did something right in that you get a PID of whatever program has a handle to the audio device, included when they connect, disconnect, and exchange audio buffers. Pass that PID to the daemon, get the process information, and hand those off to JACK as individual ports. From there you could route audio from just about any application to any other application, not just the "master" in/out channels.
Hopefully I've redeemed myself just a little on Captain Jack's design. Would love to see JACK working on OS/X so I can finish the project.
- Josh (Qix-)