OP25 with Discriminator Audio Question

stillline1979

Member
Joined
Apr 5, 2018
Messages
13
Location
Los Angeles
I've added a discriminator jack to my BCT15x and I am able to decode p25 easily with DSDPlus. I would like to do the same with OP25 so that I can decode on a pi4. However I have not been able to figure out if OP25 has an option for accepting discriminator audio via the microphone jack. I have seen it referenced in some of the older documentation but that info did not match up with any of the apps in my current op25/apps folder.


Is this possible?
 

boatbod

Member
Joined
Mar 3, 2007
Messages
2,582
Location
Talbot Co, MD
I've added a discriminator jack to my BCT15x and I am able to decode p25 easily with DSDPlus. I would like to do the same with OP25 so that I can decode on a pi4. However I have not been able to figure out if OP25 has an option for accepting discriminator audio via the microphone jack. I have seen it referenced in some of the older documentation but that info did not match up with any of the apps in my current op25/apps folder.


Is this possible?
Max will probably be along shortly to advise, but I think you'll find it has something to do with the -A or -I rx.py command line options. Recommend you try with the osmocom version of op25 as I've never tested this method on my fork.
 

KA1RBI

Member
Joined
Aug 15, 2008
Messages
581
Location
Portage Escarpment
The "-a" option is used for disc tap input. You should also add a "-g" (gain) option to tune the audio levels (utilizing the eye diagram, aka the "datascope" plot) to obtain the correct signal levels needed by the demodulator.

I also use the "-A" option with a high-performance homebrew "455 KHz to 24 KHz IF downconverter" which outputs a complex (I and Q) signal at a (nominal) IF frequency of 24 KHz (with the "-c" option specifying the IF frequency to OP25). This handles "LSM/CQPSK" nicely -- something that's not possible with discriminator style demodulation.

Why would you want to use discriminator audio when you can have a frequency agile SDR that can be used to follow trunked radio systems?
The host receiver that I use (with "-H") is an old 1980's PRO-2006. As it's equipped with the OS-456, it's quite frequency-agile!

The reason for using the PRO-2006 instead of, say, the RTL-SDR is that the 2006 blows the doors off of the SDR in terms of dynamic range. I estimate there are approx. 15 or 20 stations I can hear perfectly on the 2006 (regardless of whether the disctap or the IF tap is used) whose presence *can't even be detected* on the SDR.

If the goal is to get performance that approaches what a "real vendor system radio" can do, the architecture of the receiver hardware used is very important. Not everything can be accomplished via software alone...

73

Max

p.s. edited to add: Also, inputting the signal at audio sampling rates requires several orders of magnitude less CPU horsepower than the typical SDR -- KHz as opposed to MHz...
 
Last edited:

wgbecks

Member
Joined
Jan 17, 2005
Messages
280
Location
Porterfield, Wisconsin
Max,

I understand your argument about having a better quality receiver as opposed to the run of the mill SDR, that's understood. What I am referring to is having the ability to follow trunk traffic unless there is a feature/version of op25 that has intelligence to communicate with the scanner to retune it accordance with following trunk calls and would be really cool if such an arrangement exists!
 

KA1RBI

Member
Joined
Aug 15, 2008
Messages
581
Location
Portage Escarpment
Yes, there is a feature in OP25 that has intelligence to communicate with the scanner to retune it accordance with following trunk calls. This is done using the "-H" (hamlib) option to specify the comm protocol and model of the host radio.

If using the disc tap output of the scanner, trunked call following would be limited to C4FM trunked systems. LSM/CQPSK-style (simulcast) trunked systems do not work at all well with the disc tap, as should be well known by now. In my case (as previously noted) I use a high-performance homebrew IF downconverter to feed the IF channel to the sound card (with the I and Q developed in software) in order to do the CQPSK demod properly...

I haven't run this mode in a while so it is possible there has been some bit rot in that code - if so I will post fixes in the event of problem reports.

73

Max
 

stillline1979

Member
Joined
Apr 5, 2018
Messages
13
Location
Los Angeles
I don't need to follow any trunked systems. The LEO in my area is all conventional P25. I like having a physical scanner in the car because it has physical buttons and knobs which make changing frequencies/scan lists much safer while driving.

I've just tried the following command but didn't see any results with the discriminator tap plugged in.

./rx.py --nocrypt -S 250000 -g 30 -D fsk4 -v 1 -2 -V -a -U 2>~/scanner.log

