• Stars
    star
    148
  • Rank 249,983 (Top 5 %)
  • Language
    C
  • License
    GNU General Publi...
  • Created almost 4 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

High performant TCP server for rtl-sdr

About Build Status Quality Gate Status

design

Key features

  • Share available RF bandwidth between several independent clients:
    • Total bandwidth can be 2016000 samples/sec at 436,600,000 hz
    • One client might request 48000 samples/sec at 436,700,000 hz
    • Another client might request 96000 samples/sec at 435,000,000 hz
  • Several clients can access the same band simultaneously
  • Output saved onto disk or streamed back via TCP socket
  • Output can be gzipped (by default = true)
  • Output will be decimated to the requested bandwidth
  • Clients can request overlapping RF spectrum
  • Rtl-sdr starts only after first client connects (i.e. saves solar power &etc). Stops only when the last client disconnects
  • MacOS and Linux (Debian Raspberrypi)

Design

design

API

  • Defined in the api.h
  • Clients can connect and send request to initiate listening:
    • center_freq - this is required center frequency. For example, 436,700,000 hz
    • sampling_rate - required sampling rate. For example, 48000
    • band_freq - first connected client can select the center of the band. All other clients should request center_freq within the currently selected band
    • destination - "0" - save into file on local disk, "1" - stream back via TCP socket
  • To stop listening, clients can send SHUTDOWN request or disconnect

Queue

design

The data between rtl-sdr worker and the dsp workers is passed via queue. This is bounded queue with pre-allocated memory blocks. It has the following features:

  • Thread-safe
  • If no free blocks (consumer is slow), then the last block will be overriden by the next one
  • there is a special detached block. It is used to minimize synchronization section. All potentially long operations on it are happening outside of synchronization section.
  • Consumer will block and wait until new data produced

Configuration

Sample configuration can be found in tests:

https://github.com/dernasherbrezon/sdr-server/blob/main/test/resources/configuration.config

Performance

Is good. Some numbers in test/perf_xlating.c

Dependencies

sdr-server depends on several libraries:

  • libvolk. It is recommended to use the latest version (Currently it is 2.x). After libvolk installed or built, it needs to detect optimal kernels. Run the command volk_profile to generate and save profile.
  • librtlsdr. Version >=0.5.4 is required.
  • libconfig
  • libz. Should be installed in every operational system
  • libm. Same
  • libcheck for tests (Optional)

All dependencies can be easily installed from r2cloud APT repository:

sudo apt-get install dirmngr lsb-release
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A5A70917
sudo bash -c "echo \"deb http://s3.amazonaws.com/r2cloud $(lsb_release --codename --short) main\" > /etc/apt/sources.list.d/r2cloud.list"
sudo apt-get update
sudo apt-get install libvolk2-dev librtlsdr-dev libconfig-dev check

Build

To build the project execute the following commands:

mkdir build
cd build
cmake ..
make

Install

sdr-server can be installed from r2cloud APT repository:

sudo apt-get install sdr-server

More Repositories

1

r2cloud

Decode satellite signals on Raspberry PI or any other 64-bit CPU.
Java
243
star
2

rtlSpectrum

Analyze spectrograms created by rtl_power
Java
53
star
3

jradio

Software radio decoding
Java
53
star
4

sdr-modem

Modem based on software defined radios.
C
25
star
5

sx127x

Library to work with LoRa chips sx127x.
C
17
star
6

protobuf-gcless

Java protobuf gc-friendly implementation
Java
9
star
7

deb-maven-plugin

maven plugin for .deb packaging
Java
6
star
8

fingerprint-maven-plugin

Maven plugin for web resources optimization
Java
6
star
9

r2lora

Access LoRa transceiver via REST API
C++
5
star
10

r2cloud-ui

Web UI for r2cloud (https://github.com/dernasherbrezon/r2cloud)
Vue
5
star
11

apt-maven-plugin

Maven plugin to deploy into remote debian repository
Java
5
star
12

mockfs

Java FileSystem for simulating IOExceptions
Java
5
star
13

eclipse-log-param

Adds "formatted_method_parameter" variable for code templates in eclipse
Java
4
star
14

vue-openapi-bootstrap

OpenAPI viewer component for VueJS
Vue
2
star
15

clDsp-test

Several DSP components on GPU via OpenCL. Tuned for Raspberrypi
C
2
star
16

ssdv4j

Decode ssdv protocol
Java
2
star
17

apt-transport-swift

additional "swift" protocol for apt so you can host your giant apt repository in Openstack swift
C
2
star
18

rrd4j-js

Javascript library for loading rrd4j files
JavaScript
1
star
19

fcdwClient

Client for FunCube Data Warehouse
Java
1
star
20

plutosdr

small cli program for plutosdr
C
1
star
21

deps-maven-plugin

Maven plugin that outputs dependency information suitable for bash script to download
Shell
1
star
22

bh1750

Linux userspace program to read sensor BH1750
C
1
star
23

arm-tests

Various tests for DSP algorithms using ARM intristics
C
1
star
24

rpi-fma

Test FMA on RaspberryPI CPU&GPU
C
1
star
25

r2weatherClient

Java client for r2weather service
Java
1
star
26

lora-at

AT commands to control LoRa via serial interface
C
1
star