Skip to content

Instantly share code, notes, and snippets.

@HarryUPf
Last active September 28, 2023 01:37
  • Star 21 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
Star You must be signed in to star a gist
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
@davisaminaden
Copy link

Hello Harry.
Stuck at step 9.
Sunvox does not start.

@HarryUPf
Copy link
Author

Sunvox does not start.

hi Davis, try to start it manually from a terminal and if it doesn't run please post the output, maybe you have to reinstalll the dependencies (step_6) and reboot (step_8)

@theshinyknight
Copy link

When you run step 8 you need to edit the actual file (/etc/xdg/awesome/rc.lua) and at the bottom you need to give a return from the "-- }}} " line so the command to launch sunvox after launching xserver will be correctly executed.

I am stuck trying to follow the video from youtube; I run sunvox, I go in home/.config/sunvox but there is no sunvox config file there. Also I am using a sabrent usb dongle for audio output, which does not seem to work at all with this setup

@HarryUPf
Copy link
Author

HarryUPf commented Mar 4, 2020

@theshinyknight this tutorial has been tested on 'stretch' and sunvox 1.9.4c, but the 'stable' RealtimePi distro is now on 'buster' and sunvox is on 1.9.5d . Also, I know for a fact that awesome 4.x has breaking changes.
Please don't forget to read the comments on the 'sunvox.sh' script, because you have to edit it according to your specific hardware (audio and/or midi interfaces). In short find them with the command: jack_lsp -A
Finally, if there isn't a 'sunvox_config.ini' file, just create it with a text editor and add this line: softrender For more info read this forum thread: https://www.warmplace.ru/forum/viewtopic.php?t=4443#p15544
Let me know if you succeed. Nevertheless, I'll take this chance to update this tutorial and get it working again until the next software updates.

@jonathanneels
Copy link

Sunvox version 2 is out.

Now, how to make it work on raspberry pi?
I'm using the raspberry pi 3 b and made it work by installing the dependencies "sudo apt-get install libsdl2-2.0-0 qjackctl xorg awesome" and then choosing the linux_arm_armel version of sunvox. Do not select the raspberry pi version for raspbian (contradiction I know). Note: You might need to do chmod x+ on the file

@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