Hi, I built sclang as written on http://supercollider.github.io/development/building-raspberrypi under âCompiling SC natively on Raspberry Pi Raspbian Liteâ heading. (the sclang from apt-get doesnât seem to be able to run in headless mode)
Then I ran the script as you showed with a couple of modifications:
- adding killall sclang.
- & at the end of the last line.
- HOME variable initialization.
- Removed sleep.
#!/bin/bash
. /usr/local/pisound/scripts/common/common.sh
PATH=$PATH:/usr/local/bin:/usr/bin
export DISPLAY=:0.0
export HOME=/home/pi
flash_leds 1
killall sclang
(cd /home/pi; echo " " | sclang mycode.scd > /tmp/sclang.log) &
Sleep may be useful if sclang would get started during boot time, but shouldnât be necessary when starting using the button.
The & at the end of the last command is needed so that sclang is started as a background process, and the Pisoundâs button doesnât block until sclang is terminated - without it, it would become unresponsive until sclang exits. (Iâm considering simplifying this and making all scripts executed by the button to be executed in background in future versions)
I had this in mycode.scd:
s.waitForBoot{ {SinOsc.ar([400, 404])}.play }
The contents of /tmp/sclang.log after clicking the button are:
compiling class library...
Found 610 primitives.
Compiling directory '/usr/local/share/SuperCollider/SCClassLibrary'
Compiling directory '/usr/local/share/SuperCollider/Extensions'
WARNING: Could not open directory: '/home/pi/.local/share/SuperCollider/Extensions'
To resolve this, either create the directory or remove it from your compilation paths.
ERROR: Class extension for nonexistent class 'HistoryGui'
In file:'deprecated/3.9/HistoryGui.sc'
numentries = 1013163 / 11348984 = 0.089
4106 method selectors, 2764 classes
method table size 7046068 bytes, big table size 45395936
Number of Symbols 11181
Byte Code Size 303235
compiled 355 files in 0.70 seconds
Info: 4 methods are currently overwritten by extensions. To see which, execute:
MethodOverride.printAll
compile done
localhost : setting clientID to 0.
internal : setting clientID to 0.
Class tree inited in 0.06 seconds
*** Welcome to SuperCollider 3.9.0-beta1. *** For help type ctrl-c ctrl-h (Emacs) or :SChelp (vim) or ctrl-U (sced/gedit).
booting server 'localhost' on address: 127.0.0.1:57110
Found 0 LADSPA plugins
jackdmp 1.9.11
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 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"
creating alsa driver ... hw:pisound|hw:pisound|128|2|48000|0|0|nomon|swmeter|-|32bit
configuring for 48000Hz, period = 128 frames (2.7 ms), buffer = 2 periods
ALSA: final selected sample format for capture: 32bit integer little-endian
ALSA: use 2 periods for capture
ALSA: final selected sample format for playback: 32bit integer little-endian
ALSA: use 2 periods for playback
port created: Midi-Through:midi/playback_1
port created: Midi-Through:midi/capture_1
port created: pisound:midi/playback_1
port created: pisound:midi/capture_1
JackDriver: client name is 'SuperCollider'
SC_AudioDriver: sample rate = 48000.000000, driver's block size = 128
JackDriver: connected system:capture_1 to SuperCollider:in_1
JackDriver: connected system:capture_2 to SuperCollider:in_2
JackDriver: connected SuperCollider:out_1 to system:playback_1
JackDriver: connected SuperCollider:out_2 to system:playback_2
SuperCollider 3 server ready.
JackDriver: max output latency 5.3 ms
Shared memory server interface initialized
FAILURE IN SERVER /s_new Group 1 not found
Requested notification messages from server 'localhost'
localhost: server process's maxLogins (1) matches my options.
localhost: keeping clientID (0) as confirmed by server process.
And ps does show that thereâs sc and jack processes running:
pi@raspberrypi:~ $ ps -ef
...
root 22679 1 0 12:47 ? 00:00:00 /bin/bash /usr/local/pisound/scripts/pisound-btn/start_sclang.sh 1
root 22681 22679 1 12:47 ? 00:00:04 sclang mycode.scd
root 22705 22681 2 12:47 ? 00:00:06 scsynth -u 57110 -a 1024 -i 2 -o 2 -b 1026 -R 0 -C 0 -l 1
root 22712 1 7 12:47 ? 00:00:19 /usr/local/bin/jackd -T -ndefault -dalsa -r48000 -p128 -n2 -Xseq -D -Chw:pisound -Phw:pisound
However, I donât get any audio outputâŚ
So it looks like on my system it gets further, not sure whatâs different from yours.
Any ideas about the missing audio output?