liquidsoap: address/port in use (and other errors Im sure to come)

Status
Not open for further replies.

zapman987

Member
Premium Subscriber
Joined
Jan 16, 2014
Messages
297
Location
nc, recently moved to jax, FL
setup liquidsoap due to all my darkice issues. Getting this regardless of my config (was trying to feed it to 2 different destinations via different ports, commented out both in sequence, and together, doesnt make a difference).

Traceback (most recent call last):
File "./audio.py", line 48, in <module>
audio_handler = socket_audio("0.0.0.0", options.wireshark_port, options.audio_output, options.two_channel, options.audio_gain, options.stdout)
File "/home/yoder/op25/op25/gr-op25_repeater/apps/sockaudio.py", line 320, in __init__
self.setup_sockets(udp_host, udp_port)
File "/home/yoder/op25/op25/gr-op25_repeater/apps/sockaudio.py", line 419, in setup_sockets
self.sock_a.bind((udp_host, udp_port))
File "/usr/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 98] Address already in use
^CTraceback (most recent call last):
File "./audio.py", line 48, in <module>
audio_handler = socket_audio("0.0.0.0", options.wireshark_port, options.audio_output, options.two_channel, options.audio_gain, options.stdout)
File "/home/yoder/op25/op25/gr-op25_repeater/apps/sockaudio.py", line 320, in __init__
self.setup_sockets(udp_host, udp_port)
File "/home/yoder/op25/op25/gr-op25_repeater/apps/sockaudio.py", line 419, in setup_sockets
self.sock_a.bind((udp_host, udp_port))
File "/usr/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 98] Address already in use
 

zapman987

Member
Premium Subscriber
Joined
Jan 16, 2014
Messages
297
Location
nc, recently moved to jax, FL
Only one, I just copied the whole blocked, it keeps repeating itself. I got the first issue figured out, Cant run -U with liquidsoap running. New error: "strange error flushing buffer" Its doing it near constantly.

I removed pws and other info from below.

#!/usr/bin/liquidsoap

# Example liquidsoap streaming from op25 to icecast
# (c) 2019, gnorbury@bondcar.com
#

set("log.stdout", true)
set("log.file", false)
set("log.level", 1)

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

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


# LOCAL AUDIO
# 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="audio9.broadcastify.com", port=8000, mount="", password="", mean(input))
#output.icecast(%mp3(bitrate=16, samplerate=22050, stereo=false), description="op25", genre="Public Safety", url="", fallible=false, icy_metadata="false", host="localhost", port=8443, mount="~/op25", password="", mean(input))

./rx.py --args 'rtl' -N 'LNA:39' -S 960000 -o 25000 -f 860.9625e6 -q -1 -w -v 5 2> stderr-stream0.2
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,539
Location
Talbot Co, MD
How do you plan on only having one op25.liq file? The two streams each need their own setting for "-u" on the audio.py portion of the "input=" line. Technically you could probably write definitions for both streams inside a single .liq file but I don't see that you did that from what you posted above.

In a previous thread I did post examples of the configurations needed. The important part is the following line of the .liq which needs to be customized for each instance:
Code:
input = mksafe(input.external(buffer=0.02, channels=2, samplerate=8000, restart_on_error=false, "./audio.py -u 23456 -s"))
Note the "-u 23456" near the end. On the second instance this needs to be "-u 23466" or whatever port value you set on rx.py.
 

zapman987

Member
Premium Subscriber
Joined
Jan 16, 2014
Messages
297
Location
nc, recently moved to jax, FL
This is only 1 stream. It duplicated the block I posted previously, as it was effectively looping the error. Ive fixed that issue. Im just outputting it to 2 places.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,539
Location
Talbot Co, MD
This is only 1 stream. It duplicated the block I posted previously, as it was effectively looping the error. Ive fixed that issue. Im just outputting it to 2 places.
Oh, my mistake. Yes in that case there would be only one input but two outputs. Are you still having errors? If so, try increasing the liquidsoap log level to 3 or higher and see if there is more detail being output.
 

zapman987

Member
Premium Subscriber
Joined
Jan 16, 2014
Messages
297
Location
nc, recently moved to jax, FL
Will do on the log this weekend.
Current error is:
"strange error flushing buffer" Its doing it near constantly.

I do get it connected to my outputs, but Im getting a repetitive buzzing, possibly in sync with the error above.
 

zapman987

