OP25 Multiprotocol Digital Voice TX

OP25 Multiprotocol Digital Voice TX


The OP25 project in 2009 released an encoder and software TX for P25 (conventional phase I C4FM/FDMA) based on the fullrate IMBE codec contribution from Pavel Yazev.

With the addition of a software AMBE halfrate encoder the OP25 Group now releases an updated TX with voice encoders for-

This release was tested using a PC soundcard connected to the direct modulator input (i.e., 9,600 data port) of an Icom IC-820H configured for high speed data operation [AMOD/PACT switch set to PACT]. Not all PCs tested successfully so perhaps the choice of sound card isn't irrelevant, or the interface circuit needs more work... The software TX drives the audio output at optimum (close to full) signal levels, so no output level adjust is needed.

INSTALLATION

After cloning the repo change to the top level directory and check out the max branch of the repo:
git clone https://git.osmocom.org/op25
cd op25
git checkout max

Next install the required prerequisites [tested for Ubuntu 14.04 LTS]:
sudo apt-get update
sudo apt-get build-dep gnuradio
sudo apt-get install gnuradio gnuradio-dev gr-osmosdr librtlsdr-dev libuhd-dev  libhackrf-dev libitpp-dev libpcap-dev git

Then build OP25 using the standard build sequence:
mkdir build
cd build
cmake ../
make
sudo make install
sudo ldconfig

STARTING THE PROGRAM

After installing OP25 cd to the op25/gr-op25_repeater/apps/tx subdirectory (after checking out the "max" branch of the repository). Here's an example command line:
python dv_tx.py   -r -f ~/uncompressed.wav -p dstar -c dstar-cfg.dat

Hackrf Example:

python dv_tx.py  -p dmr  --args hackrf -q -21 -Q 925187500 -c dmr-cfg.dat -f ~/file1.wav -F ~/file2.wav  -r 
In this example we've selected the dstar protocol with input from a wav file (must be standard rate 8000/S16_LE/mono). Below is a full list of options.
Multiprotocol Digital Voice TX (C) Copyright 2017 Max H. Parke KA1RBI
Usage: dv_tx.py [options]

Options:
  -h, --help            show this help message and exit
  -a ARGS, --args=ARGS  device args
  -b BT, --bt=BT        specify bt value
  -c CONFIG_FILE, --config-file=CONFIG_FILE
                        specify the config file name
  -f FILE1, --file1=FILE1
                        specify the input file slot 1
  -F FILE2, --file2=FILE2
                        specify the input file slot 2 (DMR)
  -g GAIN, --gain=GAIN  input gain
  -i IF_RATE, --if-rate=IF_RATE
                        output rate to sdr
  -I AUDIO_INPUT, --audio-input=AUDIO_INPUT
                        pcm input device name.  E.g., hw:0,0 or /dev/dsp
  -N GAINS, --gains=GAINS
                        gain settings
  -O AUDIO_OUTPUT, --audio-output=AUDIO_OUTPUT
                        pcm output device name.  E.g., hw:0,0 or /dev/dsp
  -o OUTPUT_FILE, --output-file=OUTPUT_FILE
                        specify the output file
  -p PROTOCOL, --protocol=PROTOCOL
                        specify protocol
  -q FREQUENCY_CORRECTION, --frequency-correction=FREQUENCY_CORRECTION
                        ppm
  -Q FREQUENCY, --frequency=FREQUENCY
                        Hz
  -r, --repeat          input file repeat
  -R, --fullrate-mode   ysf fullrate
  -s SAMPLE_RATE, --sample-rate=SAMPLE_RATE
                        output sample rate
  -t TEST, --test=TEST  test pattern symbol file
  -v VERBOSE, --verbose=VERBOSE
                        additional output

MULTI-CHANNEL TRANSMITTER

The multi_tx.py demonstration app transmits four RF channels, one for each of the supported protocols. It requires SDR hardware (such as the HackRF); any device supported by the gr-osmosdr driver and libraries should work. Example command line:

python multi_tx.py --args hackrf --gains rf:0,if:0 -q -19.5 -Q 442187500 -f ~/rand3.wav -R

The "-Q" (frequency) option gives the frequency of the first of the four channels; the remaining channel frequencies appear at regular intervals (default spacing is 100 KHz). The ysf channel format may be set to "wide", using "-R" (default=narrow). The "-q" option is needed for PPM correction (unless a time base such as GPSDO is used). The input file ("-f" option) requires WAV format, 8000 samples/sec, S16_LE. Audio from the WAV file is transmitted on all frequencies. However if the "-A" option is given, program content for the second DMR time slot is instead taken live from the sound card audio input port ("-I" option).

GENERAL

Input audio may come either from WAV files (8000/S16_LE/mono) or from the PC microphone / line input connector. If -f filename (or -F filename in DMR mode) is selected the input is read from file(s); otherwise the GR audio source is selected. Likewise output is sent to the soundcard unless -o is given. When using files the -r option can be specified to replay the input file(s) in a continuous loop. Without this option the program exits at EOF. The -p protocol option is used to select which of the four DV standards (dmr, dstar, p25 or ysf) is to be used. The dmr and ysf modes also utilize a configuration file, specified using the -c filename parameter. See the specific section (below) for more details on the configuration file.

There currently appears to be an audio bug that causes the audio to sound "overdriven" or "clipped". The dstar and to a lesser extent the ysf-halfrate coder is most affected by this; dstar suffers from an audio level pumping or AVC malady. UPDATE (Mar. 2017) A hack was added that greatly reduces this problem in ysf. At this point only dstar seems in need of further work.

Note: in general the program currently doesn't currently send "header" or "terminator" packets which typically appear once at the start/end of voice transmissions. Instead we rely on the ability inherent in all of these protocols to start receiving even for transmissions already in progress. For two of the four protocols (dstar and ysf in fullrate mode) this means we forfeit an opportunity to transmit the station callsign. This needs to be fixed in a future release...

OPERATION

Proper FM deviation is set by adjusting the output levels using the 'alsamixer' app while monitoring with an FM deviation meter. The "Datascope" option in the scope.py OP25 gui app (running on a separate PC) can also be used to view the deviation. If this method is used scope.py must first be calibrated using a known accurate station. The test station is then adjusted to have the same deviation as the known station (leaving all receiver parameters unchanged other than perhaps the frequency).

DMR

DMR operates in Base Station (BS) mode and is 2-slot TDMA with both slots operating in Group Voice mode. [DMR Mobile Station mode utilizes time-slotted channel access and is not directly compatible with the usual FM transmitter hardware without serious modification]. The configuration file parameters that you are most likely to change are the Station Address (sa) and Group Address (ga) parameters [the latter is also known as the talkgroup ID]. See the comments in the sample DMR config file dmr-cfg.dat (supplied). It is also possible to disable one or both channels if desired.

DSTAR

As of this writing DSTAR mode has an audio clipping bug causing the speech to have a distored, overdriven character. Given sufficient time this should be quite fixable. Also the "slow speed data" feature needs to be implemented. Until this is done the config file (if present) is ignored. As mentioned, the -g gain parameter can be used to adjust the input gain, although this doesn't fully cure all dstar quality issues.

P25

The P25 coder was the earliest modulation format supported in OP25. It operates with a fixed NAC (Network Access Code) of 0x293 and transmits fullrate voice.

YSF

The ysf mode supports both halfrate (default) and fullrate voice, with some clipping distortion noted in the halfrate mode. Fullrate mode is enabled using the -R option. The halfrate mode also supports the interspersed callsign and repeater ID data, but this is currently untested. See the sample ysf config file ysf-cfg.dat (supplied).

CREDITS

Too many to list; thanks to Matt Ames, Pavel Yazev, Jonathan Naylor, unknown author(s) of DSD (DSDAuthor), Mathias Weyland, Sylvain Munaut; undoubtedly others.

©Copyright 2017, Max H. Parke KA1RBI