Raspberry Pi 5 for pyo

107 views
Skip to first unread message

p.s...@outlook.com

unread,
Jan 10, 2024, 6:30:54 PM1/10/24
to pyo-discuss
Hi all,

My laptop recently broke and I'm dreaming of physically downsizing my pyo-based looper/sequencer. The new Raspberry Pi 5 is coming out with 8gb of RAM as an option, and I'm considering getting it. I'm wondering a couple of things:

1. Are there any pervasive issues with running pyo on a Raspberry Pi that I should be aware of? I'm also reading this forum's history. 
2. Would it be powerful enough? I'm planning to put reasonable weight on it as a realtime audio processor in duplex, e.g. ~40 to 80 sets of loopers and other readers, portamento etc, some final compression but no other effects. Minimal to no simultaneous graphics. A Focusrite external audio interface at 48k and midi controller. Happy with latency of up to 20ms.

It's been a good while since I actually ran any scripts so I don't have concrete info on CPU usage. The now-destroyed laptop was a Dell Latitude 2015 ish thing running Manjaro, multicore with also about 8gb of RAM and seemed to be okay with what I was asking. I know RAM isn't the only factor but I don't have access to other info right now. 

If it's close, I'd go for a refurbished mini PC, but I like the idea of running a Pi headless or with just an LCD. The pyo bela project seems to be in limbo at the moment or I would also consider that. 

Thanks! 
Paul

Sean Wayland

unread,
Jan 10, 2024, 7:02:48 PM1/10/24
to pyo-d...@googlegroups.com
My guess is that if you used one of these  https://www.hifiberry.com/dacs/ and configured jack properly you might get the latency down to 10 msecs or better. I would be interested to see if that worked .. 
--
You received this message because you are subscribed to the Google Groups "pyo-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyo-discuss/35435277-8e92-439e-93b4-b21ebe4c6b5en%40googlegroups.com.

p.s...@outlook.com

unread,
Jan 10, 2024, 8:08:08 PM1/10/24
to pyo-discuss
Thanks. I looked at those but am not seeing any stereo full duplex options (unless I am missing something). I assume these would be preferred to an external usb audio interface because there's a shorter round trip?

Sean Wayland

unread,
Jan 10, 2024, 9:24:25 PM1/10/24
to pyo-d...@googlegroups.com
HiFiBerry DAC+ ADC Pro https://a.co/d/5VXXdrf

Its stereo input and output

You could ask on their forum about full duplex

I suspect you could process audio with it 

Perhaps an audio interface would give you better shielding etc but thats a high quality dac . If its quiet enough it might be light and good latency. 

Tiago Bortoletto Vaz

unread,
Jan 10, 2024, 9:53:34 PM1/10/24
to pyo-d...@googlegroups.com
Hi, as already mentioned, you might want to try out a DAC together with the
Rpi5. IMO that should work fine. I've used a BBB + Bela for a few projects and
had interesting results in terms of latency, but perhaps not pushing too hard
as you'll doing on effects.

https://shop.bela.io/products/bela-cape
https://github.com/belangeo/pyo-bela

Bests,

--
Tiago Vaz
https://tvaz.cc

Aaron Krister Johnson

unread,
Jan 11, 2024, 10:24:04 AM1/11/24
to pyo-d...@googlegroups.com
Want to chime in here: I have a RPi 3B. Not sure what the situation is on the 5, but I can say that the soundcard that comes built-in is utter garbage on the 3B. So, I got the pisound "hat", and that's wonderful.

https://blokas.io/pisound/

That said, one has to be careful for live performance things to _really_ go with a kind of bare-bones "embedded" mindset for audio work with the RPi. Be careful with any computationally intensive algorithm. Certain Csound opcodes or Pyo objects are just simply not in the running, in my experience. FFT, Convolution, etc. OTOH, you can test the possibilities of lower sample rates -- sometimes things are just not audibly affected enough that the power saving that buys you is worth it.

Remember after all, that things like a Yamaha DX7, I think they were what, 8k sample rate? So, we've been spoiled. That said, I use 48k as a default anymore when I can :)


Aaron Krister Johnson

unread,
Jan 11, 2024, 10:25:12 AM1/11/24
to pyo-d...@googlegroups.com
Oh, I should add, and it's obvious anyhow, and was mentioned, but +1 to not using any GUI, of course. `python3 -i your_pyo_script.py` FTW.

p.s...@outlook.com

unread,
Jan 11, 2024, 11:01:52 AM1/11/24
to pyo-discuss
Thank you all! I'm so grateful to see this much response to my question.

As several people have now recommended I get a dedicated audio "hat" rather than use the Focusrite USB audio interface, I want to check that this is because of performance improvements interacting with the Pi and not just because it's smaller and easier to hide. I quite like my audio interface and my overall setup is large so I don't need to economize space this much. But if the improvement is performance, the Pisound looks especially good - it's advertised as being for duplex use and has a volume pot, both very handy.

As the Raspberry Pi 5 is new, I'll ask in relevant forums if the hats are working well with 5.

I've been careful in the past to avoid any computationally intensive algorithms - kept an eye on Olivier's list. I'd like to add compression which would be a risk, but I'll be sure to use mix, and take it out if it's too much. I mostly want to avoid clipping when recording straight to wav. My software is just a sampler with a stereo input stream being read by a bunch of objects. I'm not really doing analysis of the audio or any synthesis.

And yes, I'll run it with just a basic LCD display (like a 16x4). I need to see some numbers but that's it. There'll be interaction with a MIDI controller too but that doesn't seem too intensive.

Sounds like I can probably gamble on this.

Much appreciated,
Paul

barmin

unread,
Jan 12, 2024, 4:48:00 AM1/12/24
to pyo-d...@googlegroups.com
Hi Paul,

