OP25 audio and errors

Status
Not open for further replies.

MCWKen

Member
Joined
Mar 4, 2013
Messages
169
Location
Clinton, IA
Good evening. Having finally gotten OP25 to work, have been tweaking some of the known changes to improve audio and stability. However, it is still has a bass sound to it, and sometimes choppy at the beginning or end of transmissions.



I suppose this should have been prefaced by the fact that I am a neophyte when it comes to Linux, and without the help and observations on this board, would have never gotten OP25 to run.



I did see over and over again, someone suggesting that boatbod run instead of osmocom. There were some instructions how to get it, but I am not sure where to install it. Again, pardon me for being so green.



Lastly, and odd occurance last night. The tower here handles two counties, and the State Patrol. While listening, one county had a call from Radio Service about their issue at their local tower, and so forth. The volume of Radio Service was much louder than other users on this tower. After that conversation ended, the other county talk groups showed transmitting in the Terminal, yet there was no audio. Same went for the State Patrol talk group. But the original County talk group still came in, and sounded as usual. The only way to fix this was to quit OP25 and restart it.



Is this something I did not configure correctly?



Thanks in advance.



Below is how I run OP25, and the stderr.2 file.



Command line:

./rx.py --args 'rtl' --gains 'lna:39' -S 1000000 -f 770.406250e6 -o 15550 -x 02 -q 52 -T trunk.tsv -2 -U 2> stderr.2



STDERR file:



gr-osmosdr v0.1.x-xxx-xunknown (0.1.5git) gnuradio 3.7.11

built-in source types: file osmosdr fcd rtl rtl_tcp uhd plutosdr miri hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp

Using device #0 Realtek RTL2838UHIDIR SN: 00000001

Found Rafael Micro R820T tuner

[R82XX] PLL not locked!

Exact sample rate is: 1000000.026491 Hz

[R82XX] PLL not locked!

[R82XX] PLL not locked!

Using two-stage decimator for speed=1000000, decim=10/4 if1=100000 if2=25000

Project 25 IMBE Encoder/Decoder Fixed-Point implementation

Developed by Pavel Yazev E-mail: pyazev@gmail.com

Version 1.0 (c) Copyright 2009

This program comes with ABSOLUTELY NO WARRANTY.

This is free software, and you are welcome to redistribute it

under certain conditions; see the file ``LICENSE'' for details.

op25_audio::eek:pen_socket(): enabled udp host(127.0.0.1), wireshark(23456), audio(23456)

p25_frame_assembler_impl: do_imbe[1], do_output[0], do_audio_output[1], do_phase2_tdma[1], do_nocrypt[0]

metadata update not enabled

audio device: default

Allocating 15 zero-copy buffers

1561862163.880817 PCM underrun

1561862375.011933 PCM underrun

1561862406.744887 PCM underrun

1561862411.071818 PCM underrun

1561862669.531946 PCM underrun

1561862708.089488 PCM underrun

1561862712.942487 PCM underrun
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,338
Location
Talbot Co, MD
There are differences in features and functionality between Max's version of op25 and mine. Best I can say is try them both and see which works best for you.

Audio buffering is a big item when it comes to audio stutter, especially on a virtual machine rather than a native os. Previous wisdom was to eliminate Pulse Audio and use ALSA directly, but these days I think you're better off using Pulse Audio with liquidsoap as the glue between op25 and the sound drivers.
 

MCWKen

Member
Joined
Mar 4, 2013
Messages
169
Location
Clinton, IA
Well now it has gotten worse once I installed boatbod's op25.

OP25 works okay when it first starts, but when a second frequency is received, it freezes up.

1562643788121.png

Next, here is the control line:

1562643909585.png
Finally, the stderr.2 file:

1562644009318.png

Not sure where to go from here.

Any suggestions?
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,338
Location
Talbot Co, MD
I believe the last few lines of the stderr.2 log amply explain what the problem is.

You need to adjust your ppm error correction, and considering you are not using a tcxo dongle, be ready for the frequency to drift again after you have had the app running for a few minutes.
 

MCWKen

Member
Joined
Mar 4, 2013
Messages
169
Location
Clinton, IA
After reading your post, I opened GQRX and ran it for about 20 hours. Mind you I was not in front of the computer all the time, however from start to finish, it stayed right on 770.406250 without deviation with an adjustment of 52 ppm which I had used before.

