Skip to content

Instantly share code, notes, and snippets.

@pwalsh
Last active November 20, 2022 14:45
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pwalsh/acf50d3359f6ec5129b6 to your computer and use it in GitHub Desktop.
Save pwalsh/acf50d3359f6ec5129b6 to your computer and use it in GitHub Desktop.
Raspberry Pi Headless Setup
; Supervisor configuration to manage a jack server
[program:jackd]
command=/usr/bin/jackd -r -t2000 -ddummy -r44100 -p1024
user=pi
redirect_stderr=true
autostart=true
autorestart=true

The steps I've taken to setup my Raspberry Pi. My entrie setup flow is headless (connecting to the Pi over ssh on a local network), and on Mac OS X (which possibly matters for some stages). YMMV.

Raspian Image

  • Download the latest "lite" Raspbian image from here.
  • Connect your flash card to the computer you are working on
  • Run the following commands from the terminal (last command takes around 5-10 minutes to complete for me... be patient)
# get the disk name from this command, e.g.: disk3
diskutil list

# then unmount the disk
diskutil unmountDisk /dev/{DISK#}

# then write the image to the disk
sudo dd bs=1m if=/path/to/raspbian.img of=/dev/{DISK#}

Connect

Now, plug the flash drive into the Pi, and connect the Pi to the local network with a network cable.

We need to find where the Pi is on our local network.

$ arp -na | grep -i b8:27:eb

Mine is currently at 10.0.0.3.

ssh pi@<IPADDRESS>
# then answer yes to the security question
# then login with the `raspberry` password

Config and Upgrade

sudo raspi-config
# do expand filesystem
# go to advanced options and then add a hostname
# finish and reboot, then log in again
sudo apt-get update && sudo apt-get upgrade
# there will be prompts, answer `y` to them

Install software

sudo apt-get install build-essential git emacs python-dev python-pip supervisor
sudo pip install jupyter jupyter-console ipdb

Install pyo

sudo apt-get install libjack-jackd2-dev libportmidi-dev portaudio19-dev liblo-dev libsndfile-dev python-dev python-tk python-imaging-tk python-wxgtk3.0 jackd2
git clone https://github.com/belangeo/pyo.git
cd pyo
sudo python setup.py install --install-layout=deb --use-jack --use-double

Using prebuilt Jack does not work, as it is compiled with dbus support, which in turn requires X, and I'm running headless (Raspian Lite) without X and similar libs installed. So, instead, I compiled Jack:

git clone https://github.com/jackaudio/jack2.git
cd jack2
./waf configure
./waf
./waf install
@SimplyOnMyWay
Copy link

SimplyOnMyWay commented May 13, 2017

Thanks so much for this - incredibly helpful!
I have jack2 installed on a RPi 3, running headless on Raspian Lite. Jack is not throwing any dbus errors, however it is still not working! When I enter:
jackd -P75 -dalsa -dhw:0 -p1024 -n3 -s -r44100 &

I get the following:

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 75
self-connect-mode is "Don't restrict self connect requests"
creating alsa driver ... hw:0|hw:0|1024|3|44100|0|0|nomon|swmeter|soft-mode|32bit
ALSA: Cannot open PCM device alsa_pcm for capture. Falling back to playback-only mode
configuring for 44100Hz, period = 1024 frames (23.2 ms), buffer = 3 periods
ALSA: final selected sample format for playback: 16bit little-endian
ALSA: use 3 periods for playback

After this it simply hangs. Any ideas?

Thanks for any suggestions!

@melvyniandrag
Copy link

Also interested in this. Following steps now, will update soon with results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment