OP25 OP25 multi_rx.py to local Icecast server

Status
Not open for further replies.

jschmall

Member
Premium Subscriber
Joined
Jul 15, 2017
Messages
80
Location
Anderson, CA
Currently have a Smartnet system working with audio piped out of my raspberry pi to speakers. Works perfectly. However, I'd like to ALSO pipe that stream to my local Icecast server but I'm not having much luck.

Does anyone have a partial example of their .json that is successfully streaming to a local Icecast server? If I need to post a snippet of my configurations, I will, just not sure what would be helpful.

Thank you.
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
949
Location
NE Wisconsin
Follow the README-rpi3-liquidsoap found in the ~/op25 fold of the boatbod version of op25 and install Liquidsoap that will interface
with multi_rx.py to convert the UDP audio from op25 to an mp3 stream going to your Icecast server.

The line, "destination": udp://127.0.0.1:23456 shown in smartnet_example.json directs audio packets into liquidsoap.
Look at the op25.liq file in the apps folder where you'll see that audio.py listens for the inbound udp audio packets.

input = mksafe(input.external(buffer=0.25, channels=2, samplerate=8000, restart_on_error=false, "./audio.py -x 1.5 -s"))

You'll still have the ability to listen to local audio from the headphone jack but will now have to enable one of the local
audio options in the op25.liq script.

The following configuration works well in Liquidsoap V1.3.3 on the Raspberry Pi-4 without having
to install and deal with PulseAudio.

# LOCAL AUDIO OUTPUT
# Uncomment the appropriate line below to enable local sound
#
# Default audio subsystem
#out (input)
#
# PulseAudio
#output.pulseaudio(input)
#
# ALSA
output.alsa(input)

Come back if you have any questions, or feel free to send me a PM whereby we can establish contact and communicate interactively offline.

Bill


 

jschmall

Member
Premium Subscriber
Joined
Jul 15, 2017
Messages
80
Location
Anderson, CA
Follow the README-rpi3-liquidsoap found in the ~/op25 fold of the boatbod version of op25 and install Liquidsoap that will interface
with multi_rx.py to convert the UDP audio from op25 to an mp3 stream going to your Icecast server.

The line, "destination": udp://127.0.0.1:23456 shown in smartnet_example.json directs audio packets into liquidsoap.
Look at the op25.liq file in the apps folder where you'll see that audio.py listens for the inbound udp audio packets.

input = mksafe(input.external(buffer=0.25, channels=2, samplerate=8000, restart_on_error=false, "./audio.py -x 1.5 -s"))

You'll still have the ability to listen to local audio from the headphone jack but will now have to enable one of the local
audio options in the op25.liq script.

The following configuration works well in Liquidsoap V1.3.3 on the Raspberry Pi-4 without having
to install and deal with PulseAudio.

# LOCAL AUDIO OUTPUT
# Uncomment the appropriate line below to enable local sound
#
# Default audio subsystem
#out (input)
#
# PulseAudio
#output.pulseaudio(input)
#
# ALSA
output.alsa(input)

Come back if you have any questions, or feel free to send me a PM whereby we can establish contact and communicate interactively offline.

Bill



Bill, thank you very much for your input! Right after I posted this question initially, I found the README file and was able to get things working.

Only question I have is the gain adjustment of the audio stream going to my Icecast server. Not sure where I can adjust that, if that's within the op25.liq file or elsewhere.
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
949
Location
NE Wisconsin
You can adjust the audio gain up or down by changing the audio.py (-x) parameter whereby the default is -x 1.0, but can be increased
or decreased as may be necessary for your application.

However, I would recommend the configuration shown below for your input line in op25.liq with the addition of the compand function that serves and an excellent overall AGC and will provide nearly optimum mp3 encoding to your Icecast server over widely varying talker audio levels.

There are other optional audio processing blocks in the op25.liq script that also provide excellent results but I have been testing and running
the compand function of late and really likes how well it seems to function. Of course, audio processing and control is a matter of personal
preference but digital (p25) audio levels vary so widely that some form of AGC is desirable, IMHO.

input = mksafe(input.external(buffer=0.25, channels=2, samplerate=8000, restart_on_error=false, "./audio.py -x 1.0 -s"))
#
input = compand(input, mu = 0.5)
#
output.icecast(%mp3(bitrate=16, samplerate=22050, stereo=false), description="op25", genre="Public Safety", url="",
fallible=false, icy_metadata="true", host="localhost", port=8000, mount="op25", password="hackme",mean(input))

Bill
 

jschmall

Member
Premium Subscriber
Joined
Jul 15, 2017
Messages
80
Location
Anderson, CA
You can adjust the audio gain up or down by changing the audio.py (-x) parameter whereby the default is -x 1.0, but can be increased
or decreased as may be necessary for your application.

However, I would recommend the configuration shown below for your input line in op25.liq with the addition of the compand function that serves and an excellent overall AGC and will provide nearly optimum mp3 encoding to your Icecast server over widely varying talker audio levels.

There are other optional audio processing blocks in the op25.liq script that also provide excellent results but I have been testing and running
the compand function of late and really likes how well it seems to function. Of course, audio processing and control is a matter of personal
preference but digital (p25) audio levels vary so widely that some form of AGC is desirable, IMHO.

input = mksafe(input.external(buffer=0.25, channels=2, samplerate=8000, restart_on_error=false, "./audio.py -x 1.0 -s"))
#
input = compand(input, mu = 0.5)
#
output.icecast(%mp3(bitrate=16, samplerate=22050, stereo=false), description="op25", genre="Public Safety", url="",
fallible=false, icy_metadata="true", host="localhost", port=8000, mount="op25", password="hackme",mean(input))

Bill
Once again, thank you for the above info. I will be diving into this tomorrow, then hopefully pushing this to Broadcastify.

I appreciate the helpful insight.
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
949
Location
NE Wisconsin
Excellent! Liquidsoap is a wonderful tool. I have several feeds, public (BCFY) and private that all have the compand (AGC) function configured that that I think you'll really appreciate, especially if you intend to supply a feed to BCFY.
 
Status
Not open for further replies.
Top