Skip to content

General configuration file structure

Tomasz Lemiech edited this page Oct 18, 2021 · 11 revisions

Here is a RTLSDR-Airband's config file structure shown on a real example, taken from config/basic_multichannel.conf file, which is also installed as a default configuration file.

fft_size = 512;
devices: (
  {
    type = "rtlsdr";
    index = 0;
    gain = 25;
    centerfreq = 120000000;
    correction = 80;
    channels:
    (
      {
        freq = 119.5;
        outputs: (
          {
            type = "icecast";
            server = "icecast.server.example.org";
            port = 8080;
            mountpoint = "TWR.mp3";
            name = "Tower";
            genre = "ATC";
            username = "source";
            password = "mypassword";
          }
        );
      },
      {
        freq = "120.225M";
        outputs: (
          {
            type = "icecast";
            server = "icecast.server.example.org";
            port = 8080;
            mountpoint = "GND.mp3";
            name = "Ground";
            genre = "ATC";
            description = "My local airport - ground feed";
            username = "source";
            password = "mypassword";
          }
        );
      }
    );
  }
);

A few things to note:

  • First, there are global settings, which are outside of all groups and lists (fft_size in this case).
  • The remaining part of the file is a list named devices. Every element of this list is a group of settings related to a particular SDR receiver. So if you are running RTLSDR-Airband with, say, two RTLSDR dongles and an Airspy, you will have three groups here. The above example contains a single device for simplicity's sake.
  • Each device has a few scalar options which configure the hardware - receiver type, center frequency, gain, maybe others. Then comes a list named channels.
  • Every element of the channels list is a group of settings related to a particular channel which is to be received and demodulated on this device. First there are scalar settings of the channel - in this case, its frequency. Then comes the outputs list.
  • Every element of the outputs list is a group of settings related to a particular destination where the audio from this channel is to be routed to. The most important parameter is type - in this case, icecast. The remaining settings depend on the type. For a file output you need to set the directory where the files are to be stored and the file name prefix. For icecast output, you need to put server settings here, like host name, port, user name and password.

Putting it all together in a more general form:

# global settings
...
# device list
devices: (
  {                              # device 0
    ...                          # device settings
    channels: (
      {                          # device 0, channel 0
        ...                      # channel settings
        outputs: (
          {                      # device 0, channel 0, output 0
            ...                  # output settings
          },                     # end of device 0, channel 0, output 0
          {                      # device 0, channel 0, output 1
            ...
          },                     # end of device 0, channel 0, output 1
          ...
          {                      # device 0, channel 0, output N
            ...
          }                      # end of device 0, channel 0, output N
        );                       # end of outputs list
      },                         # end of device 0, channel 0
      ...
      {                          # device 0, channel N
        ...
        outputs: (
           ...
        );                       # end of outputs list
      }                          # end of device 0, channel N
    );                           # end of channels list
  },                             # end of device 0
  ...
  {                              # device N
    ...
  }                              # end of device N
);                               # end of device list

Specifying frequency values

Several configuration parameters specify a frequency (ie. number of cycles per second). There are two such parameters in the above example - centerfreq and freq. Their values can be given in three formats:

  • As an integer number, which assumes the value is in Hertz:
freq = 121500000;
  • As a floating point number, which means the value is in Megahertz:
freq = 121.5;
  • As a string containing a floating point number and a multiplier-denoting letter (case insensitive). Supported multipliers: k/K = 1000, m/M = 1000000, g/G = 1000000000. If the letter is ommitted, the multiplier is 0, ie. the value is assumed to be in Hertz:
freq = "121.5M";
freq = "121500k";
freq = "0.1215G";
freq = "121500000";

All of the above examples specify the same frequency - 121500000 Hz. You can choose whichever format you find the most convenient.

Now head on to the details:

Clone this wiki locally