Maybe I'm a little bit late, but I've been experiencing quite a bit with pyo on an (older) rpi lately.

Part of my experience is there: https://www.matthieuamiguet.ch/blog/rpi-diy-fx-pedal

Basically I could get a very decent latency ("jack" latency 4ms, roundtrip ~6.7ms) and still get some processing power for (simple) fxs.

BUT: with a USB-powered sound interface, I've been experiencing electrical noise that was very annoying.

I still have to solve a couple of minor issues and then I will write a second blog post about what works for me, but basically:

- I bought a Pisound hat and it works great
- I installed bloka's "Patchbox os" distribution, which makes it very much easier to get low latencies than any other distrib I've considered

I still have to completely solve the "floating ground hum" I'm mentioning near the bottom of the above post, but whether you experience it or not will depend a lot how you amplify your signal.

But with a few hacks I've been playing regularly through my rpi for several months now and it works great!

Please keep us informed about your experience with the rpi5, I'm definitely interested in knowing wether it works well for audio applications. And don't hesitate to ask if you encounter difficulties, I spent more time getting things working than I'm willing to admit, so I'm happy if I can help others getting there more quickly!

Cheers,

Matthieu

Le 11.01.24 à 17:01, p.s...@outlook.com a écrit :
> Thank you all! I'm so grateful to see this much response to my question.
>
> As several people have now recommended I get a dedicated audio "hat" rather than use the Focusrite USB audio interface, I want to check that this is because of performance improvements interacting with the Pi and not just because it's smaller and easier to hide. I quite like my audio interface and my overall setup is large so I don't need to economize space /this /much. But if the improvement is performance, the Pisound looks especially good - it's advertised as being for duplex use and has a volume pot, both very handy.

p.s...@outlook.com

unread,
Jan 12, 2024, 9:20:34 AM1/12/24
to pyo-discuss
Hi Matthieu,

Not too late at all. Thank you for this information! This is extremely helpful to read. Good to see that even a 3B can do this. When I first started Python and pyo I naively tried to use a Raspberry Pi 2 with just the onboard soundcard - that wasn't good. I'll probably start work on this next month or so, likely first using the Focusrite interface (it's wall-powered, and I have a big rack of effects with it so the independent portability is not as much of an issue for me) and then maybe switching to the Pisound hat. I have some more coding to do before I worry about latency anyway.

A couple of questions that you may or may not have an easy answer for (this isn't a request for you to test things, just if you know already) ...
  • Have you noticed a difference in performance between your USB interface and the Pisound hat, in terms of xruns and latency?
  • Is the Patchbox OS better for low latencies regardless of interface, or is it specifically better for the Pisound hat?
I hadn't realized that was your Python library for the nanoKONTROL2. I referred to it when setting up my Akai APC40!

I'll keep you updated here, and will bookmark your blog.

Thanks,
Paul

barmin

unread,
Jan 12, 2024, 9:45:35 AM1/12/24
to pyo-d...@googlegroups.com
> A couple of questions that you may or may not have an easy answer for (this isn't a request for you to test things, just if you know already) ...
>
> * Have you noticed a difference in performance between your USB interface and the Pisound hat, in terms of xruns and latency?

xruns and 'jack latency': it did not make any difference.
roundtrip latency: I don't remember that it was anything significant. I'd have to measure it again, though, to be sure. I will certainly do that before I write my next blog post about it.

> * Is the Patchbox OS better for low latencies regardless of interface, or is it specifically better for the Pisound hat?

I *guess* Patchbox OS would make it easier for getting low latencies regardless of the sound interface (although I did not test it with anything else than the pisound).

Now just to be clear: I don't think Patchbox is better than, say, a properly configured Debian. The trick is in "properly configured", which is likely to take a couple of hours on a Debian, where Patchbox OS comes configured for low latency out of the box.

Same thing for the Pisound: it's probably entirely possible to get it to work on any distrib... it's just that it works out of the box with Patchbox OS.

> I hadn't realized that was your Python library for the nanoKONTROL2. I referred to it when setting up my Akai APC40!

Happy if it could help! :-)

Cheers,

Matthieu

p.s...@outlook.com

unread,
Jan 12, 2024, 3:59:37 PM1/12/24
to pyo-discuss
That's fine, I like out of the box solutions to things as opaque as audio problems! I'll use the USB interface I have for now. Would be nice if I could use that so I can save the GPIO pins for an LCD.

I'm excited about this.

Alexandros Drymonitis

unread,
Jan 13, 2024, 2:09:44 AM1/13/24
to pyo-d...@googlegroups.com
Using the Pisound doesn't restrict you from using the GPIOs of the Pi. The Pisound uses only few of those, like the I2s and I think the I2c interface, which can be combined with other devices, if I'm not mistaken.

Also, I wanted to jump in this thread to point out that the Pi 5 is very powerful, nothing compared to Pi 3. I doubt that you would get CPU issues. You could even try and overclock it, even though the manufacturer states that you shouldn't. Some people have already tried it and got it to work at 3GHz! Mind though to get some active cooling if you do that. 

--
You received this message because you are subscribed to the Google Groups "pyo-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyo-discuss...@googlegroups.com.

p.s...@outlook.com

unread,
Jan 16, 2024, 12:28:22 PM1/16/24
to pyo-discuss
Thank you! That's wonderful to hear on both counts.

I've preordered a Raspberry Pi 5 from the next batch, hopefully arriving in February. I've included an active cooler just in case. If I can push my program I definitely will - 80 sets of loopers was me limiting myself. Would love to add some dynamic filtering to overcome the perceived additional volume of higher-rate playback, for example.

Paul
Reply all
Reply to author
Forward
0 new messages