Any tips would be greatly appreciated.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
2,582
Location
Talbot Co, MD
@boatbod Thanks for clarifying which fork to use. I believe i am on the osmocomm version but not quite sure how to confirm that.
Code:
cat ~/op25/.git/config
If you see 'osmocom' in there you should be ok.
If you see 'boatbod' you have the wrong version. e.g.
Code:
[remote "origin"]
        url = https://github.com/boatbod/op25
        fetch = +refs/heads/*:refs/remotes/origin/*
 

stillline1979

Member
Joined
Apr 5, 2018
Messages
13
Location
Los Angeles
@boatbod

Looks like I do have your version installed. If i compile and install the osmocomm version will it remove the boatbod version?

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = boatbod/op25
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
 

KA1RBI

Member
Joined
Aug 15, 2008
Messages
581
Location
Portage Escarpment
Code:
./rx.py --nocrypt  -S 250000  -g 30 -D fsk4  -v 1 -2 -V -a -U 2>~/scanner.log
When using the disc tap input you should get rid of the "-S 250000" and take the default sample rate.

Also assuming gnuplot is available, highly recommend you add "-P datascope" in order to see what the signal looks like.

Also you may want to experiment with the audio input device name ("-I")... A couple of possible values to try are "-I default" or "-I hw:0,0"

Max
 

stillline1979

Member
Joined
Apr 5, 2018
Messages
13
Location
Los Angeles
I got the datascope working and it looks like the audio input is working. The first screenshot is of the datascope when a p25 signal is being received by the scanner and the second one is when no signal is being received.

I'm not getting any decoded voice. I tried switching -d to cqpsk but op25 will not start unless i choose fsk4. Though I've been able to deode this signal with fsk4 when i used the SDR instead of the Disc tap.

I'm using this command
./rx.py --nocrypt -P datascope -g 5 -D fsk4 -v 5 -2 -V -a -I default -U 2>~/scanner.log


2021-01-20-141012_1680x1050_scrot.png2021-01-20-141021_1680x1050_scrot.png
 

KA1RBI

Member
Joined
Aug 15, 2008
Messages
581
Location
Portage Escarpment
ok the datascope plot is helpful and indicates the signal audio level is insufficient. You can try setting a higher gain - perhaps "-g 20" or "-g 25".

Another method assuming ALSA is used is to open "alsamixer" in another terminal window and adjust the input levels. This can be done interactively while monitoring the datascope plot.

Also would be good to have you add "symbol" to the plot types, something like
-P "datascope,symbol" .

Once you have it tuned properly you should see the four nodal points aligned with the -3/-1/+1/+3 marks on the datascope, and four distinct horizontal lines (the demodulated symbols prior to the slicer).

The page SignalScopePage - OP25 - Open Source Mobile Communications should give an idea of how the symbol and datascope plot displays should appear. The datascope plot appearance on that page is actually for a CQPSK/LSM system, but the difference is not important here.

Max
 

stillline1979

Member
Joined
Apr 5, 2018
Messages
13
Location
Los Angeles
@KA1RBI

Thank you for the detailed advice. I played with the gain settings and the alsamixer input device volume and I was able to get some partial words to decode. Never a whole sentence. The plotter did not split into distinct streams no matter what I did with he volume or the gain. The symbol display stays mostly random except for a few flashes of something that starts to look close the pattern that is required. This scanner/disc Tap decodes these same frequencies flawlessly with DSDPlus so I don't think it's neccesarily an issue with the tap, cable or scanner. Would love to hear your opinion and thanks again for all the work you do on this software.

73,
KM6TOA
 

KA1RBI

Member
Joined
Aug 15, 2008
Messages
581
Location
Portage Escarpment
OK have you tried any variations in the "-I" option as mentioned previously in post 11?

Also could you post the command line you're running and all message output - both on the console and in the stderr file

Max
 

stillline1979

Member
Joined
Apr 5, 2018
Messages
13
Location
Los Angeles
I confirmed that audio input works with both -I default and -I hwplug:1,0, it also works without the -I flag at all.

Here is the command i am using.
./rx.py --nocrypt -P datascope,symbol -O default -D fsk4 -v 5 -2 -V -a -U -g 20 2>~/scanner.log

Code:
pi@raspberrypi:~ $ cat scanner.log
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::open_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]
audio device: default
python version detected: 2.7.16 (default, Oct 10 2019, 22:02:15)
[GCC 8.3.0]
pi@raspberrypi:~ $
 

KA1RBI

Member
Joined
Aug 15, 2008
Messages
581
Location
Portage Escarpment
The disc tap appears to be working properly at the moment on a scanner I have here....

This is based on a fresh install .... head of the git commit log should look like this

Code:
commit ccf9a9f20b4845acd749cc47852843ede886fc53
Author: Max <address redacted>
Date:   Fri Dec 25 22:30:39 2020 -0500

    additional README-hls updates
Since you appear to have ruled out tap, cable, and scanner, you might try a different pc and/or sound card.

Audio capture can be "fun" and there are a lot of things that can interfere - There might be a local mic and ambient room sounds are mixing with the channel. There might be a sound mixer/equalizer type of app running that is helpfully "shaping" the audio for you. The sound capture source might only support 44,100 not the required 48,000.... Difficult to say exactly from a distance... Based on my successful disc tap OP25 test result, it's tempting to want to think that the problem may be external to OP25 although it's always possible that it may not...

73

Max
 

wgbecks

Member
Joined
Jan 17, 2005
Messages
280
Location
Porterfield, Wisconsin
Although I am not personally a huge fan of disc tapping, I will share that I have found some discriminator (detector chips) circuits to be very touchy of the load impedance presented on them and ended up having to use an opamp stage to achieve the required level of isolation.

Most soundcard inputs are fairly high impedance these days, but depending upon the particular host receiver, the input impedance may not be high enough to avoid loading issues. This effect was fairly easy to detect while observing the waveform at the disc tap point with and without the soundcard device connected while using an FM signal generator modulated at various frequencies over a wide range while observing amplitude response and waveform shape.

If this is perhaps your issue, and you have enough input gain, then you could try sourcing the soundcard input with a resistor of a high enough value to reduce net loading effects, but you'll have to verify overall frequency response and may have to alter the value of the blocking capacitor.
 
Top