Installing Sonic Pi on Ubuntu

Can anyone tell me how to install and run Sonic Pi on Ubuntu Linux. I am frustrated. I have gone through many discussions and forums but still haven’t been able to run it in my system. I have inatalled it from the software center and tried compiling on my own from github; but nothing worked.
Can anyone exactly tell if we are able to run Sonic Pi on linux and if so, how?

Thank you.

Hi @tom2321,
Sorry you’re not having much success getting Sonic Pi working on Linux. Keeping in mind that while Sonic Pi on Linux is not ‘officially supported’, you are intended to be able to build it on Linux - there are many folks who have had success, so there are bound to be folks on in_thread that could help you with it.
Depending on your particular system setup, it’s possible that @robin.newman may have a working Sonic Pi build for your version of Ubuntu. Otherwise, it’s definitely recommended to go with compiling it yourself (there are likely to be no up-to-date PPAs for Sonic Pi, and any official deb packages are also quite old).

To start with, a few more details about your setup would be very helpful:

  • What version of Ubuntu are you trying to get it running on?
  • What is the console output when you try to compile it yourself?
1 Like

I am on ubuntu 20.04. When I run build the error I get looks something like this:

c++: fatal error: Killed signal terminated program cc1plus

I am afraid I don’t know much of what is going on. I fell along the instructions at sonic-pi/BUILD-LINUX.md at main · sonic-pi-net/sonic-pi · GitHub.

I think I must revert back to using Windows again.

Up to you, but we’ve barely begun to help you here, so it might be something that is easy for us to resolve for you (and Robin’s Ubuntu Sonic Pi build might work for you too, if that’s enough) :slight_smile:

Can we see more of the console output please? the more context we have, the more we can understand about your system :slight_smile: Perhaps all of the output starting from the line that caused the first error…

Note: Searching around, there are suggestions that this may be due to the compiler running out of memory while trying to compile Sonic Pi. If this is the case, then one way to try to fix this is to add some swap space - basically, a file on the hard drive that the system uses when its physical RAM is full. There are many websites that describe how to do such a thing: https://linuxize.com/post/how-to-add-swap-space-on-ubuntu-20-04/ is one. So that might be an option, depending on what more of your console output says…

Sorry but I think I had some temporary building issues previously. But after restarting the computer I have successfully compiled and build, got an executable sonic-pi. But the problem persists. After a few moments the screen collapses and this is what the output says:

Sonic Pi Boot Error Report

System Information

  • Sonic Pi version: 3.3.1
  • OS: Ubuntu 20.04.3 LTS

GUI Log

/home/tomal/.sonic-pi/log/gui.log

[GUI] -                            
[GUI] -                            
[GUI] -                            
[GUI] - Welcome to the Sonic Pi GUI
[GUI] - ===========================
[GUI] -                            
[GUI] - {9bbdd10e-313a-46ed-a5ff-69fd21fdd740}
[GUI] - ui locale:  en-US
[GUI] - sys locale: en_US
[GUI] - translations available 
[GUI] - Discovering port numbers...
[GUI] - Port entry server-listen-to-gui : 51235 : 51235
[GUI] - Port entry gui-send-to-server : 51235 : 51235
[GUI] - Port entry gui-listen-to-server : 51237 : 51237
[GUI] - Port entry server-send-to-gui : 51237 : 51237
[GUI] - Port entry scsynth : 51238 : 51238
[GUI] - Port entry scsynth-send : 51238 : 51238
[GUI] - Port entry server-osc-cues : 4560 : 4560
[GUI] - Port entry erlang-router : 51239 : 51239
[GUI] - Port entry websocket : 51240 : 51240
[GUI] - Detecting port numbers...
[GUI] - GUI listen to server port 51237
[GUI] -    port: 51237 [OK]
[GUI] - Server listen to gui port 51235
[GUI] -    port: 51235 [OK]
[GUI] - Server incoming OSC cues port 4560
[GUI] -    port: 4560 [OK]
[GUI] - Scsynth port 51238
[GUI] -    port: 51238 [OK]
[GUI] - Server send to GUI port 51237
[GUI] -    port: 51237 [OK]
[GUI] - GUI send to server port 51235
[GUI] -    port: 51235 [OK]
[GUI] - Scsynth send port 51238
[GUI] -    port: 51238 [OK]
[GUI] - Erlang router port 51239
[GUI] -    port: 51239 [OK]
[GUI] - Websocket port 51240
[GUI] -    port: 51240 [OK]
[GUI] - All ports OK
[GUI] - hiding main window
[GUI] - initialising toolbar icons
[GUI] - setting up window structure
[GUI] - restoring scope states 
[GUI] - creating status bar
[GUI] - creating info panel
[GUI] - creating shortcuts
[GUI] - creating tool bar
[GUI] - initialising documentation window
[GUI] - launching Sonic Pi Runtime Server:
[GUI] - starting UDP OSC Server on port 51237...
[GUI] - UDP OSC Server ready and listening
[GUI] - Ruby server pid registered: 4026
[GUI] - wait for sync
[GUI] - waiting for Sonic Pi Server to boot...
............................................................
[GUI] - Critical error! Could not boot Sonic Pi Server.
[GUI] - stopping UDP OSC Server...
[GUI] - Critical Error. Unable to connect to server..
[GUI] - UDP OSC Server no longer listening

