NA0D.COM
Darkice How-To's
Darkice
Darkice is one of many streaming-type programs that will take audio and send it to servers, such as Icecast, for listening online. This program, based in Linux for our purposes, runs well and streams quality audio for playback on desktops and mobile devices. More professional-type outfits like Broadcastify use Darkice and other software of this type for their streaming services. Now, we can stream more or less whatever we want (including GMRS repeaters) the same way as they do! This is a work in progress so updates as needed.
Equipment Needed
You will need some equipment to do this, and a little Linux know-how. But I'll try to make it somewhat easier and if I can do it, you can too. This is a collection of what I did, whether right or wrong, to get to the endpoint of "works". I'm always open to it can be done better or easier. There may be better ways; do em!
Okay, here's what I used for different things and where I got it.....
​
Your repeater or radio is on the air and you're looking to stream the audio from it to the Icecast server for playback. Icecast server is already set up (that's a whole 'nother beast) and ready. Here are some sample pieces of equipment you could use (your choice)....
​
-
A computer with internet access at your site or home. Raspberry Pi works well, or a Thin Client or old computer you have laying around.
-
A USB Sound Card, such as a SABRENT USB External Stereo Sound Adapter LINKY HERE
-
A cheap scanner or radio with an audio plug out. Old scanners can be had cheap from eBay or wherever. It can be analog and doesn't have to be a fancy digital one since we're streaming an analog repeater. Preferably something that doesn't run on batteries that you have to replace all the time.
-
An AUX cable to bring audio from radio or scanner to USB (it can be stereo or mono) LINKY HERE
​
That's about it. The scanner will receive your repeater over the air, and then send that signal to the Icecast server for remote monitoring through the Raspberry Pi or computer using Darkice. Some tips:
-
If you put the scanner at your site, you'll get great signal. Take the antenna off so the only thing it hears is the repeater and not the kids down the street making noises. Especially important at a repeater site.
-
If your scanner has the ability to decode CTCSS, use it!
-
If you place the scanner at your house, make sure it receives your repeater well and isn't full of a bunch of humming, noises, and junk. You'll also need to adjust audio levels. More on that later but do the best you can.
​
​
Setup Darkice
Okay, here we go and let's try to setup Darkice. There are several ways to do this, so we'll do it like we're using a Raspberry Pi. I'll put links to different places as we go so you can figure out what works best. Most of what we do will be using a Putty or SSH terminal to make changes and add files.
Install Darkice
Install Raspian or Raspberry Pi OS on your Raspberry Pi. If you're using a computer, go for Debian 12 as it works great and is stable. Most of the commands you'll use here will work on both, as follows, since RPi OS is built on Debian. There may be changes as to file locations but you'll get it as we go on. If you use the Raspberry Pi, download the Raspberry Pi IMAGER to build your card. Make sure to Enable SSH before making the SD card.
If enabling SSH on the imager doesn't work, you can enable it on the desktop side so you can use your terminal on your computer. You'll want to have SSH access with Putty or terminal if it is to be placed at a remote site. More later and you'll thank me. I thanked me ha ha.
​
Once you've gotten this far, make sure you're updated first (apt-get update or apt update) and then open a terminal and enter
​
​
​​
​
​
​
​
​
Find your USB Sound Card
Once Darkice is installed, we need to figure a few things out, set up a few files and run some tests.
Some computers will have a built in one, some won't, it depends. Unless you installed something (in the case of our Raspberry Pi that was a fresh install) only one may come up. Plug in your USB sound card to a USB port. Then open your terminal and run
​
​
​
The output will look something like this
​
**** List of CAPTURE Hardware Devices ****
card 2: Device [USB Audio Device], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0
​
Make note of the Card Number and Device Number that matches your USB Card. If you have multiple sound cards, you can run this command with it plugged in and without it plugged in, noting what device comes and goes. With the Sabrent and most external USB cards, it should say something like "USB Audio" that will provide you with clues on which one it is. You will need these numbers when working on your config file as the "plughw:2,0" or whatever card will be needed to tell Darkice where to get the audio from. In our case here, 2,0 will be the correct numbers.
Edit Darkice.cfg Configuration File
Now let's create our configuration file, and edit it to get prepared for streaming. There is a sample configuration file below that you can copy and paste into your editor. Open a terminal and use your favorite editor to create a file. I find it easiest to place it in the /etc/ folder, but it don't matter as long as you know where it is so you can point to it later. For this example, we'll place it into the /etc/ folder. Execute the following command that will both land you in the proper folder and start the configuration file (we will use nano) that we will need.
​
​
Copy the entire contents of the sample configuration file below and paste into your new config, then edit appropriately. A few of these settings you'll leave as is, but the explanation follows.....
Sample Darkice Configuation File
#darkice.conf
# this section describes general aspects of the live streaming session
[general]
duration = 0 # duration of encoding, in seconds.
bufferSecs = 5 # size of internal slip buffer, in seconds
reconnect = yes # reconnect to the server(s) if disconnected
realtime = yes # 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
[input]
device = plughw:1,0 #enter sound card from arecord-l here
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
# this section describes a streaming connection to an IceCast2 server
# there may be up to 8 of these sections, named [icecast2-0] ... [icecast2-7]
# these can be mixed with [icecast-x] and [shoutcast-x] sections
[icecast2-0]
bitrateMode = abr # average bit rate
format = mp3 # format of the stream
bitrate = 96 # bitrate of the stream sent to the server
server = audio.na0d.com
#server = 192.168.1.1 # host name of the server
port = 8000 # port of the IceCast2 server, usually 8000
password = xxxxxxx # source password to the IceCast2 server
mountPoint = Your Repeater_Stream # mount point of this stream on the IceCast2 server. Name after your repeater like Rock 600.
name = Rock 600 Repeater, Little Rock # name of the stream
description = Streaming feed of the 462.575 Rock 600 GMRS Repeater in Arkansas. # add a description of your system.
url = https://arkradio.net/repeaters/baxter575 # URL related to the stream
genre = GMRS Repeater Stream # genre of the stream
Configuration File Explanations
Don't direct copy any text from here and paste it into your config file as it could mess up your file formatting! Copy and paste from the black box above only and make changes in your config file directly. For a safer bet, you can copy the above config sample and paste into a notepad for editing, then copying from there into your darkice.cfg file. Keep note of spaces and symbols. The information that follows is the explanation area and may have formatting issues!
​
[General] Section
We can leave the general section as-is for most cases for our purposes. Adjustments here will be sent to all streamers as needed.
​
[Input] Section
This is the section where you will tell Darkice what sound card to use and how to use it.
Device: plughw:2,0 This is where you enter your sound card we talked about earlier. Card number first then device number. Make no changes to spaces in the config file. Yours may be 1,0 or 1,1, or 2,0. This is critical. If you make a mistake it will either refuse to stream, or you'll get no audio.
​
sampleRate: 22050 This is fine for what we're doing
​
bitsPerSample: 16 is fine for this setup.
​
channel=1 Run this as Mono, since its a scanner. 2 is stereo and won't kill anything but may save yourself from some failures and overruns. More on Buffer Overrun Later.
​
[icecast2-0] This section describes the server you'll be streaming to
and what data is needed. This config file will allow you to stream to mine at audio.na0d.com. Most of this is "as-is", except for password and personal data for your radio site.
bitrateMode = abr # average bit rate (leave this as-is)
format = mp3 # format of the stream (leave this as-is)
bitrate = 96 # bitrate of the stream sent to the server (leave this as-is)
server = audio.na0d.com (this is the server I own that the above file will work for. Add your server of choice in this space as needed.
#server = 192.168.1.1 # host name of the server (this is for internal servers. Leave it commented out, or leave the # in front where it is in the file)
port = 8000 # port of the IceCast2 server, usually 8000 (leave this as-is)
password = xxxxxxx # source password to the IceCast2 server (I will give this to whoever wants to stream
to audio.na0d.com)
mountPoint = Your Repeater_Stream # mount point of this stream on the IceCast2 server. (Name after your repeater like Rock 600 and use _Stream after it. A sample is Rock 600_Stream)
name = Rock 600 Repeater, Little Rock # (The simple name of your repeater or stream)
description = Streaming feed of the 462.575 Rock 600 GMRS Repeater in Arkansas. # add a description of your system.(This is the full description of the repeater stream contents, location, etc.)
url = https://arkradio.net/repeaters/baxter575 # URL related to the stream (This is where you enter your webpage if available)
genre = GMRS Repeater Stream # genre of the stream (leave this if it is a GMRS repeater, if something else I can give you something to add.)
Once you're done editing your config file, use CTL-X and Yes (Y) to save the file. Your config file is now ready at /etc/darkice.cfg for later editing. Keep note of this as you'll need it later if you want to automatically start Darkice in case of power cycles or editing.
​
​
Before We Fire Up The Stream!
Scanner Preparation
Before we fire this bad dude up for the first time, let's talk about the scanner or radio used to pick up the audio! Some quick hints...
​
-
Use a line out jack if you want and is available. Most cheap scanners that you'd use for this type of stuff may only have an external speaker or headphone jack. That will be fine, but you'll need to adjust the audio out to your streamer for a pleasant listening experience with the volume button on the scanner. Too loud and it will be all buzzy, clipping, and sound like general trash. Too low, won't hear it. You'll be able to adjust once your stream starts and you can listen to playback and make adjustments accordingly. Start with the volume very low, and work up. If you have a VU meter or using some sort of audio monitoring interface, shoot for -12dB or -15db. Otherwise, make it sound nice and not too loud. I will come up with something you can test with.
-
Plug your AUX cable between that speaker jack and the MIC jack of your USB card. On the Sabrent ones, as with most of them, it should be the PINK jack.
-
Find a good place for the scanner where you'll be able to hear your repeater. In the case of GMRS repeaters, one at the site with no antenna works pretty well to hear the repeater but nothing else.
-
If using a scanner that is committed specifically to this task, it would be a good idea to make sure that only one "channel" is programmed into it so in case of power outages it doesn't start inadvertently scanning other stuff when power is restored. A UPS is nice also for a remote site. A Pi and a scanner don't use a lot of juice and this is provided your sites' internet connection is also on backup.​
-
Make sure your scanner is programmed to the correct frequency (and CTCSS, where available).
PI or Computer Preparation
Last but not least, after all is done with your config file, as well as your scanner and USB sound card is ready, let's do a couple simple things.
-
Double check config file for errors and all data is prepared correctly. You'll see them when you start but best to have none!
-
Make sure config file is saved.
-
Restart or better yet, reboot your Pi or computer system to save and activate all the changes and updates.
Start Darkice Stream
The moment of truth is here. Let's get to streaming!
​
Once your computer is all powered up and your scanner is on and tested, you have your config file and everything is ready to go, you execute Darkice with once simple command:
​
​
Darkice doesn't always have to run with sudo, but when it is, it provides additonal resource capability and is generally happier.
If all is well, and darkice is happy, this should be the output shown in your terminal:
Started darkice - Darkice Streamer.
DarkIce 1.3 live audio streamer, http://code.google.com/p/d>
Copyright (c) 2000-2007, Tyrell Hungary, http://tyrell.hu/
Copyright (c) 2008-2013, Akos Maroy and Rafael Diniz
This is free software, and you are welcome to redistribute >
under the terms of The GNU General Public License version 3>
any later version.
Using config file: /etc/darkice.cfg
Using ALSA DSP input device: plughw:2,0
Using POSIX real-time scheduling, priority 3
Likewise if all the server and password information was correct, your stream should show up on the Icecast server and look something like this...
Keep Darkice Running!
The previous setup will work, but you'll have to keep a terminal running to keep the stream on. Eventually, you will want to set it up to either automatically start, or create a systemd.service to keep Darkice running remotely or when you close a terminal. This is especially helpful with remote site login and starts. Here are some links and videos to different places that can explain the how-to's.
Common Systemctl Commands
rpi ~$ sudo systemctl enable darkice.service
rpi ~$ sudo systemctl start darkice.service
rpi ~$ sudo systemctl stop darkice.service
rpi ~$ sudo systemctl status darkice.service
​