Sonic doesnt launch on Raspberry Pi Buster OS

Hello,
I installed Sonic-pi on Buster installing following packages apt install sonic sonic-pi-samples sonic-visualiser sonic-pi sonic-pi-server sonic-pi-dbgsym sonic-pi-server-doc
But sonic doesnt launch. I just get the smiling face , the first screen comes up and nothing else.

Same thing happens on Linux Mint 19.2 also.
Any advise please?

qjackctl gives error "Jack server could not be started.

indent preformatted text by 4 spaces 16:36:13.116 ALSA connection change.

16:36:13.123 D-BUS: Service is available (org.jackaudio.service aka jackdbus).
16:36:13.217 D-BUS: JACK server could not be started. Sorry
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
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

Hi Deepack

On the latest version of Buster, there is a version of Sonic Pi available which should be installed automatically. If not then sudo apt update followed by sudo apt install sonic-pi should install it for you.
Unfortunately, although it announces itself as version 3.1 is is in fact a cut-down version which does NOT support OSC or midi, and so is a little limited in scope, although.
For a full version of 3.1 or later you have at present got to build it yourself from source.

Hi Robin,
Sonic Pi wasnt automatically installed on Buster. I am using Buster , fully updated.I ran sudo apt update followed by sudo apt install sonic-pi But the status didnt change .

Are you using Buster on a Raspberry Pi or solely on other linux?
EDIT

I tried on my Raspberry Pi 4
sudo apt update
sudo apt install sonic-pi
and it installed the cutdown Sonic Pi ok, so not sure why yours didn’t work.

I run Buster on the Pi, but its an early model hence when I run sonic-pi it stalls. ```
Its Rasperry pi model B Rev 1 , 32 bit where as you have latest and powerful model.

So I try to run sonic-pi on my Mint 19.2 desktop. But I am running into same problems.
I opened a thread at Mint forum. https://forums.linuxmint.com/viewtopic.php?f=47&t=305633&p=1716729#p1716729

Ah that explains some of your problems. I don’t think that version of SP on Buster will run on such an old machine with its limited memory. You would be better downgrading to Stretch and running SP 3.0.1 on it.

As regards your problems with linuxmint, you certainly want to have qjackctl running AND started before attempting to run Sonic Pi. Otherwise it may try to launch scsynth itself, and qjackctl will not be able to launch a second copy. You can make sure that no copies are running before launching either of them using killall jackd

It will also be useful to look at the Sonic Pi logs which are in your home folder in a sub-folder named .sonic-pi/log
To get there try:

cd ~
cd .sonic-pi/log
ls

It is worth inspecting all the log files. (You can use cat <filename> or open the log with a browser window and use a text editor) In particular server-errors.log server-output.log and scsynth.log

They should indicate the source of any problems.

Thank you for your post. I am a Unix and Linux veteran so wont need the tips on how to open log files. :). qjackctl can run on Mint now as explained on the Mint link , yet sonic-pi wont run.

I have customized the Buster a lot and want to avoid going to Stretch and do all the customisation again. Hence I am trying to get Sonic running on Mint.

The logs
/.sonic-pi/log $ ls -lt
total 16
-rw-rw-r-- 1 uma uma 482 Nov 20 13:35 gui.log
-rw-rw-r-- 1 uma uma 99 Nov 20 13:34 server-output.log
-rw-rw-r-- 1 uma uma 1056 Nov 20 13:34 server-errors.log
-rw-rw-r-- 1 uma uma 212 Nov 20 13:34 scsynth.log
-rw-r–r-- 1 uma uma 0 Nov 20 13:34 debug.log
(base) uma@mint-18-uma ~/.sonic-pi/log $ cat gui.log
[GUI] - using default editor colours
[GUI] - shutting down any old audio servers…
[GUI] - starting UDP OSC Server on port 4558…
[GUI] - UDP OSC Server ready and listening
[GUI] - booting live coding server
[GUI] - waiting for server to boot…
…[GUI] - server failed to start with this error message:
> Server Exception:
Boot - Unable to connect to SuperCollider

[GUI] - Critical error! Could not boot server.
(base) uma@mint-18-uma ~/.sonic-pi/log $
(base) uma@mint-18-uma ~/.sonic-pi/log $ cat server-output.log
Sonic Pi server booting…
Using protocol: udp
Server is exiting.
Shutting down GUI…
Goodbye :slight_smile:
(base) uma@mint-18-uma ~/.sonic-pi/log $ cat server-errors.log
Failed to start server: Boot - Unable to connect to SuperCollider
/usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/scsynthexternal.rb:292:in boot_and_wait' /usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/scsynthexternal.rb:392:in boot_server_linux’
/usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/scsynthexternal.rb:181:in boot' /usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/scsynthexternal.rb:29:in initialize’
/usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/server.rb:73:in new' /usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/server.rb:73:in initialize’
/usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/studio.rb:102:in new' /usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/studio.rb:102:in init_studio’
/usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/studio.rb:43:in initialize' /usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/lang/sound.rb:123:in new’
/usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/lang/sound.rb:123:in block (2 levels) in included' /usr/lib/sonic-pi/server/bin/sonic-pi-server.rb:99:in new’
/usr/lib/sonic-pi/server/bin/sonic-pi-server.rb:99:in `’
(base) uma@mint-18-uma ~/.sonic-pi/log $ cat scsynth.log

