Giter Site home page Giter Site logo

p25rx's Introduction

p25rx โ€“ P25 receiver

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 rtl-sdr 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.

p25rx's People

Contributors

kchmck avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.