View Single Post
  #43 (permalink)  
Old 06-01-2013, 2:36 PM
IredellMon IredellMon is offline
Join Date: Jan 2012
Location: North Carolina
Posts: 88
Default Automatically running two feeds (using two instances of darkice) at boot up.

If you already have a second feed that works when manually started then skip down to “Open and edit the initialization script.”

Create a second darkice configuration file for the second feed: Open and edit /etc/darkice.cfg:
sudo nano /etc/darkice.cfg
Change the input device to the second sound card:
device = plughw:0,0
(Against what one would expect, on my system at least, the original device was 1,0 but when I added a second one, the second one became 0,0. Your system might be different)
Change the mount point, server, password and whatever else you need to for the second feed.
Save the script as /etc/darkice2.cfg
At this point you can test the second feed by manually starting it.

OPEN AND EDIT THE INITIALIZATION SCRIPT: sudo nano /etc/init.d/darkice
edit the following lines to read:
# Provides: darkice2
(Assuming the configuration file for your second feed using darkice is darkice2.cfg)
Save the script as /etc/init.d/darkice2
Make the script executable: sudo chmod +x /etc/init.d/darkice2
Update the symbolic links: sudo update-rc.d darkice2 defaults

At this point both instances of darkice should start when the system is booted up.. However, if your are also using the radioplay file archiving script, then “HOUSTON WE HAVE A PROBLEM!”

radioplay will not delete the temporary file for the second feed. This file will quickly grow to the point where it will fill your SD card and crash your system. If you can live with no file archive for the second feed, then a simple “duct tape” fix is open the configuration file for the second feed and comment out:
[file-0] ### Archive File for radioplay ###
by putting “#” before [file-0]. The rest of the options in the file section should then be ignored. Radioplay for the second feed will still run as a cron job and generate an error because it can’t find the temporary file. However the error will be sent to the bit bucket (discarded) and there will be no file filling up the SD card.

Next I might work on radioplay2 which is a second copy of the radioplay script slightly modified to archive the audio from the second feed. However it won’t be this weekend. Anyone else want to give it a try?

Last edited by IredellMon; 06-01-2013 at 2:47 PM..
Reply With Quote