Skip to content
mxmxmx edited this page Jan 30, 2018 · 88 revisions

linux

these steps are identical for a+, b+, zero (W), pi 2, and pi 3. you'll need 1) an internet connection. and 2) some way to access the device.

  • ssh + wlan is perhaps the most convenient. ssh is enabled easily (see below). zero W and pi 3 come with onboard wifi, which can be configured prior to first boot (also see below). for the other models you'll need an USB wifi dongle. models b+, pi 2 and pi 3 also have an ethernet port.

  • alternatively, you could use a USB/TTL cable like this one: http://www.adafruit.com/product/954 (in which case you'd have to proceed without the terminal tedium attached, evidently).

  • with zero, you can also try to set up USB OTG (or here). (in theory, using the g_audio module, a pi zero could even be turned into an USB audio device. (see e.g. here), but i don't know how well this would work).

  • (none of the below requires the terminal tedium hardware attached to the r-pi, of course, so you could even just use a monitor and keyboard.)

anyways ...

  • you have to choose a distro:

  • to use vanilla raspian, get it here: https://www.raspberrypi.org/downloads/raspbian/ (use Lite)

  • alternatively, you may want to try piCore. the advantage being, it's much leaner and you're less likely to suffer from SD corruption issues (it runs entirely in the RAM).

  • there's still other options, but this wiki only covers raspbian and piCore.

using raspian:

  • prepare the micro SD card (class 10) — if you haven't done this before, see here: http://elinux.org/RPi_Easy_SD_Card_Setup

  • to use ssh, you'll have to enable it first, as mentioned. you can do so simply by putting a file (any file) called ssh in the top directory of the SD card (ie once you've flashed the image onto the SD card).

  • to enable/configure wifi (if applicable), create yet another file, call it wpa_supplicant.conf, and put that also in the boot directory. the latter should contain your WLAN settings, basically/typically:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

network={
   ssid="YOUR_NETWORK_NAME"
   psk="YOUR_PASSWORD"
   key_mgmt=WPA-PSK
}
  • once you've flashed the image, and added the ssh and wpa_supplicant.conf files, insert the micro SD card into its socket, plug the raspberry into the terminal tedium, power it up — the power LED should be on now and the activity LED should begin to indicate some, well, activity.

  • now ssh into the device. to do so you'll need to figure out the IP address of the raspberry in your network. then type: ssh pi@192.168.xx.xx (... using the IP address you've just figured out). the default password is raspberry.

  • once connected, make sure you have the latest kernel: in the terminal, run rpi-update. reboot. (you may be prompted to resize your SD card first); and see https://github.com/Hexxeh/rpi-update

configure:

short version (wm8731 only):

  • type:

wget https://raw.githubusercontent.com/mxmxmx/terminal_tedium/master/software/install.sh

sudo chmod +x install.sh

sudo bash install.sh

  • this will configure/install a bunch of things (pd, the i/o externals, alsa, device-tree, rc.local), then reboot. that's it.

  • once the thing has rebooted, you can test whether the inputs and outputs are properly working. try the passthru.pd example first: cd into /terminal_tedium/software, then run:

sudo pd -nogui -rt -r 48000 passthru.pd

  • this shouldn't complain/throw a lot of errors ... and any sound source patched into the audio inputs should be passed on through to the outputs.

  • for more details on testing, see

  • note that the install-script puts a start-up script called rt_start in /home/pi/terminal_tedium/software. this will be invoked by rc.local during boot-up. you can modify it or use a similar script to automate various tasks, like running a puredata patch. (also see here)

long version:

  • alternatively, you can set things up manually.... we need to configure some things: easiest to edit /boot/config.txt : sudo nano /boot/config.txt and add the device tree overlays. the following lines (at least) should be added or modified. (rpi-proto = wm8731, for pcm5102a use dtoverlay=hifiberry-dac instead)
# disable snd-bcm2835
dtparam=audio=off 
# memory split:
gpu_mem=16
# enable i2c: 
dtparam=i2c_arm=on
# enable spi:
dtparam=spi=on
# enable i2s:
dtparam=i2s=on
# i2s / DAC driver:
dtoverlay=i2s-mmap
dtoverlay=rpi-proto

  • config.txt is als where you'd set overclock settings and so on. or alternatively, run sudo raspi-config and choose the settings (in advanced options)

  • reboot.

  • finally, we need to install/download a few things, that we'll need that later:

git:

sudo apt-get install git-core

terminal tedium misc:

git clone https://github.com/mxmxmx/terminal_tedium

install wiringPi:

git clone git://git.drogon.net/wiringPi

cd wiringPi 
git pull origin 
./build 

puredata:

  • if you intend to use pd, i'd recommend miller puckette's vanilla release for ARMv6/linux resp. ARMv7/linux; or compile it yourself, which can be a pain, admittedly. so easiest to just do:

    wget http://msp.ucsd.edu/Software/pd-0.47-1.armv7.tar.gz

  • and unzip:

    tar -xvzf pd-0.47-1.armv7.tar.gz

  • ... (NB: the most recent versions exist for ARMv7 only, actually. but seems to work on pi zero, too).

misc:

  • there's various ways to optimize performance (probably not something you need to worry about at this stage, but once you've confirmed things are basically working). this is probably a good place to get started, though a lot of it doesn't pertain to our scenario / hardware set-up. in particular, take a look at "CPU frequency scaling", which is something you'd put in rc.local or a script such as this, which you'd run during start-up. NB: details somewhat depend on the hardware.

    • for pi zero, you'd do:
## set CPU scaling governor to performance
echo -n performance | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
  • pi 2 and pi 3 have several cores, so:
for cpu in /sys/devices/system/cpu/cpu[0-9]*; do 
  echo -n performance | sudo tee $cpu/cpufreq/scaling_governor 
done 
  • if you want to experiment with RT kernels, other distros (archlinux, etc), bare metal, or whatever, you'll be largely on your own ...