Member
Premium Subscriber
Joined
Jan 16, 2014
Messages
297
Location
nc, recently moved to jax, FL
I started that fix, Got to the optional bit, didnt include it. Got errors on my icecast mount so I removed that output for time being. Seems like it did fix that problem. New one though (log is on 3):

$ ./op25.liq
2019/05/04 12:07:22 >>> LOG START
2019/05/04 12:07:21 [protocols.external:3] Found "/usr/bin/wget".
2019/05/04 12:07:21 [main:3] Liquidsoap 1.1.1
2019/05/04 12:07:21 [main:3] Using: graphics=[distributed with Ocaml] pcre=7.0.4 dtools=0.3.1 duppy=0.5.1 duppy.syntax=0.5.1 cry=0.2.2 mm=0.2.1 xmlplaylist=0.1.3 lastfm=0.3.0 ogg=0.4.5 vorbis=0.6.1 opus=0.1.0 speex=0.2.0 mad=0.4.4 flac=0.1.1 flac.ogg=0.1.1 dynlink=[distributed with Ocaml] lame=0.3.2 shine=0.2.0 gstreamer=0.2.0 frei0r=0.1.0 voaacenc=0.1.0 theora=0.3.0 schroedinger=0.1.0 gavl=0.1.5 bjack=0.1.4 alsa=0.2.1 ao=0.2.0 samplerate=0.1.2 taglib=0.3.1 magic=0.7.3 camomile=0.8.4 inotify=1.0 faad=0.3.2 soundtouch=0.1.7 portaudio=0.2.0 pulseaudio=0.1.2 ladspa=0.1.4 dssi=0.1.1 sdl=0.9.1 camlimages=4.2.0 lo=0.1.0 yojson=1.2.3 gd=1.0a5
2019/05/04 12:07:21 [dynamic.loader:3] Could not find dynamic module for fdkaac encoder.
2019/05/04 12:07:21 [dynamic.loader:3] Could not find dynamic module for aacplus encoder.
2019/05/04 12:07:21 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/ladspa.cmxs.
2019/05/04 12:07:21 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/gstreamer.cmxs.
2019/05/04 12:07:21 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/shine.cmxs.
2019/05/04 12:07:21 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/soundtouch.cmxs.
2019/05/04 12:07:21 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/flac.cmxs.
2019/05/04 12:07:21 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/frei0r.cmxs.
2019/05/04 12:07:21 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/mad.cmxs.
2019/05/04 12:07:21 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/graphics.cmxs.
2019/05/04 12:07:21 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/alsa.cmxs.
2019/05/04 12:07:21 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/ao.cmxs.
2019/05/04 12:07:21 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/bjack.cmxs.
2019/05/04 12:07:21 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/sdl.cmxs.
2019/05/04 12:07:21 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/ogg.cmxs.
2019/05/04 12:07:21 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/gd.cmxs.
2019/05/04 12:07:21 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/portaudio.cmxs.
2019/05/04 12:07:21 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/dssi.cmxs.
2019/05/04 12:07:21 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/samplerate.cmxs.
2019/05/04 12:07:21 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/pulseaudio.cmxs.
2019/05/04 12:07:21 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/camlimages.cmxs.
2019/05/04 12:07:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/xmlplaylist.cmxs.
2019/05/04 12:07:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/lo.cmxs.
2019/05/04 12:07:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/cry.cmxs.
2019/05/04 12:07:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/lame.cmxs.
2019/05/04 12:07:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/voaacenc.cmxs.
2019/05/04 12:07:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/faad.cmxs.
2019/05/04 12:07:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/speex.cmxs.
2019/05/04 12:07:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/oss.cmxs.
2019/05/04 12:07:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/schroedinger.cmxs.
2019/05/04 12:07:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/taglib.cmxs.
2019/05/04 12:07:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/gavl.cmxs.
2019/05/04 12:07:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/theora.cmxs.
2019/05/04 12:07:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/vorbis.cmxs.
2019/05/04 12:07:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/opus.cmxs.
2019/05/04 12:07:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/flac_ogg.cmxs.
2019/05/04 12:07:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/lastfm.cmxs.
2019/05/04 12:07:22 [frame:3] Using 8000Hz audio, 25Hz video, 8000Hz master.
2019/05/04 12:07:22 [frame:3] Frame size must be a multiple of 320 ticks = 320 audio samples = 1 video samples.
2019/05/04 12:07:22 [frame:3] Targetting 'frame.duration': 0.04s = 320 audio samples = 320 ticks.
2019/05/04 12:07:22 [frame:3] Frames last 0.04s = 320 audio samples = 1 video samples = 320 ticks.
2019/05/04 12:07:22 [threads:3] Created thread "generic queue #1".
2019/05/04 12:07:22 [threads:3] Created thread "generic queue #2".
2019/05/04 12:07:22 [input.external_6354:2] Starting process.
2019/05/04 12:07:22 [pns7hwbc63xm:3] Connecting mount pns7hwbc63xm for source@audio9.broadcastify.com...
audio device: stdout
2019/05/04 12:07:22 [pns7hwbc63xm:3] Connection setup was successful.
2019/05/04 12:07:22 [threads:3] Created thread "wallclock_pulse" (1 total).
2019/05/04 12:07:22 [clock.wallclock_pulse:3] Streaming loop starts, synchronized by active sources.
2019/05/04 12:07:22 [mksafe:3] Switch to safe_blank.
2019/05/04 12:07:32 [mksafe:3] Switch to input.external_6354 with transition.
2019/05/04 12:07:32 [mksafe:3] Switch to safe_blank with transition.
2019/05/04 12:07:42 [mksafe:3] Switch to input.external_6354 with transition.
2019/05/04 12:07:42 [mksafe:3] Switch to safe_blank with transition.


