#sdr #radio

bin+lib soapysdr

Library wrapping SoapySDR, a hardware abstraction layer for many software defined radio devices, including rtl-sdr, HackRF, USRP, LimeSDR, BladeRF, and Airspy

5 unstable releases

Uses old Rust 2015

0.3.2 Feb 23, 2022
0.3.1 Oct 17, 2021
0.3.0 Apr 17, 2021
0.2.0 Sep 22, 2019
0.1.0 Nov 13, 2018

#170 in Hardware support

Download history 63/week @ 2023-02-04 61/week @ 2023-02-11 76/week @ 2023-02-18 32/week @ 2023-02-25 55/week @ 2023-03-04 43/week @ 2023-03-11 39/week @ 2023-03-18 34/week @ 2023-03-25 35/week @ 2023-04-01 33/week @ 2023-04-08 35/week @ 2023-04-15 31/week @ 2023-04-22 40/week @ 2023-04-29 39/week @ 2023-05-06 124/week @ 2023-05-13 73/week @ 2023-05-20

279 downloads per month
Used in 3 crates (2 directly)


1.5K SLoC

Rust bindings for SoapySDR

SoapySDR provides a hardware abstraction layer for many software defined radio devices.

API Documentation | Changelog


This library requires dependencies not handled by Cargo:

  • libsoapysdr 0.6, 0.7, or git master (0.8)
  • libclang 3.9+ (for bindgen)


(Tested on Ubuntu 20.04)

sudo apt install libsoapysdr-dev libclang-dev llvm-dev pkg-config

# Choose the appropriate drivers for your hardware:
sudo apt install soapysdr-module-rtlsdr soapysdr-module-hackrf soapysdr-module-uhd soapysdr-module-lms7



(see shell.nix)


Install pre-built PothosSDR and LLVM, then

  • Set LIBCLANG_PATH environment variable to LLVM bin directory for rust-bindgen
  • Add PothosSDR bin directory to system PATH


Many SoapySDR driver modules have error handling and thread safety bugs. This library provides safe Rust wrappers assuming the drivers meet the (under-documented) intentions of the SoapySDR core API contract, but if SoapySDR loads modules that violate this contract and you do atypical things with them, you may encounter unexpected behavior. For details, see this SoapySDR issue.


This crate comes with two small utilities that serve as example code.


Displays device details like SoapySDRUtil.

cargo run --release --features=binaries --bin soapy-sdr-info


Records data from a device.

e.g. capture 15 seconds of data from the FM band:

cargo run --release --features=binaries --bin soapy-sdr-stream -- -d driver=rtlsdr -r out.cfile -f 96M -s 1M -n 15M

The resulting file contains 32-bit little-endian complex float samples, and can be opened with inspectrum.


Licensed under either of


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


~50K SLoC