[LAD] Multiple JACK servers connected in one host?

Markus Seeber markus.seeber at spectralbird.de
Mon Mar 7 14:19:43 UTC 2016


On 03/07/2016 02:12 AM, Jonathan E. Brickman wrote:
> Greetings, everyone.  Since I am using 85% of JACK DSP in my primary
> production box, while using 14% of the CPU and 1/8 of the RAM according
> to htop, it appears that I need to develop a way to move forward :-)

14% of what? One physical core? One virtual core? All cores? Chicken?

> I would like to use the power of my box to do the same internally.

Jack should be doing this already in a single instance.

> 
> I have taken a number of hours over the last few days in testing. Thus
> far, my impression is that netjack1, netjack2, and jacktrip are
> explicitly not set up for this.  Using jack2, netjack1 and jacktrip
> worked fine for one client/slave, but a second one froze both, and
> netjack2 did not work at all, I found a web reference stating that
> multijack explicitly does not do localhost unless explicitly set to do
> so at the TCP/IP stack programming level.  Using jack1, netjack1 did not
> connect at all, so I decided to halt for now and ask Those Who Know :-)
> 
> So far, the only clearly workable option, has been to try the Docker
> lightweight virtualizer, and run each JACK server and related
> application chain in its own container.  Anyone have better ideas?

Yes, maybe take a step back and try to find the problem before finding a
solution.

>From what I just read:

* You noticed, that there is a high DSP load for JACK
* You noticed, that there is a low CPU load on you box, which has most
likely multiple physical cores?

So I assume you think the following:
Ok, my Hardware still has free CPU resources, and since JACK is supposed
to be a smart thing, it should be able to utilize all of my CPU cores.
One could think, that JACK just needs to put your clients on different
CPUs so they can run in _parallel_, using up more CPU Cycles and increasing.

Sadly it is not that easy, since this assumes, that your processing
chain actually _can_ be parallelized. Can it? Depends...

If your processing chain looks like a daisy chain, you are out of luck:

mic -> client1 -> client2 -> client3 -> speaker

(fig 1)

Since each client must wait for the previous one, only one client can do
its work at a time, which means only one of your cores can be utilized
_at a time_, the others will just sit there idling around.


On the other hand, if your processing chain looks like this:

mic --> client1 ---> speaker
    \-> client2 -----^ ^ ^
    \-> client3 ------/ /
    \-> client4 -------/

(fig2)

the clients 1,2,3,4 can run at the same time. JACK _can_ schedule them
to run on 4 different CPUs, which means you can reach a higher average
CPU load while keeping the DPS load lower.

There are many more details, but the most important thing is the question:
"Can my processing chain be parallel?"
"Can I do anything to my processing chain to make it (more) parallel?"

I stop here trying to interpret what you were trying to achieve and
maybe the best thing you could do to get some tips is to describe your
processing chain, maybe something can be worked out. A picture in form
of a graph, says more than a thousand words in this case.

Best Regards
Markus


More information about the Linux-audio-dev mailing list