Starting SuperCollider 2019-11-20 13:34:10

Found 0 LADSPA plugins
JackDriver: client name is ‘SuperCollider’
SC_AudioDriver: sample rate = 44100.000000, driver’s block size = 1024
SuperCollider 3 server ready.

The command is killall jackdbus. In Linux its easy to know the parameter by hitting tab key. :grinning: Now the next problem is resolving the following error.

Unable to connect to SuperCollider.

The qjackctl messages are

Wed Nov 20 14:00:22 2019: Client 'qjackctl' with PID 8192 is out

Wed Nov 20 14:00:22 2019: Stopping jack server…
Wed Nov 20 14:00:22 2019: Client ‘system’ with PID 0 is out
Wed Nov 20 14:00:22 2019: Client ‘PulseAudio JACK Sink’ with PID 4283 is out
Wed Nov 20 14:00:22 2019: Client ‘PulseAudio JACK Source’ with PID 4283 is out
Wed Nov 20 14:00:22 2019: ERROR: Cannot write socket fd = 20 err = Broken pipe
Wed Nov 20 14:00:22 2019: ERROR: CheckRes error
Wed Nov 20 14:00:22 2019: ERROR: Could not write notification
Wed Nov 20 14:00:22 2019: ERROR: ClientNotify fails name = system notification = 1 val1 = 0 val2 = 0
Wed Nov 20 14:00:22 2019: Released audio card Audio1
Wed Nov 20 14:00:22 2019: Released audio card Audio0
Wed Nov 20 14:00:23 2019: ERROR: Cannot write socket fd = 16 err = Broken pipe
Wed Nov 20 14:00:23 2019: ERROR: CheckRes error
Wed Nov 20 14:00:23 2019: ERROR: Could not write notification
Wed Nov 20 14:00:23 2019: ERROR: ClientNotify fails name = freewheel notification = 1 val1 = 0 val2 = 0
Wed Nov 20 14:00:23 2019: ERROR: Cannot write socket fd = 20 err = Broken pipe
Wed Nov 20 14:00:23 2019: ERROR: CheckRes error
Wed Nov 20 14:00:23 2019: ERROR: Could not write notification
Wed Nov 20 14:00:23 2019: ERROR: ClientNotify fails name = freewheel notification = 1 val1 = 0 val2 = 0
14:00:24.345 D-BUS: JACK server is starting…
14:00:24.407 D-BUS: JACK server was started (org.jackaudio.service aka jackdbus).
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
Wed Nov 20 14:00:24 2019: Starting jack server…
Wed Nov 20 14:00:24 2019: JACK server starting in realtime mode with priority 10
Wed Nov 20 14:00:24 2019: self-connect-mode is “Don’t restrict self connect requests”
Wed Nov 20 14:00:24 2019: Acquired audio card Audio1
Wed Nov 20 14:00:24 2019: Acquired audio card Audio0
Wed Nov 20 14:00:24 2019: creating alsa driver … hw:0|hw:Generic|1024|2|44100|0|0|nomon|swmeter|-|32bit
Wed Nov 20 14:00:24 2019: ERROR: ALSA: Cannot open PCM device alsa_pcm for playback. Falling back to capture-only mode
Wed Nov 20 14:00:24 2019: configuring for 44100Hz, period = 1024 frames (23.2 ms), buffer = 2 periods
Wed Nov 20 14:00:24 2019: ALSA: final selected sample format for capture: 32bit integer little-endian
Wed Nov 20 14:00:24 2019: ALSA: use 2 periods for capture
Wed Nov 20 14:00:24 2019: graph reorder: new port ‘system:capture_1’
Wed Nov 20 14:00:24 2019: New client ‘system’ with PID 0
Wed Nov 20 14:00:24 2019: graph reorder: new port ‘system:capture_2’
Wed Nov 20 14:00:24 2019: New client ‘PulseAudio JACK Sink’ with PID 4283
Wed Nov 20 14:00:24 2019: New client ‘PulseAudio JACK Source’ with PID 4283
Wed Nov 20 14:00:24 2019: Connecting ‘system:capture_1’ to ‘PulseAudio JACK Source:front-left’
Wed Nov 20 14:00:24 2019: Connecting ‘system:capture_2’ to ‘PulseAudio JACK Source:front-right’
Wed Nov 20 14:00:25 2019: Saving settings to “/home/uma/.config/jack/conf.xml” …
14:00:26.497 JACK connection change.
14:00:26.499 Server configuration saved to “/home/uma/.jackdrc”.
14:00:26.502 Statistics reset.
14:00:26.529 Client activated.
14:00:26.531 Patchbay activated.
14:00:26.533 Post-startup script…
14:00:26.536 pacmd set-default-sink jack_out
14:00:26.599 JACK connection graph change.
Wed Nov 20 14:00:26 2019: New client ‘qjackctl’ with PID 8192
14:00:26.953 Post-startup script terminated successfully.
14:00:26.960 JACK active patchbay scan…
14:00:26.964 ALSA active patchbay scan…