I then decided to re-install OP25 and all it's associated packages. Since 0300, it has run flawlessly. GQRX still shows the dongle right on frequency.
 

MCWKen

Member
Joined
Mar 4, 2013
Messages
169
Location
Clinton, IA
Just curious, what is that software on the left of your screen shot?

That is Win500. Since the Iowa P25 State Radio is new, many municipalities and counties have joined the system. Using Win500 allows me to log talkgroup usage. Since the Whistler cannot translate Phase II TDMA, it can at least help me out in identifying new services (one has to change it from P25 auto to P25 manual).

I later translate that information into OP25's tsv.
 

DRL-XM43

Member
Joined
Jun 23, 2015
Messages
842
Location
Durham Region
After reading your post, I opened GQRX and ran it for about 20 hours. Mind you I was not in front of the computer all the time, however from start to finish, it stayed right on 770.406250 without deviation with an adjustment of 52 ppm which I had used before.

I then decided to re-install OP25 and all it's associated packages. Since 0300, it has run flawlessly. GQRX still shows the dongle right on frequency.

Bear in mind an error of 1 ppm can prevent the decode, as I found out through experience, a dongle which is -q 52 could present a challenge.

see this thread https://forums.radioreference.com/threads/op25-tuning-question.388480/
 
Last edited:

MCWKen

Member
Joined
Mar 4, 2013
Messages
169
Location
Clinton, IA
I will be replacing the generic RTL with a NooElec NESDR Smart Premium RTL-SDR as soon as I get an antenna put out for it. Hanging out a window 7 stories up is not my cup of tea, so will have to wait for someone to install it for me.
 

DRL-XM43

Member
Joined
Jun 23, 2015
Messages
842
Location
Durham Region
I will be replacing the generic RTL with a NooElec NESDR Smart Premium RTL-SDR as soon as I get an antenna put out for it. Hanging out a window 7 stories up is not my cup of tea, so will have to wait for someone to install it for me.

I can add that NooElec NESDR Smart Premium RTL-SDR works extremely well for me so I replaced all my high ppm dongles with them, 6 to date.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,338
Location
Talbot Co, MD
I can add that NooElec NESDR Smart Premium RTL-SDR works extremely well for me so I replaced all my high ppm dongles with them, 6 to date.
The old dongles are ok but you have to keep them running so they stabilize, then adjust ppm while hot. After that they run great until you turn them off and let then cool down.
 

rdwrench

Member
Joined
Aug 22, 2006
Messages
7
Good day Boatbod.....it's been a while but have a few questions that I hope you can answer. Other than your branch, where is the other branch
of op25 as I have only been using yours. I have relocated to an area where they are now using the TDMA/Phase II and am wondering how you
can tune the audio channels that you've spoken about before. Also, should I get noise from the encrypted channels as well?? What version
of Ubuntu are you up to support now? Sorry for the questions...i just logged into yahoo and saw that it was moved....thank you in advance and
will check back later.....

happy trails!


There are differences in features and functionality between Max's version of op25 and mine. Best I can say is try them both and see which works best for you.

Audio buffering is a big item when it comes to audio stutter, especially on a virtual machine rather than a native os. Previous wisdom was to eliminate Pulse Audio and use ALSA directly, but these days I think you're better off using Pulse Audio with liquidsoap as the glue between op25 and the sound drivers.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,338
Location
Talbot Co, MD
Max's repo is here: op25 - Osmocom OP25

Encryption can be detected and the (garbled) audio disabled by adding the "--nocrypt" command line option on the boatbod version.
For phase 2, just add "-2" to the command line options. Everything else operates the same.
I'm running ubuntu 16.04, but you can probably run with later versions just fine. If you run in to build issues, drop back to cmake 3.12.4 or earlier.
Pulse Audio offers better buffering on marginal systems if you use liquidsoap. For native ALSA (the -U command line option) you don't need pulse audio.
 
S

simpilo

Guest
Max's repo is here: op25 - Osmocom OP25

Encryption can be detected and the (garbled) audio disabled by adding the "--nocrypt" command line option on the boatbod version.
For phase 2, just add "-2" to the command line options. Everything else operates the same.
I'm running ubuntu 16.04, but you can probably run with later versions just fine. If you run in to build issues, drop back to cmake 3.12.4 or earlier.
Pulse Audio offers better buffering on marginal systems if you use liquidsoap. For native ALSA (the -U command line option) you don't need pulse audio.
It could be of some help at least temporarily to know which version of CMAKE, which GCC compiler is needed and if it uses a fortran which one. Just the stuff it was developed and tested on.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,338
Location
Talbot Co, MD
It could be of some help at least temporarily to know which version of CMAKE, which GCC compiler is needed and if it uses a fortran which one. Just the stuff it was developed and tested on.

