Does zita-ajbridge work with Patchbox OS?

Hi,

Unfortunately, I can’t get zita-ajbridge to work on Patchbox OS 5.15.36. Does it work with Patchbox OS or am I missing something?

Here’s what I’m doing to connect Roland MC-101 to Pisound, which is the default sound card:

zita-a2j -j "mc101" -d hw:MC101,DEV=0 -r 44100 -p 64 -n 3 &

Then, with jack_lsp -c, I get the following:

mc101:capture_1
mc101:capture_2

Which then I connect with:

jack_connect mc101:capture_1 system:playback_1
jack_connect mc101:capture_2 system:playback_2

Everything seems connected, but I don’t get any audio from the MC-101.

Does anyone know how to make this work?

Thanks in advance!

Try providing a ‘-v’ option additionally to see some additional output, also try bigger values for -p, like 128 or 256. Go to smaller values once you get audio at all. :slight_smile:

Thanks for your reply!

I tried different parameters, including all the different sample rates, buffer sizes and periods listed in the Patchbox jack settings, i.e. -r 48000 to 96000; -p 64 to 1024; -n 2 to 4. Nothing seems to affect zita-a2j.

I tried so many different things, that I cannot remember if I checked verbose. However, I remember that the output was always “Starting synchronisation”.

Yesterday, I went through the sparse documentation once again and I noticed the following text : “When starting, and in case of major trouble, you will see the ‘Starting synchronisation’ message. This can happen if there is a timeout on the Jack server, e.g. a client crashed or terminated in a dirty way.”

I wonder if something else is preventing zita-ajbridge from starting.

Cheers

Check the Jack service logs, in another terminal window do:

journalctl -u jack -f

Then it will show you new messages as they come in. Execute the other commands in a separate window.

Tanks, Giedrius.

Running journalctl -u jack -f on a separate window only shows the following, either with zita-a2j or alsa_in:

May 30 22:38:24 patchbox jackdrc[526]: ALSA: final selected sample format for capture: 16bit little-endian
May 30 22:38:24 patchbox jackdrc[526]: ALSA: use 3 periods for capture
May 30 22:38:24 patchbox jackdrc[526]: ALSA: final selected sample format for playback: 16bit little-endian
May 30 22:38:24 patchbox jackdrc[526]: ALSA: use 3 periods for playback
May 30 22:38:24 patchbox jackdrc[526]: port created: Midi-Through:midi/playback_1
May 30 22:38:24 patchbox jackdrc[526]: port created: Midi-Through:midi/capture_1
May 30 22:38:24 patchbox jackdrc[526]: port created: pisound:midi/playback_1
May 30 22:38:24 patchbox jackdrc[526]: port created: pisound:midi/capture_1
May 30 22:38:24 patchbox jackdrc[526]: port created: M8:midi/playback_1
May 30 22:38:24 patchbox jackdrc[526]: port created: M8:midi/capture_1
May 30 22:40:12 patchbox jackdrc[526]: port created: pisound-ctl:midi/playback_1
May 30 22:40:12 patchbox jackdrc[526]: port created: pisound-ctl:midi/capture_1

After running the following:

zita-a2j -j "M8_in" -d hw:M8,DEV=0 -r 44100 -p 64 -n 4 &
jack_connect M8_in:capture_1 system:playback_1
jack_connect M8_in:capture_2 system:playback_2

I get this output with jack_lsp -c:

M8_in:capture_1
   system:playback_1
M8_in:capture_2
   system:playback_2

But, I get no audio whatsoever.

Am I missing something?

It’s difficult to say, as there’s no errors found yet, there’s not much to go on.

Did you try using alsa_in?

Yes, I did.

alsa_in, alsa_out, jack_load and jack_connect, all work just fine. I wanted to try zita-a2j because I’m having a small issue with alsa_in / alsa_out, but it’s not the end of the world.

If you don’t have any more ideas, I’ll just use alsa_in / alsa_out and will end my experiments here.

One last question - have you ever tested zita-a2j with Patchbox OS?

Thank you very much!

I haven’t but had alsa_in working before. :slight_smile:

Yes, alsa_in and alsa_out work flawlessly. I was just trying to explore zita-a2j and zita-j2a, but I guess I’l end my experiments here. After all, I managed to finally get everything working with the latest Patchbox OS version. Thank you very much for your help!

I also fell back to alsa_in and also_out.

AI gives some explanation:
Here are the three main reasons why Zita fails with you while the ALSA tools are running:

  1. Radical Clock Synchronization (The Main Reason)
    Sound cards always drift slightly apart in time.

    asla_in/out solves this very shirt-sleeved: If the buffers run unequal, the tool simply artificially adds audio samples or omits some (resampling via linear interpolation). This is not perfect, but it is guaranteed to run with any USB chip.
    Zita uses high-precision resampling (resampling with resonance filters). It tries to synchronize the exact hardware clock (clock) of the Roland P-6 with the watch of the Pisound. If the hardware of the Roland P-6 does not allow these fine adjustments via the USB driver to be made quickly enough, Zita immediately breaks off with a security error (FAILURE) to prevent crackers.

  2. Different permissions for memory access (shared memory)
    Zita requires direct access to the fast shared memory of the JACK server to guarantee the extremely low latency.
    Because the JACK server runs on Patchbox OS in a special user group, our Systemd service (whether as root or as a user patch) was not allowed to manipulate this storage area as profoundly as Zita has requested. asla_in uses simpler standard connections that require fewer rights.

  3. Rigid hardware channels
    asna_in/out opens a device and simply takes what it gets (even if it presses a stereo signal into a mono system). Zita requires an absolutely exact definition of the channels. If the number of channels that the Roland P-6 reports via USB (often it sends mix channels + single tracks) does not exactly match the configuration of Zita, Zita refuses the service.

Thanks for the explanation.

still struggling with my Roland P6 USB Audio&MIDI - I had it all before but then I had a system crash on my RPi4. Now journalctl -u jack -f gives me xruns :thinking: