Author Topic: Streaming to Multiple Icecast Servers with RTL SDR and Darkice  (Read 2351 times)

0 Members and 1 Guest are viewing this topic.

Offline tim273

  • Senior Member
  • **
  • Posts: 94
This guide is outdated.

Please go to https://github.com/tim273/weather_radio_scripts instead as this guide will no longer be updated.




Introduction

This is a guide to set up NOAA streaming weather radio using a Raspberry Pi and an RTL SDR stick.  The advantages to using a Raspberry Pi over Windows is that Raspberry Pi primary runs Linux and Linux is ideal for 24/7 type servers where as Windows is not. Linux can run days, weeks or even months without needing to be restarted as it was designed to be used this way.  It doesn't have the problem of restarting on you or going to sleep and you don't need an entire computer dedicated to streaming.  The Raspberry Pi is also very low power, maybe 5-15 watts at the most and much less depending the load and it is very small, about the size of a deck of cards so it can be put just about anywhere.  The only disadvantage is that is not very powerful, it's about the equivalent of an average smart phone in power, but for the purposes of streaming no GUI is needed, so resources are not needed for that, so it has plenty of power to do what we need. The other big advantage is that all the software is free.

Note: You can also use a Raspberry Pi with just Darkice and a weather radio, the setup is similar, you would just use a weather radio instead of an RTL SDR stick. I used this setup for a few years to stream to Weather Underground (Raspberry Pi/Darkice/Weather Radio), the instructions are the same except you only need to follow the instructions to install the OS and compile/setup Darkice and skip the RTL SDR setup.  You would also need an external sound card such as this one: https://www.amazon.com/Behringer-UCA202-BEHRINGER-U-CONTROL/dp/B000KW2YEI and then an adapter for your weather radio like this: https://www.amazon.com/gp/product/B0052A2LYG and then an RCA left/right cable.  The trick is to find the right ALSA input to stream from, but I believe I used 'plughw:1,0'.

Equipment

Purchase a Raspberry Pi from Amazon: https://www.amazon.com/CanaKit-Raspberry-Clear-Power-Supply/dp/B01C6EQNNK you'll also need a microSD card, preferably class 10
Micro Center also carries Raspberry Pi's and everything else you'll need:

MicroSD: http://www.microcenter.com/product/366176/16GB_microSDHC_Class_10_Flash_Memory_Card (I've used Micro Center microSD cards in all my Raspberry Pi's without any problems, they're cheap and reliable.  I also have a Micro Center near me though).
Raspberry Pi and Case: http://www.microcenter.com/product/461230/Raspberry_Pi_3_Model_B_Board_and_Case_Kit
Power Supply: http://www.microcenter.com/product/461596/25Amp_51v_Switching_Power_Supply_for_Raspberry_Pi_B_with_Built-in_4ft_Micro-USB_Cable

Since this Pi is going to be streaming 24/7, you'll also want an Ethernet cable to connect to your modem/router as WiFi is not reliable enough.  Amazon or Micro Center has various lengths of Cat 5e cable at reasonable prices.

Nooelec has good RTL SDR kits, this one is fairly small and includes an antenna: http://www.nooelec.com/store/sdr/sdr-receivers/nesdr/nesdr-mini2-rtl2832u-r820t2.html.  If you can't get good reception with the included antenna, you could strip off the jacket of some standard TV coax and expose 17 1/4 inches of bare center wire, then mount that somewhere up high indoors (like an attic).

OS Install

Once you have all that equipment download Raspbian Jessie Lite from https://www.raspberrypi.org/downloads/raspbian and follow these instructions to put it on the microSD card: https://www.raspberrypi.org/documentation/installation/installing-images/   Once the OS is installed on the SD card, insert it into the Pi, connect the network cable, HDMI to a monitor or TV, and a USB keyboard (mouse not needed).  You can also plug in the RTL SDR and hook it up to the antenna.  Finally, plug in the power.

Once booted, log in with username pi and password raspberry, then type:

Code: [Select]
sudo raspi-config

Select 5 Interfacing Options, hit Enter
Select 2 SSH, hit Enter
Select Yes to enable SSH
At the main menu, select 7 Advanced Options
Select A3 Memory Split
Type in 16 and select Ok

Optional: From the main menu

Select 2 Hostname and slelect Ok
change the hostname from "raspberrypi" to something more meaningful like "weather-radio-streamer" or whatever you choose.
Select 4 Localisation Options then I2 Change Timezone then choose your timezone (GMT is the default timezone).

Then exit out of raspi-config by selecting Finish and hit Enter.  If it ask to reboot, select no or cancel as we will be rebooting later.

Next type:

Code: [Select]
ifconfig

Then take note of the IP address of eth0.  From there, you no longer need the monitor/TV or keyboard and you can SSH using Putty (http://www.putty.org/) and perform the rest of this guide remotely with SSH from a desktop/laptop.

Optional step: Create an SSH key pair so that you don't have to enter your username or password when you log in: http://www.tecmint.com/ssh-passwordless-login-with-putty/

Next update your pi:

Code: [Select]
sudo apt-get update
sudo apt-get dist-upgrade

This will take a few minutes depending on the number of updates.  Once finished reboot just in case there are any kernel updates.

Code: [Select]
sudo reboot

Install Packages

Wait a couple minutes and then ssh in again.  Install necessary packages:

Code: [Select]
sudo apt-get install build-essential devscripts autotools-dev fakeroot dpkg-dev debhelper autotools-dev dh-make quilt ccache libsamplerate0-dev libpulse-dev libaudio-dev lame libjack-jackd2-dev libasound2-dev libtwolame-dev libfaad-dev libflac-dev libmp4v2-dev libshout3-dev libmp3lame-dev vim htop screen git icecast2 libtool-bin rtl-sdr sox libsox-fmt-mp3 ezstream iftop

When it asks about configuring Icecast, just choose the default values for now.  Installing these packages will take several minutes, now would be a good time to get a coffee or take a walk or something.

Download and Compile Darkice

Clone Darkice from GitHub:

Code: [Select]
git clone https://github.com/rafael2k/darkice

Compile and install Darkice (one command at a time):

Code: [Select]
cd darkice/darkice/trunk
./autogen.sh --prefix=/usr --sysconfdir=/usr/share/doc/darkice/examples --with-vorbis-prefix=/usr/lib/arm-linux-gnueabihf/ --with-jack-prefix=/usr/lib/arm-linux-gnueabihf/ --with-alsa-prefix=/usr/lib/arm-linux-gnueabihf/ --with-faac-prefix=/usr/lib/arm-linux-gnueabihf/ --with-aacplus-prefix=/usr/lib/arm-linux-gnueabihf/ --with-samplerate-prefix=/usr/lib/arm-linux-gnueabihf/ --with-lame-prefix=/usr/lib/arm-linux-gnueabihf/ CFLAGS='-march=armv6 -mfpu=vfp -mfloat-abi=hard'
make
sudo make install

Setup Darkice

I like using vim for text editing, that's just me I'm old school, :grin: you can also use nano if you'd like. More on nano here: https://www.howtogeek.com/howto/42980/the-beginners-guide-to-nano-the-linux-command-line-text-editor and you want to read about vim vs nano vs emacs, here you go: http://downtoearthlinux.com/posts/clash-of-the-text-editors-nano-vim-and-emacs/

Here's a quick vim rundown:

vim test.txt
i (i for insert or a for add)
Type: "Here's my text"
Esc (takes you out of insert/add mode)
:wq (w for write q for quit)

If you don't know what's going on hit Esc a few times and start over.  If you make changes and screw up and don't want to save type

:q!

This will quit without saving changes. Typing : will allow you to search and do other things as well.  Here's more info: https://www.linux.com/learn/vim-101-beginners-guide-vim

Code: [Select]
sudo vim /etc/darkice.cfg

add the following:

Code: [Select]
[general]
duration      = 0
bufferSecs    = 5
reconnect     = yes

[input]
device        = plughw:1,1
sampleRate    = 48000
bitsPerSample = 16
channel       = 1

# Primary Icecast
[icecast2-0]
bitrateMode   = abr
format        = mp3
bitrate       = 64
server        = icecast.yourserver.com
port          = 8000
password      = your_password
mountPoint    = your/mountpoint
name          = Your Weather Radio
description   = NOAA Weather Radio
url           = http://www.wunderground.com
genre         = Weather
public        = yes
#lowpass       = 3000
lowpass       = 3500
#lowpass       = 4300

# Broadcastify/Radio Reference Icecast (if you have one, if not comment out or remove the following)
[icecast2-1]
bitrateMode   = cbr
quality       = 0.3
format        = mp3
bitrate       = 16
sampleRate    = 22050
server        = audio9.broadcastify.com
port          = 80
password      = your_password
mountPoint    = your/moutpoint
name          = Your Weather Radio
description   = NOAA Weather Radio
url           = http://www.wunderground.com
genre         = Weather
public        = yes
#lowpass       = 3000
lowpass       = 3500
#lowpass       = 4300

Darkice allows you to stream to up to 8 Icecast/Shoutcast servers from a single source and each can have its own bitrate, sampleRate, etc and it will reencode from the source, they are labeled icecast2-0, icecast2-1, icecast2-2, etc. You shouldn't need more than 2, but you never know.  For more info type:

Code: [Select]
man darkice.cfg

Next, modify the above and add your url, mount point, password and information.  Next, add an init script for Darkice so it starts on boot:

Code: [Select]
sudo vim /etc/init.d/darkice

add the following:

Code: [Select]
#! /bin/sh
### BEGIN INIT INFO
# Provides:          darkice
# Required-Start:    $remote_fs $syslog $network $named $time alsa-utils
# Required-Stop:     $remote_fs $syslog $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: darkice audio streamer
# Description:       Darkice will take an ALSA audio input and send it to
#                      a streaming server.
### END INIT INFO
# or try
# Required-Start:       $all
# in  above header

# Author: <glyman3@gmail.com>
# Based on skelton script installed with "Raspbian", A community-created
#  port of Debian wheezy, optimised for the Raspberry Pi

# This is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.#

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="darkice"
NAME=darkice
DAEMON=/usr/bin/$NAME
DAEMON_ARGS="-v10 -c /etc/darkice.cfg"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read deafult configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Overide VERBOSE variable so that results are displayed
VERBOSE=yes
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions

#
# Function that starts the daemon/service
#
do_start()
{
 # Return
 #   0 if daemon has been started
 #   1 if daemon was already running
 #   2 if daemon could not be started
 start-stop-daemon --start --quiet --background --make-pidfile --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
 || return 1
 #start-stop-daemon --start --quiet --background --make-pidfile --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS \
 start-stop-daemon --start --quiet --make-pidfile --pidfile $PIDFILE --background --startas /bin/bash -- -c "exec darkice -v10 > /var/log/darkice.log 2>&1" \
 || return 2
 # Add code here, if necessary, that waits for the process to be ready
 # to handle requests from services started subsequently which depend
 # on this one.  As a last resort, sleep for some time.

# # If radioplay script exists & can be run then initalize it when darkice starts recording:
#        [ -x "/usr/local/bin/radioplay" ] &&  /usr/local/bin/radioplay init
}

#
# Function that stops the daemon/service
#
do_stop()
{
 # Return
 #   0 if daemon has been stopped
 #   1 if daemon was already stopped
 #   2 if daemon could not be stopped
 #   other if a failure occurred
 start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
 RETVAL="$?"
 [ "$RETVAL" = 2 ] && return 2
 # Wait for children to finish too if this is a daemon that forks
 # and if the daemon is only ever run from this initscript.
 # If the above conditions are not satisfied then add some other code
 # that waits for the process to drop all resources that could be
 # needed by services started subsequently.  A last resort is to
 # sleep for some time.
 #  WAS ACTIVE:
 #start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
 [ "$?" = 2 ] && return 2
 # Many daemons don't delete their pidfiles when they exit.
 rm -f $PIDFILE
 return "$RETVAL"
}

#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
 #
 # If the daemon can reload its configuration without
 # restarting (for example, when it is sent a SIGHUP),
 # then implement that here.
 #
 start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
 return 0
}

