OP25 boatbod op25 + icecast

sean_

Member
Joined
Feb 20, 2017
Messages
53
Reaction score
3
Location
las vegas, nevada
Hello,

What's the process to get op25 working with icecast? I already have op25 working with trunking and it plays audio but only locally.
I've installed icecast from src, along with op25 on my Linux Mint machine.

What does my icecast XML file need to look like and the op25 config? I assume for the op25 config, it's just a matter of updating the relevant fields to match the icecast XML config.

If you have a config to share, that would be really helpful!

Thanks!
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,167
Reaction score
416
Location
NE Wisconsin
Okay, maybe a simpler question to get started...
can icecast and op25 be on the same host?
Yes, they can. You'll need to install Liquidsoap or Darkice as a bridge between op25 and Icecast. Liquidsoap for example will be
configured with an input source that accepts the UDP audio stream from op25 and will in turn reformat it to MP3 before sending
the audio upstream to the Icecast mount point.
 

sean_

Member
Joined
Feb 20, 2017
Messages
53
Reaction score
3
Location
las vegas, nevada
And if i use liquidsoap, do I need to update the device string in cfg.json?


Code:
    "devices": [
        {
            "args": "rtl",
            "gains": "LNA:39",
            "gain_mode": false,
            "name": "sdr0",
            "offset": 0,
            "ppm": 0.0,
            "rate": 1000000,
            "usable_bw_pct": 0.85,
            "tunable": true
        }
    ],
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,650
Reaction score
1,040
Location
Talbot Co, MD
And if i use liquidsoap, do I need to update the device string in cfg.json?


Code:
    "devices": [
        {
            "args": "rtl",
            "gains": "LNA:39",
            "gain_mode": false,
            "name": "sdr0",
            "offset": 0,
            "ppm": 0.0,
            "rate": 1000000,
            "usable_bw_pct": 0.85,
            "tunable": true
        }
    ],
You don't need to change anything in the devices section, but you do need to disable the local audio player. The easiest way to do that is to set instance_name to "" in the audio section. Once you have the local audio player disabled, you use (your own version) of the op25.liq script to start a liquidsoap instance that listens for UDP frames and sends them to icecast.
 

sean_

Member
Joined
Feb 20, 2017
Messages
53
Reaction score
3
Location
las vegas, nevada
Once you've modified op25.liq, you start multi_rx.py and then op25.liq?

What's the number_channels section control? Can you play multiple voice channels simultaneously?




Code:
"audio": {
        "module": "sockaudio.py",
        "instances": [
            {
                "instance_name": "audio0",
                "device_name": "pulse",
                "udp_port": 23456,
                "audio_gain": 1.0,
                "number_channels": 1
            }
        ]
    },
 

sean_

Member
Joined
Feb 20, 2017
Messages
53
Reaction score
3
Location
las vegas, nevada
See the file: ~/op25/README-rpi3-liquidsoap.md

Thanks! That says icecast is optional. If it's optional, how do you hear the radio traffic with just liquidsoap? Are only only able to hear the traffic locally on the machine (raspberry pi in the example)?
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,167
Reaction score
416
Location
NE Wisconsin
Thanks! That says icecast is optional. If it's optional, how do you hear the radio traffic with just liquidsoap? Are only only able to hear the traffic locally on the machine (raspberry pi in the example)?
"Optional", in that some folks use Liquidsoap to provide a feed to BCFY or to an Icecast server sitting on another host. Liquidsoap can be
configured to supply local audio in addition to providing MP3 to an upstream server.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,650
Reaction score
1,040
Location
Talbot Co, MD
Thanks! That says icecast is optional. If it's optional, how do you hear the radio traffic with just liquidsoap? Are only only able to hear the traffic locally on the machine (raspberry pi in the example)?
The majority of people using op25+liquidsoap are sending their feed to Broadcastify. Most everyone else just uses the built-in audio player if they only want local audio. The use case for op25+liquidsoap+icecast would be a self-hosted streaming server, but you really have to be very careful how you make that accessible outside of a firewall because the op25 web terminal has zero security.

As an aside, all the code already exists inside op25 to stream received audio over a websocket. What's yet-to-be-written is the javascript code to take this ws data and send it to the browser's audio subsystem. In theory it should be "simple" but I've run into some problems related to secure vs non-secure http and what a browser will allow as far as accepting ws connections from anywhere other than loopback. I really need someone familiar with web development to assist me...
 
Last edited:

sean_

Member
Joined
Feb 20, 2017
Messages
53
Reaction score
3
Location
las vegas, nevada
The use case for op25+liquidsoap+icecast would be a self-hosted streaming server

That's basically what I had in mind. A headless instance of op25 +liquidsoap + icecast so I could listen to it on my TV, phone, other computers without needing to have speakers/headphones connected to the machine doing the stream. It would be less practical on the TV, since you can't see who's calling, but you could hear it.

but you really have to be very careful how you make that accessible outside of a firewall because the op25 web terminal has zero security.

Understood. I don't have a need to expose outside my LAN or my virtual LAN, i.e. open to the word.

As an aside, all the code already exists inside op25 to stream received audio over a websocket. What's yet-to-be-written is the javascript code to take this ws data and send it to the browser's audio subsystem. In theory it should be "simple" but I've run into some problems related to secure vs non-secure http and what a browser will allow as far as accepting ws connections from anywhere other than loopback.

I see see the websocket setting in the cfg.json and wondered how that was working. Are you basically thinking of a webRTC like way of having this work?


I think you may not have seen this the other day:
What's the number_channels section control? Can you play multiple voice channels simultaneously?



Thank you for continuing to work on op25 and improve it. Your efforts are appreciated.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,650
Reaction score
1,040
Location
Talbot Co, MD
That's basically what I had in mind. A headless instance of op25 +liquidsoap + icecast so I could listen to it on my TV, phone, other computers without needing to have speakers/headphones connected to the machine doing the stream. It would be less practical on the TV, since you can't see who's calling, but you could hear it.



Understood. I don't have a need to expose outside my LAN or my virtual LAN, i.e. open to the word.



I see see the websocket setting in the cfg.json and wondered how that was working. Are you basically thinking of a webRTC like way of having this work?


I think you may not have seen this the other day:




Thank you for continuing to work on op25 and improve it. Your efforts are appreciated.
number_channels is only pertinent to DMR. For P25 it is always "1".

OP25's websocket code creates a ws server on the specified port and streams binary pcm frames to any client connected to the ws server. The intent is that the web terminal will then establish a ws connection, receive the pcm frames and send them to the browser local audio subsystem. Right now the server side is functional, but there is no corresponding client side. I've got some ideas and a basic code framework, but haven't had the time to put it all together yet.
 

yandoz

Member
Joined
Dec 30, 2025
Messages
14
Reaction score
-108
Once you've modified op25.liq, you start multi_rx.py and then op25.liq?

Yes
 
Top