sonic-pi-net / sonic-pi

Code. Music. Live.
https://sonic-pi.net
Other
10.78k stars 923 forks source link

Sonic Pi Boot Error on RPi 3 #1772

Closed olsonk closed 6 years ago

olsonk commented 6 years ago

Sonic Pi Boot Error Report

System Information

GUI Log

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

[GUI] - Detecting port numbers...
[GUI] - GUI OSC listen port 4558
[GUI] -    port: 4558 [OK]
[GUI] - Server OSC listen port 4557
[GUI] -    port: 4557 [OK]
[GUI] - Server incoming OSC cues port 4559
[GUI] -    port: 4559 [OK]
[GUI] - Scsynth port 4556
[GUI] -    port: 4556 [OK]
[GUI] - Server OSC out port 4558
[GUI] - GUI OSC out port 4557
[GUI] - Scsynth send port 4556
[GUI] - Erlang router port 4560
[GUI] -    port: 4560 [OK]
[GUI] - OSC MIDI out port 4561
[GUI] -    port: 4561 [OK]
[GUI] - OSC MIDI in port 4562
[GUI] -    port: 4562 [OK]
[GUI] - Init script completed
[GUI] - using default editor colours
[GUI] - launching Sonic Pi Server:
[GUI] - starting UDP OSC Server on port 4558...
[GUI] - UDP OSC Server ready and listening
[GUI] - Ruby server pid registered: 1653
[GUI] - waiting for Sonic Pi Server to boot...
.................................
[GUI] - Sonic Pi Server failed to start with this error message: 
      > Server Exception:
 Promise timed out after 5 seconds.
 ["/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/promise.rb:38:in `block in get'", "/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/promise.rb:32:in `synchronize'", "/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/promise.rb:32:in `get'", "/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/server.rb:581:in `with_done_sync'", "/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/server.rb:151:in `load_synthdefs'", "/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/server.rb:108:in `initialize'", "/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/studio.rb:183:in `new'", "/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/studio.rb:183:in `init_scsynth'", "/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/studio.rb:56:in `initialize'", "/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/lang/sound.rb:125:in `new'", "/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/lang/sound.rb:125:in `block (2 levels) in included'", "/opt/sonic-pi/app/gui/qt/../../../app/server/bin/sonic-pi-server.rb:178:in `new'", "/opt/sonic-pi/app/gui/qt/../../../app/server/bin/sonic-pi-server.rb:178:in `<main>'"]
[GUI] - UDP OSC Server no longer listening
...........................
[GUI] - Critical error! Could not boot Sonic Pi Server.
[GUI] - stopping UDP OSC Server...

Server Errors

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

ALSA: Cannot open PCM device alsa_pcm for capture. Falling back to playback-only mode
o2m: no process found
m2o: no process found
[xcb] Unknown sequence number while processing reply
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
scsynth: ../../src/xcb_io.c:630: _XReply: Assertion `!xcb_xlib_threads_sequence_lost' failed.

Server Output

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

Sonic Pi server booting...
Using protocol: udp
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
Booting server...

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

Booting on Raspberry Pi
Jackd not running on system. Starting...
jackdmp 1.9.11
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2014 Grame.
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 [1883] [-] sh [-] /tmp/sonic-pi-pids/1883
Started [1883] [-] sh [-] /tmp/sonic-pi-pids/1883
Boot - Starting the SuperCollider server...
Boot - scsynth -u 4556 -a 1024 -m 131072 -D 0 -R 0 -l 1 -z 128 -c 128 -U /usr/lib/SuperCollider/plugins:/opt/sonic-pi/app/server/native/raspberry/extra-ugens/ -i 2 -o 2 -b 4096
Started [2085] [-] scsynth -u 4556 -a 1024 -m 131072 -D 0 -R 0 -l 1 -z 128 -c 128 -U /usr/lib/SuperCollider/plugins:/opt/sonic-pi/app/server/native/raspberry/extra-ugens/ -i 2 -o 2 -b 4096 [-] /tmp/sonic-pi-pids/2085
Boot - SuperCollider booted successfully.
Boot - Connecting to the SuperCollider server...
Boot - Sending /status to server: 127.0.0.1:4556
Boot - Receiving ack from scsynth
Boot - Server connection established
Failed to start server: Promise timed out after 5 seconds.
/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/promise.rb:38:in `block in get'
/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/promise.rb:32:in `synchronize'
/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/promise.rb:32:in `get'
/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/server.rb:581:in `with_done_sync'
/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/server.rb:151:in `load_synthdefs'
/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/server.rb:108:in `initialize'
/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/studio.rb:183:in `new'
/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/studio.rb:183:in `init_scsynth'
/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/studio.rb:56:in `initialize'
/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/lang/sound.rb:125:in `new'
/opt/sonic-pi/app/server/sonicpi/lib/sonicpi/lang/sound.rb:125:in `block (2 levels) in included'
/opt/sonic-pi/app/gui/qt/../../../app/server/bin/sonic-pi-server.rb:178:in `new'
/opt/sonic-pi/app/gui/qt/../../../app/server/bin/sonic-pi-server.rb:178:in `<main>'
Exiting - shutting down scsynth server...
Sending /quit command to scsynth
Stopping OSC server...
Stopped OSC server...
Server is exiting.
Shutting down GUI...
Goodbye :-)

Scsynth Output

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