Hmm. I think Linux mint 19.2 is based on Ubuntu 18.04 The packages for that are for Sonic Pi 2.10.0~repack-2.1 which is quite an old version. The same is true for Debian Buster general distribution. The specific Raspberry Pi version has an additional package for a cut down Sonic-Pi 3.1. This version will not support midi or OSC functions. It is not clear what exactly you have installed.
The logs you have are slightly unfamiliar in format, and it looks like you have concatenated the separate files. From what I can see scsynth is launching OK. Usually when the server fails in that case it is because the port allowing communication between the ruby server and scsynth is not availalbe. Later versions make this very clear in the log files.
These are the ports up to version 3.1
Detecting port numbers…

Send port: 4558
Listen port: 4557
  - OK
Scsynth port: 4556
  - OK
Scsynth send port: 4556
  - OK
OSC cues port: 4559
  - OK
Erlang port: 4560
  - OK
OSC MIDI out port: 4561
  - OK
OSC MIDI in port: 4562
  - OK

They have changed in later versions. In versions before 3.1 the OSC cues, Erlang and OSC MIDI are not relevant. So check that ports 4556,7 and 8 are available, before starting Sonic Pi. The code which connects to scsysnth is in the file scsynthexternal.rb in the lib/sonicpi folder. Note this folder is in different positions in the source tree depending on the version you are using. It changes for version 3.2dev

Personally, if you are experienced in Linux I would have a go at building the latest 3.2dev version from source. It has much better facilities available in it. There are instructions for building on various versions of Ubuntu referenced in this site (search for ubuntu or mint), and some present in the github distro in the sonic-pi/app/gui./qt folder.
For Buster I have a recipe posted here

Yes Mint 19.2 is based on Ubuntu 18.04. I just installed the Sonic packages from the Mint 19.2 repositories with apt-install commands. The packages I installed are sonic sonic-pi-samples sonic-pi-server-doc sonic-pi sonic-pi-server sonic-visualiser I installed the doc package but am not sure how to view the docs on the system. You are correct , its Sonic version 2.1. I am learning Sonic hence even 2.1 is good initially. Since the installed packages did not work out I found that qjackctl running is a pre requisites. Now that is out of the way. Indeed ports 4556,7 and 8 are available otherwise netstat would indicate some process binding the ports but it doesnt. Please see command output sudo netstat -ntlp|grep 45 [sudo] password for uma: (base) uma@mint-18-uma ~ $
I did try building version 3.2 from source . I followed this link
Ubuntu 18.04 Sonic 3.2 dev build But it failed in the end exiting with error code 2. To debug this is beyond me as it would require a good grasp on Sonic, git and Linux shell scripting.
I hav not conconated any log files. I just did cat file1 one after other for all the log files. The cat command is visible between the contents of 2 files. I had copied and pasted the output of all the files.

