Broadcastify Streaming with RaspberryPi Raspbian Stretch

Status
Not open for further replies.

jj358mhz

Member
Feed Provider
Joined
Sep 28, 2005
Messages
12
Location
Berkeley, CA
Has anyone been able to setup Darkice to stream scanner audio on the latest Raspbian version 9 (Stretch)? As I understand, Darkice does not need to be compiled as it already natively supports mp3 encoding.

Any help is appreciated.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,545
Location
Massachusetts
Yes, with the current Stretch, simply install darkice, create a configuration file (/etc/darkice.cfg) and it works. In my case I am also running TwoToneDetect so I need pulseaudio. This makes the source for darkice become default. See my config file below. If you want to use pulseaudio, just install PAvolumecontrol. Sudo apt install pavucontrol. When you start darkice from the command line you will see it appear in the Recording Tab of PA. From there select your usb sound card as its source.


# sample DarkIce configuration file, edit for your needs before using
# see the darkice.cfg man page for details

# this section describes general aspects of the live streaming session
[general]
duration = 0 # duration of encoding, in seconds. 0 means forever
bufferSecs = 5 # size of internal slip buffer, in seconds
reconnect = yes # reconnect to the server(s) if disconnected

# this section describes the audio input that will be streamed
[input]
device = default # OSS DSP soundcard device for the audio input
sampleRate = 11025 # sample rate in Hz. try 11025, 22050 or 44100
bitsPerSample = 16 # bits per sample. try 16
channel = 1 # channels. 1 = mono, 2 = stereo

