How to stream to Broadcastify from a Rasberry Pi?

Status
Not open for further replies.

13CA350

Member
Joined
Jan 2, 2015
Messages
71
Location
Massachusetts
I recently bought a Raspberry Pi because I will be moving soon, and will be able to stream the Local Fire Department there.

I have everything I need, and have followed the directions from this article multiple times.

https://wiki.radioreference.com/index.php/Raspberry_Pi_Broadcastify_Build

I haven't been able to get it to work, and it seems that it may be because the guide is outdated and the commands don't work anymore.

I haven't gotten much help from email support, they basically told me to ask here....

If anyone at all has done this before or has any advice, it would be greatly appreciated. It's surprising that a website who wants you to stream your scanner to them doesn't provide much support....
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
I recently bought a Raspberry Pi because I will be moving soon, and will be able to stream the Local Fire Department there.

I have everything I need, and have followed the directions from this article multiple times.

https://wiki.radioreference.com/index.php/Raspberry_Pi_Broadcastify_Build

I haven't been able to get it to work, and it seems that it may be because the guide is outdated and the commands don't work anymore.

I haven't gotten much help from email support, they basically told me to ask here....

If anyone at all has done this before or has any advice, it would be greatly appreciated. It's surprising that a website who wants you to stream your scanner to them doesn't provide much support....

At your command prompt ($), type darkice -c /etc/darkice1.cfg

Then post back here the message that returns,

Yes, the instructions you followed are immensely more complicated than necessary and don’t work. Once we figure out where you are at with the setup, the fix will be easy, I think.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
I recently bought a Raspberry Pi because I will be moving soon, and will be able to stream the Local Fire Department there.

I have everything I need, and have followed the directions from this article multiple times.

https://wiki.radioreference.com/index.php/Raspberry_Pi_Broadcastify_Build

I haven't been able to get it to work, and it seems that it may be because the guide is outdated and the commands don't work anymore.

I haven't gotten much help from email support, they basically told me to ask here....

If anyone at all has done this before or has any advice, it would be greatly appreciated. It's surprising that a website who wants you to stream your scanner to them doesn't provide much support....

If you want to start over, or if someone else bumps into this thread while trying to stream from a pi, you may have much better luck following the Ubuntu instructions at: https://wiki.radioreference.com/index.php/Live_Audio/Ubuntu_Darkice

Image your SD card with the lite version of Stretch and follow the command line instructions. Ubuntu and Raspbian are very much the same and the same commands work on the pi.

Skip the long version of the darkice.cfg file and use the short version as shown in the attached image.

Edit: if this cfg doesn’t work, try changing to device = plughw:1,0 in the configuration file.


Skip everything after the heading Starting Darkice.

Use this command to start dakice and keep it running:

screen -dmS darkice-screen darkice

This will start darkice in a detached screen which keeps it running after you end your terminal session.

To auto start on boot, open your crontab file by typing crontab -e. (If it asks about editors, choose nano)

Then add this line at the end of the file:

@reboot screen -dmS darkice-screen darkice
 

Attachments

  • 111BF464-3D64-4BE5-A854-0467987BBCC4.jpg
    111BF464-3D64-4BE5-A854-0467987BBCC4.jpg
    58.1 KB · Views: 659

13CA350

Member
Joined
Jan 2, 2015
Messages
71
Location
Massachusetts
DC31

Here's what I got after typing in your command

pi@raspberrypi:~ $ darkice -c/etc/darkice1.cfg
DarkIce 1.3 live audio streamer, Google Code Archive - Long-term storage for Google Code Project Hosting.
Copyright (c) 2000-2007, Tyrell Hungary, Tyrell Hungary Corporation
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/darkice1.cfg
DarkIce: DarkIce.cpp:155: no section [general] in config [0]
pi@raspberrypi:~ $

If what you have in mind doesn't work, then I'll start over using the directions you posted in your second post. Thank you!
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
Okay, that tells you that darkice is starting okay but that it can't locate the configuration file. It is looking for a file titled darkice1.cfg in the /etc directory. Take a look in your /etc directory and see if there is any .cfg file starting with darkice. If you find one, then run that same command but replace darkice1.cfg with the name of the file you found. If there is no darkice configuration file in /etc then we will need to get one there
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
Darkice made simple

