Scanner feed using Rasberry Pi ?

Status
Not open for further replies.

IredellMon

Member
Joined
Jan 23, 2012
Messages
90
Location
North Carolina
Anybody on this topic/issue? I ran through the entire process again today with another Raspberry Pi and the same issue occurs...

Still didn't get it working? I was not able to look into that too much before but I will do what ever it takes to get it working for you! We might have to re-do a few steps however.

1. Does it start ok with this command: sudo /etc/init.d/darkice start ??
2. toward the top of the file, /etc/init.d/darkice , under #Required-Start and #Required-Stop, is pulse audio listed? If so, it might work fine if you remove the reference to pulse audio in #Required-Start (its worth a try but if still no joy put it back and let me know, and post the top 20 lines from /etc/init.d/darkice

Note that had pulseaudio as a #Required-Start item at first.. but now I have the following line which just means that (after doing " sudo update-rc.d darkice defaults " everything else starts before darkice, and darkice is the last thing started.. and that seems to work fine.

# Required-Start: $all
 
Last edited:

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,305
Anybody on this topic/issue? I ran through the entire process again today with another Raspberry Pi and the same issue occurs...

I use a cron task to start darkice on reboot. May not be the most elegant way to do it, but seems to work.

Andy
 

W2GLD

Active Member
Premium Subscriber
Joined
May 20, 2003
Messages
609
Location
Michigan
Still didn't get it working? I was not able to look into that too much before but I will do what ever it takes to get it working for you! We might have to re-do a few steps however.

1. Does it start ok with this command: sudo /etc/init.d/darkice start ??
2. toward the top of the file, /etc/init.d/darkice , under #Required-Start and #Required-Stop, is pulse audio listed? If so, it might work fine if you remove the reference to pulse audio in #Required-Start (its worth a try but if still no joy put it back and let me know, and post the top 20 lines from /etc/init.d/darkice

Note that had pulseaudio as a #Required-Start item at first.. but now I have the following line which just means that (after doing " sudo update-rc.d darkice defaults " everything else starts before darkice, and darkice is the last thing started.. and that seems to work fine.

# Required-Start: $all

Okay, first off, thank you for the reply...

Yes, "sudo /etc/init.d/darkice start" does work if I manually enter the command to start that service, everything works as advertised...

I tried removing the "pulseaudio" audio from the "Required-Start" section and I was able to run the "sudo update-rc.d darkice defaults"; however, it generates another error with regards to LSB and mathkernel, just a warning message, so I'm not sure what that's about. Also, I tried "$all" as well and same results; it does not start upon rebooting.

Here is the code pasting you asked for as well:

#! /bin/sh
### BEGIN INIT INFO
# Provides: darkice
# Required-Start: alsa-utils pulseaudio $local_fs $remote_fs $network
# Required-Stop: alsa-utils pulseaudio $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: darkice streamer
# Description: Darkice will take an ALSA audio input and send it to
# a streaming server.
### END INIT INFO

# Author: Matt Rockwell <matt@mattrock.net>
# minor changes Feb2013 by <glyman3@gmail.com>
# File: /etc/init.d/darkice

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


I am really at wits end with this project. I've now wasted countless hours trying to get this to work properly based on these instructions. I am an experienced computer administrator and I do a great deal of work with embedded computers such as the Raspberry Pi and have build many other systems based around these, but I have very little experience with Darkice and streaming services on this hardware. Another thing that bugs me is the MIC audio input; it gives you very little audio control and seems to have the 20db boost on all the time by default; causing any line in audio from the Uniden BCD996XT to be greatly amplified, almost into distortion as indicated on my service monitor. I do not have these issues with a typical PC hardware and SoundBlaster soundcards. I guess I'm asking allot from a $10 USB sound fob.

Anyway, I would appreciate any assistance you could provide. I'm at the point that if I cannot figure this out in the next couple of days; I'm just going to terminate all of my feeds. Running all of these devices is just too costly on a monthly basis to make it worth while continuing, the Raspberry Pi makes sense; it's just extremely frustrating at this point.

Thanks,

Jerry, W2GLD
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,567
Location
Massachusetts
Jerry, you sound like you are at wits end with this. I use the same method as Andy Knitt which is a simple line in your crontab:

@reboot /bin/sleep 120 ; screen -dmS darkice-screen darkice

To access your crontab it is crontab -e

You will need to have screen installed if you don't already. This line waits two minutes after booting to Allow things to settle then starts darkice in a detached screen. With it in a detached screen you can exit the terminal and it will continue to run. If you want to check on it, type screen -list at the linux prompt and it will show you what is running detached.

