Sound Issue on Raspberry Pi and OSC

#1

Hello Peeps.
I’m stuck on a tricky issue. I’m using Sonic Pi 3.0.1 on a Raspberry Pi 3 B+. I’ve attached a USB sound card, and getting sound out of it works fine. I’m also using TouchOSC to control my sound while i code it. I’m never running more than 4 live_loops at a time, apart from those I run to receive OSC messages.

The issue I’m running into is that when I use TouchOSC to control the code parameters (like synth :beep, amp: get(:amp1) ) I get intermittent crackling noises, but they aren’t consistent. I can frantically wiggle 6 sliders on my phone and the sound plays fine, then tune one slider and it sounds like gravel in a blender. I’m accessing the OSC messages by keeping a loop for each element, which syncs to the OSC element (like i described previously). I’ve tried encapsulating my loops with a with_timing_guarantees false block, but that didn’t help either.

I’m not getting this issue on my laptop (Windows 7) or my desktop (windows 10), where i run Sonic Pi 3.1.0. I’ve changed the CPU governor on the pi from ondemand to performance, which alleviated it somewhat. It doesn’t seem to matter whether I’m accessing 4 or 18 TouchOSC elements. When I’m live coding, the CPU monitor never shows more than 25% - 30%.

I’m stumped. The only thing I haven’t tried is getting a better sound card from HiFiBerry, which I’d rather leave out as a last resort. Is there anything I could try looking into, or have i reached the limits of the Pi?