Server Errors

/home/tomal/.sonic-pi/log/server-errors.log

Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user
no message buffer overruns
Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user
no message buffer overruns
Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user
no message buffer overruns
ALSA: Cannot open PCM device alsa_pcm for playback. Falling back to capture-only mode
JackTemporaryException : now quits...
Cannot initialize driver
JackServer::Open failed with -1
Failed to open server
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user
no message buffer overruns
Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user
no message buffer overruns
Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user
no message buffer overruns
Cannot lock down 82280346 byte memory area (Cannot allocate memory)
ALSA: Cannot open PCM device alsa_pcm for playback. Falling back to capture-only mode
JackTemporaryException : now quits...
Cannot initialize driver
JackServer::Open failed with -1
Failed to open server
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
terminate called without an active exception

Server Output

/home/tomal/.sonic-pi/log/server-output.log

Sonic Pi server booting...
The time is 2021-09-13 17:29:16 +0600
Using primary protocol: udp
Detecting port numbers...
Listen port: 51235
  - OK
Scsynth port: 51238
  - OK
Scsynth send port: 51238
  - OK
OSC cues port: 4560
  - OK
Erlang port: 51239
  - OK
Websocket port: 4562
  - OK
Opening UDP Server to listen to GUI on port: 51235
Starting Server Runtime
Booting server...


Booting Sonic Pi
----------------

Booting on Linux
Jackd not running on system. Starting...
Boot - Starting the SuperCollider server...
jackdmp 1.9.12
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2017 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK server starting in realtime mode with priority 10
self-connect-mode is "Don't restrict self connect requests"
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:0|hw:0|2048|3|44100|0|0|nomon|swmeter|-|32bit
Released audio card Audio0
audio_reservation_finish
Started [4040] [-] jackd [-] /tmp/sonic-pi-pids/4040
Started [4042] [-] scsynth -u 51238 -a 1024 -m 131072 -D 0 -R 0 -l 1 -i 16 -o 16 -b 4096 -B 127.0.0.1 [-] /tmp/sonic-pi-pids/4042

Scsynth Output

/home/tomal/.sonic-pi/log/scsynth.log

# Starting SuperCollider 2021-09-13 17:29:16
Found 0 LADSPA plugins
jackdmp 1.9.12
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2017 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK server starting in realtime mode with priority 10
self-connect-mode is "Don't restrict self connect requests"
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit
Released audio card Audio0
audio_reservation_finish
could not initialize audio.

Process Log

/home/tomal/.sonic-pi/log/processes.log


	ask-clear.rb


Clearing pids: ["3953", "3939", "3955"]

Clearing [3953]
  -- command jackd
  -- removing /tmp/sonic-pi-pids/3953
  -- politely killing 3953
  -- politely killing 3953
  -- politely killing 3953
  -- force killing 3953
  -- force killing 3953
  -- force killing 3953
  -- force killing 3953
  -- force killing 3953
  -- unable to kill 3953

Clearing [3939]
  -- command /usr/bin/ruby --enable-frozen-string-literal -E utf-8 /home/tomal/Development/sonic-pi/app/build/gui/qt/../../../../app/server/ruby/bin/sonic-pi-server.rb -u 51235 51236 51237 51237 4560 51238 51239
  -- removing /tmp/sonic-pi-pids/3939
  -- politely killing 3939
  -- politely killing 3939
  -- politely killing 3939
  -- force killing 3939
  -- force killing 3939
  -- force killing 3939
  -- force killing 3939
  -- force killing 3939
  -- unable to kill 3939

Clearing [3955]
  -- command scsynth -u 51237 -a 1024 -m 131072 -D 0 -R 0 -l 1 -i 16 -o 16 -b 4096 -B 127.0.0.1
  -- removing /tmp/sonic-pi-pids/3955
  -- unable to get ProcTable info for: 3955
  -- process: 3955 not running

Finished clearing pids

