Skip to content

Instantly share code, notes, and snippets.

@schollz
Forked from madskjeldgaard/raspi_sc_install.sh
Created July 15, 2022 17:43
Show Gist options
  • Save schollz/ddfec47fb9e914a44bccd274cadfc12f to your computer and use it in GitHub Desktop.
Save schollz/ddfec47fb9e914a44bccd274cadfc12f to your computer and use it in GitHub Desktop.

Revisions

  1. @madskjeldgaard madskjeldgaard created this gist Nov 3, 2018.
    59 changes: 59 additions & 0 deletions raspi_sc_install.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,59 @@
    #!/bin/bash

    #
    # Steps to install and set up a headless raspberry pi (3) for SuperCollider use
    # This is primarily copied from https://supercollider.github.io/development/building-raspberrypi
    #
    #

    # Get updated
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get dist-upgrade

    # update the system, install required libraries
    sudo apt-get install git libjack-jackd2-dev libsndfile1-dev libasound2-dev libavahi-client-dev libreadline6-dev libfftw3-dev libxt-dev libudev-dev libcwiid-dev cmake qttools5-dev-tools libqt5webkit5-dev qtpositioning5-dev libqt5sensors5-dev

    # SETUP JACK
    # compile & install jackd (no d-bus)
    git clone git://github.com/jackaudio/jack2 --depth 1
    cd jack2
    ./waf configure --alsa --libdir=/usr/lib/arm-linux-gnueabihf/
    ./waf build
    sudo ./waf install
    sudo ldconfig
    cd ..
    rm -rf jack2
    echo "@audio - memlock 256000" | sudo tee --append /etc/security/limits.conf
    echo "@audio - rtprio 75" | sudo tee --append /etc/security/limits.conf


    # compile and install supercollider
    git clone --recursive git://github.com/supercollider/supercollider

    cd supercollider
    git checkout 3.9 #use latest version 3.9.x on branch 3.9
    git submodule init && git submodule update
    mkdir build && cd build

    cmake -L -DCMAKE_BUILD_TYPE="Release" -DBUILD_TESTING=OFF -DSUPERNOVA=OFF -DNATIVE=ON -DSC_WII=ON -DSC_IDE=OFF -DSC_QT=OFF -DSC_ED=OFF -DSC_EL=OFF -DSC_VIM=ON ..
    make -j 4 #use -j4 flag only for rpi3 (quadcore)
    sudo make install
    sudo ldconfig
    # mkdir -p ~/.config/SuperCollider # Only needed for sc < 3.9.3

    # Set up jack file
    echo /usr/bin/jackd -P75 -dalsa -dhw:0 -r44100 -p1024 -n3 > ~/.jackdrc

    # the -dhw:0 above is the internal soundcard.
    # change this to -dhw:1 for usb soundcards.
    # aplay -l will list available devices.
    # another way to set up and start jack is to open
    # a terminal and type qjackctl. click ‘setup’ to
    # select soundcard and set periods to 3 (recommended).
    # then start jack before scide by clicking the play icon.


    # Start it up
    # Reboot and then start it up by typing sclang
    sudo reboot