3 releases

0.0.3 May 22, 2023
0.0.2 May 16, 2023
0.0.1 Jan 30, 2023

#1545 in Hardware support

Download history 3/week @ 2024-07-20 6/week @ 2024-07-27 4/week @ 2024-08-03 33/week @ 2024-08-24 11/week @ 2024-08-31 35/week @ 2024-09-07 3/week @ 2024-09-14 12/week @ 2024-09-21 25/week @ 2024-09-28 4/week @ 2024-10-05 29/week @ 2024-10-19 49/week @ 2024-10-26 34/week @ 2024-11-02

112 downloads per month
Used in 2 crates (via seify)

GPL-3.0 license

85KB
2K SLoC

RTL-SDR

An RTL-SDR library written in Rust!

What is RTL-SDR?

RTL-SDR is a family of low-cost (~$30) USB software-defined radio (SDR) receivers that can tune a wide range of frequencies which are then processed in software (thus the 'software' in SDR).

They can receive all kinds of signals such as FM radio (see the simple_fm example in this project), aircraft radio and position data (like what you see on adsb-exchange), weather satellite imagery, and more!

rtl-sdr.com has a great page with much more explanation.

Getting Started

You can run the example FM radio receiver with the following command on Mac:

cargo run --example simple_fm | play -r 32k -t raw -e s -b 16 -c 1 -V1 -

and similarly on Linux:

cargo run --example simple_fm | aplay -r 32k -f S16_LE

Uload Kernel Modules

If the RTL kernel modules are installed you will need to temporarily unload them before using this library as follows:

sudo rmmod rtl2832_sdr
sudo rmmod dvb_usb_rtl28xxu
sudo rmmod rtl2832
sudo rmmod rtl8xxxu

Failure to do so will result in the following USB error:

thread 'main' panicked at 'Unable to open SDR device!: Usb(Busy)'

The example is thoroughly documented to clearly show how to use this library, and hopefully make the FM demodulation process understandable too!

Build Options

This library includes the RTL-SDR Blog modifications to the original Osmocom library as a feature. Enable it in cargo with the --features rtl_sdr_blog flag.

Contributing

Contributions to this project are welcome! Check out the Issues page to see what's on the roadmap that you could help with, or open a new Issue.

Acknowledgments

This library originated as a port of the Osmocom rtl-sdr library, with modifications from the RTL-SDR Blog fork.

Dependencies

~5–11MB
~131K SLoC