The "Switch" block keeps repeating. I get a burst of static every time it does. Im not getting any tangible audio from the feed otherwise. OP25 on I get this every 2 seconds. OP25 off, slows down to about every 5-10.

EDIT actually with OP25 off the static stops. Error continues on at the timing of 10 seconds.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,539
Location
Talbot Co, MD
I started that fix, Got to the optional bit, didnt include it. Got errors on my icecast mount so I removed that output for time being. Seems like it did fix that problem. New one though (log is on 3):




The "Switch" block keeps repeating. I get a burst of static every time it does. Im not getting any tangible audio from the feed otherwise. OP25 on I get this every 2 seconds. OP25 off, slows down to about every 5-10.

EDIT actually with OP25 off the static stops. Error continues on at the timing of 10 seconds.

The purpose of "input = mksafe(...)" is to keep the stream flowing when there is no actual input by filling it with silence. Liquidsoap will log when the stream transitions between actual input and safe_blank, and this is what you are seeing with the multiple 'Switch" entries.

Now I'm not certain why it's transitioning every 2 seconds, but I'll take a wild guess and ask if you are perhaps losing and regaining control channel sync (or cycling between multiple channels) and this is causing the PCM stream to be forcibly flushed?
 

zapman987

Member
Premium Subscriber
Joined
Jan 16, 2014
Messages
297
Location
nc, recently moved to jax, FL
UPDATE: Solved it all!!! I didnt have -V. This is a phase 1 system, so really havnt needed it. Put that in, worked fine after that.

That said, Ive got TG tracking dropping. Its effectively garbling itself as it wont hold a TG channel. Im not seeing any control channel errors, just it keeps reacquiring the TG channel. Any ideas? Thanks!
 
Last edited:

boatbod

Member
Joined
Mar 3, 2007
Messages
3,539
Location
Talbot Co, MD
UPDATE: Solved it all!!! I didnt have -V. This is a phase 1 system, so really havnt needed it. Put that in, worked fine after that.

That said, Ive got TG tracking dropping. Its effectively garbling itself as it wont hold a TG channel. Im not seeing any control channel errors, just it keeps reacquiring the TG channel. Any ideas? Thanks!

Possible mismatch of modulation types? If it's a "Phase 1 Only" system, it may require "-D fsk4" on the command line. If it's mixed Phase 1/Phase 2 then it almost certainly will need any -D option removed if one is present.

How are you adjusting for frequency error? Hopefully you have dialed in the -q (ppm) correction rather than a large static offset. The latter can cause the CC to be received fine, but not reliably tune the traffic channel.
 

zapman987

Member
Premium Subscriber
Joined
Jan 16, 2014
Messages
297
Location
nc, recently moved to jax, FL
Na its the CPSK type. I think last night was just getting interference, Ive noticed some from time to time. It cleared up quickly, and Ive been listening all day today and its actually I think better than before.

Thanks again for all the help on this!!
 
Status
Not open for further replies.
Top