Skip to content

xeddmc/p25rx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

p25rx – P25 receiver

CircleCI

This project implements a real-time Project 25 receiver in Rust. The receiver is trunking-aware and hops between control and traffic channels as talkgroup conversations begin and end.

Building

For a Linux machine, use the following build steps:

  1. Install nightly Rust. If rustup is used, nightly can be installed with

    rustup default nightly
  2. Install the librtlsdr system library (pacman -S rtl-sdr on Archlinux or apt-get install librtlsdr-dev on Ubuntu), and verify that the library is recognized by pkg-config:

    pkg-config --modversion librtlsdr
  3. Build the project by running

    cargo rustc --release -- -C target-cpu=native -C lto

    within the project root. This will compile an optimized binary for the current machine and place it at target/release/p25rx.

Usage

The program is typically ran with a command like

./target/release/p25rx -f 856162500 -p=-2 -g auto -a p25.fifo

This receives P25 using the control channel at 856.1625MHz, setting the RTL-SDR frequency correction to -2ppm, enabling the hardware automatic gain control, and writing any decoded voice frames into the p25.fifo pipe. These options are explained more in the following sections.

Audio output

Audio samples are written out in the following raw PCM format:

  • 8kHz sample rate
  • 32-bit float samples in native endianness
  • Mono channel

The stream of samples is written into the file specified by -a, which will typically be a FIFO pipe connected to an audio output command like Pulseaudio's paplay or Alsa's aplay.

For example, create the pipe with

mkfifo p25.fifo

Then, stream the samples to Pulseaudio:

paplay -p --raw --rate 8000 --format float32le --channels 1 p25.fifo

or to Alsa:

aplay -t raw -r 8000 -f FLOAT_LE -c 1 p25.fifo

These commands will run until the receiver exits.

Note that paplay can be installed with the libpulse package on Archlinux and the pulseaudio-utils package on Ubuntu, and aplay can be installed with the alsa-utils package on both.

To disable audio output, pass in -a /dev/null.

About

Trunking-aware, RasPi-ready P25 receiver daemon using RTL-SDR

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%