Its a secret... ;)
No serious, I suggest using the latest and if it won't work then drop back to earlier versions. The ubuntu 16.04 packages work fine.
 

sqlgeek

Member
Joined
Jun 21, 2014
Messages
33
Location
Griffin, GA
Max's repo is here: op25 - Osmocom OP25

Encryption can be detected and the (garbled) audio disabled by adding the "--nocrypt" command line option on the boatbod version.
For phase 2, just add "-2" to the command line options. Everything else operates the same.
I'm running ubuntu 16.04, but you can probably run with later versions just fine. If you run in to build issues, drop back to cmake 3.12.4 or earlier.
Pulse Audio offers better buffering on marginal systems if you use liquidsoap. For native ALSA (the -U command line option) you don't need pulse audio.
If you take out the -U in the rx.py arguments, what do you replace it with to force it to go through Pulse Audio?
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,338
Location
Talbot Co, MD
If you take out the -U in the rx.py arguments, what do you replace it with to force it to go through Pulse Audio?

The following is the command I use to start op25 for one of my broadcastify streams:
Code:
./rx.py --args "rtl=0" --gains 'lna:36' -D cqpsk -S 960000 -T trunk-fire.tsv -q 0 -d -200 -v 1 -2 -u 23456 -V -w 2> stderr-fire.2

In a second process liquidsoap is started using the following .liq file:
Code:
#!/usr/bin/liquidsoap

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

set("log.stdout", false)
set("log.file", false)
set("log.syslog", true)
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 -u 23456 -x 1.5 -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="Talbot Fire & EMS", genre="Public Safety", url="", fallible=false, icy_metadata="false", host="audio3.broadcastify.com", port=80, mount="prm79gyjckbv", password="6st81f4z", mean(input))

Under the section titled "LOCAL AUDIO" you would remove the '#' in front of the command immediately below the PulseAudio comment.
 

sqlgeek

Member
Joined
Jun 21, 2014
Messages
33
Location
Griffin, GA
@boatbod I am needing some help if you could take a look at my setup

rx.py
Code:
./rx.py --args 'rtl' -N 'LNA:47' -S 250000 -q 0 -v 1 -2 -T trunk.tsv -V -n -M meta.json -w 2> stderr.2

op25.liq
Code:
#!/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", 3)

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

# 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="Spalding County Public Safety", genre="Public Safety", url="", fallible=false, icy_metadata="false", host="audio9.broadcastify.com", port=80, mount="xcjkdymvz0f2", password="mypassword", mean(input))

meta.json
Code:
{"icecastPass": "mypassword", "icecastMountpoint": "xcjkdymvz0f2", "icecastServerAddress": "audio9.broadcastify.com:80", "delay": "0.0", "icecastMountExt": ".m3u"}

