sdr-server:用于rtl-sdr的高性能TCP服务器

  • Y0_221067
    了解作者
  • 157.3KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-13 12:40
    上传日期
关于 主要特点 在多个独立客户端之间共享可用的RF带宽: 总带宽可以为436,600,000 Hz的2016000个样本/秒 一位客户可能以436,700,000 hz的速度请求48000个样本/秒 另一个客户可能以435,000,000 hz的速度请求96000个样本/秒 多个客户端可以同时访问同一频段 输出保存到磁盘或通过TCP套接字流回 可以压缩输出(默认情况下为true) 输出将被抽取到所请求的带宽 客户可以要求重叠的射频频谱 Rtl-sdr仅在第一个客户端连接(即节省太阳能等)之后启动。 仅在最后一个客户端断开连接时停止 MacOS和Linux(Debian Raspberrypi) 设计 每个客户端都有自己的dsp线程 每个dsp线程都执行 用于SIMD优化 仅支持RTL-SDR 原料药 在定义 客户端可以连接并发送请求以启动侦听: center_freq-这是必需的中
sdr-server-main.zip
  • sdr-server-main
  • .travis.yml
    1.1KB
  • build_debug.sh
    184B
  • sonar-project.properties
    555B
  • docs
  • dsp.jpg
    29KB
  • queue.drawio
    1.8KB
  • queue.png
    21.7KB
  • dsp.drawio
    40.5KB
  • threads.drawio
    1.8KB
  • threads.png
    32.8KB
  • .github
  • FUNDING.yml
    23B
  • test
  • test_tcp_server.c
    8.1KB
  • resources
  • invalid.basepath.config
    174B
  • invalid.config
    64B
  • run_tests.sh
    342B
  • minimal.config
    52B
  • invalid2.config
    88B
  • configuration.config
    1KB
  • invalid.format.config
    96B
  • core.config
    130B
  • tcp_server.config
    132B
  • mock_librtlsdr.c
    4.1KB
  • perf_xlating.c
    1.5KB
  • utils.c
    1.3KB
  • tcp_client.h
    811B
  • test_queue.c
    2.4KB
  • utils.h
    439B
  • test_lpf.c
    2.3KB
  • tcp_client.c
    3.6KB
  • test_core.c
    6.8KB
  • test_xlating.c
    7.8KB
  • test_config.c
    2.3KB
  • test_rotator.c
    2.1KB
  • LICENSE
    17.7KB
  • debian
  • control
    576B
  • changelog
    326B
  • compat
    1B
  • install
    0B
  • copyright
    1.2KB
  • sdr-server.service
    263B
  • rules
    280B
  • prerm
    60B
  • postinst
    437B
  • source
  • format
    12B
  • src
  • config.h
    531B
  • tcp_server.c
    12.2KB
  • rotator.c
    1.2KB
  • main.c
    1.2KB
  • lpf.h
    225B
  • resources
  • config.conf
    132B
  • lpf.c
    2.3KB
  • core.h
    586B
  • rotator.h
    442B
  • queue.c
    4.8KB
  • core.c
    12.3KB
  • xlating.h
    491B
  • config.c
    4.8KB
  • tcp_server.h
    332B
  • queue.h
    448B
  • xlating.c
    6.4KB
  • api.h
    838B
  • .gitignore
    479B
  • CMakeLists.txt
    2.6KB
  • README.md
    4.2KB
内容介绍
# About [![Build Status](https://travis-ci.com/dernasherbrezon/sdr-server.svg?branch=main)](https://travis-ci.com/dernasherbrezon/sdr-server) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dernasherbrezon_sdr-server&metric=alert_status)](https://sonarcloud.io/dashboard?id=dernasherbrezon_sdr-server) ![design](/docs/dsp.jpg?raw=true) ## 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](/docs/threads.png?raw=true) * Each client has its own dsp thread * Each dsp thread executes [Frequency Xlating FIR Filter](http://blog.sdr.hu/grblocks/xlating-fir.html) * [Libvolk](https://www.libvolk.org) is used for SIMD optimizations * Only RTL-SDRs are supported ## API * Defined in the [api.h](https://github.com/dernasherbrezon/sdr-server/blob/main/src/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](/docs/queue.png?raw=true) 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](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](https://www.libvolk.org). It is recommended to use the latest version (Currently it is 2.x). After libvolk [installed or built](https://github.com/gnuradio/volk#building-on-most-x86-32-bit-and-64-bit-platforms), it needs to detect optimal kernels. Run the command ```volk_profile``` to generate and save profile. * [librtlsdr](https://github.com/dernasherbrezon/librtlsdr). Version >=0.5.4 is required. * [libconfig](https://hyperrealm.github.io/libconfig/libconfig_manual.html) * libz. Should be installed in every operational system * libm. Same * [libcheck](https://libcheck.github.io/check/) for tests (Optional) All dependencies can be easily installed from [r2cloud APT repository](https://r2server.ru/apt.html): ``` 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](https://r2server.ru/apt.html): ``` sudo apt-get install sdr-server ```
评论
    相关推荐