# Starting SuperCollider 2017-12-01 13:03:44
Found 0 LADSPA plugins
JackDriver: client name is 'SuperCollider'
SC_AudioDriver: sample rate = 44100.000000, driver's block size = 2048
SuperCollider 3 server ready (debug build).
JackDriver: max output latency 139.3 ms

Process Log

/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 [1653] [-] ruby -E utf-8 /opt/sonic-pi/app/gui/qt/../../../app/server/bin/sonic-pi-server.rb -u 4557 4558 4556 4556 4559 4560 4561 4562 [-] /tmp/sonic-pi-pids/1653
Started [1883] [-] sh [-] /tmp/sonic-pi-pids/1883
Started [1883] [-] sh [-] /tmp/sonic-pi-pids/1883
Started [2085] [-] scsynth -u 4556 -a 1024 -m 131072 -D 0 -R 0 -l 1 -z 128 -c 128 -U /usr/lib/SuperCollider/plugins:/opt/sonic-pi/app/server/native/raspberry/extra-ugens/ -i 2 -o 2 -b 4096 [-] /tmp/sonic-pi-pids/2085
olsonk commented 6 years ago

This was an upgrade from Jessie to Stretch. I realized I'd forgotten to purge pulseaudio, so I did that and then got this error when I tried to re-open Sonic Pi.

Sonic Pi Boot Error Report

System Information

GUI Log

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

[GUI] - Detecting port numbers...
[GUI] - GUI OSC listen port 4558
[GUI] -    port: 4558 [OK]
[GUI] - Server OSC listen port 4557
[GUI] -    port: 4557 [OK]
[GUI] - Server incoming OSC cues port 4559
[GUI] -    port: 4559 [OK]
[GUI] - Scsynth port 4556
[GUI] -    port: 4556 [OK]
[GUI] - Server OSC out port 4558
[GUI] - GUI OSC out port 4557
[GUI] - Scsynth send port 4556
[GUI] - Erlang router port 4560
[GUI] -    port: 4560 [OK]
[GUI] - OSC MIDI out port 4561
[GUI] -    port: 4561 [OK]
[GUI] - OSC MIDI in port 4562
[GUI] -    port: 4562 [OK]
[GUI] - Init script completed
[GUI] - using default editor colours
[GUI] - launching Sonic Pi Server:
[GUI] - launching Sonic Pi Server:
[GUI] - starting UDP OSC Server on port 4558...
[GUI] - UDP OSC Server ready and listening
[GUI] - Ruby server pid registered: 0
[GUI] - stopping UDP OSC Server...
[GUI] - waiting for Sonic Pi Server to boot...
[GUI] - UDP OSC Server no longer listening

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


Clearing pids: ["1883", "2085", "1653"]

Clearing [1883]
  -- command sh
  -- removing /tmp/sonic-pi-pids/1883
  -- unable to get ProcTable info for: 1883
  -- process: 1883 not running

Clearing [2085]
  -- command scsynth -u 4556 -a 1024 -m 131072 -D 0 -R 0 -l 1 -z 128 -c 128 -U /usr/lib/SuperCollider/plugins:/opt/sonic-pi/app/server/native/raspberry/extra-ugens/ -i 2 -o 2 -b 4096
  -- removing /tmp/sonic-pi-pids/2085
  -- unable to get ProcTable info for: 2085
  -- process: 2085 not running

Clearing [1653]
  -- command ruby -E utf-8 /opt/sonic-pi/app/gui/qt/../../../app/server/bin/sonic-pi-server.rb -u 4557 4558 4556 4556 4559 4560 4561 4562
  -- removing /tmp/sonic-pi-pids/1653
  -- unable to get ProcTable info for: 1653
  -- process: 1653 not running

Finished clearing pids
olsonk commented 6 years ago

How embarrassing - a reboot solved the issue...Should've rebooted after purging pulseaudio I suppose! Oh well, now there's a record of my mistake and may help others...?

samaaron commented 6 years ago

Easiest fix ever!:)

Cpt-xx commented 6 years ago

That leaves the other boot/start up problems on the PI2 (#1768)... any news on that? Is there any more you need from us in terms of log-files (syslog, messages... you name it)?

Cpt-xx commented 6 years ago

Just tried the same card on a new Pi 3 model B and the construction with X-term client on a Linux box, and sonic-pi running on the raspberry runs fine (it starts up at least, haven't tried the sound etc. yet). So we can turn our attention to things like number of kernels (1 vs. 3) memory (512mb vs. 1Gb) and that kind of differences I think.

samaaron commented 6 years ago

Any new information is gladly received :) I wonder if it might be a memory thing

bekereke commented 6 years ago

In my case, I changed the GPU to 512 so as to work with CAD programs, and realized that I couldn't start Sonic anymore. I remembered using it without problems in my RPi3, and all of a sudden it wouldn't work. Indeed, it was a memory thing in the end. I reversed to default 128 and hence, Sonic Pi came to live again. I was stuck with "Sonic-Pi could not start server..." error.

Cpt-xx commented 6 years ago

Oh, cool. I wasn't aware yet that the amount of memory for GPU could be lowered. You're never too old to learn. As this is a feasible solution, I would suggest @samaaron to put this somewhere in the installation instructions or thereabouts. That saves modifying the code, and still allows people to play around with Sonic Pi.

samaaron commented 6 years ago

@Cpt-xx great suggestion - and also great to hear that it's a simple memory allocation issue :-)