I have two pi's running his way that reboot daily. I don't worry about my feeds reloading at all.

We have also developed an autostart on power restoration if that is something you would be interested in

Jim
 

IredellMon

Member
Joined
Jan 23, 2012
Messages
90
Location
North Carolina
We have also developed an autostart on power restoration if that is something you would be interested in

Jim

Do tell.. how do you autostart upon power restoration? I run my RasPi on a UPS and it draws so little power it has well outlasted any black outs here, but that would be a great feature.
 

IredellMon

Member
Joined
Jan 23, 2012
Messages
90
Location
North Carolina
Jerry, W2GLD

I can certainly commiserate with you.. sometimes I think I know what I am doing pretty well, then I run into something that drives me nuts. But I refuse to let any piece of silicon beat me so I usually stay with a problem no matter how long it takes... which explains why my laptop starts crashing a few times, every few weeks, and has done so for a year or more. The “trouble ticket” is still open here as I will never give up but I might have to add it to my bucket list, i.e. “Fix laptop before dying”. (LOL)

So if you want to avoid using the “proper” SysV init method, use a cron job instead. Not as elegant but it works.

Q: On the console (must be local/direct connected) when its booting up, toward the end and maybe just before you get a login prompt, do you see “Starting darkice..” if so it’s starting all right, but then it stops. For example if the network is not reachable yet and it can’t connect it will stop but it won’t be so polite as to let you know.

Now to your issues. LSB error is no doubt a reference to the LSB (Linux Standards Base) compliant headers in you dependency based boot init script(s). The init script runs fine when run manually but fails on bootup so it sounds like something is not compliant on your box.

Now I don’t have mathkernal or Mathematica on my RasPi.. but I stumbled across this web page:

Raspberry Pi • View topic - Raspbian init script bug

Which might explain the error you are seeing. Give it a shot. Either:
1. add the LSB header to /etc/init.d/mathkernel
Or 2. uninstall it (mathkernal and/or Mathematica?) and make sure that etc/init.d/mathkernel is gone
Or 3. Just remove the symlinks for the boot sequence: ‘sudo update-rc.d –f mathkernel remove’ (This option might not survive a system update)

I see no reason to not have darkice start last. That way we know the system is fully operational before it does start. Change the line in darkice init file: /etc/init.d.darkice
to #Required start $all

Remove the current darkice links for the boot sequence just to be sure it’s a clean slate: ‘sudo update-rc.d –f darkice remove’

Then run ‘sudo update-rc.d darkice defaults 99’ to force it to last position in the boot sequence.

If you want to explore a little now.. ‘cd /etc/rc2.d’ then ‘ls –la’
Look for a link with the word darkice in it. The link should be “Sxxdarkice’ where xx is higher or equal to the others in the directory (04 on my system), and it should point to /etc/init.d/darkice. These links of course point to all the scripts that are supposed to start in run level 2. You can also explore the other run level directories, rc0.d, rc1.d, etc. if you wish. Darkice should be set up to start in the run levels specified in the LSB header in the /etc/init.d/darkice file, namely 2 3 4 5.

(Don’t edit this links directly, that’s what update-rc.d is for)

If still no joy then we have to look further and maybe you would be willing to allow me a copy of your SD card to run here (minus passwords, etc) or even SSH in to try and fix it. Don’t let the silicone win!


'73 de N4YTM
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,567
Location
Massachusetts
Do tell.. how do you autostart upon power restoration? I run my RasPi on a UPS and it draws so little power it has well outlasted any black outs here, but that would be a great feature.

I followed the instructions at:

Auto Login and Auto Start in Raspberry Pi

All that you need is the first section regarding Auto Login (steps 1-4). Then set the cron job.

Jim
 

IredellMon

Member
Joined
Jan 23, 2012
Messages
90
Location
North Carolina
I need to clarify my statement: "The link should be “Sxxdarkice’ where xx is higher or equal to the others in the directory (04 on my system)... "
...
xx should be equal to the highest number in the links or higher... If the links are S01foo, S02bar, S03foobared (and no more) for example.. then you should see S03darkice -> ../init.d/darkice
OR S03 could be any number higher than 03 also.
 

W2GLD

Active Member
Premium Subscriber
Joined
May 20, 2003
Messages
609
Location
Michigan
I can certainly commiserate with you.. sometimes I think I know what I am doing pretty well, then I run into something that drives me nuts. But I refuse to let any piece of silicon beat me so I usually stay with a problem no matter how long it takes... which explains why my laptop starts crashing a few times, every few weeks, and has done so for a year or more. The &#8220;trouble ticket&#8221; is still open here as I will never give up but I might have to add it to my bucket list, i.e. &#8220;Fix laptop before dying&#8221;. (LOL)