On Mint I started qjackctl first , then sonicpi. The server-errors-log is

  Failed to start server: Boot - *Unable to connect to SuperCollider*

/usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/scsynthexternal.rb:292:in boot_and_wait' /usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/scsynthexternal.rb:392:in boot_server_linux’
/usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/scsynthexternal.rb:181:in boot' /usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/scsynthexternal.rb:29:in initialize’
/usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/server.rb:73:in new' /usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/server.rb:73:in initialize’
/usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/studio.rb:102:in new' /usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/studio.rb:102:in init_studio’
/usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/studio.rb:43:in initialize' /usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/lang/sound.rb:123:in new’
/usr/lib/sonic-pi/server/sonicpi/lib/sonicpi/lang/sound.rb:123:in block (2 levels) in included' /usr/lib/sonic-pi/server/bin/sonic-pi-server.rb:99:in new’
/usr/lib/sonic-pi/server/bin/sonic-pi-server.rb:99:in <main>' If we somehow tackle the Failed to start server: Boot - Unable to connect to SuperCollider` that would be one step ahead.

When I tried to build the Sonic from source, git clone,make etc added 3 gb extra to my system. I had a Clonezilla backup . I reverted to it and Mint doesnt have the failed sonice build now.

Looking at your logs it looks like it is failing in the program scsynthexternal.rb lin 392 where it is trying to start scsynth with current jack settings. from qjackctl.synth
Your scsynth log shows an instance started, with correct sample rate 41000 but there is no connetion made from SP.
I wonder what your configuration of Qjackctl is? This works for me.

Make sure it is running with this config and the server is started before running Sonic Pi.

Also make sure that scsynth is NOT running before you start SP.
use killall scsynth to check

If you still have problems, it may be that the version of scsynth you are running is too new for the code in version 2.10 Later versions require at least one additional parameter in the starting configuration.
In line 392 you may need to change the line from
boot_and_wait("scsynth", "-u", @port.to_s, "-m", "131072", "-a", num_audio_busses_for_current_os.to_s, "-D", "0", "-R", "0", "-l", "1")
to
boot_and_wait("scsynth", "-u", @port.to_s, "-m", "131072", "-a", num_audio_busses_for_current_os.to_s, "-D", "0", "-R", "0", "-l", "1", "-B" , "127.0.0.1")

later versions may respond to scsynth -v to give a version number.

Thank you so much .
I changed the 392nd line to boot_and_wait("scsynth", "-u", @port.to_s, "-m", "131072", "-a", num_audio_busses_for_current_os.to_s, "-D", "0", "-R", "0", "-l", "1""-B" , "127.0.0.1")
I changed the qjackctl options according to your 4 screen shots.
I started qjackctl
Started sonic pi with terminal command sonic-pi. Yet it coudnt be started.
The current logs

  Sonic Pi Boot Error Report

==================

System Information

  • Sonic Pi version: 2.10.0
  • OS: Linux Mint 19.2

GUI Log

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

[GUI] - using default editor colours
[GUI] - shutting down any old audio servers...
[GUI] - starting UDP OSC Server on port 4558...
[GUI] - UDP OSC Server ready and listening
[GUI] - booting live coding server
[GUI] - waiting for server to boot...
............................................................
[GUI] - Critical error! Could not boot server.

Server Errors

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


Server Output

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

Sonic Pi server booting...
Using protocol: udp

Scsynth Output

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

# Starting SuperCollider 2019-11-21 18:41:06
ERROR: Invalid option 127.0.0.1
supercollider_synth  options:
   -v print the supercollider version and exit
   -u <udp-port-number>    a port number 0-65535
   -t <tcp-port-number>    a port number 0-65535
   -B <bind-to-address>    an IP address
   -c <number-of-control-bus-channels> (default 16384)
   -a <number-of-audio-bus-channels>   (default 1024)
   -i <number-of-input-bus-channels>   (default 8)
   -o <number-of-output-bus-channels>  (default 8)
   -z <block-size>                     (default 64)
   -Z <hardware-buffer-size>           (default 0)
   -S <hardware-sample-rate>           (default 0)
   -b <number-of-sample-buffers>       (default 1024)
   -n <max-number-of-nodes>            (default 1024)
   -d <max-number-of-synth-defs>       (default 1024)
   -m <real-time-memory-size>          (default 8192)
   -w <number-of-wire-buffers>         (default 64)
   -r <number-of-random-seeds>         (default 64)
   -D <load synthdefs? 1 or 0>         (default 1)
   -R <publish to Rendezvous? 1 or 0>  (default 1)
   -l <max-logins>                     (default 64)
          maximum number of named return addresses stored
          also maximum number of tcp connections accepted
   -p <session-password>
          When using TCP, the session password must be the first command sent.
          The default is no password.
          UDP ports never require passwords, so for security use TCP.
   -N <cmd-filename> <input-filename> <output-filename> <sample-rate> <header-format> <sample-format>
   -H <hardware-device-name>
   -V <verbosity>
          0 is normal behaviour
          -1 suppresses informational messages
          -2 suppresses informational and many error messages
   -U <ugen-plugins-path>    a colon-separated list of paths
          if -U is specified, the standard paths are NOT searched for plugins.
   -P <restricted-path>    
          if specified, prevents file-accessing OSC commands from
          accessing files outside <restricted-path>.

