Sure thing, I've been keeping notes to help me streamline future installs. I plan on writing something much more detailed for the ASR open source streamer thread but this should get you going for now. The procedure below will get CamillaDSP up and running on Ubuntu Server 21.10 64 bit. The procedure is geared towards using squeezelite and airplay, if you have other players in mind you might want to change the capture sample rate from 44.1 kHz. I've attached a CamillaDSP yml file for the MOTU M4 to get you started but you will need to change the extension from .txt to .yml (I had to rename so I could attach). I also attached the python scripts for the display (oled8.txt) and the FLIRC IR receiver (flirc.txt), as above you will need to rename the extensions from .txt to .py. Of course if you are not using the display or the FLIRC IR receiver feel free to ignore those parts in the instructions.
Code:
CamillaDSP Setup
1) Write Ubuntu Server 21.10 to SD card using Raspberry Pi Imager
https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#1-overview
2) Modify network-config on SD card to enable wifi
wifis:
wlan0:
dhcp4: true
optional: true
access-points:
"network name":
password: "passwd"
3) Change host name
ssh ubuntu@ubuntu
Change ubuntu to desired hostname in files below.
sudo nano /etc/hostname
sudo nano /etc/hosts
sudo reboot
4) Change user name
ssh ubuntu@hostname
Create "temp" user so that you can log in as temp and change user name.
sudo -s
useradd -G sudo temp
passwd temp
shutdown now -r
ssh temp@hostname
Change user name from "ubuntu" to "newUsername"
sudo -s
usermod -l newUsername ubuntu
Change home directory to "newHomeDir" and change group name from "ubuntu" to "NEW_GROUP_NAME"
usermod -d /home/newHomeDir -m newUsername
groupmod --new-name NEW_GROUP_NAME ubuntu
reboot
ssh newUsername@hostname (you will use this for all future logins)
Delete "temp user"
sudo -s
deluser temp
rm -r /home/temp
exit
5) Update / upgrade apt
sudo apt update
sudo apt full-upgrade
5) Install CamillaDSP
sudo apt install pkg-config libasound2-dev openssl libssl-dev build-essential
Install rust via rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
sudo reboot
git clone https://github.com/HEnquist/camilladsp
cd ~/camilladsp
RUSTFLAGS='-C target-feature=+neon -C target-cpu=native' cargo build --release --no-default-features --features alsa-backend --features websocket
cd ..
6) Create CamillaDSP yml configuration file
Prefer to leave this in /home/username/ so camilladsp can be removed and updated without impacting configuration.
7) Create CamillaDSP service
You will need to change "ExecStart" line to reflect your username and yml configuration name / location
sudo nano /lib/systemd/system/camilladsp.service
After=syslog.target
StartLimitIntervalSec=10
StartLimitBurst=10
[Service]
Type=simple
ExecStart=/home/username/camilladsp/target/release/camilladsp -g-40 -p 1234 /home/username/camilladsp.yml
Restart=always
RestartSec=1
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=camilladsp
User=root
Group=root
CPUSchedulingPolicy=fifo
CPUSchedulingPriority=10
[Install]
WantedBy=graphical.target
8) Enable service
sudo systemctl enable camilladsp
9) Install python and dependencies
sudo apt install python3 python3-pip python3-websocket python3-aiohttp python3-jsonschema python3-numpy python3-matplotlib
10) Install pycamilladsp
sudo git clone https://github.com/HEnquist/pycamilladsp
cd ~/pycamilladsp
pip3 install .
cd ..
11) Install pycamilladsp-plot
sudo git clone https://github.com/HEnquist/pycamilladsp-plot
cd ~/pycamilladsp-plot
pip3 install .
cd ..
12) Install gui server
mkdir ~/configs
mkdir ~/coeffs
sudo apt install unzip
wget https://github.com/HEnquist/camillagui-backend/releases/download/v0.8.0/camillagui.zip
unzip ~/camillagui.zip -d ~/camillagui
nano ~/camillagui/config/camillagui.yml -> update path to configuration files and configs / coeffs
GUI is accessed via http://hostname:5000
14) Setup crontab to start camillagui on startup
crontab -e
@reboot python3 ~/camillagui/main.py
15) Setup loopback
sudo nano /etc/modules-load.d/snd-aloop.conf -> snd-aloop
snd-aloop.ko is not installed by default on Ubuntu 21.10, run command below to install it.
sudo apt install linux-modules-extra-$(uname -r)
sudo reboot
16) Run flirc python script at startup
crontab -e
@reboot python3 ~/flirc.py 1234
17) Change permission of FLIRC at startup
sudo crontab -e
@reboot chown username /dev/input/by-id/usb-flirc.tv_flirc-if01-event-kbd
18) Install lgpio and evdev
sudo apt install python3-lgpio
pip3 install evdev
19) Connect display and run display python script at startup
lgpio needs to be run as root on Ubuntu 21.10, this was not the case on Ubuntu 21.04
nano oled8.py -> update sys.path.append('/home/username/pycamilladsp/camilladsp') to reflect your username
sudo crontab -e
@reboot python3 /home/username/oled8.py 1234
20) Install squeezelite
This will install squeezelite and resample all files to 44.1 kHz using sox (unless file is natively 44.1 kHz). In addition squeezelite will stop after 5 seconds of inactivity to allow for shairport-sync to be used in addition to squeezelite.
sudo apt install squeezelite
sudo nano /etc/default/squeezelite
SL_SOUNDCARD="hw:0,1"
SB_EXTRA_ARGS="-W -C 5 -r 44100-44100 -R hLE:::28"
21) Install shairport-sync
sudo apt install shairport-sync libsoxr-dev
sudo nano /etc/shairport-sync.conf
Uncomment the following lines (delete // from start of line) and make changes shown below.
name = "%h";
interpolation = "soxr";
port = 6000;
drift_tolerance_in_seconds = 0.010;
output_device = "hw:0,1";
Let me know if you have any questions or have another configuration in mind (other inputs, other players, etc).
Michael