Is seify/future-sdr interested in a from-scratch async rust implementation for RTL2832U?
I'm writing one for my SDR framework, but by default it works on its own. The driver was written from scratch, trying not to copy librtlsdr too much, or at least trying to understand what's going on. I found a few bugs, and lots of features that librtlsdr doesn't expose, and that I will definitely experiment with in the future.
Code. It's unpublished - I just got it to work this week.
You can run a test program that runs a rtl_tcp server:
cargo run --release --bin mrrp-rtl-sdr-test -- tcp -l 127.0.0.1:1234
(compilation might take a while since there's a lot of other stuff in the workspace, but the driver crate itself is pretty lightweight)
And usage as a library is also pretty straight-forward:
use mrrp_rtl_sdr::{
OpenOptions,
open_any,
};
use tokio::io::AsyncReadExt;
let mut device = open_any(OpenOptions::default()).await?;
// Set sample rate to 2.4 MSa/s
device.set_sample_rate(2_400_000.0).await?;
// Set center frequency to 7 MHz
device.set_center_frequency(7_000_000.0).await?;
// Start sampling and acquire a Reader
let mut reader = device.reader(Default::default()).await?;
// read samples. these are interleaved IQ as pairs of u8, with the equilibrium at 128.
loop {
let i = reader.read_u8().await?;
let q = reader.read_u8().await?;
println!("i=0x{i:02x} q=0x{q:02x}");
}
Noteworthy here is that the Reader is completely separate from the Device. Reader is pretty much just a wrapper around nusb::io::EndpointRead. There's some interaction with the Device, but only when the reader is being closed. Otherwise they don't interact and don't need to synchronize with each other.
Only R82xx tuners are supported right now, and I only tested with R828D, because I only have a RTL-SDR Blog v4.
Is seify/future-sdr interested in a from-scratch async rust implementation for RTL2832U?
I'm writing one for my SDR framework, but by default it works on its own. The driver was written from scratch, trying not to copy librtlsdr too much, or at least trying to understand what's going on. I found a few bugs, and lots of features that librtlsdr doesn't expose, and that I will definitely experiment with in the future.
Code. It's unpublished - I just got it to work this week.
You can run a test program that runs a
rtl_tcpserver:(compilation might take a while since there's a lot of other stuff in the workspace, but the driver crate itself is pretty lightweight)
And usage as a library is also pretty straight-forward:
Noteworthy here is that the
Readeris completely separate from theDevice.Readeris pretty much just a wrapper aroundnusb::io::EndpointRead. There's some interaction with theDevice, but only when the reader is being closed. Otherwise they don't interact and don't need to synchronize with each other.Only R82xx tuners are supported right now, and I only tested with R828D, because I only have a RTL-SDR Blog v4.