Scanner feed using Rasberry Pi ?

Status
Not open for further replies.

btrogdon

Member
Joined
Jun 15, 2010
Messages
19
Location
Forsyth County, North Carolina
I can come up with about 1000 reasons one would see this error message, but what is really throwing me for a loop is that it seems the first time you start darkice it works, the second time it does not. And that I cannot explain (yet). The /etc/hosts file looks OK to me.
If that is correct, ask yourself what is different the second time.
Is the first instance running automatically at boot? If so, verify that it is REALLY running (and working), then stop darkice:
sudo /etc/init.d/darkice stop
verify it is stopped, then try manually starting it:
sudo /usr/bin/darkice yourfirstconfigfilename
Does it start? does it feed OK?
If OK, try a second instance:
sudo /usr/bin/darkice yoursecondconfigfilename
Cross fingers and report back...

UPDATE as to my progress..

1. I have been able to launch the second instance successfully using this command:
darkice -c /etc/darkice1.cfg

2. You are correct the initial instance launches at boot without any action.

So my last question (I Hope) is how can I locate the area that automatically launches session 1 at boot and also add Session 2 as to eliminate the manual execution?

Thanks to everyone for your assistance.

W4INT - Brad
 

IredellMon

Member
Joined
Jan 23, 2012
Messages
90
Location
North Carolina
The script that starts darkice at boot (and by the way also stops it at shutdown) is:
/etc/init.d/darkice
After creating this script (or editing to change the run levels or required options) you need to run the command:
sudo update-rc.d darkice defaults
That will update the appropriate symbolic links that cause the script to be executed when the system starts, stops or changes run levels. (its a Sys-V like init system, see Making scripts run at boot time with Debian or google it for more info)
...So how do you get two instances of darkice with it? I think you will need to create a second init script which will be a copy of /etc/init.d/darkice with some critical changes.
then run update-rc.d for the new init script so that it will start a second copy of darkice with the second darkice config file.
-IF- you are going to use the radioplay file archiving ALSO then its more complicated (like it wasn't complicated enough already, right ;) )...
I think radioplay will still work OK with the first instance of darkice but not the second (unless more changes are made).
If I have time I will try and work of this over the weekend on my spare Pi. I'm not sure this is the best approach but I think that it is. In the meantime any linux gurus out there want to chime in with some guidance?
 

IredellMon

Member
Joined
Jan 23, 2012
Messages
90
Location
North Carolina
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
NAME=darkice2
DAEMON=/usr/bin/darkice
CONFIGFILE=/etc/darkice2.cfg
(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:

TheMadScanner

Member
Joined
Jan 18, 2006
Messages
19
Location
Outer Banks, NC
Hey Y'all, I've got my feed running through a RasPi also and so far it's been working great. What I am wondering though is if there is a way to port the input audio through one of the headset jacks for real time local monitoring. I've played around with the alsamixer for both the onboard audio jack and the USB Sound Card Jack and can't seem to find a way to do it without actually splitting the audio in. I figure there has to be a way to do it like there is with the Windows PC soundcard options. Any Ideas?

Thanks!
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
Hey Y'all, I've got my feed running through a RasPi also and so far it's been working great. What I am wondering though is if there is a way to port the input audio through one of the headset jacks for real time local monitoring. I've played around with the alsamixer for both the onboard audio jack and the USB Sound Card Jack and can't seem to find a way to do it without actually splitting the audio in. I figure there has to be a way to do it like there is with the Windows PC soundcard options. Any Ideas?

Thanks!

Mad:

I had my Pi set up to feed audio out to a set of speakers as well as TTD at one point. I don't remember the exact details now. I do remember that i had a sound card with Line In and Mic jacks. Plugged into the Line in, all scanner audio was fed to the speakers. Plugged into Mic, only the "playback during record" from TTD came through. Try adjusting the outputs in Pavucontrol to see if you can find the right one. Try the Alsa output and plug your headset into the audio jack on the pi, not the sound card. I realize that i am just giving you shots in the dark here. Maybe later I can set up the pi the way i had it previously and figure it out.


My apologies, Mad, i thought i was in the TwoToneDetect on a Pi thread rather than the broadcasting a feed with a Pi thread. I have done what youbare describing when running TTD but not darkice. I don't believe darkice uses pulseaudio so you probably don't have pavucontrol.
Good luck.
 
Last edited:

nhaviator

Member
Premium Subscriber
Joined
Aug 7, 2009
Messages
6
Location
Southern NH / Hudson Valley of NY
No Experience

Wow.. I'd really like to transition my feed over to a Raspberry Pi. I've read through this whole thread but am a little intimidated because I have zero experience with linux. If I was to buy one of these, and also a sound card (I think that's all the hardware, right?) then is it possible that I could use what has been written on this thread to get up and running?

I'm not familiar with the programs you've been talking about, I've only been running a PC with ScannerCast so far, so sorry for being underinformed!
 
Joined
Mar 21, 2010
Messages
237
Location
Bellingham Washington
I hate to say it but getting a feed running on the Raspberry-PI is not really for the feint of heart. With a novice amount of Linux experience just setting up Darkice to stream your feed can be a daunting task in it's self. The R-Pi using a USB audio device adds another set of hoops to jump through.

I would suggest you start out just getting to know Linux and get your feed running on a more standard distribution like Ubuntu. It's free and you can install it to a USB flash drive with "persistence" so any changes you make and programs you install will remain on the flash drive.

The thing that you don't always hear about the R-Pi is the little extra add on costs. Sure the R-Pi is $45(?) but you need a power supply, cable, a case, SD card, keyboard, mouse, and "the right" USB sound card. In the end if you don't have a few of these things laying around already your total cost can go over $100 to get the $45 R-Pi operating.

For that price you can get a thin-client on E-bay that runs Windows and Scannercast.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
Wow.. I'd really like to transition my feed over to a Raspberry Pi. I've read through this whole thread but am a little intimidated because I have zero experience with linux. If I was to buy one of these, and also a sound card (I think that's all the hardware, right?) then is it possible that I could use what has been written on this thread to get up and running?

I'm not familiar with the programs you've been talking about, I've only been running a PC with ScannerCast so far, so sorry for being underinformed!

Aviator,

I have to agree with Bellingham that it can be daunting. I had no experience with Linux prior to picking up a pi around the first of this year and now i know more about linux than i ever thought that i would. As for costs, if you run it headless total cost is in the $60-70 range. I have two RR feeds running off headless pi's now. I can pretty easily make a copy of the card image and post it for you to download and image your card. That would take care of the worst of the daunting tasks. Or you could mail me a card that i would image and send back to you. Hell, i am in NW Mass, we could meet for coffee near exit 26...
 

kb8zxe

Member
Joined
Jul 6, 2004
Messages
73
Location
Wakefield, MI
nhaviator

If you are interested in using a PI I can help you out. I have a generic image on google docs that you can download and change 2 lines in a conf file and you should be ready to go. If you prefer I can change the 2 lines for you and mail you an SD card where all you have to do is insert the SD card and plug in the cables. This image is setup to broadcast to Broadcastify and also runs Icecast so you can listen to it via your local network. It is also setup where you can plug headphones into the sound card and listen before the audio goes through the computer.

You will have to buy a Syba USB stereo SD-CM-UAUD sound card as that is what I am using.

Let me know if you are interested, it's not a big deal and I would be glad to help you out.

Bob
 

IredellMon

Member
Joined
Jan 23, 2012
Messages
90
Location
North Carolina
Well the guys are right.. if you are expecting a plug and play solution you might be disappointed. If you get a SD card from me or one of the guys here then it might work right off after you edit a few simple configuration files, but if it does not and you don’t have any Linux knowledge then it will difficult. I believe that it’s the journey (of learning) more than the destination however, for that reason I would encourage you to give it a try. And here is how I would do it:

Get ye a Pi and learn how to use it. There are lots of guides and help docs on the RasPi!

Install Icecast on a Windows computer. Go here first: Icecast.org
…and see if there is an updated installer for Windows. If not get an older version from their archive page here: ftp.osuosl.org :: Oregon State University Open Source Lab
Choose the most recent Windows setup program, toward the end of the list.

Install Icecast on your Windows computer and read up on how to set it up: Icecast.org

Then do either of these things…

1. Set up the RasPi to stream audio per my guide or similar instructions.
OR
2. Take up one of the guys on their offer to set you up with a SD card with the darkice audio streaming already installed.

Then hook up the pi to an audio source, even a microphone will work but it’s easier if you have a steady source of audio such as a scanner with the National Weather Service broadcast.

Configure the pi to stream to Icecast on your Windows machine. Configure Icecast to accept the stream from the pi. (Again my docs, the Darkice and Icecast docs, and lots of people on this forum will guide you in this). This way you can make sure everything is working right before you try to stream to Broadcastify.com.

Is this easy? Probably not… but you can do it this way without touching your current feed and work on it at your leisure. And at the end of the journey you will have learned a great deal about a computer operating system that runs seventy-five percent of stock exchanges worldwide(1), is the basis of the Macintosh and Android OS, is used on countless embedded devices including my Asus router, and best of all is free.

Footnote 1: After 20 Years, Linux Looks Better Than Ever | PCWorld
 
Last edited:

W2GLD

Active Member
Premium Subscriber
Joined
May 20, 2003
Messages
605
Location
Michigan
Has anyone been able to get the following command to work?

" sudo update-rc.d darkice defaults "

It generates the follow:

update-rc.d: using dependency based boot sequencing
insserv: Service pulse audio has to be enabled to start this service darkice
insserv: exiting now!
update-rc.d: error: insert rejected the script header

The feed is working great; however, if I reboot the device, I must manually start the service for audio to begin processing.

Any help would be greatly appreciated. I just spent countless hours on this and my mind is exhausted, time for a cold one...

Thanks,

Jerry, W2GLD
 
Last edited:

frazpo

Member
Joined
Jan 14, 2007
Messages
1,476
Location
SW Mo
Best USB soundcard Pi

Kinda funny. I started this thread and have yet to set up a Pi to feed to RR. Anyway, I think I have the time now and am going to start. I have read through the posts.

I would like to know what USB soundcard has been the best for a feed using Pi. Any suggestions?

Does the Pi utilize a USB hub pretty well. I read of multiple feeds on one Pi. During a reboot will you lose the usb mapping of the ports? I had this issue once on an ubuntu feed I set up.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
Thanks for starting the thread at least. Nice that you can now get to the fun part of the project. I have had two darkice feeds running on separate pi's since sometime in August. The only time either feed has gone down unexpectedly is when the server at RR went down one day. I think that the pi should handle multiple feeds well. Each of mine also runs TwoToneDetect.

I don't have any experience with anything except the cheap $3 or so sound cards off of Ebay. Never had a problem with one of these yet. Regardless of the sound card the audio is never going to be better than the scanner output. My audio isn't the best but I blame the scanners. It is certainly in the acceptable range, though.

My pi's auto reboot every morning at 3 am. The feed has never failed to come back on line within a minute or so. They aren't in usb hubs but I don't think that will have an effect.

There is some additional setup information that I followed in another thread:

http://forums.radioreference.com/1979683-post113.html

Good luck.
 

frazpo

Member
Joined
Jan 14, 2007
Messages
1,476
Location
SW Mo
Is the TTD an advantage to your listeners or is this a separate function besides streaming? Briefly explain the function of TDD.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
TTD decodes alert tones in the audio, records X seconds of audio, then emails the recording to users. The program page is at TwoToneDetect Page Redirection.

Many Fire/EMS agencies use it as a secondary means of notification to personnel who depend on voice pagers as their primary means of notification.
 

frazpo

Member
Joined
Jan 14, 2007
Messages
1,476
Location
SW Mo
TTD decodes alert tones in the audio, records X seconds of audio, then emails the recording to users. The program page is at TwoToneDetect Page Redirection.

Many Fire/EMS agencies use it as a secondary means of notification to personnel who depend on voice pagers as their primary means of notification.

Ok, I have read about that in the past. That would be a nice feature.

On the Pi. Are there any Pi sellers that are recommended? Ebay? Amazon?
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
Ok, I have read about that in the past. That would be a nice feature.

On the Pi. Are there any Pi sellers that are recommended? Ebay? Amazon?

They are all basically the same $. Mine came from newark.com. Get the model B. Best way to run one is to remote into it from another computer thus you don't need keypad, mouse, or monitor. HDMI output connects easily to a modern TV for initial setup. Then once you determine the pi's IP address (ifconfig is the command) you can remote in from puTTY on a windows machine or from the Terminal application on a Mac. Lots easier than having all those cables around.

Attached is a shopping list of what you need. Choose another 5v. power supply as they are out of the one listed. Just make sure that it has a minimum 1amp output.

Here is the sound card:

USB External 7 1 Channel 3D Virtual Audio Sound Card Adapter PC A 229 | eBay
 
Last edited:
Status
Not open for further replies.
Top