Started [4026] [-] /usr/bin/ruby --enable-frozen-string-literal -E utf-8 /home/tomal/Development/sonic-pi/app/build/gui/qt/../../../../app/server/ruby/bin/sonic-pi-server.rb -u 51235 51237 51238 51238 4560 51239 51240 [-] /tmp/sonic-pi-pids/4026
Started [4040] [-] jackd [-] /tmp/sonic-pi-pids/4040
Started [4042] [-] scsynth -u 51238 -a 1024 -m 131072 -D 0 -R 0 -l 1 -i 16 -o 16 -b 4096 -B 127.0.0.1 [-] /tmp/sonic-pi-pids/4042


I have copied and pasted the exact output. I hope anyone can help. I am really in love with sonic-pi. I have used it in Windows previously and did a lot fun stuff :slight_smile:

Great that you got it compiling, and I’m glad that when Sonic Pi works for you, you’re enjoying it - that’s the most important thing :grinning_face_with_smiling_eyes:

As to your current issue:
The messages from server-errors.log…

Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user

…makes me suspect that your user is not set up for real-time system access.
See here for how to address this:
https://jackaudio.org/faq/linux_rt_config.html

Have a go at following the directions there - that should hopefully be enough to get Sonic Pi booting correctly. If not, we can try to help you further :slight_smile:

1 Like

maybe Jack is not running at all. You have to launch Jack before sonic pi. You can use qjackctl to control Jack :slight_smile:

Not quite - Jack is started automatically if it is not detected as already running :slightly_smiling_face: see here:

oups sorry ! it was an old souvenir :-). There was a time we had to check that point no ?

Once upon a time, yes :slightly_smiling_face:

1 Like

Goodness gracious. IT WORKED!!!
I think there was problem regarding my jack server. I got error After I ran the command qjackctl in my terminal and tried to start jack. I went searching for it and the below link solved it. I was able to run sonic-pi. A great feeling!!!

I hope this helps.

Thank you very much @ethancrawford for helping with your attention. @nlb thank you for informing about qjackctl. :smiley: :smiley: :smiley:

2 Likes

You’re welcome - sounds like nlb was on the right track talking about qjackctl! :man_shrugging: :grinning_face_with_smiling_eyes:

good news @tom2321 ! you know @ethancrawford we’re never enough to lend a hand when it comes to mastering Jack :grinning:

Hello everyone!
Please… if anyone can help me out, please…
How can I install 4.3 Sonic-Pi on 22.04 Ubuntu Linux?

I tried usign flatpak but I could not get any sound with jack audio…

Is there any reasonable how-to guide for installation?

Thank you so much!!!

Hi @ieysimurra,

if there isn’t currently a package for v4.3 for your Linux distro then the best way to get it on your system is to build it from source: sonic-pi/BUILD-LINUX.md at dev · sonic-pi-net/sonic-pi · GitHub

1 Like

dear @samaaron!

Thank you so much!
It worked very well with sound! :slight_smile:

thank you for the support!
Cheers!

Just built latest SP from source on a virtual Ubuntu 22.04 running on my Mac. Fairly straightforward once I’d worked out the packages to install. Qt packages install a bit different than for Debian.

Basically following the Linuux build instructions for Debian on Github I just built successfully the latest Sonic Pi v4.5.0 on Ubuntu 23.10 (mantic) from source.

At first my build failed. In order to succeed I had to do the following:

  1. Install Ninja for Python.
sudo apt-get install python3-jinja2
  1. Probably due to missing support for gcc/cpp version 13 in Microsofts vcpkg I had to make a small change in the file sonic-pi/app/linux-pre-vcpkg.sh where I had to change the VCPKG_BRANCH date from 2023.10.19 to its most current version of 2023.12.12. I also had to remove the already fetched directory sonic-pi/app/vcpkg before restarting linux-build-all.sh.

Additional note: After I started sonic-pi everything worked fine, except I could not get any sound out of it. I guess this is due to the fact that my system uses two additional sound cards in addition to the built in sound device on the mother board. Since I havent used Sonic Pi on this computer for about two years, I didn’t realize that it got PipeWire installed and my previous configuration with PukseAudio and Jack obviousely no longer works.

To fix this problem I first started Sonic Pi and after it was running I opened qpwgraph which I found in my Apps. This showed me that SuperCollider’s out_1 and out_2 were attached to the Built-in Audio Analog Stereo which I’m normally not using. It was easy to change that to another output device, but after a restart the config got lost again. Not very nice, but I hope to find a solution that somehow allows me to use a pre-configured device setup.

However, I’m happy I’ve got my Sonic Pi back again! :slightly_smiling_face:

You can use the pw-link utility (should already be installed) to link to specified outputs. I have written some ruby based routines to do this which can be run from Sonic Pi. You could load into init.rb for example. See here