Setting up SuperCollider on Pi|setting-up-supercollider-on-pi

Prerequisites

  1. A Raspberry Pi 2 (the one with the quad core).
  2. Computer with connection to local network router.
  3. Power cable, HDMI cable, keyboard, monitor, ethernet cable, router.
  4. Plug everything in, put Pi on the network via ethernet. Do not plug the Pi in until you have burned NOOBs and inserted the SD card into the Pi.

Prep and Basic installation of dependencies

  1. Burn NOOBs lite onto micro SD card. Set up Pi, use screen and keyboard to configure basic system.
  2. Configure basic system; use ifconfig to discover network settings. 'enable ssh, set timezone, etc, finish and reboot.'
  3. ssh pi@XXX.XXX.XXX.XXX into device using ip address from previous step, sudo adduser USERNAME, sudo visudo, copy admin line and change andmin to your USERNAME. Log back in as you.
  4. sudo apt-get update
  5. sudo apt-get upgrade # this might take a while
  6. sudo apt-get autoremove
  7. sudo apt-get install cmake libasound2-dev libsamplerate0-dev libsndfile1-dev libavahi-client-dev libicu-dev libreadline-dev libfftw3-dev libxt-dev libcwiid1 libcwiid-dev subversion libqt4-dev libqtwebkit-dev
  8. sudo ldconfig

Note: I installed libjack-jackd2-dev according to 2. For the remainder, I am following Sam Aaron's 2012 [tutorial] 1, adding some emphasis to any tweaks that I made.

This is NOT the jack that you want: sudo apt-get install jackd2

Get SuperCollider:
You might do OK with whatever version of supercollider comes out of sudo apt-get install supercollider, but I'm downloading sources and compiling.

Compile SuperCollider

Compilation is based on [Charles Céleste Hutchins' article] 2 which is quoted in its entirety with notes here:

  • wget http://downloads.sourceforge.net/project/supercollider/Source/3.6/SuperCollider-3.6.6-Source.tar.bz2
  • tar -xvf SuperCollider-3.6.6-Source.tar.bz2 - this is very stable build, as far as I can tell
  • rm SuperCollider-3.6.6-Source.tar.bz2
  • cd SuperCollider-Source
  • mkdir build && cd build
  • sudo dd if=/dev/zero of=/swapfile bs=1MB count=512 # create a temporary swap file
  • sudo mkswap /swapfile
  • sudo swapon /swapfile
  • CC="gcc" CXX="g++" cmake -L -DCMAKE_BUILD_TYPE="Release" -DBUILD_TESTING=OFF -DSSE=OFF -DSSE2=OFF -DSUPERNOVA=OFF -DNOVA_SIMD=ON -DNATIVE=OFF -DSC_ED=OFF -DSC_EL=OFF -DCMAKE_C_FLAGS="-march=armv6 -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp" -DCMAKE_CXX_FLAGS="-march=armv6 -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp" .. # should add ‘-ffast-math -O3’ here but then gcc4.6.3 fails
  • make # this ~~takes hours~~ took about an hour on the quad-core device
  • sudo make install
  • cd ../..
  • sudo rm -r SuperCollider-Source
  • sudo swapoff /swapfile
  • sudo rm /swapfile
  • sudo ldconfig
  • echo "export SC_JACK_DEFAULT_INPUTS=\"system\"" >> ~/.bashrc
  • echo "export SC_JACK_DEFAULT_OUTPUTS=\"system\"" >> ~/.bashrc
  • sudo reboot

These next steps were critical:

sudo dpkg-reconfigure -p high jackd2

The last "2" is important, . Then choose yes, you want to lock down memory and have rtprio scheduling privilege. This will add those lines automatically. tms: WE ARE ACTUALLY USING JACK 1.9.9, according to [Sam Aaron's tutorial] 1.

Now, you have to make sure you are in the audio group, so do a:

sudo adduser XXXX audio

supposing that XXXX is your user name.

Now, you have to reboot.

Now, check that you have said privileges:

ulimit -r -l

pi@raspberrypi ~ $ ulimit -r -l

After you log in again, should be exactly 95 and unlimited:

real-time priority (-r) 95

max locked memory (kbytes, -l) unlimited

If it is any other value---the default is 0 and 5(?)---stop and check your earlier work.

[1]: http://sam.aaron.name/2012/11/02/supercollider-on-pi.html "Sam Aaron's guide."

[2]: http://celesteh.blogspot.com/2014/04/building-supercollider-36-on-raspberry.html "Charles Céleste Hutchins' guide to compilation."

[3]: http://ubuntuforums.org/showthread.php?t=1637399 these steps were important!"

[4]: http://cagewebdev.com/index.php/raspberry-pi-getting-audio-working/ "some basic troubleshooting"

[5]: http://kitefishlabs.com/ghost/23/ "Later set of configuration instructions."

Show Comments

Copyright (C) 2019, Thomas Stoll, Kitefish Labs