To quit, send a 'quit' command via UDP or TCP, or press ctrl-C.


Then I removed 127.0.0.1 from line 392, again started sonic pi after starting qjackctl. Yet there is no joy.
scsynth -v
scsynth 3.8.0 (Built from branch ‘not_a_git_checkout’ [na])
In the terminal when I run sonic-pi There is error

[GUI] - could not open file /proc/asound/card0/pcm0p/info
libpng warning: iCCP: known incorrect sRGB profile

Even after running qjackctl and sonic-pi ,killall scsynth scsynth: no process found

I saw this for Ubuntu 19.04 at Build under ubuntu 19.04 DISCO

The recommendation is
git clone https://github.com/samaaron/sonic-pi.git
$ cd sonic-pi/app/gui/qt
Get the ubuntu-disco build script, make it executable and start it

Copy Code
$ wget https://raw.githubusercontent.com/samaaron/sonic-pi/5e58c2b44afe535c87fe7246e22b4ec79461c7c9/app/gui/qt/build-ubuntu-disco-app
$ chmod +x build-ubuntu-disco-app
$ ./build-ubuntu-disco-app
Or are there any tweeks for 18.04 , or are there any changes now as the comment is date July 10th.

I did sudo apt install libssl-dev

Hi there
You definitely do not need the -B addition if your version of scsynth is 3.8 That is what was current when SP 2.10 was released. I’m not sure why it is not linking to scsynth as it seems to be starting, according to the scsynth log. I suspect possible problems with the osc link to it, or the one linking the gui and the server. It is difficult to say without hands on your linux mint machine of which I have no experience.
You can see that even with Ubuntu 19.04 some have had difficulties. I have built SP using that script on a pristine virtual Ubuntu 19.04, but personally I am not a fan of script installs, because it is difficult to debug when things go wrong. I prefer to have a recipe of instructions and to carry them out one by one. That way you can see more easily when steps go wrong.
Most of the linux build recipes are very similar. They differ sometimes in package names for supporting packages. Often that is solved by looking at the library you want then searching the distro you are using to see which package installs it. You can get an idea from my Buster Raspberry Pi instructions, but I don’t think it would work on your model B which is unlikely to have enough memory. However building on Linux Mint shouldn’t be too much different from that.

EDIT

you might get some help from the author of this post

So I changed back the line to the original `boot_and_wait(“scsynth”, “-u”, @port.to_s, “-m”, “131072”, “-a”, num_aud io_busses_for_current_os.to_s, “-D”, “0”, “-R”, “0”, “-l”, “1”)

I can folow the instructions for Mint , but the little difference is sometimes decisive and causes the install to fail.

I have bumped that topic with a comment, wil wait for any response.

Thanks once again for your patience.

I am running Mint 19.2 which is based on Ubuntu 18.04. The install for SP was version 2.1 . In Mint community another use who had Mint 18.3 based on Ubuntu 14 was able to install SP without any problem. He got version 2.9. Strange that Mint 19.2 has SP 2.1 and Mint 18.3 has SP 2.9

Hi there,
Is there anyway can the sonic pi open automatically
while raspberry pi start up?
(By the way, I’m making the project in the university, my topic named music lock , which the door can be opened if the rhythm and pitch someone play is corresponded to the password I set. In this project, i need some technique to achieve. including the use of sonic pi ,touchosc, raspberry pi etc. There’s many method of use I was learned from you through some article or youtube channel. All I want to say is sincerely thank you so much for all of your tutorials in details and of your academic contributions)

1 Like