Let's cut right to the chase and make it simple. Image an SD card with Raspbian Stretch lite:

https://www.raspberrypi.org/downloads/raspbian/


Get yourself to the command line and run these five commands:

1 sudo apt-get install darkice screen
2 cd /etc
3 sudo wget http://twotonedetect.net/burnham/darkice/darkice.cfg
4 sudo nano darkice.cfg (this will open the configuration file in a text editor. Put your Broadcastify mount point, password etc. in the appropriate places. Save and close)
5 darkice

this should return something that looks like this:

pi@raspberrypi:~ $ darkice
DarkIce 1.3 live audio streamer, Google Code Archive - Long-term storage for Google Code Project Hosting.
Copyright (c) 2000-2007, Tyrell Hungary, Tyrell Hungary Corporation
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
Using ALSA DSP input device: hw:1,0
Could not set POSIX real-time scheduling, this may cause recording skips.
Try to run darkice as the super-user.


Ignore the part about running as super-user. There will be one more line on the end of the above indicating darkice is running or the error received. If an error, it is likely in your /etc/darkice.cfg file. You may need to use device = plughw:1,0

Close out of this using Control-C. This will also stop darkice streaming.

To start and keep darkice streaming run it in a detached screen by running the following command:

screen -dmS darkice-screen darkice

There will be no indication that darkice is running. To confirm that it is running use the command screen -list to see the list of detached screens.
 

13CA350

Member
Joined
Jan 2, 2015
Messages
71
Location
Massachusetts
Everything went well until step #5, when I run the command darkice it says command not found....

Not sure if it's because instead of pi@raspberrypi: at the beginning it says pi@raspberrypi:/etc $
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
Everything went well until step #5, when I run the command darkice it says command not found....

Not sure if it's because instead of pi@raspberrypi: at the beginning it says pi@raspberrypi:/etc $

That shouldn’t make a difference. When you ran line 1 did it look like it installed darkice properly or were there some errors? Try running line 1 again, it won’t hurt.

Make sure that you have a usb sound card plugged in. You can always try power cycling the pi also.
 

13CA350

Member
Joined
Jan 2, 2015
Messages
71
Location
Massachusetts
I ran it again, and it looks like it installed properly this time. When I enter the stream password, should I enter the slash at the beginning, or no? I didn't, most of the tutorials I found on here and other sites said not to...

How would I go about changing the /etc/darkice.cfg file to correct any error(s) that may be present?

I also tried the screen -dmS darkice-screen darkice command.... and nothing

Screen -list says that "no sockets are found"
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
I ran it again, and it looks like it installed properly this time. When I enter the stream password, should I enter the slash at the beginning, or no? I didn't, most of the tutorials I found on here and other sites said not to...

How would I go about changing the /etc/darkice.cfg file to correct any error(s) that may be present?

I also tried the screen -dmS darkice-screen darkice command.... and nothing

Screen -list says that "no sockets are found"

Yeah, I imaged an SD card and ran the five commands and it worked for me.

Omit the slash. All you want is the numbers/letters.

To edit the configuration file:

$ cd

$ sudo nano /etc/darkice.cfg

You will need to edit that file to enter your BCFY credentials as well as to make any error corrections.

Once you put the BCFY credentials (server, port, mount point, password) in and save them, get back to the command prompt and simply type darkice. That will start darkice and you will see any errors that it spits. If you get something like "lame underlying sink error" (real meaningful, right?) it means that you forgot to take down the other computer that you already have running that feed. you can't send two sources to the same feed.

You are getting real close. once you get it to connect when using the darkice command at the prompt then you can try the screen command. Until you are successful making the feed the screen command won't work or give you any feedback
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
another error

You will find another error in the darkice.cfg file. The two lines that have notes in parenthesis need those notes and parentheses removed.

server = audioX.broadcastify.com
port = 80

Get rid of the notes. I will correct that in the file that you grabbed using the wget line.
 

13CA350

Member
Joined
Jan 2, 2015
Messages
71
Location
Massachusetts
Amazing! It worked! There is about a 2 minute delay from when you start the software, to when it appears online.

