Ardour on Raspberry Pi 4 B

Hi -

I’m having some trouble getting Ardour to run on my Raspberry Pi 4 B. I hope somebody can offer some help.

I’m running Ubuntu 24 LTS, mainly because it’s got a realtime kernel available standard (well, you need a pro account, but they’re free).

Cyrus Adkisson reported success with this model five years ago:

The biggest difference I see between my setup and Cyrus’s is that I’m using the Pi’s onboard audio (“bcm2835 Headphones”) instead of a hifiberry.

A hifiberry sounds like a very good idea, but since the onboard audio playback sounds OK when I’m using mpg321 to play an mp3, I figure Ardour should work too.

Unfortunately, Ardour’s sound quality is terrible. I’ve tried both ACE Reasonable Synth and importing an mp3 with the same results. Sound is very “choppy”; a bit like lots of xruns, but there are no xruns (or very few). ALSA or jack both act the same way. Nothing in the messages window to suggest what might be the problem. The stock ardour from the repository and one compiled from the github tree both act the same way.

Any ideas what the problem might be?

My hope for this project is to mount the Raspberry Pi inside a Williams Allegro 1 keyboard that I picked up used and replace the keyboard’s sound engine with Ardour, to get a keyboard that runs Linux.

Thanks in advance for any feedback anybody can offer.

agape
brent

What are your buffer settings ? Are you using ALSA , Jack, or Pipewire ?

I’ve tried both ALSA and Jack, with both 256 and 1024 byte buffers at both 44.1 kHz and 48 kHz.

I’ve haven’t tried every combination.

For testing, I’ve pretty much settled on ALSA at 44.1 kHz with a 1024 byte buffer. I figure the larger buffer size should be easier, ALSA is simpler, and one my main tests is to import a 44.1 kHz mp3 into a track and then play it back.

Are able to try with the non real-time kernel ?

I have not used a Pi before. Just guessing at this point.

Thanks for guessing. No really - that’s what I’m doing, too, and I hoping that somebody else either knows or can guess better than me!

Yes, I’ve been trying it with the standard kernel. Same results.

Do yourself a favour and use an audio hat or an external USB audio interface. Even a cheap Behringer €30 interface will give you better results.

2 Likes

@SpotlightKid, I think you’re right.

The more I listen to it, the mp3 audio doesn’t sound very good. Looking at the documentation, I see that the processor creates audio using pulse width modulation, which is then fed through some kind of simple RC filter to the audio jack.

I think the answer to my question is that I’m just not going to get very good audio from the Pi’s built in audio interface.

I’ve recorded several hours of podium discussions using Ardour on a RPi3 Model B+ with Pisound HAT, with very good results, about 5 years ago. But any ALSA supported USB soundcard should work, and like SpotlightKid I I’d also give up on the builtin sounddevice/3,5mm jack.

With the RPi 3 the GUI was very laggy and used to freeze for several seconds, it couldn’t quite keep up with updating the waveforms in the recorded regions during recording. Later I changed it for a RPi4 where these hangs almost completely went away. And recently for a RPi5 but I haven’t tried Ardour on it yet.

I used blokaslabs’ Patchbox OS which is very easy to install, configure and get going.

Thanks again for all the good advice.

The main thing I’m wondering about now is the difficulty of running multiple sound devices with Ardour.

I’m thinking about getting some kind of HAT (Hardware On Top - boards that plug in to the Raspberry Pi’s 40 pin GPIO connector, like the Pisound HAT that Edgar mentioned); the other option is a USB-attached device.

But if I get a HAT that only outputs audio, how much trouble would it then be to add a USB device to record audio? In one sense, this is simple, but in other sense it’s not, because now we’ve got two sound devices clocked independently of each other and I’m not sure if this is going to be a big problem.

In short - should I get a simple HAT now, or is it best to get a more expensive one because it’ll be hard to add a second audio device?

That requires real time resampling. Not really a problem on a normal desktop machine, but I’m not sure a Pi 4 has the processing power to spare.

The situation with two interfaces is common enough that Paul wrote an Ardour site page specifically recommending against doing that:
Say No to USB Microphones
The given context is USB microphones, because that is the second interface most commonly mentioned, but it applies to any time you have multiple interfaces running from independent clocks (not applicable in the case of pro studio equipment which is synchronized through network clock, word clock, MADI, etc.).

If you think you will want to record with the Pi, and not just mix, and you do not want to use an external USB interface, then you might as well get a decent hat now rather than getting a playback hat now, then a recording hat later, then a third playback and recording hat when you are not satisfied with the performance you have when using separate playback and recording devices.

1 Like

Update:

I bought a HiFiBerry DAC2 Pro and it works great!

I picked the DAC2 Pro because it has an on-board amplifier, so I can plug a pair of headphones into it. Once I get the audio wired into the keyboard’s built-in amplifier, I’m planning to switch to a HiFiBerry DAC2 ADC Pro, which has audio input but no amplifier on its audio output, avoiding any problems with resampling.

As I posted earlier, I’m running Ardour 8.10 on Ubuntu 24 Pro with its realtime kernel. I’ve compiled Ardour, sfizz 1.2.3 and dexed 0.9.0 from source. These two, along with Yoshimi 2.3.2, which is available in the Ubuntu 24 repository, are my three LV2/VST3 instruments. My main sfz instruments are the Salamander piano and the AVL drumkits.

No directly attached video. I’m running Ardour headless in a tigervnc server that I connect to from an Android tablet running a VNC client. The HiFiBerry seems to substantially degrade the Pi’s WiFi performance, to the point where I use an Ethernet cable. Also, GNOME desktop on a VNC server doesn’t seem to work on Ubuntu 24, plus GNOME seems awfully heavy for an embedded device, so I just FVWM for a window manager. You do need some kind of basic window manager to close popup windows, but I run Ardour in full screen mode; it’s now the keyboard’s GUI.

I do get occasional xruns on a single song that uses a lot of polyphony, and there’s some kind of bug in dexed/juce that occasionally locks up the entire program, but it works fine 99 percent of the time.

I experimented a bit with Zynthian, but I’m much happier with Ardour since it’s so much more featureful and gives far fewer xruns.

I’ve also identified where in the keyboard’s circuitry that I cut into its MIDI and audio lines. Right now, I’m still have the Raspberry Pi sitting next to the keyboard, but I’m planning to mount it inside the keyboard case in the near future.

In short, I keep moving closer to having a Linux keyboard that I can take out busking and gigging, and am absolutely delighted with it!