[LAU] Working with netJack2 on raspberry pi

Chris Caudle chris at chriscaudle.org
Wed Apr 19 01:43:40 UTC 2017

On Tue, April 18, 2017 12:36 pm, Claus Lensbøl wrote:
> Hi Chris

I hope you do not mind, but I have taken the liberty of replying also to
the linux-audio mailing list.  The question was originally asked there,
and many others are more experienced than I with netjack, so keeping
replies there is better to get the most accurate information, as well as
to benefit others who may have similar questions and search the mailing
list archives for possible solutions.

> I have on my master node (Ubuntu Studio 16.10), let the system start
> jack, and the loaded the netmanager as:
>     jack_load netmanager

I see here a confusion possibly on my part.  Your  original email stated
that you wished to " set up a Raspberry pi as an output for jack"

Which is why I asked explicitly:
>>> So I'm trying to set up a Raspberry pi as an output for jack.
>> Meaning that the R-Pi has the audio hardware, i.e. R-Pi is master?

By that do you mean the Rasberry pi has the only audio output?  In that
case the Rasberry pi should be the master, the Rasberry pi must start jack
first with the ALSA driver (assuming R-Pi uses ALSA for the audio
hardware, I am not directly familiar with the details of that hardware).
After the master (the device with the audio hardware) has started jack
successfully then you use jack_load to load the netmanager.

> At this point I can on the Pi start jack as:
>    jackd -R -d net

That would allow using software on the R-Pi to play audio  on your Ubuntu

> , and have it connect to the master (where I, on the master, can see
> the Pi using qjackctl).

> This is where I get into the problem where running (on the Pi):
>     jack_load audioadapter

You have configured the R-Pi as a slave of the Ubuntu computer, you do not
usually load audioadapter on the slave.
Well, I guess that is not entirely accurate.  You would not load
audioadapter on the slave if you wanted one machine to have audio output,
and the other machines to be connected by network to that single audio

What are you trying to accomplish?  Which machine will generate digital
audio data, and which machine should output audio?
Are you perhaps attempting to have both the local audio device on your
Ubuntu computer play audio, and also the R-Pi available to play audio?  In
that case what you are attempting may be the correct way.  If you do not
need to use an audio interface on your Ubuntu computer then make it slave
only (use net as the driver instead of ALSA, use ALSA as the driver for
the R-Pi).

> , results in:
>     could not load audioadapter, intclient = 0 status = 0x 1

Look also at the jackd status messages.  I attempted to load audioadapter
on a machine where the only audio interface was already in use by jackd
and got this on the console where I executed jack_load:
$ jack_load audioadapter
could not load audioadapter, intclient = 0 status = 0x 1

But also saw these additional messages from jackd:
../linux/alsa/JackAlsaAdapter.h:225, alsa error -16 : Device or resource busy

That makes sense on my machine, the audio interface is already exclusively
used so audioadapter could not use the device.
Perhaps on your R-Pi there are informative messages as well.

> I think I was assuming that I could not play music from the Pi using
> jack_play when the Pi had another master, but I should be able to test
> that out tonight.

That previous suggestion was based on the assumption that the Pi was the
master since you stated you wanted the Pi to be the audio output.

I was assuming that the Pi would be the jack master, since typically in an
audio production setup where jack is often used you do not want the audio
to be resampled, so you have just one master, a single device with the
audio output.

>>> What I've done is to follow this guide:
>>> https://github.com/jackaudio/jackaudio.github.com/wiki/WalkThrough_User_NetJack2

Definitely check the output of jackd when using jack_load.
Section 6. has this note:
By default this client will open the same number of input/output ports the
net driver has opened and will use the sampling rate the net backend is
currently using.

Perhaps the netbackend is using a sampling rate not compatible with the Pi
audio hardware.  Perhaps there is a mismatch with the number of ports, I
do not know from that description if the number of ports on the netjack
slave must match the number of physical audio channels available or not.

Did you try the suggested:
jack_load audioadapter -i "-h"

That may give information on the correct number of ports to use.

If you really do want to use the audio adapters of both devices (Ubuntu
computer and Pi) perhaps zita-net2jack (zita-n2j) will work better for

Chris Caudle

More information about the Linux-audio-user mailing list