Notes for setting up a Raspberry Pi 4 for audio work

We have been messing around with the Raspberry Pi 4 at Notam and had lots of fun with it. We compiled some notes (and a realtime kernel) on how to optimize headless raspbian for audio work and install and setup SuperCollider + neovim + scnvim in easy to copy-paste commands.

PS. The PI4 is an amazing machine for SC!

7 Likes

This is fantastic!

Could you post some rough benchmarks, e.g. how many of X before dropouts occur, this sort of thing? It would be super nice to know what one can expect from a well configured RPI SC setup.

I will do some stats with xruncounter and get back to you!

I overhauled my Raspberry Pi 4 audio setup guide quite significantly. It now includes instructions for installing Raspbian, a script for realtime kernel installation and a photo of a broken arm.

1 Like

I never got around to making viable benchmarks here but in use I experience almost no difference in terms of performance between the Pi4 and my laptop (which is a 2019 model)!

Has anyone tested the difference between the Preempt-RT and the Xenomai real-time kernels on the raspberry pi?

I am curious because this website says that Preempt-RT performs better than Xenomai but the Bela platform has chosen the Xenomai for their ultralow latency system using the BBB.

Oh man oh man, so excited about this, just got a pi4 in the mail. Thank you!

I’ve only tried the RT kernel in my blog post and it is a bit sketchy. I’d like to try the ones you suggest. That said, I normally don’t use RT kernel at all on Pi4 these days. Would love to hear experiences with those kernels though

1 Like

Do you install the 32bit on the RPI4 or the 64bit version of the Raspian Lite?

Bela runs a custom audio processing environment based on the Xenomai real-time Linux extensions. Your audio code runs in hard real-time, bypassing the entire operating system to go straight to the hardware. We have written a custom audio driver using the Programmable Realtime Unit (PRU), a microcontroller on the same chip as the BeagleBone Black CPU. This driver is capable of buffer sizes as small as 2 audio samples for very low latency, and its performance is not affected by other system load. No other embedded Linux platform can match this performance.

The website seems to be talking about more than just a real-time kernel. It looks like there’s a special patch that’s all about making sure audio gets top priority, separate from everything else the system is doing. Normally, a real-time kernel doesn’t do this on its own. You’d have to mess around with the system settings to make audio the main focus. Also, I’ve never heard of having a block size as tiny as 2 samples. That’s not possible in a “normal” system.

But remember: real-time IS NOT real fast! You compromise other things to have a realtime system. Maybe that’s the reason each project chose a different kernel, they have different priorities.