For those who may be reading this in the future, I realized that I also put my password in the mountpoint spot and mountpoint in the password spot. The two lines are reversed in the software, and in your broadcastify profile.

Thanks a bunch, DC31. I never ended up changing hw:1,0 to plughw:1,0 either.

One final question... Will this run on boot, or do you have to manually enable it? I'd like to put the pi in my basement, with no monitor. It would be helpful if there was a way it would start on its own so that I don't have to drag a monitor down there to set it up. If not, no biggie.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
One final question... Will this run on boot, or do you have to manually enable it? I'd like to put the pi in my basement, with no monitor. It would be helpful if there was a way it would start on its own so that I don't have to drag a monitor down there to set it up. If not, no biggie.

No, it won't run on boot. Easily done though. A crontab file in linux controls scheduled tasks.

$ crontab -e

If it asks you about the text editor, choose 2 (nano)

then add this line at the end:

@reboot sleep 10 ; screen -dmS darkice-screen darkice

That will start darkice in a detached screen when the pi boots up.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
For setup and trouble shooting I find it much easier to stream the audio to a local server rather then trying to make adjustments using the broadcastify server.

install icecast on the pi:

$ sudo apt-get install icecast2

Accept the default server name and passwords during the setup.

In your darkice.cfg add another section at the end:

[icecast2-1]
bitrateMode = cbr
format = mp3
bitrate = 16
channel = 1
lowpass = 5000
sampleRate = 22050
server = localhost
port = 8000
password = hackme
mountPoint = 12345678
name = Name

Then power cycle your pi to restart darkice.

Now from a web browser on the same network as the pi browse to RadioReference.com - Scanner Frequencies and Radio Frequency Reference or if that doesn't work try http://piipaddress:8000. Of course you need to use your pi's ip address. This will open up the icecast server web page on the pi. click the .m3u button to listen to the stream.
 

13CA350

Member
Joined
Jan 2, 2015
Messages
71
Location
Massachusetts
Now one more somewhat bizarre problem... I was able to do all that, and now I figured out how to address the pi using my iPhone

But, it seems like the scanner audio is in verrrrrry slow motion. 1 second of audio seems to be almost a full ten seconds slowed down. Is there any way to fix this?
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
Now one more somewhat bizarre problem... I was able to do all that, and now I figured out how to address the pi using my iPhone

But, it seems like the scanner audio is in verrrrrry slow motion. 1 second of audio seems to be almost a full ten seconds slowed down. Is there any way to fix this?

In your darkice.cfg file try changing the samplerate to either 11025, or to 44100
 

13CA350

Member
Joined
Jan 2, 2015
Messages
71
Location
Massachusetts
In your darkice.cfg file try changing the samplerate to either 11025, or to 44100

Perfect, I changed the samplerate to 44100 and it's working great

Thanks for all your help! Maybe I'll make a new guide and send it over to the guys at the wiki
 

Night_Watchman

Member
Premium Subscriber
Joined
Dec 19, 2002
Messages
61
Location
Syracuse, NY
Hi, I too am trying to stream audio. I'm using a RPi3B with an RTL-SDR and OP25. I'm getting an error when I try to start Darkice.
Code:
DarkIce: DarkIce.cpp:1273: can't open connector [0]
Any suggestions would be helpful. I am only trying to stream locally for now but if all goes well, I intend to set up a Broadcastify feed.
Thanks in advance.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
Hi, I too am trying to stream audio. I'm using a RPi3B with an RTL-SDR and OP25. I'm getting an error when I try to start Darkice.
Code:
DarkIce: DarkIce.cpp:1273: can't open connector [0]
Any suggestions would be helpful. I am only trying to stream locally for now but if all goes well, I intend to set up a Broadcastify feed.
Thanks in advance.

Streaming from RTL-SDR is an entirely different animal. Darkice is looking for input from a sound card. The output from RTL-SDR is stdin/stdout. You would somehow need to route that through an audio program. I believe that it can be done be may not be as easy as one might hope. I have never been successful.

Check out this thread for example:

https://forums.radioreference.com/s...rcraft-am-atc-broadcastify-using-rtl-sdr.html
 
Status
Not open for further replies.
Top