The Definitive Guide to install the software for Raspberry Pi 2b-4b+

This installation will use the late master of svxlink, updated on 1st Sep 2021. If you are unsure, then go to the svxlink page and look at the Raspbian install there.


  1. 1. Raspberry Pi B+, 2 or 3, or 4.
  2. 16 Gb MicroSD Card:
  3. PC:
  4. USB Sound Card:
  5. Time Allotment: At least 60 Minutes


Tip: You do not need to be an expert in Linux but in following this guide you will understand everything you need to know for this project


  1. On the PC install a suitable image writer.
  2. Download from the latest version of Raspbian Buster – the Raspberry OS – Lite version. The full version is quite unnecessary.
  3. Save the download and expand the image to a suitable location using 7-zip.
  4. Insert the SD Card and run the ImageWriter program, selection the .img from the previous step.
  5. Write the image and wait for the prompt upon completion.
  6. Before removing the card from the PC, create an empty file named “ssh” without a file type and save it to the boot sector on the MicroSD card, but don’t save it in the /boot folder. Tip: This action permits SSH access on boot up, and you won’t need a screen or keyboard.
  7. Remove the card from the PC

Raspberry Instruction

Tip: Before booting the raspberry with the new SDCard, ensure that it is connected on an adequate power supply and connected to the same network as the PC. You will need the application AngryIP scanner, and SSH app installed on the PC.

  1. Boot the Raspberry
  2. Run AngryIP scanner on your PC to determine the IP address of the Raspberry.
  3. Note down the IP address, and close AngryIP.
  4. Open SSH and type in the IP address for the Raspberry.
  5. Open the terminal screen and type the user “pi” and password “raspberry”.
  6. Now you are ready for the next steps in Raspbian linux. Be careful of your syntax as all commands are lower case, but if an uppercase is shown it must be used.

Updating the Raspberry

Tip: This step is absolutely necessary. Type the commands at the prompt, and wait for each of the commands to complete. There is no need to expand the operating system in the MicroSD Card, as Stretch does this on first boot.

  1. sudo raspi-config to open the configuration menu.
  2. At option 7 Advanced options, select A5 for Mode 16
  3. Exit raspi-config, but do not reboot yet.
  4. At the prompt type sudo apt update
  5. At the prompt type sudo apt-get upgrade
  6. When the commands have all finished type sudo reboot. Exit the SSH app.

Installation of the USB Soundcard

  1. Install the USB Sound Card on the Raspberry then in the terminal screen type the following command at the prompt.
  2. sudo nano /etc/modprobe.d/raspi-blacklist.conf
  3. and type the following line.
  4. blacklist snd_bcm2835
  5. then save the file (cntrl-o) and exit (cntrl-x) then type
  6. sudo nano /lib/modprobe.d/aliases.conf
  7. locate the following line
  8. options snd-usb-audio index=-2 and insert a “#” before it, then save and exit.
  9. If you want to add a dummy sound card for streaming then install the Loopback soundcard at boot-time by adding this line to /etc/modules:


You can load the module in your running system using ‘modprobe snd-aloop’.

At the other end of the Loopback, we will connect darkice as a streaming device. Put the following in /etc/asound.conf:

pcm_slave.hw_Loopback_1_2 {

pcm “hw:Loopback,1,2”

format S16_LE

channels 2

rate 48000


pcm.plug_Loopback_1_2 {

type plug

slave hw_Loopback_1_2

ttable {

0.0 = 1

0.1 = 1



Save the file. 

Create a new file by sudo nano /etc/modprobe.d/asound.conf

type this one line.

options snd-aloop index=1 pcm_substreams=8

Save and close the file and reboot.

To verify the installation type sudo aplay -l

you should see the following:

**** List of PLAYBACK Hardware Devices ****
card 0: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 1: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7

Now, when you open the device ‘plug_Loopback_1_2’ in an application, the above will force the ‘Loopback,1,2’ to be configured with parameters that SvxLink likes, and the explicit wiring of only the left channel. The darkice config will then be like this:


duration        = 0         # duration of encoding, in seconds. 0 means forever

bufferSecs      = 1         # size of internal slip buffer, in seconds

reconnect       = yes       # reconnect to the server(s) if disconnected

realtime        = no        # run the encoder with POSIX realtime priority

rtprio          = 3         # scheduling priority for the realtime threads

# this section describes the audio input that will be streamed


device          = plug_Loopback_1_2 # ALSA soundcard device for the audio input

sampleRate      = 22050     # sample rate in Hz. try 11025, 22050 or 44100

bitsPerSample   = 16        # bits per sample. try 16

channel         = 1         # channels. 1 = mono, 2 = stereo

  1. sudo apt install darkice icecast2. As you install icecast2, you will be presented with request for passwords and other parameters. Make notes as you proceed. You will need to configure darkice after reboot. Directions are includes with both packages.
  2. Darkice requires you to do the following before you can operate on it. sudo gunzip /usr/share/doc/darkice/examples/darkice.cfg.gz, then sudo cp /usr/share/doc/darkice/examples/darkice.cfg /etc then sudo nano /etc/darkice.cfg to final configure the dummy sound card you have previously made above.
  3. sudo nano /etc/default/darkice and change “no” to “yes” and save and exit.
  4. Sudo nano /etc/default/icecast2 and add a new line Enable=true, save and exit.
  5. Once you have configured IceCast – (sudo nano /etc/icecast2/icecast.xml), we can now…
  6. reboot, but we’ve not finished yet.

Sound Card Configuration

  1. Re-open RealVNC viewer to the raspberry pi.
  2. Re-open a terminal screen and type the following command at the prompt.
  3. sudo alsamixer
  4. you should now see that your USB sound card is the default sound card. type cntrl-f5 to view all the sliders.
  5. set the first slider to around 60% the second to zero, the third to a maximum of 12 and in the fourth type M to mute the amplifier.
  6. Type escape then type
  7. sudo alsactl store This will save these settings even after re-booting.
  8. sudo adduser svxlink (This will prepare the card for the installation of SVXLink.)
  9. Make the password svxlink, as you won’t need to use this any further.

Compiling SVXLink successfully

  1. To insure git is installed, type sudo apt install git, although I have found it installed as standard.
  2. At the prompt in the terminal type sudo git clone
  3. This will give you a download of the the latest master of svxlink.git including svxreflector, svxserver and svxremote into a folder called svxlink in the current user.
  4. When it is safely downloaded, go to the instructions page to add all the necessary additional software. The list is very important and is found on the project page of at install.adoc. Some of the software is standard in Raspbian Stretch so you may find the system reporting this fact. The list of -dev packages is more difficult, but I will show you the following pointers.
  5. To install the top list of software simply type “sudo apt install gcc g++ make cmake groff gzip doxygen tar git”
  6. For the second half of the list install each of the packs individually.
  7. sudo apt install libsigc++-2.0-dev
  8. sudo apt install libpopt-dev
  9. sudo apt install tcl8.6-dev
  10. sudo apt install libgcrypt20-dev
  11. sudo apt install libasound2-dev
  12. sudo apt install libgsm1-dev
  13. sudo apt install libspeex-dev
  14. sudo apt install librtlsdr-dev
  15. sudo apt install libqt4-dev
  16. sudo apt install curl libcurl4-openssl-dev libjsoncpp-dev
  17. sudo apt install libopus0 opus-tools libopus-dev
  18. sudo apt install lame –this is for darkice streaming type MP3 see below.

This line 16 permits the metarinfo module to access the weather information from an https source. The line 17 adds the best codec for any sound app.

If the system responds with a y/n query always go for the y and you will have no issues. The final line to type will be sudo apt install alsa-utils, but it may attract the response that the latest tools are already installed.

The Compilation
Now follows the commands below.

  1. cd svxlink/src
  2. sudo mkdir build
  3. cd build

Now we start compiling. Type the following line EXACTLY, including / \. as they are important for the syntax. This command must go on one line. The final two .. after a single space are important too. The command will take several minutes to execute.

  2. sudo make – This command will take 30-45 minutes to run dependent on processor used.
  3. sudo make doc – This prepares all the documentation and manual files.
  4. sudo make install – This compiles all the software into the operating system.
  5. sudo ldconfig
  6. Before proceeding we can test the darkice server by typing the IP address of the raspberry:8000/stream into a browser.

Installation of the Sound Files

The software is now installed, but not yet ready for use. We need the Language files. My preferred method is as follows.

cd /usr/share/svxlink/sounds – We are now in the correct directory. There is a useful command wget that downloads a file from a web source.

sudo wget http://(websource) filename
If you want the french language…

sudo wget

If you want the British-English language, then

sudo wget

sudo tar -xzvf fr_FR.tar.gz – unwraps all the necessary files into their proper folders.

Or sudo tar -xzvf enGB.tar.gz for the British English.

If you want the en_US files they are on
If you want to make your own then download DSpeech from Dimio and play with that. However the finished .wav files need to be imported into Audacity, trimmed and exported as microsoft .wav files. This changes the bit 16 (H10) from Hex 12 to Hex 10, to enable them to work in svxlink.

Setting up the GPIO ports

We need to setup the GPIO ports. The simplest way is to add the following lines to the file /etc/rc.local, after fi and before the last line.

  1. sudo nano /etc/rc.local






# GPIO 17 as PTT to TX2

echo 17 > /sys/class/gpio/export

echo out > /sys/class/gpio/gpio17/direction

sudo chmod 777 /sys/class/gpio/gpio17/value

# GPIO 18 as Squelch to RX2

echo 18 > /sys/class/gpio/export

echo in > /sys/class/gpio/gpio18/direction

sudo chmod 777 /sys/class/gpio/gpio18/value

#GPIO 24 as PTT to TX1

echo 24 > /sys/class/gpio/export

echo out > /sys/class/gpio/gpio24/direction

sudo chmod 777 /sys/class/gpio/gpio24/value

# GPIO 23 as Squelch to RX1

echo 23 > /sys/class/gpio/export

echo in > /sys/class/gpio/gpio23/direction

sudo chmod 777 /sys/class/gpio/gpio23/value

#end of GPIO Section

#Remove # at start of next line for permanent reboot on power loss.

#sudo svxlink –daemon –logfile=/var/log/svxlink.log

And if you are running Darkice then this following line is essential.

sudo /usr/bin/darkice -c /etc/darkice.cfg

These lines go immediately before the final

exit 0

  1. Save and exit the file.

CW.tcl New Paragraph

In the first version I described some changes relating to increasing the CW characters in the available list. Those changes to the CW character table still apply, but the syntax that sends the characters/callsigns to the audio chain has changed as follows:

CW::play $mycall 95 650 -4;

CW::play “-” 95 650 -4;

This command plays the CW character “-” or the assigned call sign at speed 95 with tone 650 Hz at volume -4, which I find quite adequate for most purposes.

Run Time

  1. The final steps are to set the parameters in /etc/svxlink/svxlink.conf and /etc/svxlink/svxlink.d/ModuleEchoLink.conf to enable your installation, paying attention to syntax and whether you are operating simplex or duplex.
  2. I have plenty more tips, but most of the answers are in the documentation on your MicroSD Card.
  3. Don’t forget to remove the # from the run line in /etc/rc.local to make your installation run at boot up.
  4. KISS principle – Do not overcomplicate your system. Ask yourself – Do I really need it? when considering changes. Why do you think that people want to see what’s occurring on the repeater when all they have is a radio and want to talk?

Streaming : Some issues

Firstly I discovered through some research that Raspbian Buster cannot handle booting Darkice from the /etc/rc.local without some intervention. Despite the line starting Darkice in the file, I discovered that darkice would still not start. Going into Terminal I found that by stopping the darkice service and starting it again the stream would start. So I have derived this script that must be added to you build in the following way.

sudo mkdir /etc/scripts

cd /etc/scripts

sudo nano, and type the following text exactly into it.


sudo systemctl stop darkice.service
sleep 1
sudo systemctl start darkice.service
sleep 1

save and close the file.

sudo chmod +x


sudo nano /etc/rc.local

and insert the following line before the final line exit 0.

sudo sh /etc/scripts/

save the file and reboot.

The stream will start after a short delay on boot up.

Leave a Reply