log on op25.liq - it quits immediately
Code:
2019/08/28 20:37:18 >>> LOG START
2019/08/28 20:37:17 [main:3] Liquidsoap 1.3.3
2019/08/28 20:37:17 [main:3] Using: bytes=[distributed with OCaml 4.02 or above] pcre=7.2.3 dtools=0.4.0 duppy=0.7.2 duppy.syntax=0.7.2 cry=0.6.2 mm=0.3.1 xmlplaylist=0.1.3 lastfm=0.3.0 ogg=0.5.2 vorbis=0.7.1 opus=0.1.2 speex=0.2.1 mad=0.4.4 flac=0.1.3 flac.ogg=0.1.3 dynlink=[distributed with Ocaml] lame=0.3.2 shine=0.2.0 gstreamer=0.2.0 frei0r=0.1.0 theora=0.3.1 gavl=0.1.5 bjack=0.1.4 alsa=0.2.3 ao=0.2.0 samplerate=0.1.2 taglib=0.3.1 magic=0.7.3 camomile=0.8.5 yojson=1.3.2 faad=0.4.0 soundtouch=0.1.7 portaudio=0.2.1 pulseaudio=0.1.2 ladspa=0.1.4 dssi=0.1.1 sdl=0.9.1 camlimages=4.2.0 lo=0.1.0 gd=1.0a5
2019/08/28 20:37:17 [gstreamer.loader:3] Loaded GStreamer 1.14.4 0
2019/08/28 20:37:17 [dynamic.loader:3] Could not find dynamic module for fdkaac encoder.
2019/08/28 20:37:18 [frame:3] Using 8000Hz audio, 25Hz video, 8000Hz master.
2019/08/28 20:37:18 [frame:3] Frame size must be a multiple of 320 ticks = 320 audio samples = 1 video samples.
2019/08/28 20:37:18 [frame:3] Targetting 'frame.duration': 0.04s = 320 audio samples = 320 ticks.
2019/08/28 20:37:18 [frame:3] Frames last 0.04s = 320 audio samples = 1 video samples = 320 ticks.
2019/08/28 20:37:18 [threads:3] Created thread "generic queue #1".
2019/08/28 20:37:18 [threads:3] Created thread "generic queue #2".
2019/08/28 20:37:18 [threads:3] Created thread "non-blocking queue #1".
2019/08/28 20:37:18 [threads:3] Created thread "non-blocking queue #2".
2019/08/28 20:37:18 [input.external_7212:3] Starting process
2019/08/28 20:37:18 [clock.wallclock_pulse:2] Error when starting output pulse_out(liquidsoap:): Pulseaudio error: Connection refused!
2019/08/28 20:37:18 [clock.wallclock_pulse:3] Raised by primitive operation at file "pulseaudio.ml" (inlined), line 47, characters 6-67
2019/08/28 20:37:18 [clock.wallclock_pulse:3] Called from file "io/pulseaudio_io.ml", line 83, characters 13-190
2019/08/28 20:37:18 [clock.wallclock_pulse:3] Called from file "tools/start_stop.ml", line 99, characters 6-16
2019/08/28 20:37:18 [clock.wallclock_pulse:3] Called from file "clock.ml", line 237, characters 19-37
2019/08/28 20:37:18 [xcjkdymvz0f2:3] Connecting mount xcjkdymvz0f2 for source@audio9.broadcastify.com...
2019/08/28 20:37:18 [xcjkdymvz0f2:3] Connection setup was successful.
2019/08/28 20:37:18 [threads:3] Created thread "wallclock_pulse" (1 total).
2019/08/28 20:37:18 [clock.wallclock_pulse:3] Streaming loop starts, synchronized by active sources.
2019/08/28 20:37:18 [main:3] Shutdown started!
2019/08/28 20:37:18 [main:3] Waiting for threads to terminate...
strange error flushing buffer ...
strange error flushing buffer ...
2019/08/28 20:37:18 [xcjkdymvz0f2:3] Closing connection...
2019/08/28 20:37:18 [clock.wallclock_pulse:3] Streaming loop stopped.
2019/08/28 20:37:18 [threads:3] Thread "wallclock_pulse" terminated (0 remaining).
2019/08/28 20:37:18 [main:3] Threads terminated.
2019/08/28 20:37:18 [input.external_7212:3] Cleaning up process
2019/08/28 20:37:18 [threads:3] Shutting down scheduler...
2019/08/28 20:37:18 [threads:3] Scheduler shut down.
2019/08/28 20:37:18 [threads:3] Thread "generic queue #2" terminated.
2019/08/28 20:37:18 [main:3] Cleaning downloaded files...
2019/08/28 20:37:18 [main:3] Freeing memory...
2019/08/28 20:37:18 [threads:3] Thread "non-blocking queue #2" terminated.
2019/08/28 20:37:18 [threads:3] Thread "generic queue #1" terminated.
2019/08/28 20:37:18 >>> LOG END


No issues picking up the signal - just not hearing anything because op25.liq is not starting...
Code:
NAC 0xa WACN 0x924b3 SYSID 0xa 852.350000/807.350000 tsbks 10600
voice frequency 851.225000 tgid(s) 10 None 17.2s ago count 116
voice frequency 851.325000 tgid(s) 2 None 13.0s ago count 169
voice frequency 851.600000 tgid(s) 10 None  9.8s ago count 139
voice frequency 852.187500 tgid(s) 10 None 12.5s ago count 1
voice frequency 852.200000 tgid(s) 10 None  7.2s ago count 110
voice frequency 852.812500 tgid(s) 2 None  2.6s ago count 148
voice frequency 853.637500 tgid(s) 10 None  2.6s ago count 116













Frequency 852.350000(0)
 
Status
Not open for further replies.
Top