These instructions come from getting this working on a fresh install of DietPi running on a Raspberry Pi 3 B+ There is an existing issue to automate this process for ease of use.
Some knowledge of how to use the command line and the ability to use git/GitHub.
If you've never used GitHub before, this Quick Start guide will help.
Run the following commands in your terminal.
- mkdir ~/tmp
- cd ~/tmp
- wget https://go.dev/dl/go1.19.4.src.tar.gz
- sudo tar -C /usr/local -xzf go1.19.4.src.tar.gz
- add export PATH=$PATH:/usr/local/go/bin to .profile
- source ~/.profile
- go version
returns
go version go1.19.4 linux/arm64
These are the dependencies that I installed during the process of troubleshooting. An audit of these dependencies is needed.
Run the following in your terminal.
sudo apt install libasound2 -y
sudo apt install alsa-utils -y
sudo apt-get install -y -qq libasound2-dev libssl-dev libpulse-dev libdbus-1-dev portaudio19-dev
sudo apt install build-essential
sudo apt install mpv
// this installs many of the previous packages, but I did this as step 5 when testing.
Run the following in your terminal.
cd ~/
mkdir dev
git clone https://github.com/jmillerv/go-dj
Run the following in your terminal.
cd ~/dev/go-dj
go build
- chmod +x ./go-dj
- cd ~/dev/go-dj
mv config.example.yml config.yml
- populate the yaml with your desired content
This will be different based on your OS and you may have done this during setup. I missed setting it to mine during the boot, so files weren't playing when I expected. You can use the System Configuration docs to aid you in getting to the DietPi timezone settings.
DietPi doesn't have the soundcards installed by default, I had to do this to get sound out of the 3.5mm jack. go-dj outputs to wherever the default audio is sent to.
Run the following in the termnal. This command will test the speakers without playing loud noise.
speaker-test -t wav -c 6
To end the test press ctrl+c
./go-dj s
Should your SBC go down, you'll likely not want to have to reboot the daemon yourself.
- open crontab
crontab -e
- add command to file
@reboot cd ~/dev/go && ./go-dj s
Ctrl+C
will usually be enough to stop the program; however, there are known issues where it does not.
Should you run into issues, knowing how to kill the program is useful
- Get the process ID
ps aux | grep go-dj
should yeild something that looks like
root 22328 0.0 1.2 1240808 12436 pts/0 Sl+ 02:03 0:00 ./go-dj s
- stop the process with the procdess ID
kill -9 22328