OP25 liquidsoap not working

VengeanceNight

Newbie
Premium Subscriber
Joined
Apr 28, 2024
Messages
4
Hi...I've been working on this for a while and have had no luck. I'm someone who likes to try and read everything available and figure it out on my own but haven't been able to this time.

I was able to get op25 working with local audio and was working on enabling remote audio using icecast. I believe the issue is with not calling liquidsoap correctly and hoping I'm just missing something obvious.

I am using multi_rx.py. I am able to connect to the icecast2 admin page but get no status and no active mountpoints are shown. Looking at the icecast log I see the following error:

/usr/share/icecast2/web/mount
WARN admin/admin_handle_request Admin command metadata on non-existent source /mount

It does look like liquidsoap is running as when checking the version I get

Liquidsoap 2.2.4-1+dev
Copyright (c) 2003-2023 Savonet team
Liquidsoap is open-source software, released under GNU General Public License.
See <Liquidsoap - Audio & Video Streaming Language> for more information.

I check the liquidsoap log directory and it's empty. So that is why I think I may not be calling it

Here are the relevant sections from the config file.

Code:
"metadata": {
        "module": "icemeta.py",
        "streams": [
            {
                "stream_name": "stream_0",
                "meta_format_idle": "[idle]",
                "meta_format_tgid": "[%TGID%]",
                "meta_format_tag":  "[%TGID%] %TAG%",
                "icecastServerAddress": "192.168.1.1:8000",
                "icecastMountpoint": "mount",
                "icecastMountExt": ".m3u",
                "icecastPass": "password",
                "delay": 0.0
            }
        ]
    },
    "audio": {
        "module": "",
        "instances": [
            {
                "instance_name": "audio0",
                "device_name": "default",
                "udp_port": 23456,
                "audio_gain": 1.0,
                "number_channels": 1
            }
        ]
   },

Any help would be appreciate. Just let me know if you want me to post any more information. Thanks!
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,027
Location
NE Wisconsin
The channel destination of your multi_rx.py JSON must point to the port that Liquidsoap's input operator is listening on.
Liquidsoap's output.icecast operator must be configured to the desired IP address, port, mountpoint and password of
the intended Icecast server.

Example multi_rx.py channel
"destination": "udp://127.0.0.1:23450",

Example op25.liq Version 1.4.3 input operator()
input = input.external.rawaudio(buffer=0.25, channels=2, samplerate=8000, restart_on_error=false, "./audio.py -u 23450 -x 1.25 -s")

Example op25.liq Version 1.4.3 output.icecast operator()
output.icecast(%mp3(bitrate=16, samplerate=22050, stereo=false), description="op25", genre="Public Safety",
url="", fallible=false, icy_metadata="false", host="localhost", port=8000, mount="op25", password="hackme", mean(input_safe))
 

VengeanceNight

Newbie
Premium Subscriber
Joined
Apr 28, 2024
Messages
4
The channel destination of your multi_rx.py JSON must point to the port that Liquidsoap's input operator is listening on.
Liquidsoap's output.icecast operator must be configured to the desired IP address, port, mountpoint and password of
the intended Icecast server.

Example multi_rx.py channel
"destination": "udp://127.0.0.1:23450",

Example op25.liq Version 1.4.3 input operator()
input = input.external.rawaudio(buffer=0.25, channels=2, samplerate=8000, restart_on_error=false, "./audio.py -u 23450 -x 1.25 -s")