So if you want to avoid using the &#8220;proper&#8221; SysV init method, use a cron job instead. Not as elegant but it works.

Q: On the console (must be local/direct connected) when its booting up, toward the end and maybe just before you get a login prompt, do you see &#8220;Starting darkice..&#8221; if so it&#8217;s starting all right, but then it stops. For example if the network is not reachable yet and it can&#8217;t connect it will stop but it won&#8217;t be so polite as to let you know.

Now to your issues. LSB error is no doubt a reference to the LSB (Linux Standards Base) compliant headers in you dependency based boot init script(s). The init script runs fine when run manually but fails on bootup so it sounds like something is not compliant on your box.

Now I don&#8217;t have mathkernal or Mathematica on my RasPi.. but I stumbled across this web page:

Raspberry Pi &bull; View topic - Raspbian init script bug

Which might explain the error you are seeing. Give it a shot. Either:
1. add the LSB header to /etc/init.d/mathkernel
Or 2. uninstall it (mathkernal and/or Mathematica?) and make sure that etc/init.d/mathkernel is gone
Or 3. Just remove the symlinks for the boot sequence: &#8216;sudo update-rc.d &#8211;f mathkernel remove&#8217; (This option might not survive a system update)

I see no reason to not have darkice start last. That way we know the system is fully operational before it does start. Change the line in darkice init file: /etc/init.d.darkice
to #Required start $all

Remove the current darkice links for the boot sequence just to be sure it&#8217;s a clean slate: &#8216;sudo update-rc.d &#8211;f darkice remove&#8217;

Then run &#8216;sudo update-rc.d darkice defaults 99&#8217; to force it to last position in the boot sequence.

If you want to explore a little now.. &#8216;cd /etc/rc2.d&#8217; then &#8216;ls &#8211;la&#8217;
Look for a link with the word darkice in it. The link should be &#8220;Sxxdarkice&#8217; where xx is higher or equal to the others in the directory (04 on my system), and it should point to /etc/init.d/darkice. These links of course point to all the scripts that are supposed to start in run level 2. You can also explore the other run level directories, rc0.d, rc1.d, etc. if you wish. Darkice should be set up to start in the run levels specified in the LSB header in the /etc/init.d/darkice file, namely 2 3 4 5.

