Skip to content

Instantly share code, notes, and snippets.

@HarryUPf
Last active September 28, 2023 01:37
Show Gist options
  • Save HarryUPf/de42a8d9e2a65e9d7ab5e303b776af6d to your computer and use it in GitHub Desktop.
Save HarryUPf/de42a8d9e2a65e9d7ab5e303b776af6d to your computer and use it in GitHub Desktop.
Raspberry Pi SunVox Headless Synth (in 10 easy steps)

Raspberry Pi SunVox Headless Synth Setup (in 10-easy-steps)

INSTRUCTIONS

STEP_01

STEP_02

  • write the extracted .img to sdcard with Etcher

STEP_03

  • replace cmdline.txt and config.txt on sdcard boot partition in its root folder with contents from this gist

STEP_04

  • create bin folder on sdcard rootfs partition in its home/pi folder
  • create sunvox.sh in the bin folder with contents from this gist

STEP_05

  • turn-on and configure rpi
  • login:pi / password:raspberry
sudo raspi-config
  • follow on-screen instructions
3 boot options
	B1:B2
	B2:NO
4 localization options
	I1:your_locale	//en_US.UTF-8(recommended)
	I2:your_timezone
	I3:your_kb_layout
	I4:your_country
finish
reboot now?:YES

STEP_06

  • hold the realtime kernel from upgrades
sudo apt-mark hold raspberrypi-kernel
  • connect ethernet cable to install packages
  • install sunvox SDL2 dependency, jack daemon and window manager
sudo apt-get update
sudo apt-get install libsdl2-2.0-0 qjackctl xorg awesome
//enable realtime process priority?:YES
sudo apt-get clean

STEP_07

  • download and unzip sunvox
wget -c http://warmplace.ru/soft/sunvox/sunvox-1.9.4c.zip
unzip -p sunvox-1.9.4c.zip sunvox/sunvox/linux_arm_armhf_raspberry_pi/sunvox_lofi > /home/pi/bin/sunvox_lofi
chmod +x /home/pi/bin/sunvox_lofi /home/pi/bin/sunvox.sh

STEP_08

  • set jack and sunvox autostart
echo 'startx' >> /home/pi/.profile

sudo sh -c "echo 'autorun=true apps={"sunvox.sh",} if autorun then for n=1, #apps do awful.util.spawn(apps[n]) end end' >> /etc/xdg/awesome/rc.lua"

reboot

STEP_09

  • wait for sunvox to start
  • configure sunvox for headless setup. Marky Shaw's video tutorial starts at 04:08
  • check comments and modify configuration in sunvox.sh script

STEP_10

  • enjoy your rpi-sunvox-synth and consider donating to sunvox development!
dwc_otg.lpm_enable=0 console=tty1 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=no rootwait fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo dwc_otg.fiq_fix_enable=1 dwc_otg.speed=0 smsc95xx.turbo_mode=N consoleblank=0 quiet init=/usr/lib/raspi-config/init_resize.sh
disable_splash=1
disable_overscan=1
dtparam=audio=on
audio_pwm_mode=2
max_usb_current=0
arm_freq=1000
dtoverlay=pi3-disable-bt
dtoverlay=pi3-disable-wifi
#!/bin/bash
##reference:https://wiki.linuxaudio.org/wiki/raspberrypi
##remount /dev/shm to prevent memory allocation errors
sudo mount -o remount,size=128M /dev/shm
##disable networking
#echo -n "1-1.1:1.0" | sudo tee /sys/bus/usb/drivers/smsc95xx/unbind
#sudo service networking stop
##performance governor to reduce xruns
echo -n performance | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
##kill if already running
killall jackd
killall sunvox
killall sunvox_lofi
wait
##list audio ports aliases with command: jack_lsp -A
##your setup. replace with your audio interface alias and choose a frame/period: -p128 -p256 -p512
#jackd -P70 -p16 -t2000 -dalsa -dhw:_insert_alias_here_ -r44100 -p_insert_fram/period_here_ -n3 -s -Xseq &
##my setup
#jackd -P70 -p16 -t2000 -dalsa -dhw:CODEC -r44100 -p256 -n3 -s -Xseq &
##default setup
jackd -P70 -p16 -t2000 -dalsa -dhw:ALSA -r44100 -p512 -n3 -s -Xseq &
sleep 1
##choose sunvox executable (lofi recommended)
#sunvox &
sunvox_lofi &
sleep 2
##list midi ports aliases with command: jack_lsp -A
##your setup. replace with you midi devices second aliases (they don't change after reboot/unplug)
#jack_connect _insert_midi_second_alias_here SunVox:Keyboard1
#jack_connect _insert_midi_second_alias_here SunVox:Keyboard1
##my setup
#jack_connect microKEY:midi/playback_1 SunVox:Keyboard1
#jack_connect nanoKONTROL2:midi/playback_1 SunVox:Keyboard1
##default setup
jack_connect system:midi_capture_1 SunVox:Keyboard1
jack_connect system:midi_capture_2 SunVox:Keyboard1
exit
@jozefSCK
Copy link

replace cdmline.txt.....you mean cmdline.txt?? or there will be additional file cdmline.txt?

@rafistolique
Copy link

rafistolique commented Sep 5, 2023

Hello Harry,
In 2023, it's my turn to try myself. I am a beginner, and after a lot of trouble I managed with the help of a youtube video to understand some of the linux commands, enough to succeed after two days, to launch Sunvox. But OK.

Today, I only need one thing to make it perfect: To succeed in a sunvox auto start. I really can't.
Step 8 does not work. I do have the active line that gets added in rc.lua, but it doesn't seem to do much.
I also have the impression that I don't have the: /home/pi/.profile

To launch it manually I have to go to the "linux_arm" directory, type " export LD_LIBRARY_PATH=/opt/glibc/lib" and then ./sunvox_lofi .
How to make it automatic? The sunvox turns nickel, with a well recognized Korg nano, as well as the touch screen. But I would like to not have to type anything at startup.
I hope there are still people, because there I go around in circles.

Thank you. And sorry for my bad english

@BoxOfSnoo
Copy link

Hello Harry, In 2023, it's my turn to try myself. I am a beginner, and after a lot of trouble I managed with the help of a youtube video to understand some of the linux commands, enough to succeed after two days, to launch Sunvox. But OK.

Today, I only need one thing to make it perfect: To succeed in a sunvox auto start. I really can't. Step 8 does not work. I do have the active line that gets added in rc.lua, but it doesn't seem to do much. I also have the impression that I don't have the: /home/pi/.profile

To launch it manually I have to go to the "linux_arm" directory, type " export LD_LIBRARY_PATH=/opt/glibc/lib" and then ./sunvox_lofi . How to make it automatic? The sunvox turns nickel, with a well recognized Korg nano, as well as the touch screen. But I would like to not have to type anything at startup. I hope there are still people, because there I go around in circles.

Thank you. And sorry for my bad english

Hi there - if you don't have /home/pi/.profile just create it. This is what will start the x server as soon as you log in and xawesome should launch sunvox. If it doesn't launch, then you may have a small error/typo in your rc.lua file

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