Running Sonic Pi Crashes My Audio (RPi)

Noticing Sonic Pi was in the Pi OS repository (for 64-bit), I installed it using:

sudo apt install sonic-pi

Upon running it however, I was immediately presented with a loud unpleasant buzzing sound. This became even louder about every second as additional buzzing appeared to be overlaid.

This buzzing only stopped after having shut down and restarted Sonic Pi, however subsequently playing any audio resulted in the same effect, whether Sonic Pi was running or not.

Playing examples in Sonic Pi produced no audio, though was captured by the record function.

This crashed audio was reset successfully with a reboot, however the behaviour continued with any audio playback once Sonic Pi had been run.

Would it matter that I was playing audio while loading Sonic Pi the first time?

Hi Anthony
Which version of Raspberry Pi OS are you using, and also which version of Sonic -Pi
The latest version should be downloaded from sonic-pi.net and installed by right clicking and selecting install. However a good idea to remove any other versions first.
This requires the latest Raspberry Pi 64 bit OS to work.
if you are using sudo apt insteall Sonic Pi that is probably installing an old version.

You may find this useful

Well that’s interesting; thanks for getting back to me. I tried ascertaining the version number from running ‘sonic-pi --version’ at the command line (to avoid running it and crashing the audio again), but it just ran. The version is 3.2.2.

The OS version I am using is 64-bit (as mentioned) Bookworm, and it’s a Pi 5, so I’m struggling to understand why the repository would hold what seems to be such a dated version, given the current version is 4.5.1.

I would have thought that if your software had made it in to such a repository, you’d want to ensure it was up-to-date. Is it a lot of hassle to do that? If so, why don’t you have it removed from the repository?

OK, I have to re-boot now :upside_down_face:

I should probably have mentioned that I’m using the X11 (Openbox) desktop. I don’t see any mention of any requirements about that, but maybe that’s because the link for the full installation instructions seems to be broken:

https://sonic-pi.net/files/releases/v4.5.1/README-Sonic-Pi-Raspberry-Pi-OS.txt

Yes 3.3.2 will not work audio wise on the bookworm based os which defaults to using pipewire.
It is difficult to make a standard install package for sonic pi and instead I produce a binary install for the raspberry pi for each version since 4. This installs and works well. The 3.2.2 has been developed externally as a standard package and has not been upgraded. Remove it using

sudo apt purge sonic-pi

Then download the latest RPi version from sonic-pi.net and right click it and select install

Refer to the video in my previous post for help in adjusting audio

Is this not equivalent to sudo dpkg -i packagename.deb? This gives me dependency errors, following which rt-click Package Install gives a warning, asks for a password then kind of vanishes. Trying again does the same but without the warning.

just purged my install and tried graphical install right clicking icon and selecting install. put in password when prompted under xbox X11 worked ok on Pi5 both with hdmi audio and bluetooth to my headphones. using qwgraph to switch

OK. Just purged with dpkg -P, reinstalled using Package Install and all is fine.

I thought it was weird that there was no message to say it had finished installing though. Maybe it did it before but I looked for Sonic Pi in Sound & Video instead of Programming. I keep doing that.

I understand that I could have used apt install ./package.deb rather than dpkg -i package.deb to install with the dependencies, and that I could have tried apt install -f to fix the dependencies.

I appreciate the support, thank you Robin. I’m still puzzled as to why there seems to be a zombie version 3.2.2 (if that’s what it is) lurking in the repository though.

The 3.2.2 version is not under the control of the Sonic Pi development team.
There is an alternative flatpak version (again independently created) which for example runs on Ubuntu 24.04 LTS although there are reports of problems with Ubuntu 24.01