Closed NoozAbooz closed 2 years ago
1) It might be an issue with Sonic Pi failing to start jackd, which is required to run sonic pi. Try installing and using qjackctl to start jackd before opening Sonic Pi. :) 2) You're using an outdated version of Sonic Pi, I'd recommend downloading the newest version v3.2.2 from https://sonic-pi.net/, which may also fix some issues. :)
Hi @mobilegmYT. SunderB is correct - and regarding the second point, unfortunately the version of Sonic Pi that is bundled with the Raspberry Pi is partially broken/incomplete, as it was a build created outside of Sam's/the core team's control. Thankfully Robin Newman very kindly put together the more up to date/functional version that you can access from the Sonic Pi website as SunderB has alluded to above 🙂 I would start by downloading and testing that first.
/home/pi/.sonic-pi/log/gui.log
[GUI] - Welcome to the Sonic Pi GUI
[GUI] - ===========================
[GUI] -
[GUI] - {48d18618-d5b7-4688-bd60-0c09b13e795b}
[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 : 51236 : 51236
[GUI] - Port entry server-send-to-gui : 51236 : 51236
[GUI] - Port entry scsynth : 51237 : 51237
[GUI] - Port entry scsynth-send : 51237 : 51237
[GUI] - Port entry osc-midi-out : 51238 : 51238
[GUI] - Port entry osc-midi-in : 51239 : 51239
[GUI] - Port entry server-osc-cues : 4560 : 4560
[GUI] - Port entry erlang-router : 51240 : 51240
[GUI] - Port entry websocket : 51241 : 51241
[GUI] - Detecting port numbers...
[GUI] - GUI listen to server port 51236
[GUI] - port: 51236 [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 51237
[GUI] - port: 51237 [OK]
[GUI] - Server send to GUI port 51236
[GUI] - port: 51236 [OK]
[GUI] - GUI send to server port 51235
[GUI] - port: 51235 [OK]
[GUI] - Scsynth send port 51237
[GUI] - port: 51237 [OK]
[GUI] - Erlang router port 51240
[GUI] - port: 51240 [OK]
[GUI] - OSC MIDI out port 51238
[GUI] - port: 51238 [OK]
[GUI] - OSC MIDI in port 51239
[GUI] - port: 51239 [OK]
[GUI] - Websocket port 51241
[GUI] - port: 51241 [OK]
[GUI] - All ports OK
[GUI] - launching Sonic Pi Runtime Server:
[GUI] - Ruby server pid registered: 21141
[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] - wait for sync
[GUI] - waiting for Sonic Pi Server to boot...
[GUI] - starting UDP OSC Server on port 51236...
[GUI] - UDP OSC Server ready and listening
............................................................
[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
/home/pi/.sonic-pi/log/server-errors.log
ALSA: Cannot open PCM device alsa_pcm for capture. Falling back to playback-only mode
Cannot use real-time scheduling (RR/10)(1: Operation not permitted)
AcquireSelfRealTime error
JackPosixProcessSync::LockedTimedWait error usec = 5000000 err = Connection timed out
Driver is not running
Cannot read socket fd = 6 err = Success
Cannot create new client
CheckRes error
JackSocketClientChannel read fail
Cannot open SuperCollider client
JackShmReadWritePtr1::~JackShmReadWritePtr1 - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
terminate called without an active exception
/home/pi/.sonic-pi/log/server-output.log
starting compton for RaspberryPi transparency
Started [21202] [-] compton [-] /tmp/sonic-pi-pids/21202
Sonic Pi server booting...
This is version 3.2.0 running on Ruby 2.5.5.
The time is 2020-10-22 22:17:27 -0600
Using primary protocol: udp
Detecting port numbers...
Listen port: 51235
- OK
Scsynth port: 51237
- OK
Scsynth send port: 51237
- OK
OSC cues port: 4560
- OK
Erlang port: 51240
- OK
OSC MIDI out port: 51238
- OK
OSC MIDI in port: 51239
- OK
Websocket port: 51241
- OK
Opening UDP Server to listen to GUI on port: 51235
Starting Server Runtime
Booting server...
Booting Sonic Pi
----------------
Booting on Raspberry Pi
Jackd not running on system. Starting...
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|2|nomon|swmeter|-|32bit
configuring for 44100Hz, period = 2048 frames (46.4 ms), buffer = 3 periods
ALSA: final selected sample format for playback: 16bit little-endian
ALSA: use 3 periods for playback
Started [21258] [-] jackd -R -p 32 -d alsa -d hw:0 -n 3 -p 2048 -o2 -r 44100 [-] /tmp/sonic-pi-pids/21258
Started [21258] [-] jackd -R -p 32 -d alsa -d hw:0 -n 3 -p 2048 -o2 -r 44100 [-] /tmp/sonic-pi-pids/21258
Boot - Starting the SuperCollider server...
Boot - scsynth -u 51237 -m 131072 -a 1024 -D 0 -R 0 -l 1 -i 2 -o 2 -z 128 -c 128 -U /usr/lib/SuperCollider/plugins -b 4096 -B 127.0.0.1
Started [21323] [-] scsynth -u 51237 -m 131072 -a 1024 -D 0 -R 0 -l 1 -i 2 -o 2 -z 128 -c 128 -U /usr/lib/SuperCollider/plugins -b 4096 -B 127.0.0.1 [-] /tmp/sonic-pi-pids/21323
/home/pi/.sonic-pi/log/scsynth.log
# Starting SuperCollider 2020-10-22 22:17:28
Found 0 LADSPA plugins
could not initialize audio.
/home/pi/.sonic-pi/log/processes.log
Clearing pids: []
No pids to clear :-)
Started [21141] [-] /usr/bin/ruby --enable-frozen-string-literal -E utf-8 /opt/sonic-pi/app/gui/qt/build/../../../../app/server/ruby/bin/sonic-pi-server.rb -u 51235 51236 51237 51237 4560 51240 51238 51239 51241 [-] /tmp/sonic-pi-pids/21141
Started [21202] [-] compton [-] /tmp/sonic-pi-pids/21202
Started [21258] [-] jackd -R -p 32 -d alsa -d hw:0 -n 3 -p 2048 -o2 -r 44100 [-] /tmp/sonic-pi-pids/21258
Started [21258] [-] jackd -R -p 32 -d alsa -d hw:0 -n 3 -p 2048 -o2 -r 44100 [-] /tmp/sonic-pi-pids/21258
Started [21323] [-] scsynth -u 51237 -m 131072 -a 1024 -D 0 -R 0 -l 1 -i 2 -o 2 -z 128 -c 128 -U /usr/lib/SuperCollider/plugins -b 4096 -B 127.0.0.1 [-] /tmp/sonic-pi-pids/21323
Hi mobilegmYT Sorry you are having problems. Generally 3.2.2 performs well on a Pi. The start up logs for 3.2.2 look OK apart from the fact that jackd is not cooperating. Can you restart your Pi, then before trying Qjackctl, try the following. 1st check the audio output you have chosen by right clicking the loudspeaker icon on the taskbar and choosing either HDMI or Analog (the 3.5mm audio jack). If you choose HDMI which is the default corresponding to the hw:0 in the jackd startup command in Sonic Pi, then I assume your monitor has a speaker embedded in it. Then try starting Sonic Pi from the menu. iF it still doesn't work you can lave a look at Qjackctl. Start that from the menu. YOu will see a window with a start and stop buttons. First make sure it is stopped then click the Setup button. In the resulting larger window, select the Settings tab at the top, then the Parameters tab below that. The driver should be alsa, and Realtime ticked. Leave the interface as (Default) and check sample rate 4800, Frames/period 2048 and Periods/Buffer 2. If you have changed anything OK will be highlighted and you can click it. If not only Cancel will be available and click that.to return to the original window. Now click the Start button. All being well you will see some info in the black pane to the right and the stop button will be illuminated. The connect button will give a window with a System icon on the Writeable Clients/ Input Ports. If you get all this then jackd would appear to be working. You can get further details in the messages window, and the Status window. In that case you can leave it running and try launching Sonic Pi again. If that works you will see a SuperCollider icon added to the left hand side of the Connect window with a line joining it to the System input ports.
If the above doesn't work, I would suggest a reinstall. First remove some items.
sudp apt purge sonic-pi
sudo apt purge qjackctl
sudo apt purge jackd
sudo apt update
This latter will also remove some other packages as well.
Then try reinstalling Sonic Pi which you can do from a terminal in the folder where the install package is located using
sudo apt install ./sonic-pi_3.2.2_4_armhf.deb
Let me know how you get on and we can take it from there. In particular, fi you want to use any external audio card, then you will need to use SP in conjunction with Qjackctl to configure the external card fully with lower latency.
I just have 2 things to note here that might help. First, when I booted sonic pi, I saw that it restarted vnc server. Secondly, I'm using TwisterOS which uses xfce and pulseaudio instead of pixel and alsa. I'm not sure how this would affect sonic pi, but you probably know.
Ah if you have pulse audio running that may well create problems. It is possible to get them playing ball. I'll get back to you with details.EDIT here is some relevant stuff. https://askubuntu.com/questions/572120/how-to-use-jack-and-pulseaudio-alsa-at-the-same-time-on-the-same-audio-device On Pi (assuming you already have pulseaudio installed). also install
sudo apt install pulseaudio-module-jack
sudo apt install pavucontrol
Reboot the computer. In qjackcontrol go to the settings page and add in the scripts shown in answer "Ubuntu 20.04, I found it to be a mix of various answers" This lets the two systems work together, and you can control individual volumes with pavucontrol. Its a bit messy but works, although the latency etc are not as good as just using jack.
Ok, so I added the code to qjackctl and rebooted, but it still gave me an error:
/home/pi/.sonic-pi/log/gui.log
[GUI] - Welcome to the Sonic Pi GUI
[GUI] - ===========================
[GUI] -
[GUI] - {ba8e53e4-49c8-4b98-8b70-f1827bfd579b}
[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 : 51236 : 51236
[GUI] - Port entry server-send-to-gui : 51236 : 51236
[GUI] - Port entry scsynth : 51237 : 51237
[GUI] - Port entry scsynth-send : 51237 : 51237
[GUI] - Port entry osc-midi-out : 51238 : 51238
[GUI] - Port entry osc-midi-in : 51239 : 51239
[GUI] - Port entry server-osc-cues : 4560 : 4560
[GUI] - Port entry erlang-router : 51240 : 51240
[GUI] - Port entry websocket : 51241 : 51241
[GUI] - Detecting port numbers...
[GUI] - GUI listen to server port 51236
[GUI] - port: 51236 [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 51237
[GUI] - port: 51237 [OK]
[GUI] - Server send to GUI port 51236
[GUI] - port: 51236 [OK]
[GUI] - GUI send to server port 51235
[GUI] - port: 51235 [OK]
[GUI] - Scsynth send port 51237
[GUI] - port: 51237 [OK]
[GUI] - Erlang router port 51240
[GUI] - port: 51240 [OK]
[GUI] - OSC MIDI out port 51238
[GUI] - port: 51238 [OK]
[GUI] - OSC MIDI in port 51239
[GUI] - port: 51239 [OK]
[GUI] - Websocket port 51241
[GUI] - port: 51241 [OK]
[GUI] - All ports OK
[GUI] - launching Sonic Pi Runtime Server:
[GUI] - Ruby server pid registered: 10388
[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] - wait for sync
[GUI] - waiting for Sonic Pi Server to boot...
[GUI] - starting UDP OSC Server on port 51236...
[GUI] - UDP OSC Server ready and listening
............................................................
[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
/home/pi/.sonic-pi/log/server-errors.log
ALSA: Cannot open PCM device alsa_pcm for capture. Falling back to playback-only mode
JackPosixProcessSync::LockedTimedWait error usec = 5000000 err = Connection timed out
Driver is not running
Cannot read socket fd = 6 err = Success
Cannot create new client
CheckRes error
JackSocketClientChannel read fail
Cannot open SuperCollider client
JackShmReadWritePtr1::~JackShmReadWritePtr1 - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
terminate called without an active exception
/home/pi/.sonic-pi/log/server-output.log
compton not installed so transparency not available
sudo apt install compton to remedy this
Sonic Pi server booting...
This is version 3.2.0 running on Ruby 2.5.5.
The time is 2020-11-02 15:58:05 -0700
Using primary protocol: udp
Detecting port numbers...
Listen port: 51235
- OK
Scsynth port: 51237
- OK
Scsynth send port: 51237
- OK
OSC cues port: 4560
- OK
Erlang port: 51240
- OK
OSC MIDI out port: 51238
- OK
OSC MIDI in port: 51239
- OK
Websocket port: 51241
- OK
Opening UDP Server to listen to GUI on port: 51235
Starting Server Runtime
Booting server...
Booting Sonic Pi
----------------
Booting on Raspberry Pi
Jackd not running on system. Starting...
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|2|nomon|swmeter|-|32bit
configuring for 44100Hz, period = 2048 frames (46.4 ms), buffer = 3 periods
ALSA: final selected sample format for playback: 16bit little-endian
ALSA: use 3 periods for playback
Started [10475] [-] jackd -R -p 32 -d alsa -d hw:0 -n 3 -p 2048 -o2 -r 44100 [-] /tmp/sonic-pi-pids/10475
Started [10475] [-] jackd -R -p 32 -d alsa -d hw:0 -n 3 -p 2048 -o2 -r 44100 [-] /tmp/sonic-pi-pids/10475
Boot - Starting the SuperCollider server...
Boot - scsynth -u 51237 -m 131072 -a 1024 -D 0 -R 0 -l 1 -i 2 -o 2 -z 128 -c 128 -U /usr/lib/SuperCollider/plugins -b 4096 -B 127.0.0.1
Started [10540] [-] scsynth -u 51237 -m 131072 -a 1024 -D 0 -R 0 -l 1 -i 2 -o 2 -z 128 -c 128 -U /usr/lib/SuperCollider/plugins -b 4096 -B 127.0.0.1 [-] /tmp/sonic-pi-pids/10540
/home/pi/.sonic-pi/log/scsynth.log
# Starting SuperCollider 2020-11-02 15:58:07
Found 0 LADSPA plugins
could not initialize audio.
/home/pi/.sonic-pi/log/processes.log
No pids store found here: /tmp/sonic-pi-pids
Exiting
Creating pids store: /tmp/sonic-pi-pids
Started [10388] [-] /usr/bin/ruby --enable-frozen-string-literal -E utf-8 /opt/sonic-pi/app/gui/qt/build/../../../../app/server/ruby/bin/sonic-pi-server.rb -u 51235 51236 51237 51237 4560 51240 51238 51239 51241 [-] /tmp/sonic-pi-pids/10388
Started [10475] [-] jackd -R -p 32 -d alsa -d hw:0 -n 3 -p 2048 -o2 -r 44100 [-] /tmp/sonic-pi-pids/10475
Started [10475] [-] jackd -R -p 32 -d alsa -d hw:0 -n 3 -p 2048 -o2 -r 44100 [-] /tmp/sonic-pi-pids/10475
Started [10540] [-] scsynth -u 51237 -m 131072 -a 1024 -D 0 -R 0 -l 1 -i 2 -o 2 -z 128 -c 128 -U /usr/lib/SuperCollider/plugins -b 4096 -B 127.0.0.1 [-] /tmp/sonic-pi-pids/10540
I'll try and do a step by step sequence on setting it up for you tomorrow. Just checked it out on my computer tonight, and will write up soon.
Closing for now due to inactivity. We have improved our build process - especially for Raspberry Pi - in addition to a complete overhaul of how we boot the system. Therefore, please feel free to re-open if this is still an issue with the recently released v4 of Sonic Pi - https://github.com/sonic-pi-net/sonic-pi/releases
Sonic Pi Boot Error Report
System Information
GUI Log
/home/pi/.sonic-pi/log/gui.log
Server Errors
/home/pi/.sonic-pi/log/server-errors.log
Server Output
/home/pi/.sonic-pi/log/server-output.log
Scsynth Output
/home/pi/.sonic-pi/log/scsynth.log
Process Log
/home/pi/.sonic-pi/log/processes.log