case "$1" in
  start)
 [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
 do_start
 case "$?" in
 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
 esac
 ;;
  stop)
 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
 do_stop
 case "$?" in
 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
 esac
 ;;
  status)
 status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
 ;;
  reload|force-reload)
 log_daemon_msg "Reloading $DESC" "$NAME"
 do_reload
 log_end_msg $?
 ;;
  restart)
 log_daemon_msg "Restarting $DESC" "$NAME"
 do_stop
 case "$?" in
   0|1)
 do_start
 case "$?" in
 0) log_end_msg 0 ;;
 1) log_end_msg 1 ;; # Old process is still running
 *) log_end_msg 1 ;; # Failed to start
 esac
 ;;
   *)
 # Failed to stop
 log_end_msg 1
 ;;
 esac
 ;;
  *)
 echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
 exit 3
 ;;
esac

Next add darkice to the services:

Code: [Select]
sudo chmod +x /etc/init.d/darkice
sudo update-rc.d darkice defaults

Setup for RTL SDR

Add the ALSA loopback plugin to the kernel modules:

Code: [Select]
sudo vim /etc/modules

add the following two lines:

Code: [Select]
snd_bcm2835
snd-aloop

Create the ALSA config file:
Code: [Select]
sudo vim /etc/asound.conf

Add the following:

Code: [Select]
pcm.duplex {
    type asym
    playback.pcm "hw:1,0"
    capture.pcm "hw:0,0"
}
pcm.!default {
    type plug
    slave.pcm "duplex"
}

Next create the rules file for RTL SDR which allows the correct kernel driver to be used:

Code: [Select]
sudo vim /etc/udev/rules.d/20.rtlsdr.rules

add the following:

Code: [Select]
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", GROUP="adm", MODE="0666", SYMLINK+="rtl_sdr"

Create a script to start RTL SDR and pipe it to the ALSA loopback card:

Code: [Select]
vim /home/pi/weather_radio.sh

and then add the following:

Code: [Select]
#!/bin/sh

# Using Sox/Play with ALSA Loopback
rtl_fm -f 162.55M -s 48000 | play -q -r 48000 -t raw -e s -b 16 -c 1 -V1 -v 6 -

In my area the weather radio frequency is 164.55Mhz, you'll want to edit this to use your local frequency.  Then make it executable like this:

Code: [Select]
chmod +x /home/pi/weather_radio.sh

Next add the following to /etc/rc.local to make it run at boot:

Code: [Select]
sudo vim /etc/rc.local

add the following before exit 0:

Code: [Select]
screen -d -m /home/pi/weather_radio.sh

Finally reboot:

Code: [Select]
sudo reboot

Wait a few minutes and if all goes well, you should be able to go to http://raspberry.pi.ip:8000 (or whatever Icecast server you are pointing to) and see your mount point and hear your weather radio stream!

Starting and Stopping Services

There will be two things started at boot, one is Darkice which can be started, stopped and restarted with the following commands:

Code: [Select]
sudo service darkice start
sudo service darkice stop
sudo service darkice restart

Log output for Darkice is sent to /var/log/darkice.log and can be monitored using less or tail:

Code: [Select]
tail -f /var/log/darkice.log
less -n +F /var/log/darkice.log

I prefer less as it has more features because it is an extension of vim, so it allows for searching and scrolling up and down, for more information on less vs tail see: http://www.brianstorti.com/stop-using-tail/

