Skip to content

Configuring mixers

charlie-foxtrot edited this page Oct 14, 2023 · 6 revisions

RTLSDR-Airband can mix audio from several channels into a common audio stream. Mixed channels may come from a common SDR device or from different devices. Volume and stereo balance can be adjusted independently for each component stream. Mixed audio can be routed to any supported output, just like an ordinary channel.

Configuration consists of two steps:

  • Define a mixer, assign a name to it and configure its outputs,
  • For each component channel create an output of type "mixer" and give a name of the mixer which the audio is to be routed to.

Defining mixers

Mixers are defined in a top-level list named mixers. Each mixer is a group of settings - just like a device, however devices are unnamed groups, while mixers are named.

Here is an example of two mixer definitions - mixer1 and mixer2. The first one has two outputs - Icecast and a file. The second one has one output - Icecast.

mixers: {
  mixer1: {
    outputs: (
        {
          type = "icecast";
          server = "icecast.server.example.org";
          port = 8080;
          mountpoint = "mixer1.mp3";
          name = "VOLMET + Approach + Director"
          genre = "ATC";
          username = "source";
          password = "mypassword";
        },
        {
          type = "file";
          directory = "/home/pi/recordings";
          filename_template = "mixer1";
        }
    );
  },
  mixer2: {
    outputs: (
        {
          type = "icecast";
          server = "icecast.server.example.org";
          port = 8080;
          mountpoint = "mixer2.mp3";
          name = "Ground + Delivery"
          genre = "ATC";
          username = "source";
          password = "mypassword";
        }
    );
  }
};

You can disable unneeded mixers just like any other configuration section - by putting a disable = true keyword inside the mixer. See Disabling configuration sections for more information on this topic.

Configuring component channels

Component channel is configured just like any other channel. It may have any number of outputs. In order to connect a channel to a mixer as an input stream, you define an output of type mixer, like this:

devices: ({
  ...
  channels: ({
    freq = 120.875;
    outputs: ({
      {
        type = "mixer";
        name = "mixer1";
#       balance = 0.0;
#       ampfactor = 1.0;
      }
    });
  });
});

Explanation of keywords

  • name (string, mandatory) - the name of the mixer to attach the stream to.
  • balance (float, optional) - the number in the range between -1.0 and 1.0 indicating where the stream is to be put on a stereo plane. -1.0 means full left, 0.0 means centered, 1.0 means full right, 0.5 means halfway between the center and full right.
  • ampfactor (float, optional) - amplification factor, ie. the the volume knob for this stream. The default is 1.0, which means default volume (unchanged). Any positive value is allowed. Values between 0.0 and 1.0 cause the stream to be attenuated, while values above 1.0 cause it to be amplified. You can use this feature to equalize the volume of component streams, so that the mixed stream is more balanced and pleasing to the ear. Or you can reduce the volume of a less interesting stream.

Note: Defining mixer outputs for mixers is not allowed.


Note: It is OK to have a mixer defined in the config, but not used. If a mixers does not have any inputs connected, its outputs won't be initialized either.


Clone this wiki locally