Is it possible to improve CPU and I/O scheduling

I’m using a Pi4B and a Behringer UMC22 USB.

If I do my own normal Raspberry Pi install, use the low-latency kernel, and build the latest Dexed, I have a really nice experience with 64 samples and 2 periods.

But if I use the Zynthian image, anything less than 256 samples causes bad xruns. And of course with a buffer that large, the latency is quite annoying.

Has anyone had any success at optimizing Zynthian for smaller buffer sizes ?

1 Like

Hi ! Apparently, there is significant difference when using a GPIO DAC compared to using a USB interface. But, it seems, even in a optimal scenario, you cannot get below 128 samples at the moment.

Hopefully, one day we can swap the Pi 4 with a Pi 5 and still keep our Zynthian boxes !

On the Patchbox OS, they advise to use :

  • with a USB interface : 3 periods * 256 samples
  • with the PiSound GPIO DAC : 2 periods * 128 samples

The default for a Zynthian box with GPIO DAC being 2 periods * 256 samples

Zynthian does require some optimisation which I hope we may be able to review over the next few months. Currently there is some inefficiency in CPU usage and load on the jack audio layer which we really need to optimise. Zynthian does present a less powerful DSP than a raw Raspberry Pi - sorry, we will improve matters and hopefully not just throw power at it (by waiting for the RPi5).

1 Like

3 periods for usb jack config was relevant only for pretty old kernels if I remember correctly. And there’s efforts to get it even lower in a 5.15. I’ll see if I can rustle up the link. Also we don’t use the low latency kernel because we have have a ui that we want to keep useful. Normal kernels can run the jack stuff on a real-time scheduler anyway.

Thank you I would like to read that, if you find the link.

Here we go. It’s more important for the Jack period / buffer settings to set up whole integer latencies for usb devices, e.g. 10ms rather than 10.33333 ms, having 2 or 3 periods is pretty irrelevent.

improvements in kernel 5.16 Linux 5.16 Aims For Better USB Low-Latency Audio Playback - Phoronix