The second service is the screen instance with the RTL_SDR script.  Darkice will stream silence to your mount point if it is running and the RTL SDR script is not, so keep that in mind if you stop or start that script. Screen is used as a "poor mans service" for the RTL SDR script (more on screen here  https://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/). You can access the RTL SDR script in the screen instance by typing this:

Code: [Select]
sudo screen -r

This will bring you into the screen and you should see something like this:

Code: [Select]
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Tuner gain set to automatic.
Tuner error set to 14 ppm.
Tuned to 162802000 Hz.
Oversampling input by: 21x.
Oversampling output by: 1x.
Buffer size: 8.13ms
Exact sample rate is: 1008000.009613 Hz
Sampling at 1008000 S/s.
Output at 48000 Hz.

To stop the script type Ctrl+C and this will stop the script and exit screen at the same time.  You will know it exited screen when you see something like this:

Code: [Select]
[screen is terminating]

If you don't see the above then you are still in the screen instance, but have just stopped the script.  If that is the case, skip the next command as it will just start a second screen instance.  Otherwise to start the RTL SDR script again, type this to start a new screen instance:

Code: [Select]
sudo screen

There will be some text, and just hit enter.  Then navigate (cd /home/pi or wherever you put it) to the folder with the script and execute it by typing:

Code: [Select]
./weather_radio.sh

This will bring you back to where you were and send the output of RTL SDR to the alsa loopback device.  To detach from screen type Ctrl+a, d.  So Ctrl+a and then d, and you should see something like this:

Code: [Select]
[detached from 3318.pts-0.weather-radio-server]

Then you can reattach the same way as mentioned above:

Code: [Select]
sudo screen -r

Don't type Ctrl+c unless you want to stop the RTL SDR script.  If you want to exit out of screen completely, type Ctrl+c.

Continued in Reply #3 below.
« Last Edit: April 06, 2017, 03:15:50 PM by tim273 »

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 537
  • BismarckWeather.net
    • BismarckWeather.net
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #1 on: March 11, 2017, 06:53:41 PM »
I'm a bit stuck at the moment.  I got to the part where you can get the -p number, but I keep getting an error:

Sat 11 Mar 17:46:24 CST 2017
Found 1 device(s):
  0:  Generic RTL2832U OEM

Using device 0: Generic RTL2832U OEM
usb_claim_interface error -6
Failed to open rtlsdr device #0.


Also, your last step doesn't mention how to "tune" your radio to the proper frequency.  I'm assuming the 162.55m is the freq I'd need to enter.
http://www.BismarckWeather.net
Davis VP2, Cumulus, Blitzortung, Bloomsky, Saratoga Scripts

Offline tim273

  • Senior Member
  • **
  • Posts: 94
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #2 on: March 11, 2017, 08:50:45 PM »
I'm a bit stuck at the moment.  I got to the part where you can get the -p number, but I keep getting an error:

Sat 11 Mar 17:46:24 CST 2017
Found 1 device(s):
  0:  Generic RTL2832U OEM

Using device 0: Generic RTL2832U OEM
usb_claim_interface error -6
Failed to open rtlsdr device #0.


Also, your last step doesn't mention how to "tune" your radio to the proper frequency.  I'm assuming the 162.55m is the freq I'd need to enter.

It looks like that error happens when another process is using the rtl sdr, so my guess is that you have the script running in screen and you need to stop it first before trying to run it again.  So type in:

Code: [Select]
sudo screen -r

If nothing comes back, try the above without 'sudo' and then to stop it type Ctrl+c and that will stop the RTL SDR script and screen at the same time.  Then start screen again by typing:

Code: [Select]
sudo screen

It will give you some text and just hit enter and you'll be in a new screen instance.  Then run your script and type Ctrl+a, d to detach from the screen, then to reattach type:

Code: [Select]
sudo screen -r

again. 

Hope that helps.  I updated the post above with that information.
« Last Edit: March 11, 2017, 09:05:13 PM by tim273 »

Offline tim273

  • Senior Member
  • **
  • Posts: 94
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #3 on: March 11, 2017, 09:18:34 PM »
Optional (but recommended): PPM Error Correction

Since the RTL SDR sticks are made with super cheap crystals sometimes the frequency needs to be corrected. Before doing this, stop the RTL SDR script as mentioned above.  Here's a guide to show you how to do that: http://314256.blogspot.com/2015/03/how-to-use-kal-software-to-workout-ppm.html  In addition to the packages it has you install, add these:

Code: [Select]
sudo apt-get install librtlsdr-dev usb-1.0

Then modify weather_radio.sh to look like this:

Code: [Select]
#!/bin/sh

# Using Sox/Play with ALSA Loopback
rtl_fm -f 162.55M -s 48000 -p 14 | play -q -r 48000 -t raw -e s -b 16 -c 1 -V1 -v 6 -

Note the addition of "-p 14" use whatever number is calculated from the instructions.  Then restart the RTL SDR script as mentioned above.

Optional: Purchase a UPS (Uninterruptible Power Supply)

Since power outages often occur with sever weather, a UPS would be a good purchase to keep the weather radio setup running during a power outage.  At minimum, plug in the Raspberry Pi, modem (from whatever type of ISP you have),  and router (if you have one).  It could be that the router and modem are one unit, in which case only the router/modem and Raspberry Pi need to be plugged in.  The power consumption of these two or three units will be fairly low, around 10-20 watts which will allow the UPS to work for 1-3 hours depending on the size.  Search Amazon for Uninterruptible Power Supply to find options, APC is generally a good brand.

Notes on Reception

If you are finding that you cannot get a good signal, here's some tips to improve that. 

  • Make sure the antenna you have is about 17 1/4 inches long.  This is a quarter wave of 162.5 Mhz and should work for all the weather radio frequencies.  There are more advanced antenna designs that are out of scope for this tutorial, but you may need to resort to a Yagi style antenna if you're not able to get a good signal with a monopole design.  You could also search for "quarter wave ground plane antenna" on Google and you'll get lots of info on how to make one, it's fairly simple if you're good with a soldering iron.
  • Height matters with antennas, the higher up you can get it, the better reception you'll get.  For example, I have my Raspberry Pi in the basement, but run a coax cable up to the attic which is about 15 feet of the ground.  I happen to live in an area that gets good reception regardless, but if you're having trouble, get the antenna up as high as you can.  You may need to resort to an outdoor antenna, but if you do that, make sure it's made for outdoors, and is grounded.
Optional: Create a script to monitor the uptime

Sometimes the weather radio will go down for various reasons, network issues, the Icecast server goes down, etc.  One way to monitor this is to create a script to check that the stream is mounted on the Icecast server, and to send an email when it's down.  It would be best to run this script from an outside source.  For exmaple, I have my Icecast server on a Linode instance and I have it checked from a separate Linode instance.  If this is not possible, just run it on your Raspberry Pi, which is better than nothing.

First follow this tutorial:  https://www.howtoforge.com/tutorial/configure-postfix-to-use-gmail-as-a-mail-relay to get Gmail set up as a relay.

Then create a script to check your mount point:

Code: [Select]
#!/bin/bash

#url="http://audioplayer.wunderground.com"
url="http://your_icecast_url:8000"
#status_code=$(curl -o /dev/null --silent --write-out '%{http_code}\n' $url)
status_code=$(curl -v --silent $url 2>&1 | grep your/moutpoint)
date=`date`

if [ "$status_code" == "" ]
then
        #echo "The weather radio is down at $date" >> /var/log/status_check.log
        mail -s "Weather Radio is Down" your@email.com <<< "The weather radio is down at $date."
fi

and save it as check_weather_radio.sh or something similar.  Then add a cron to run every 15 or 30 minutes (mine is every 15):

Code: [Select]
crontab -e

Add the following:

Code: [Select]
*/15 * * * * /path/to/check-weather-radio

This is opened in nano so type Ctrl+o to save (hit enter when it asks what file to save as) and Ctrl+x to exit.  If all went well you should see:

Code: [Select]
crontab: installing new crontab

Then you can type crontab -e again and you should still see the line you added.  You can test this by stopping Darkice and waiting 15-30 minutes to see if there's an email.

Recommended: Software Updates

Occasionally there are software updates which the repository will handle for you.  To update log in and type:

Code: [Select]
sudo apt-get update

and

Code: [Select]
sudo apt-get dist-upgrade

It's usually good to do this about once a week, sometimes the Pi will need to be rebooted, but usually only if there is a kernel update.

Recommended: Checking Logs

The darkice output will be sent to /var/log/darkice.log and it's good to check this from time to time.  Occasonally you'll see something like this in the log:

Code: [Select]

16-Mar-2017 11:45:21 BufferedSink, healed: 0  /  480000
16-Mar-2017 11:45:23 BufferedSink, healed: 0  /  480000
16-Mar-2017 11:56:03 BufferedSink, new peak: 169  /  480000
16-Mar-2017 11:56:03 BufferedSink, new peak: 506  /  480000
16-Mar-2017 11:56:03 BufferedSink, new peak: 1215  /  480000
16-Mar-2017 11:56:03 BufferedSink, new peak: 2762  /  480000
16-Mar-2017 11:56:03 BufferedSink, new peak: 5530  /  480000
16-Mar-2017 11:56:04 BufferedSink, new peak: 11062  /  480000
16-Mar-2017 11:56:06 BufferedSink, new peak: 22231  /  480000
16-Mar-2017 11:56:06 BufferedSink, new peak: 55  /  480000
16-Mar-2017 11:56:07 BufferedSink, new peak: 198  /  480000
16-Mar-2017 11:56:07 BufferedSink, new peak: 410  /  480000
16-Mar-2017 11:56:07 BufferedSink, new peak: 938  /  480000
16-Mar-2017 11:56:07 BufferedSink, new peak: 1919  /  480000
16-Mar-2017 11:56:08 BufferedSink, new peak: 3858  /  480000
16-Mar-2017 11:56:09 BufferedSink, new peak: 44525  /  480000
16-Mar-2017 11:56:09 BufferedSink, new peak: 7754  /  480000
16-Mar-2017 11:56:12 BufferedSink, new peak: 15531  /  480000
16-Mar-2017 11:56:15 BufferedSink, new peak: 89148  /  480000
16-Mar-2017 11:56:17 BufferedSink, new peak: 31153  /  480000
16-Mar-2017 11:56:18 TcpSocket :: write, send error 32
16-Mar-2017 11:56:18 Exception caught in BufferedSink :: write1
16-Mar-2017 11:56:18 HTTP/1.0 200
16-Mar-2017 11:56:28 BufferedSink, healed: 0  /  480000
16-Mar-2017 11:56:32 BufferedSink, healed: 0  /  480000
16-Mar-2017 12:13:35 BufferedSink, new peak: 347  /  480000
16-Mar-2017 12:13:35 BufferedSink, healed: 0  /  480000

This is darkice dealing with network issues, but if you see multiple messages that say "buffer overrun" then first restart darikce (see post 1) and if that doesn't fix it, there could be issues with your internet connection.  You may need to restart your router and/or modem to fix these, otherwise contact your ISP.

Optional: Run Your Icecast Server Externally

If you're worried about your bandwidth or your ISP has limitations Linode (http://www.linode.com/) has a number of inexpensive options that can be used to set up an Icecast server, starting at $5 a month for 1TB of data transfer (both in and out).  When setting up the Linode, choose the latest Ubuntu LTS release.  Setup will be similar to the Raspberry Pi, except there is no raspi-config utility, but it uses the same apt-get utility and has all the same tools.  Icecast can be installed by running this:

Code: [Select]
sudo apt-get install icecast2

You'll also need to register a domain and tie it to the IP address. That's not absolutely necessary, but otherwise you would just use your IP address to access the Icecast server, not pretty, but it works.  Then you would just send your stream to your Linode Icecast server.
« Last Edit: April 02, 2017, 09:57:58 PM by tim273 »

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 537
  • BismarckWeather.net
    • BismarckWeather.net
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #4 on: March 13, 2017, 05:25:24 PM »
If I wanted to turn down the volume just a bit on the stream, is it one of these options I need to change?  I'm guessing one of the last numbers.

rtl_fm -f 162.55M -s 48000 | play -q -r 48000 -t raw -e s -b 16 -c 1 -V1 -v 6 -
http://www.BismarckWeather.net
Davis VP2, Cumulus, Blitzortung, Bloomsky, Saratoga Scripts

Offline tim273

  • Senior Member
  • **
  • Posts: 94
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #5 on: March 13, 2017, 05:58:48 PM »
If I wanted to turn down the volume just a bit on the stream, is it one of these options I need to change?  I'm guessing one of the last numbers.

rtl_fm -f 162.55M -s 48000 | play -q -r 48000 -t raw -e s -b 16 -c 1 -V1 -v 6 -

Yep it's -v 6, so change it to -v 5 or -v 4.

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1734
    • SouthEast Lincoln, NE Weather
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #6 on: April 02, 2017, 03:15:29 PM »
Trying this rather complex Raspberry Pi trick, but I'm not getting a stream for some reason.

This is my 'screen':
Code: [Select]
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Tuner gain set to automatic.
Tuner error set to -6 ppm.
Tuned to 162727000 Hz.
Oversampling input by: 21x.
Oversampling output by: 1x.
Buffer size: 8.13ms
Exact sample rate is: 1008000.009613 Hz
Sampling at 1008000 S/s.
Output at 48000 Hz.

As you can see the tuner is tuned to 162.727 MHz, but I've set it to 162.475 MHz in 'weather_radio.sh':
Code: [Select]
#!/bin/sh

# Using Sox/Play with ALSA Loopback
rtl_fm -f 162.475M -s 48000 -p -6 | play -q -r 48000 -t raw -e s -b 16 -c 1 -V1 -v 6 -
When I log onto my icecast server as 'admin' with the password I set as 'hackme', this is what shows:

 [ You are not allowed to view attachments ]

There is no mountpoint:

 [ You are not allowed to view attachments ]

I'm not sure what the mountpoint, etc. should be.  Here are my entries in 'darkice.cfg':
Code: [Select]
[general]
duration      = 0
bufferSecs    = 5
reconnect     = yes

[input]
device        = plughw:1,1
sampleRate    = 48000
bitsPerSample = 16
channel       = 1

# Primary Icecast
[icecast2-0]
bitrateMode   = abr
format        = mp3
bitrate       = 64
server        = 192.168.2.124
port          = 8000
password      = hackme
mountPoint    = raspi
name          = Raspi
description   = NOAA Weather Radio
url           = http://localhost

I've never been very fluent in 'Linux Speak', but I've gotten this far by following your instructions.  I also tried to set icecast's output port to '8002' with no success.  Lotsa gotcha's here for me apparently.
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline tim273

  • Senior Member
  • **
  • Posts: 94
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #7 on: April 02, 2017, 04:37:14 PM »
Looks like an issue with Darkice, check your log file:

Code: [Select]
less -n +F /var/log/darkice.log

It could be that it can't find the sound card input, or it can't find the Icecast server.

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1734
    • SouthEast Lincoln, NE Weather
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #8 on: April 02, 2017, 04:38:43 PM »
Looks like an issue with Darkice, check your log file:

Code: [Select]
less -n +F /var/log/darkice.log

It could be that it can't find the sound card input, or it can't find the Icecast server.
Thanks, you may be right.  I get this:
Code: [Select]
pi@GWWilkinsNOAARadioServer:~ $ less -n +F /var/log/darkice.log
/var/log/darkice.log: No such file or directory
pi@GWWilkinsNOAARadioServer:~ $

How to fix?

(I finally found how to enable my Pi 3's wifi, so I've removed the ethernet tether.)
« Last Edit: April 02, 2017, 04:41:04 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline tim273

  • Senior Member
  • **
  • Posts: 94
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #9 on: April 02, 2017, 04:41:21 PM »
Looks like an issue with Darkice, check your log file:

Code: [Select]
less -n +F /var/log/darkice.log

It could be that it can't find the sound card input, or it can't find the Icecast server.
Thanks, you may be right.  I get this:
Code: [Select]
pi@GWWilkinsNOAARadioServer:~ $ less -n +F /var/log/darkice.log
/var/log/darkice.log: No such file or directory
pi@GWWilkinsNOAARadioServer:~ $

How to fix?

A couple things, first if your Icecast server is on your local Raspberry Pi, you can just use localhost for the server, you don't need your IP.

I'm wondering if Darkice didn't start, so try

Code: [Select]
sudo service darkice start

and then try looking at the log again.

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1734
    • SouthEast Lincoln, NE Weather
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #10 on: April 02, 2017, 04:43:18 PM »
I get this:
Code: [Select]
pi@GWWilkinsNOAARadioServer:~ $ sudo service darkice start
Job for darkice.service failed. See 'systemctl status darkice.service' and 'journalctl -xn' for details.
I've also tried those commands before, to no avail.
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline tim273

  • Senior Member
  • **
  • Posts: 94
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #11 on: April 02, 2017, 04:46:13 PM »
Ok, try this:

Code: [Select]
sudo /etc/init.d/darkice start

If that doesn't work, just try typing this just to see if it works at all:

Code: [Select]
darkice -v10

If the second one works, then it's just an issue of the service not being set up.

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1734
    • SouthEast Lincoln, NE Weather
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #12 on: April 02, 2017, 04:47:52 PM »
Ok, try this:

Code: [Select]
sudo /etc/init.d/darkice start

If that doesn't work, just try typing this just to see if it works at all:

Code: [Select]
darkice -v10

If the second one works, then it's just an issue of the service not being set up.
Here's the result:
Code: [Select]
pi@GWWilkinsNOAARadioServer:~ $ darkice -v10
DarkIce 1.3 live audio streamer, http://code.google.com/p/darkice/
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 it
under the terms of The GNU General Public License version 3 or
any later version.

Using config file: /etc/darkice.cfg
02-Apr-2017 15:47:09 Using ALSA DSP input device: plughw:1,1
02-Apr-2017 15:47:09 buffer size:  480000
02-Apr-2017 15:47:09 encoding
02-Apr-2017 15:47:09 scheduler high priority 99
02-Apr-2017 15:47:09 Could not set POSIX real-time scheduling, this may cause recording skips.
Try to run darkice as the super-user.
DarkIce: TcpSocket.cpp:251: connect error [113]
02-Apr-2017 15:47:15 BufferedSink :: write, couldn't reopen underlying sink, attempt 1 / 10
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1734
    • SouthEast Lincoln, NE Weather
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #13 on: April 02, 2017, 04:50:32 PM »
Here it is again with 'sudo':
Code: [Select]
pi@GWWilkinsNOAARadioServer:~ $ sudo darkice -v10
DarkIce 1.3 live audio streamer, http://code.google.com/p/darkice/
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 it
under the terms of The GNU General Public License version 3 or
any later version.

Using config file: /etc/darkice.cfg
02-Apr-2017 15:49:06 Using ALSA DSP input device: plughw:1,1
02-Apr-2017 15:49:06 buffer size:  480000
02-Apr-2017 15:49:06 encoding
02-Apr-2017 15:49:06 scheduler high priority 99
02-Apr-2017 15:49:06 Using POSIX real-time scheduling, priority 4
DarkIce: TcpSocket.cpp:251: connect error [113]
02-Apr-2017 15:49:12 BufferedSink :: write, couldn't reopen underlying sink, attempt 1 / 10
p
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline tim273

  • Senior Member
  • **
  • Posts: 94
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #14 on: April 02, 2017, 04:53:04 PM »
That's odd, I haven't seen that one before. At this point, if it were me, I would just start over.  Don't feel bad that you didn't get it the first time, I've had to start over many times when I've done stuff with the Raspberry Pi, sometimes it just doesn't work out.  Maybe something got missed, I don't know, but that's my best advice. 

Ironically, I had to start over with mine today because something got messed up.

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1734
    • SouthEast Lincoln, NE Weather
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #15 on: April 02, 2017, 04:54:44 PM »
That's odd, I haven't seen that one before. At this point, if it were me, I would just start over.  Don't feel bad that you didn't get it the first time, I've had to start over many times when I've done stuff with the Raspberry Pi, sometimes it just doesn't work out.  Maybe something got missed, I don't know, but that's my best advice.
Start over where?  Format the Micro-SD?  Just try to reinstall the packages over those already present?
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline tim273

  • Senior Member
  • **
  • Posts: 94
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #16 on: April 02, 2017, 05:00:57 PM »
Ok, a couple options, if you are planning to just stream to one destination, not multiple, you could use ezstream, more info on that here: http://icecast.org/ezstream.  Otherwise you could just recompile darkice and see if that works.

If you want to try ezstream, you could use this for your script:

Code: [Select]
rtl_fm -f 162.55M -s 48000 -p 14 | lame --bitwidth 16 --signed -s 48000 --lowpass 3500 --abr 64 --scale 9 -r -m m - - | ezstream -c ezstream.xml

and here's the ezstream.xml file

Code: [Select]
<!--
   EXAMPLE: MP3 playlist stream WITHOUT reencoding

   This example streams a playlist that contains only MP3 files. No other file
   formats may be listed. Since ezstream will not be doing any reencoding, the
   resulting stream format (bitrate, samplerate, channels) will be of the
   respective input files.
 -->
<ezstream>
    <url>http://localhost:8000/mount</url>
    <sourcepassword>password</sourcepassword>
    <format>MP3</format>
    <filename>stdin</filename>
    <stream_once>1</stream_once>
    <!--
      The following settings are used to describe your stream to the server.
      It's up to you to make sure that the bitrate/samplerate/channels
      information matches up with your input stream files. Note that
      <svrinfoquality /> only applies to Ogg Vorbis streams.
     -->
    <svrinfoname>Minneapolis, Minnesota Weather Radio</svrinfoname>
    <svrinfourl>http://www.wunderground.com</svrinfourl>
    <svrinfogenre>Weather</svrinfogenre>
    <svrinfodescription>NOAA Weather Radio KEC65 162.55Mhz</svrinfodescription>
    <svrinfobitrate>64</svrinfobitrate>
    <svrinfochannels>2</svrinfochannels>
    <svrinfosamplerate>48000</svrinfosamplerate>
    <!--
      Prohibit the server to advertise the stream on a public YP directory:
     -->
    <svrinfopublic>0</svrinfopublic>
</ezstream>


Obviously, change the info.  If that doesn't work, then I would reformat the microSD card and start over that way.

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1734
    • SouthEast Lincoln, NE Weather
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #17 on: April 02, 2017, 05:06:02 PM »
I don't know how to 'recompile' darkice.  Any advice?
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline tim273

  • Senior Member
  • **
  • Posts: 94
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #18 on: April 02, 2017, 05:08:03 PM »
I don't know how to 'recompile' darkice.  Any advice?
It's in the original instructions at to top.

Sent from my SGH-M919 using Tapatalk


Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1734
    • SouthEast Lincoln, NE Weather
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #19 on: April 02, 2017, 05:09:31 PM »
I don't know how to 'recompile' darkice.  Any advice?
It's in the original instructions at to top.
You mean this?
Code: [Select]
pi@GWWilkinsNOAARadioServer:~ $ git clone https://github.com/rafael2k/darkice
fatal: destination path 'darkice' already exists and is not an empty directory.
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline tim273

  • Senior Member
  • **
  • Posts: 94
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #20 on: April 02, 2017, 05:10:49 PM »
I don't know how to 'recompile' darkice.  Any advice?
It's in the original instructions at to top.
You mean this?
Code: [Select]
pi@GWWilkinsNOAARadioServer:~ $ git clone https://github.com/rafael2k/darkice
fatal: destination path 'darkice' already exists and is not an empty directory.
The part after that.

Sent from my SGH-M919 using Tapatalk


Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1734
    • SouthEast Lincoln, NE Weather
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #21 on: April 02, 2017, 05:38:37 PM »
I now get this:
Code: [Select]
pi@GWWilkinsNOAARadioServer:~ $ sudo darkice -v10
DarkIce 1.3 live audio streamer, http://code.google.com/p/darkice/
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 it
under the terms of The GNU General Public License version 3 or
any later version.

Using config file: /etc/darkice.cfg
02-Apr-2017 16:35:05 Using ALSA DSP input device: plughw:1,1
02-Apr-2017 16:35:05 buffer size:  480000
02-Apr-2017 16:35:05 encoding
02-Apr-2017 16:35:05 scheduler high priority 99
02-Apr-2017 16:35:05 Using POSIX real-time scheduling, priority 4
02-Apr-2017 16:35:05 HTTP/1.0 200
02-Apr-2017 16:35:05 set lame mode 3
02-Apr-2017 16:35:05 set lame channels 1
02-Apr-2017 16:35:05 set lame in sample rate 48000
02-Apr-2017 16:35:05 set lame out sample rate 48000
02-Apr-2017 16:35:05 set lame abr bitrate 3
02-Apr-2017 16:35:05 set lame abr mean bitrate 64
02-Apr-2017 16:35:05 set lame lowpass frequency 3500
02-Apr-2017 16:35:05 set lame highpass frequency 0
02-Apr-2017 16:35:05 set lame psycho acoustic model 1
02-Apr-2017 16:35:05 set lame error protection 1
LAME 3.99.5 32bits (http://lame.sf.net)
Using polyphase lowpass filter, transition band:  3290 Hz -  3871 Hz
02-Apr-2017 16:35:05 MultiThreadedConnector :: transfer, bytes 0
02-Apr-2017 16:35:05 MultiThreadedConnector :: ThreadData :: threadFunction, was (thread, priority, type):  0xebcad8 4 SCHED_FIFO
02-Apr-2017 16:35:05 MultiThreadedConnector :: ThreadData :: threadFunction, now is (thread, priority, type):  0xebcad8 1 SCHED_FIFO

I have a mountpoint and a very static-ridden radio!

Thanks, Tim! :-)  Gonna take a break.
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline tim273

  • Senior Member
  • **
  • Posts: 94
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #22 on: April 02, 2017, 06:03:51 PM »
Great!  Glad you got it working.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6107
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #23 on: April 03, 2017, 01:27:49 PM »
Sadness.. I rebuilt the RP3 using the full instructions in the first post.  Now I see what Jerry saw
Code: [Select]
$ sudo darkice -v10
DarkIce 1.3 live audio streamer, http://code.google.com/p/darkice/
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 it
under the terms of The GNU General Public License version 3 or
any later version.

Using config file: /etc/darkice.cfg
03-Apr-2017 10:25:22 Using ALSA DSP input device: plughw:1,1
03-Apr-2017 10:25:22 buffer size:  480000
03-Apr-2017 10:25:22 buffer size:  480000
03-Apr-2017 10:25:22 encoding
03-Apr-2017 10:25:22 scheduler high priority 99
03-Apr-2017 10:25:22 Using POSIX real-time scheduling, priority 4
DarkIce: TcpSocket.cpp:251: connect error [111]
03-Apr-2017 10:25:22 HTTP/1.0 200
03-Apr-2017 10:25:22 BufferedSink :: write, couldn't reopen underlying sink, attempt 1 / 10
I didn't see what was done to resolve that.. I'd like to continue to use icecast2 and not switch to easystream unless necessary.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline tim273

  • Senior Member
  • **
  • Posts: 94
Re: Streaming to Multiple Icecast Servers with RTL SDR and Darkice
« Reply #24 on: April 03, 2017, 01:34:10 PM »
Sadness.. I rebuilt the RP3 using the full instructions in the first post.  Now I see what Jerry saw
Code: [Select]
$ sudo darkice -v10
DarkIce 1.3 live audio streamer, http://code.google.com/p/darkice/
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 it
under the terms of The GNU General Public License version 3 or
any later version.

Using config file: /etc/darkice.cfg
03-Apr-2017 10:25:22 Using ALSA DSP input device: plughw:1,1
03-Apr-2017 10:25:22 buffer size:  480000
03-Apr-2017 10:25:22 buffer size:  480000
03-Apr-2017 10:25:22 encoding
03-Apr-2017 10:25:22 scheduler high priority 99
03-Apr-2017 10:25:22 Using POSIX real-time scheduling, priority 4
DarkIce: TcpSocket.cpp:251: connect error [111]
03-Apr-2017 10:25:22 HTTP/1.0 200
03-Apr-2017 10:25:22 BufferedSink :: write, couldn't reopen underlying sink, attempt 1 / 10
I didn't see what was done to resolve that.. I'd like to continue to use icecast2 and not switch to easystream unless necessary.

Actually ezstream the equivalent of Darkice, the only difference is that Darkice can stream to multiple Icecast2 servers (as well as Shoutcast), where as ezstream only streams to one Icecast2 server.

But to answer your question, he had to recompile Darkice and that seemed to do it.