[arm-allstar] Broadcastify using Darkice
Patrick Perdue
borrisinabox at gmail.com
Mon Apr 3 06:06:20 EDT 2023
John:
I'm using ezstream now on HamVoIP, and it works pretty well. Write me
privately and I'll try to help you resolve that.
As far as Darkice, here is what I did to stream from alsa loopback on
ASL. The process should theoretically be pretty similar on HamVoIP, but
I couldn't get Darkice to compile there, so I couldn't try it.
First, install Darkice. On Debian/ASL, I was able to do this using
$ sudo apt install darkice
Now, configure an alsa loopback device for Darkice to use as it's input.
Using aloop, input/output devices are set up in pairs. For example,
anything sent to device 0 is output to device 1.
$ sudo modprobe snd-aloop
To make this persist across reboots, at least on Debian, edit
/etc/modules, and add the line
snd-aloop
at the end.
On my VPS, which has no physical audio devices installed, invoking the
aplay -l option shows the following devices:
patrick at broken:/home/patrick# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
In this case, I only really care about devices 0:0 and 0:1.
Now, let's direct audio from app.rpt to a loopback device.
Edit /etc/asterisk/rpt.conf, and add the following line, substituting
hw:0,0,0 for your loopback device if it is different on your system.
outstreamcmd = /bin/sh,-c,/usr/bin/aplay -r 8000 -c 1 -f S16_LE -D hw:0,0,0
Restart Asterisk. Theoretically, you could also do asterisk -rx "rpt
reload", but this doesn't always work, in my experience.
Edit your Darkice configuration. For me, this lives in
/etc/darkice.conf. My example here streams from hw:0,1, the looped
output of what is sent to hw:0,0, which Asterisk is now theoretically
sending to.
# this section describes general aspects of the live streaming session
[general]
duration = 0 # duration of encoding, in seconds. 0 means
forever
bufferSecs = 1 # size of internal slip buffer, in seconds
reconnect = yes # reconnect to the server(s) if disconnected
realtime = yes # run the encoder with POSIX realtime priority
rtprio = 3 # scheduling priority for the realtime threads
# this section describes the audio input that will be streamed
[input]
device = hw:0,1 # OSS DSP soundcard device for the audio input
sampleRate = 8000 # 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 # average bit rate
format = mp3 # format of the stream: ogg vorbis
bitrate = 16 # bitrate of the stream sent to the server
server = audio1.radioreference.com
port = 80
password = MyReallySecurePassword # source password to the
IceCast2 server
mountPoint = BroadcastifyMountpoint # mount point of this stream on
the IceCast2 server
name = Some Cool Allstar Node
description = some description
url = http://www.WhatEver.com
genre = amateur-radio # genre of the stream
public = yes # advertise this stream
You should now theoretically be able to execute darkice as root (it will
complain about posix scheduling if you don't.) It's probably best if you
run it in a screen.
I ran into buffer underruns and silent crashes while testing this on my
ASL VPS, and as I said earlier, since I couldn't get Darkice to compile
on HamVoIP, I wasn't able to test with that. I am currently running two
ezstreams, one to stream to my own Icecast server, and another for
Broadcastify on a HamVoIP node, and that works OK most of the time. I am
using a private node for each stream rather than using nptee just to
have a bit less latency, although nptee is a safer way to do it. I
originally wanted to use a setup like this so I could add processing
(mostly just a master brickwall limiter) without using pipes, but I
never got that far because of other problems.
73
N2DYI
On 4/3/2023 1:53 AM, John Springman via ARM-allstar wrote:
> I was wondering if anyone has use Darkice for their Broadcastify repeater feed? As I have recently posted about one of the servers I am having ezstream that keeps stopping but cannot find anything wrong so I was told to try Darkice but not sure what the directions are to do it. Anyone?
> Thanks
>
> John KB3AWQWQGU515W3AHS
> _______________________________________________
>
> ARM-allstar mailing list
> ARM-allstar at hamvoip.org
> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
>
> Visit the BBB and RPi2/3/4 web page - http://hamvoip.org
More information about the ARM-allstar
mailing list