Skip to content

Configuring UDP outputs

Tomasz Lemiech edited this page Oct 18, 2021 · 1 revision

RTLSDR-Airband can stream uncompressed audio to another application over the network via UDP/IP. The server may run on the same machine where RTLSDR-Airband is running, or on another one, reachable over your local network.

The sample format is 32-bit float. Sampling rate depends on whether the program has been built with NFM support enabled or not:

  • NFM disabled - 8000 samples per second
  • NFM enabled - 16000 samples per second

Note: These rates apply regardless of whether the received channel is AM or NFM-modulated.

Syntax

outputs is a list of outputs where the audio stream of a particular channel is to be routed. An output is a group of settings enclosed in braces { }. The number of outputs per channel is unlimited.

outputs: (
  {
    type = "udp_stream";
    dest_address = "udp-server.example.com";
    dest_port = 1234;
#   continuous = false;
  }
);

Explanation of keywords

  • type (string, required) - type of this output. Put "udp_stream" here.
  • dest_address (string, required) - the host name or IP address of the destination where RTLSDR-Airband should send the stream.
  • dest_port (integer, required) - the UDP destination port.
  • continuous (boolean, optional) - whether RTLSDR-Airband shall stream the audio to the server continuously (true) or pause when the squelch is closed (false). The default is false, to make things in line with the defaults for other output types. However the receiving application might not like the fact that the stream stops and restarts frequently (for example, audio players might get stuck at buffering state pretty often). In most cases it is therefore desirable to flip this setting to true.

How to receive

Here is an example of how to receive the UDP stream with Netcat on port 2000, convert the samples from 32-bit floats to 16-bit signed integers and play the stream with mplayer:

nc -ulp 2000 | \
csdr convert_f_s16 | \
mplayer -cache 1024 -quiet -rawaudio samplesize=2:channels=1:rate=16000 -demuxer rawaudio -

If you have built RTLSDR-Airband with NFM support disabled, change rate=16000 to rate=8000.

If the UDP output has been applied to a stereo mixer (ie. when balance option is in use), change channels=1 to channels=2.

Now you may want to read about configuring other output types for your channels:

or jump straight to:

Clone this wiki locally