I’ve been using SPi for a while now on Windows and Ubuntu Studio and finding it both fun and powerful. I recently decided to actually buy a Raspberry Pi as a dedicated box for running Sonic Pi to feed midi into the rest of my setup (which is just a bunch of outboard synths). I assumed that solid midi timing would be well within the capabilities of the thing, especially as I wouldn’t be using any audio or running anything else on the system. Unfortunately, this doesn’t seem to be the case. Running a simple loop sending a steady stream of midi note triggers to a drum machine, every few seconds I hear it slow briefly and then catch up. Here’s the loop:
live_loop :solo do use_midi_defaults port: "iconnectmidi4+_iconnectmidi4+_midi_2_24_1", channel:10 midi :e0 - 12, vel: 40 if (tick % 8) == 0 midi :fs0 - 12, vel: 127 end sleep 1.0/8 end
I’m looking for advice on how to diagnose this. I don’t think there are other processes that are hogging the CPU. Nothing else shows up when I run
top, for instance,
beam.smp are the top three processes and between them they are using less than 50% of CPU capacity.
I installed gnome-system-monitor to show real-time graphs of not only CPU, but network and swap space, and there are no spikes or troughs associated with the bad timing events. I’ve also tried setting a higher priority for these processes and whilst I think I might be hearing more stable timing with fewer glitches, there are still glitches.
What else can I look at to get to the bottom of this? Does anyone know of other diagnostic tools that will show me, preferably in real time, any other IO activity - USB or otherwise - that might be interfering or causing a bottleneck here?
I have an RPi 4b with 8 Gb RAM and it’s running 5.10.11-v7l+ #1399 SMP Thu Jan 28 12:09:48 GMT 2021 armv7l GNU/Linux. Sonic Pi is Version 3.3.1. I’m running headless and using VNC Server/Viewer to create a desktop session for Sonic Pi. The midi interface is an iConnectMIDI4+ connected to a USB 2 port.
Any suggestions would be most welcome.