Skip to content

Add SRT Support#523

Open
yegors wants to merge 17 commits intortl-airband:mainfrom
yegors:main
Open

Add SRT Support#523
yegors wants to merge 17 commits intortl-airband:mainfrom
yegors:main

Conversation

@yegors
Copy link

@yegors yegors commented Jun 29, 2025

This update introduces a new SRT output feature that allows RTLSDR‑Airband to stream audio using the Secure Reliable Transport protocol.

  • Build support – SRT requires the libsrt development files; CMake will enable it automatically when the library is available
  • Audio formats – Streams can be sent as raw PCM, MP3, or WAV depending on the format setting
  • Low latency playback – When using mp3 or wav, clients such as ffplay can connect with minimal delay using: ffplay -fflags nobuffer -flags low_delay srt://<host>:<port>

Configuration example

outputs: (
  {
    type = "srt";
    listen_address = "0.0.0.0";
    listen_port = 8890;
    format = "mp3";       # pcm|mp3|wav
    continuous = true;    # optional, default false
  }
);

I'm not a C++ dev, and this code has been entirely AI written so definitely needs some human eyes on it. But it does work.

Resolves #392

@yegors
Copy link
Author

yegors commented Jul 9, 2025

Been running this server for ~2 weeks now, appears stable. I'm using it here: https://github.com/yegors/co-atc

- Change audio format from 32-bit float to 16-bit signed PCM across all formats (pcm, mp3, wav)
- Add configurable `mode` setting with two options:
  - `live` (default): Standard SRT with TSBPD for broad client compatibility (~120ms latency)
  - `raw`: Minimal latency mode with TSBPD disabled (ffplay/ffmpeg only)
- Improve error handling: drop data on buffer full (SRT_EASYNCSND) instead of disconnecting client
- Update documentation with separate ffplay commands for different formats and new mode configuration

This provides users flexibility to choose between compatibility (live mode) and minimal latency (raw mode) based on their specific use case and client applications.
@charlie-foxtrot
Copy link
Collaborator

@yegors thanks for the PR and sorry for the delay. It looks like there are a few things in here that could be pulled out into independent smaller PRs and get in sooner (addition of min_rx_seconds, changes to UDP streams). For the core of this PR, I'm going to some housekeeping work on the repo before landing the larger changes.

@yegors
Copy link
Author

yegors commented Feb 13, 2026

Yeah, I mostly just kept committing to my branch for changes I needed along the way for my project to make it output clean streams I can feed directly into TTS with no encoding. Feel free to copy whatever you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] SRT Support

2 participants