(Don&#8217;t edit this links directly, that&#8217;s what update-rc.d is for)

If still no joy then we have to look further and maybe you would be willing to allow me a copy of your SD card to run here (minus passwords, etc) or even SSH in to try and fix it. Don&#8217;t let the silicone win!


'73 de N4YTM

Gordon,

First off, that's again for additional direction, it has been somewhat helpful, but we're still not 100%; however, we're working and I can reboot and get darkice to start automatically, though not following your methods.

Okay, here goes, the fix from that web link appears to have corrected the mathkernel issue; not sure why it's there; however, it's been there since the last three releases of Raspian Weezy; I'm running Weezy 2014-01-07 with all updated firmware and packages.

As for rebooting and getting darkice to start, I found a link on the web where someone was using an R-Pi for a baby monitor and they also suggested the crontab edit; however, I didn't want the system to have to wait for it to start too long, also, I wanted a way for it to restart should it crash throughout the day. The crontab entry I used is:

@reboot while sleep 1; do /usr/bin/darkice; done

When rebooting the R-Pi, it takes about a second for the feed to become live. Even-though the service says it's starting in the services; it's apparently crashing on bootup, possibly due to slow network acquisition as Gordon had suggested.

My platform is a Raspberry Pi (Rev. B) with a Edimax WiFi dongle and an 8gig. SD-Card running Raspian Weezy 2014-01-07 and a CM119 USB sound fob. I went WiFi because it was just easier to mount the R-Pi under the desk from where the Uniden scanner is located. I'd prefer ethernet cabled, but WiFi's okay too; I'm just old school and prefer some things hardwired.

Anyway, after several reboots, it appears to be working every time; we'll keep an eye on it for a few days and see what happens.

I do have one question still... Why would you want the R-Pi to automatically login? Doesn't that break it's security just a bit? If darkice is running as a service in headless operation, what's the point exactly? I've run IRLP and Allstar nodes and almost never login to the physical boxes; it's WinSCP for almost everything and Putty for everything else; am I missing something?

Thanks for everyone for their comments and I'll never let silicone win, unless she's cute and good in bed... :lol:

BTW, here's a link to the feed: http://www.broadcastify.com/listen/feed/11325/?rl=rr

Regards,

Jerry, W2GLD
 
Last edited:

ahearn

Member
Joined
Aug 4, 2005
Messages
29
Location
Woodstock, GA
I was researching using a Raspberry Pi for scanner feeds and came across this thread. Wow. I'm glad you guys are here and this thread will be a big help as I start my project. I'm an old noob so be gentle with me.

Al - WA4GKQ
 

W2GLD

Active Member
Premium Subscriber
Joined
May 20, 2003
Messages
609
Location
Michigan
I was researching using a Raspberry Pi for scanner feeds and came across this thread. Wow. I'm glad you guys are here and this thread will be a big help as I start my project. I'm an old noob so be gentle with me.

Al - WA4GKQ

A Raspberry Pi is a great low power solution for a feed; once you get some of the kinks worked out.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,567
Location
Massachusetts
Auto login allows the pi to self restore after a power failure. When the power comes back on, the pi starts itself up and relaunches Darkice. No human intervention. When remoting in through ssh it still requires uname and pwd.
 

W2GLD

Active Member
Premium Subscriber
Joined
May 20, 2003
Messages
609
Location
Michigan
Auto login allows the pi to self restore after a power failure. When the power comes back on, the pi starts itself up and relaunches Darkice. No human intervention. When remoting in through ssh it still requires uname and pwd.

Okay, I'm still confused. I understand what you're saying but each time I remove power, it comes back up automatically by default because darkice is a service.

I'll simulate a power failure later tonight to verify again, but all the devices I've built fir various services do not require this extra procedure, unless you're running in a GUI environment and gave additional things running on it. Even the Beaglebone is the same way.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,567
Location
Massachusetts
Sorry, if i confused things. It sounds like you are accomplishing the same end result using a different means.
 

W2GLD

Active Member
Premium Subscriber
Joined
May 20, 2003
Messages
609
Location
Michigan
Sorry, if i confused things. It sounds like you are accomplishing the same end result using a different means.

It's cool, I was just trying to understand in case I was missing something too.
 

frazpo

Member
Premium Subscriber
Joined
Jan 14, 2007
Messages
1,477
Location
SW Mo
I was researching using a Raspberry Pi for scanner feeds and came across this thread. Wow. I'm glad you guys are here and this thread will be a big help as I start my project. I'm an old noob so be gentle with me.

Al - WA4GKQ

I just completed setting up a personal feed for decoded NXDN on an old laptop to a RasPi. Sounds good.
I was able to get through some issues with help from these guys. Any problems can be solved here with issues you may run in to.
 

frazpo

Member
Premium Subscriber
Joined
Jan 14, 2007
Messages
1,477
Location
SW Mo
Low volume normal using USB soundcard on PI ?

I have found that I need to increase my volume on the scanner quite a bit using my Pi to feed with in comparison to running my feed on a computer. Has anyone else had to do this? I wont be surprised if that's the case considering the PI is running on less power.
 

IredellMon

Member
Joined
Jan 23, 2012
Messages
90
Location
North Carolina
I have found that I need to increase my volume on the scanner quite a bit using my Pi to feed with in comparison to running my feed on a computer. Has anyone else had to do this? I wont be surprised if that's the case considering the PI is running on less power.
I think it really varies in each case due to differences in scanners, soundcards, ect. and has nothing to do with the RasPi being a low power device. Running two different scanners on the same RasPi (at different times) I had to turn one up where it would be very loud (if the cable unplugged), and the other turned down almost too low for comfortable listening (again, if using the internal speaker). It also depends on the gain you have set on the capture device on the RasPi. It&#8217;s trial and error and a bit of an art form to get the levels just right for maximum modulation without distorting, clipping, etc. That&#8217;s where having an icecast server available on your local network (or the RasPi itself) helps you get the levels set faster.
 

frazpo

Member
Premium Subscriber
Joined
Jan 14, 2007
Messages
1,477
Location
SW Mo
Yes and that is the case here. I have had it running on icecast for a week or so but not from a scanner. One scanner is not as sensitive as the other so I agree with your comment on the variance from one setup to the other. The important thing is that it is clear and working good. Nice shutting that ol' xp box down and not relying on it. The hard drive has that whine so I bet its getting ready to go. Don't have to worry about that anymore. Got the SD card backed up and the cfg files on drop box. Love this Pi.
 
Status
Not open for further replies.
Top