# this section describes a streaming connection to an IceCast2 server
# there may be up to 8 of these sections, named [icecast2-0] ... [icecast2-7]
# these can be mixed with [icecast-x] and [shoutcast-x] sections
[icecast2-0bitrateMode = cbr # constant bit rate
bitrate = 16
format = mp3 # format of the stream: mp3
quality = .1 # quality of the stream sent to the server
lowpass = 3000 # low pass filter to save bandwidth
server = audio1.broadcastify.com # host name of the server
port = 80 # 8000 port of the IceCast2 server, usually 8000
password = XXXXX # source password to the IceCast2 server
mountPoint = XXXXXX # mount point of this stream on the IceCast2 server
name = STREAM # name of the stream
description = AAAAA # description of the stream
url = http://localhost # URL related to the stream
genre = Public Safety # genre of the stream

public = yes # advertise this stream?
 

k7joe

Member
Joined
Feb 20, 2015
Messages
19
any update to this ? I am trying get a RPi3B to broadcast my feed as I'm tired of windows crashing. I am not able to get it to work. Can someone pls post a new/recent darkice1.cfg file ? I got my password and the feed mount. I am not sure what audio server to use, nor what port to use. I tried port 80 and port 8080... I also am using audio1.broadcastify.com as my server. There is no good documentation that I've found. I saw one "all in one" file but it works only with Pi2 and not Pi3B... I am using raspbian stretch dated 2018-11-13; Cant figure this out. This is my first ever raspb experiment. It's a cute little toy...
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,545
Location
Massachusetts
any update to this ? I am trying get a RPi3B to broadcast my feed as I'm tired of windows crashing. I am not able to get it to work. Can someone pls post a new/recent darkice1.cfg file ? I got my password and the feed mount. I am not sure what audio server to use, nor what port to use. I tried port 80 and port 8080... I also am using audio1.broadcastify.com as my server. There is no good documentation that I've found. I saw one "all in one" file but it works only with Pi2 and not Pi3B... I am using raspbian stretch dated 2018-11-13; Cant figure this out. This is my first ever raspb experiment. It's a cute little toy...
It looks like you have several things going on. Let’s rule them out one at a time.

1. How are you starting darkice? Exactly what are you typing at the command line?

2. Your password, mount point, port and server are all listed under the Technical Details tab in your feed manager’s page. Make sure that you have them all correct in your darkice configuration file. Note that the mount point in Technical Details shows a leading slash. DO NOT put this leading slash in the darkice configuration file.

3. What does your configuration file show for the device? In my previous post I show “default”. This will work if you are running pulse audio. If you are not, then you likely want this-to point to your usb sound card, hw:1,0. If that doesn’t work try plughw:1,0.

4. Make sure that you shut down your windows feed prior to starting your RPi feed. If there is a feed connected to the mount point, attempting to connect a second feed to the same mount point will always fail.

5. When you attempt to start darkice, what sort of messages are you seeing on the screen?


Please answer all five of the above points.
 

jj358mhz

Member
Feed Provider
Joined
Sep 28, 2005
Messages
12
Location
Berkeley, CA
I have reached out to Rafael Diniz, current maintainer of Darkice, to see if there are compatibly issues with Darkice 1.3 and a RaspberryPi 3B+ running Raspbian Stretch. I will update this thread if I hear anything.
 

k7joe

Member
Joined
Feb 20, 2015
Messages
19
I have reached out to Rafael Diniz, current maintainer of Darkice, to see if there are compatibly issues with Darkice 1.3 and a RaspberryPi 3B+ running Raspbian Stretch. I will update this thread if I hear anything.

Thanks, note that my board is a raspberry pi 3B (not the plus...) but i have a 3B+ also if need to change to different mo board.
Also note that these are the instructions that I am trying to use (maybe needs to be updated) https://wiki.radioreference.com/index.php/Raspberry_Pi_Broadcastify_Build
 
Last edited:

k7joe

Member
Joined
Feb 20, 2015
Messages
19
"It looks like you have several things going on. Let’s rule them out one at a time.

1. How are you starting darkice? Exactly what are you typing at the command line?

sudo service darkice1 start


2. Your password, mount point, port and server are all listed under the Technical Details tab in your feed manager’s page. Make sure that you have them all correct in your darkice configuration file. Note that the mount point in Technical Details shows a leading slash. DO NOT put this leading slash in the darkice configuration file.

NO...only the mountpoint and password are on the technical details page. The SERVER and PORT are not listed anywhere. I tried using audio1.broadcastify.com as well as audio2.broadcastify.com but neither seemed to work. Yes, I noted that the slash in the mount point for the darkice config file should be excluded.

3. What does your configuration file show for the device? In my previous post I show “default”. This will work if you are running pulse audio. If you are not, then you likely want this-to point to your usb sound card, hw:1,0. If that doesn’t work try plughw:1,0.

I am pointing the device to plughw:1,0 per the instructions in the darkice config file (no onboard microphone input, so using separate usb sound car).

4. Make sure that you shut down your windows feed prior to starting your RPi feed. If there is a feed connected to the mount point, attempting to connect a second feed to the same mount point will always fail.

Yes - did that too - the windows feed was shut down for several minutes (30 mins) during which time I used the plug in USB sound card on the PI, then tried to connect the pi broadcaster to no avail. I know the hardware is all operational.

5. When you attempt to start darkice, what sort of messages are you seeing on the screen?

No message, just the pi prompt after inputting the start command (see answer to Q1)... maybe darkice is not starting ?


Please answer all five of the above points.


thank you for your help. responses posted above.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,545
Location
Massachusetts
"It looks like you have several things going on. Let’s rule them out one at a time.

1. How are you starting darkice? Exactly what are you typing at the command line?

sudo service darkice1 start


2. Your password, mount point, port and server are all listed under the Technical Details tab in your feed manager’s page. Make sure that you have them all correct in your darkice configuration file. Note that the mount point in Technical Details shows a leading slash. DO NOT put this leading slash in the darkice configuration file.

NO...only the mountpoint and password are on the technical details page. The SERVER and PORT are not listed anywhere. I tried using audio1.broadcastify.com as well as audio2.broadcastify.com but neither seemed to work. Yes, I noted that the slash in the mount point for the darkice config file should be excluded.

3. What does your configuration file show for the device? In my previous post I show “default”. This will work if you are running pulse audio. If you are not, then you likely want this-to point to your usb sound card, hw:1,0. If that doesn’t work try plughw:1,0.

I am pointing the device to plughw:1,0 per the instructions in the darkice config file (no onboard microphone input, so using separate usb sound car).

4. Make sure that you shut down your windows feed prior to starting your RPi feed. If there is a feed connected to the mount point, attempting to connect a second feed to the same mount point will always fail.

Yes - did that too - the windows feed was shut down for several minutes (30 mins) during which time I used the plug in USB sound card on the PI, then tried to connect the pi broadcaster to no avail. I know the hardware is all operational.

5. When you attempt to start darkice, what sort of messages are you seeing on the screen?

No message, just the pi prompt after inputting the start command (see answer to Q1)... maybe darkice is not starting ?


Please answer all five of the above points.


thank you for your help. responses posted above.

Okay, thanks for the info, that helps considerably. You have some of the more common stumbling blocks covered.

See attached image for the info in my technical details tab. Are you looking in a different location?

Try starting darkice by simply typing darkice at the prompt. That should give you some feedback. When you start darkice that way, it will be looking for a configuration file /etc/darkice.cfg. In your previous post you inducated the file was titled darkice1.cfg. If so, rename it to darkice.cfg.

Let us know what messages you get when starting it this way. You will get something about POSIX scheduling and starting with sudo. Just ignore that.
 

Attachments

  • C83603AE-100E-4207-AED4-AA2B60CE3B4E.jpeg
    C83603AE-100E-4207-AED4-AA2B60CE3B4E.jpeg
    51.3 KB · Views: 24

k7joe

Member
Joined
Feb 20, 2015
Messages
19
HOLD ON... i think i feel really stupid right now. STANDBY....
The feed mount point and the feed password are coming from an email that is from 2010 or so..... And ...I just recalled that I migrated my feed to a new feed / with new coverage ( back in early 2015 ) and I am thinking now that I referenced an OLD feed from 2010 that is no longer active...that may 'splain why the server data and port data is not listed....hmmm... Sucks getting old and not being able to remember what I did years ago.

STANDBY...trying some new tricks.. !
1548081574787.png
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,545
Location
Massachusetts
HOLD ON... i think i feel really stupid right now. STANDBY....
The feed mount point and the feed password are coming from an email that is from 2010 or so..... And ...I just recalled that I migrated my feed to a new feed / with new coverage ( back in early 2015 ) and I am thinking now that I referenced an OLD feed from 2010 that is no longer active...that may 'splain why the server data and port data is not listed....hmmm... Sucks getting old and not being able to remember what I did years ago.

STANDBY...trying some new tricks.. !
View attachment 67804
Remember "Old" is relative...

Here is what a successful start of darkice from the command line looks like:

pi@station-pi:~ $ 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: default
Using POSIX real-time scheduling, priority 4
 

k7joe

Member
Joined
Feb 20, 2015
Messages
19
well.. no luck. seems it is not starting up.
when i type sudo service darkice1 start it does nothing

when i type darkice, it seems like it starts with a return about being free software, then it says
Using config file: /etc/darkice.cfg
Darkice: Darkice.cpp:150: no section [general] in config [0]

Something still not pointing correctly in the config file ..
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,545
Location
Massachusetts
You are getting closer. Now it is telling you that there is a problem in your darkice.cfg file. Or maybe that it can't find it. Check to make sure that you have it at /etc/darkice.cfg

If it is there, make sure that the format is correct. Here is what one looks like:

# sample DarkIce configuration file, edit for your needs before using
# see the darkice.cfg man page for details

# this section describes general aspects of the live streaming session
[general]
duration = 0 # duration of encoding, in seconds. 0 means forever
bufferSecs = 5 # size of internal slip buffer, in seconds
reconnect = yes # reconnect to the server(s) if disconnected

# this section describes the audio input that will be streamed
[input]
device = plughw:1,0 # OSS DSP soundcard device for the audio input
sampleRate = 11025 # sample rate in Hz. try 11025, 22050 or 44100
bitsPerSample = 16 # bits per sample. try 16
channel = 1 # channels. 1 = mono, 2 = stereo

# this section describes a streaming connection to an IceCast2 server
# there may be up to 8 of these sections, named [icecast2-0] ... [icecast2-7]
# these can be mixed with [icecast-x] and [shoutcast-x] sections

[icecast2-0]

bitrateMode = cbr # constant bit rate
bitrate = 16
format = mp3 # format of the stream: mp3
quality = .1 # quality of the stream sent to the server
lowpass = 3000 # low pass filter to save bandwidth
server = audio1.broadcastify.com # host name of the server
port = 80 # 8000 port of the IceCast2 server, usually 8000
password = XXXXXXX # stream631 # source password to the IceCast2 server
mountPoint = XXXXXX #EMR1 # mount point of this stream on the IceCast2 server
name = Fire Dispatch # name of the stream
description = AAAAA # description of the stream
url = http://localhost # URL related to the stream
genre = Public Safety # genre of the stream
public = yes # advertise this stream?
#localDumpFile = recording.mp3 # local dump file
#fileAddDate = yes
 

k7joe

Member
Joined
Feb 20, 2015
Messages
19
Copied darkice1.cfg to darkice.cfg and tried to start.
getting:

Using config file: /etc/darkice.cfg
Using ALSA DSP input device: plughw:1,0
Could not set POSIX real-time scheduling, this may cause recording skips
Try to run darkice as the super-user

and i get no more PI@raspberrypi:~S prompt...

I actually think its broadcasting.... i can see the feed online.
But I am not sure how to control it from the pi... or to auto-start when the PI boots up. hmmm..
I'm trying to "harded" the windows environment by using PI, battery backup for everything, and auto-reboot when power fails.

Also, i very much appreciate your patience and help - .THANK YOU....
 
Last edited:

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,545
Location
Massachusetts
CONGRATULATIONS. That shows that darkice successfully started.

However, when you close that Terminal window, darkice will stop.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,545
Location
Massachusetts
Easiest way that I have found to start darkice on boot is to create an autostart directory in the /home/pi/.config directory, then in that directory create a file titled darkice.desktop. Paste the following text into that file and save.

[Desktop Entry]
Version=1.0
Name=Darkice Audio Streamer
Exec=/bin/sh -c "sleep 20; darkice -c /etc/darkice.cfg"
Terminal=false
Type=Application
X-GNOME-Autostart-Phase=Initialization
NotShowIn=KDE;


The sleep 20 gives the network time to establish its connection before darkice starts.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,545
Location
Massachusetts
Control it from the pi? What is there to control?

Yes, when running on the pi, there is no real visual indication that it is streaming. To get that warm and fuzzy, type top at the command prompt. This will list everything that is running. At the right toward the top of the list you should find something called darkice. In the same row at the left side you will find a number (XXXX) in the PID column. To shut darkice down, type sudo kill XXXX at the command prompt.

There is a companion GUI interface called DarkSnow, but I have found that to be unreliable. You want v0.7.1. DarkSnow - The Revolution Will Be Streamed
 

k7joe

Member
Joined
Feb 20, 2015
Messages
19
Thanks, just looking for auto-start so when power goes out, it restarts on it's own.
thanks again -- good use of the morning to get this going -- been a project on the desk for 6 months that I never got to !
 

itismejoey

Newbie
Joined
Feb 12, 2018
Messages
2
Sorry to snipe out this thread here, but it looks like @k7joe is also looking for an auto-start like me. I am using the instructions from the following thread. Even though it has a step to "Enable the feed to start broadcasting at boot", this never works. Would love an answer to get this issue solved once and for all.

PS: would love something that would auto restart the Pi too. Seems like after a couple days running it gets hung up and causes everything to stop working.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,545
Location
Massachusetts
Have you tried the Desktop Entry in post #15 above?

As for auto rebooting the pi, try using a crontab entry:

At the command prompt: $ crontab -e

If it asks you to choose a text editor, take option 2.

Then add a line: 02 01 * * * sudo reboot

Cntrl-x, Y, enter to save.

Now it will reboot at 1:02 am daily.

Or if you are using the GUI on your pi, you can load the software gnome-schedule which will give you a GUI to manage the crontab entries.
 

itismejoey

Newbie
Joined
Feb 12, 2018
Messages
2
Small hiccup when I forgot to add the 1 exec line, but this worked!

Was also able to get the reboot working too. Now I can finally set it and forget it! Thanks for the help.
 
Status
Not open for further replies.
Top