Adding an audible output for Radio Listeners is the goal here, to provide added interest. If you have downloaded the svxlinkbuilder script, or better still installed the svxlink image and run it from today 20/10/2025, then ignore what follows and go to the very bottom of page and follow the link there.

If not then carry on.

You should have at least installed SVXLink in the fashion described in the linked page here. Read and follow the directions explicitly.

You should have a USB Sound Card preferably the CM108 already described in these pages, or USB dongle modified too drive the PTT and receive the SQL/COS signal.

Time Allotment: Allow at least 40 Minutes at the very least.

Implementation for the Darkice and Icecast2

Hopefully you shall have first tested and run your svxlink node.

If you want to stream the output for public consumption then this is what we shall do.

Installation of the Dummy Soundcard

In the terminal screen type the following command at the prompt.

sudo nano /etc/modules

Type the single line as follow

snd-aloop

Now type cntrl-o to save the new file and cntrl-x to exit the editor.

You can now load the module in your running system by typing sudo modprobe snd-aloop followed by enter.

Dummy Sound Card Configuration

At the other end of the Loopback, we will ultimately connect darkice as a streaming device. Type the following
sudo nano /etc/asound.conf

Then type the following lines exactly as they are written.

pcm.loophw {
type hw
card Loopback
device 0
subdevice 0
}

pcm.loopout {
type plug
slave.pcm “loophw”
}

Ensure you have the correct syntax, and the correct number of curly braces.
Save the file by typing cntrl-o and cntrl-x as before.

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 as before.
Reboot the raspberry at this stage.

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

If you do not see this but some errors, then go back up to Dummy Sound Configuration, and remove the configuration, save the file, reboot and repeat the configuration once more.

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 set up momentarily:

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.

To configure Darkice perform the following :

sudo nano /etc/darkice.cfg
to final configure the dummy sound card you have previously made above.

[general]
duration = 0
bufferSecs = 5
reconnect = yes

[input]
device = hw:Loopback,1,0 # You may need to change the numbers here for your setup
sampleRate = 44100
bitsPerSample = 16
channel = 2

[icecast2-0]
bitrateMode = cbr
bitrate = 320 # Max bitrate for MP3 is 320 and best for binaural audio
format = mp3
#quality = 1.0 # Sets the quality of the stream 1.0 being highest
server = localhost # This is a free server or you can pay for one
port = 8000 # Your port number from your icecast2 settings
mountPoint = stream # Omit the ‘/’ before ‘stream’ in Darkice “stream.mp3” for example
password = source # Source password from icecast or private paid for server password
name = stream # Name of account
url = http://full url of the stream:8000/stream
# example url = http://portal.svxlink.uk:8010/stream

description = Live Audio from an Svxlink Node # Stream description
genre = Amateur Radio
public = yes`

Save the file.

sudo nano /etc/default/icecast2 and add a new line ENABLE=true, save and exit.

Once you have configured Icecast2 – (sudo nano /etc/icecast2/icecast.xml), we can now…

sudo nano /etc/systemd/system/darkice.service

add the following text.

[Unit]
Description=Darkice Live Audio Streamer
After=network.target

[Service]
Type=simple
User=root
ExecStart=/usr/bin/darkice -c /etc/darkice.cfg
WorkingDirectory=/etc
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target

Save the file and type

sudo systemctl daemon-reload

Now type

sudo systemctl enable darkice

sudo systemctl start darkice

sudo mkdir scripts ….if it does not already exist – it should do, if you have used the image or svxlinkbuilder.

cd scripts

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

#!/bin/sh

sudo systemctl restart darkice

save and close the file.

sudo chmod +x darkice.sh

Now we enable Icecast2 and darkice as follows.

sudo systemctl enable icecast2  darkice –now 

This enables and starts both applications.

Now we must reconfigure svxlink.conf to channel out to the Dummy Sound Card.

sudo nano /etc/svxlink/svxlink.conf

First of all we need to configure a transmitter channel.

[TxStream]
TYPE = Local
AUDIO_DEV = alsa:plughw:Loopback,0,0
AUDIO_CHANNEL = 0
PTT_TYPE = NONE
TIMEOUT = 7200
TX_DELAY = 0
PREEMPHASIS = 0

Now to add it to a MultiTx

[MultiTx]

TYPE=Multi
TRANSMITTERS=Tx1,TxStream

Now we change the Transmitter itself to reflect these changes.

[SimplexLogic] or [RepeaterLogic]

Change TX=Tx1 to TX=MultiTx

And save the file.

Now finally we can restart – sudo systemctl restart svxlink

The stream will start after a short delay on boot up. In a browser type the ip address of the raspberry e.g. 192.168.1.195:8000

and click on the link presented – For Example. Remember you set yours in darkice.cfg.

http://portal.svxlink.uk:8010

To further enable Darkice in case of it falling over I have also added this line to the crontab as follows.

sudo crontab -e

59 23 * * * /home/pi/scripts/resetlog.sh

01 00 * * * /home/pi/scripts/darkice.sh