Example op25.liq Version 1.4.3 output.icecast operator()
output.icecast(%mp3(bitrate=16, samplerate=22050, stereo=false), description="op25", genre="Public Safety",
url="", fallible=false, icy_metadata="false", host="localhost", port=8000, mount="op25", password="hackme", mean(input_safe))
Thank you for responding! I did not have -u 23450 added to my input in the op25.liq file. Thought that was the answer but added it in and still have the same issue. :(
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,027
Location
NE Wisconsin
Thank you for responding! I did not have -u 23450 added to my input in the op25.liq file. Thought that was the answer but added it in and still have the same issue. :(
Are you running Icecast on the same machine as op25? If so, enable logging to level-3 in Liquidsoap and capture all of the data that scrolls
when first starting it up, then post here for further analysis.
 

VengeanceNight

Newbie
Premium Subscriber
Joined
Apr 28, 2024
Messages
4
Are you running Icecast on the same machine as op25? If so, enable logging to level-3 in Liquidsoap and capture all of the data that scrolls
when first starting it up, then post here for further analysis.
I am but as far as I can tell there aren't any logs being generated. Here are my settings for enabling the logs

set("log.stdout", true)
set("log.file", true)
set("log.level", 3)

I'm checking for the log in /var/log/liquidsoap

Thanks for your help
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,027
Location
NE Wisconsin
I am but as far as I can tell there aren't any logs being generated. Here are my settings for enabling the logs

set("log.stdout", true)
set("log.file", true)
set("log.level", 3)

I'm checking for the log in /var/log/liquidsoap

Thanks for your help

Suggest setting up logging to a folder owned by your account such as the op25 apps folder for example.

IE: set("log.file.path", "/home/login_user_name/op25/op25/gr-op25_repeater/apps/liquidsoap.log")
 

VengeanceNight

Newbie
Premium Subscriber
Joined
Apr 28, 2024
Messages
4
Suggest setting up logging to a folder owned by your account such as the op25 apps folder for example.

IE: set("log.file.path", "/home/login_user_name/op25/op25/gr-op25_repeater/apps/liquidsoap.log")
Made the update and am still not seeing a log file generated. Here is my op25.liq file in case it is helpful

Code:
# Example liquidsoap streaming from op25 to icecast
# (c) 2019-2021 gnorbury@bondcar.com, wllmbecks@gmail.com
#

set("log.stdout", true)
set("log.file", true)
set("log.level", 3)
set("log.file.path", "/home/ken/op25/op25/gr-op25_repeater/apps/liquidsoap.log")

# Make the native sample rate compatible with op25
set("frame.audio.samplerate", 8000)

input = mksafe(input.external(buffer=0.25, channels=2, samplerate=8000, restart_on_error=false, "./audio.py -x 1.5 -s"))
# Consider increasing the buffer value on slow systems such as RPi3. e.g. buffer=0.25
# Longer buffer results in less choppy audio but at the expense of increased latency.



# OPTIONAL AUDIO SIGNAL PROCESSING BLOCKS
# Uncomment to enable
#
# High pass filter
#input = filter.iir.butterworth.high(frequency = 200.0, order = 4, input)

# Low pass filter
#input = filter.iir.butterworth.low(frequency = 3250.0, order = 4, input)

# Compression
input = compress(input, attack = 2.0, gain = 0.0, knee = 13.0, ratio = 2.0, release = 12.3, threshold = -18.0)

# Normalization
input = normalize(input, gain_max = 6.0, gain_min = -6.0, target = -16.0, threshold = -65.0)

# 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)



# ICECAST STREAMING
# Uncomment to enable output to an icecast server
# Change the "host", "password", and "mount" strings appropriately first!
# For metadata to work properly, the host address given here MUST MATCH the address in op25's meta.json file
#
output.icecast(%mp3(bitrate=16, samplerate=22050, stereo=false), description="OP25", genre="Public Safety", url="", fallible=false, icy_metadata="false", host="localhost", port=8000, mount="op25", password="password", mean(input))

Here is also the section in icecast.xml with the hostname and listen-socket

Code:
<!-- This is the hostname other people will use to connect to your server.
         It affects mainly the urls generated by Icecast for playlists and yp
         listings. You MUST configure it properly for YP listings to work!
    -->
    <hostname>localhost</hostname>

    <!-- You may have multiple <listen-socket> elements -->
    <listen-socket>
        <port>8000</port>
        <bind-address>192.168.1.1</bind-address> -->
        <shoutcast-mount>op25</shoutcast-mount> -->
    </listen-socket>

Thanks again for all the help
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,027
Location
NE Wisconsin
I am not clear how you're executing Liquidsoap. Here's an example of execution from the command line that assumes you've made
op25.liq executable. Note that you'll see the log data scroll in your terminal as you execute op25.liq.

File Status
pi@raspberrypi-4B:~/op25/op25/gr-op25_repeater/apps $ ls -l op25.liq
-rwxr-xr-x 1 pi pi 2447 Jul 13 09:17 op25.liq

Command Line Execution & Resultant Terminal Output
pi@raspberrypi-4B:~/op25/op25/gr-op25_repeater/apps $ ./op25.liq
2024/07/13 09:18:30 >>> LOG START
2024/07/13 09:18:30 [main:3] Liquidsoap 1.4.3
2024/07/13 09:18:30 [main:3] Using: bytes=[distributed with OCaml 4.02 or above] pcre=[unspecified] sedlex=2.2 menhirLib=20201216 dtools=0.4.2 duppy=0.8.0 cry=0.6.5 mm=0.5.0 xmlplaylist=0.1.5 lastfm=0.3.2 ogg=0.5.2 vorbis=0.7.1 opus=0.1.3 speex=0.2.1 mad=0.4.6 flac=0.1.7 flac.ogg=0.1.7 dynlink=[distributed with Ocaml] lame=0.3.4 shine=0.2.1 gstreamer=0.3.0 frei0r=0.1.1 theora=0.3.1 gavl=0.1.6 ffmpeg=0.4.3 bjack=0.1.5 alsa=0.3.0 ao=0.2.1 samplerate=0.1.4 taglib=0.3.6 ssl=0.5.9 magic=0.7.3 camomile=[unspecified] inotify=2.3 yojson=[unspecified] faad=0.4.0 soundtouch=0.1.8 portaudio=0.2.1 pulseaudio=0.1.3 ladspa=0.1.5 sdl=0.9.1 camlimages=4.2.6 lo=0.1.2 gd=1.0a5
2024/07/13 09:18:30 [gstreamer.loader:3] Loaded GStreamer 1.18.4 0
2024/07/13 09:18:30 [dynamic.loader:3] Could not find dynamic module for fdkaac encoder.
2024/07/13 09:18:30 [frame:3] Using 8000Hz audio, 25Hz video, 8000Hz master.
2024/07/13 09:18:30 [frame:3] Frame size must be a multiple of 320 ticks = 320 audio samples = 1 video samples.
2024/07/13 09:18:30 [frame:3] Targetting 'frame.duration': 0.04s = 320 audio samples = 320 ticks.
2024/07/13 09:18:30 [frame:3] Frames last 0.04s = 320 audio samples = 1 video samples = 320 ticks.
2024/07/13 09:18:30 [sandbox:3] Could not find binary bwrap, disabling sandboxing..
2024/07/13 09:18:30 [video.converter:3] Using preferred video converter: gavl.
2024/07/13 09:18:30 [audio.converter:3] Using samplerate converter: ffmpeg.
2024/07/13 09:18:30 [input.external.rawaudio_9365:3] Starting process
2024/07/13 09:18:30 [op25:3] Connecting mount op25 for source@localhost...
2024/07/13 09:18:30 [op25:3] Connection setup was successful.

2024/07/13 09:18:30 [clock.wallclock_alsa:3] Streaming loop starts, synchronized by active sources.
2024/07/13 09:18:30 [mksafe:3] Switch to safe_blank.
2024/07/13 09:18:30 [alsa_out(default):3] Using ALSA 1.2.4.
2024/07/13 09:18:30 [alsa_out(default):3] Samplefreq=8000Hz, Bufsize=32768B, Frame=4B, Periods=128
 
Top