Skip to content

jlpoolen/iq_multicast

Repository files navigation

iq_multicast

Multicast IQ Streaming for RTL-SDR and AirSpy

iq_multicast is a set of minimal C utilities designed to stream raw IQ samples from either an RTL-SDR or AirSpy device over UDP multicast. These tools are intended for local or LAN-based deployment in SDR (Software Defined Radio) pipelines where multiple receivers or processors need access to synchronized IQ data streams. By multicasting UDP, one transciever can be used by an unlimited number of subscribers, e.g. processes. A "digital splitter", if you will.


Overview Diagram

        ┌────────────┐
        │  RTL-SDR   │
        │ or AirSpy  │
        └────┬───────┘
             │ IQ Samples
     ┌───────▼────────┐
     │ iq_multicast   │
     │ (airspy_rx /   │
     │  rtl-sdr_rx)   │
     └───────┬────────┘
   ┌─────────┴──────────────┐
   │ UDP Multicast Stream   │
   │ e.g. 239.192.0.3:5003  │
   └─────────┬──────────────┘
             |
   ┌─────────┴──────────────┬────────────────────┬──────────────────┬──────────────────┬───────────────────┐
   workstation          workstation         Pi archiver       Ryzen 7950 AI     Public Web Server    Development Box
┌───────▼────────┐  ┌───────▼────────┐   ┌───────▼────────┐ ┌───────▼────────┐ ┌───────▼────────┐  ┌───────▼────────┐
│ udp_decode     │  │ udp_sentry     │   │ udp_decode     │ │ udp_decode     │ │  udp_decode    │  │  multicast     │ 
│ (e.g., Rust)   │  │ (e.g., Rust)   │   │ archiver       │ │ fast whisperer │ │   Live audio   │  │  receiver      │ 
│ Listening      │  │ RSSI monitoring│   │ PCM->Flac      │ │ Transcription  │ │   broacast     │  │  DEV code      │ 
└────────────────┘  └────────────────┘   └────────────────┘ └────────────────┘ └────────────────┘  └────────────────┘

Features

  • Supports RTL-SDR and AirSpy devices
  • Transmits raw IQ samples over UDP multicast
  • Configurable sample rate, frequency, gain, and multicast destination
  • Optional .iq file output for short testing
  • Portable and minimal C implementation

Usage

Dependencies

RTL-SDR

sudo emerge -av net-wireless/rtl-sdr        # Gentoo
# or
sudo apt install librtlsdr-dev # Debian/Ubuntu

AirSpy

sudo emerge -av net-wireless/airspy      # Gentoo
# or
sudo apt install libairspy-dev # Debian/Ubuntu

Build

make 

This compiles the following executables:

  • airspy_rx – Streams AirSpy IQ samples via multicast
  • rtl-sdr_rx – Streams RTL-SDR IQ samples via multicast

Run

You can either run referencing a configuration file and/or use line parameters. Line parameters will override any in the configuration file.

Configuration

Use one of the example .conf files or create your own. Supported keys:

frequency = 124550000       # Hz
gain = 28                   # Device-specific
sample_rate = 288000        # Hz
multicast_addr = 239.192.0.3
port = 5003
device_index = 1            # RTL-SDR only
outfile = /tmp/test.iq      # optional, see warning below

Use backticks for dynamic and unique naming:

outfile = /tmp/rtl-sdr_sample_`date +'%Y%m%d_%a_%H%M'`.iq

Example Configuration Files

Two example .conf files are provided:

  • airspy-rpi5.conf
  • rtl-sdr-rpi5.conf

Each config file supports common parameters:

  • frequency (in Hz)
  • gain
  • sample_rate
  • multicast_addr (e.g., 239.192.0.3)
  • port (e.g., 5003)
  • Optional: outfile (see warning below)

Each file will also have configuration settings unique to its product, e.g. RTL-SDR device


Runtime Examples

./rtl-sdr_rx -c rtl-sdr-rpi5.conf

or

./airspy_rx -c airspy-rpi5.conf -f 119100000

These will begin streaming IQ data to the specified multicast address and port. To monitor or decode the stream:

Receiving RTL-SDR broadcasts

(7/31/25 - Note: udp_decode has not yet been publicly released.)

cd /usr/local/src/rustradio
target/release/examples/udp_decode -m 239.192.0.3 -p 5003 --samp-rate 288000 --format u8 --volume 8

Receiving AirSpy2 broadasts

cd /usr/local/src/rustradio
target/release/examples/udp_decode -m 239.192.0.5 -p 5005 --samp-rate 2500000 --format i16 --volume 0.9

Be sure to set --format to match the stream format (u8 for RTL-SDR, i16 for AirSpy). Also, the --volume range is different for each transceiver.


⚠️ Warning: --outfile Usage

Both tools support the -o / --outfile parameter or outfile = ... config key. When specified, the tool writes a local .iq file containing raw IQ samples in addition to multicast transmission.

These files can grow extremely large, very fast.

Sample Rate Bit Depth Growth Rate
2.5 MSPS 16-bit ~300 MB/minute
2.88 MSPS 8-bit ~172 MB/minute

✅ Use only for short tests and monitor disk space carefully.


License

MIT License

See LICENSE for details.


Author

Developed by John Laurence Poole with ChatGTP.

For additional tools (e.g. udp_decode), see: https://github.com/jlpoole/rustradio

About

Multicast broadcaster for USB Transceivers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published