Actions

RTL SDR multiple FM channels

From The RadioReference Wiki

This page describes how to use a single RTL-SDR dongle on a Raspberry Pi to simultaneously monitor multiple FM radio channels at the same time. The demodulated audio from each radio channel can be sent to a speaker or headphones for listening, or can be sent to downstream applications such as TwoToneDetect. Because this method uses PulseAudio to route audio between programs, it can be used on a Raspberry Pi or other Linux systems running PulseAudio, but does not apply to Windows (on Windows, programs like Virtual Audio Cable can be used instead of PulseAudio).


Example showing flow for sending audio to multiple instances of TwoToneDetect:

                       |--->frequency 1 audio --->pulse sink--->pulse monitor source-->TwoToneDetect Instance 1
RTL-SDR -> rtl-airband |--->frequency 2 audio --->pulse sink--->pulse monitor source-->TwoToneDetect Instance 2
                       |--->frequency 3 audio --->pulse sink--->pulse monitor source-->TwoToneDetect Instance 3

Example showing flow for sending audio to speakers:

                       |--->frequency 1 audio --->pulse sink--->pulse monitor source-->\
RTL-SDR -> rtl-airband |--->frequency 2 audio --->pulse sink--->pulse monitor source--> |--->pulse audio default sink (via loopback)
                       |--->frequency 3 audio --->pulse sink--->pulse monitor source-->/

Note: It is possible to send audio to TwoToneDetect and speakers at the same time

Background

RTL-SDR dongles are capable of monitoring a ~2.2 MHz wide chunk of radio spectrum in the VHF and UHF bands. The rtl-airband software can be used to create multiple FM "tuners" at different frequencies within this 2.2 MHz wide swath of spectrum. Unlike a traditional scanner that switches between multiple frequencies but can only listen to one at a time, an RTL-SDR is capable of simultaneously demodulating multiple frequencies at the same time as long as they are all within the RTL-SDR's ~2.2 MHz bandwidth.

Example

An RTL-SDR whose center frequency is tuned to 156.000 MHz could simultaneously demodulate and "listen" to FM two-way radio transmissions on 155.430 MHz and 156.800 MHz.

PulseAudio

PulseAudio is a sound server used on the Raspberry Pi. The latest Raspberry Pi OS includes PulseAudio by default. If not already installed, it can be installed with:

 sudo apt-get install pulseaudio

It's also helpful to install the pavucontrol GUI for PulseAudio:

 sudo apt-get install pavucontrol

PulseAudio Terminology

In PulseAudio, a source is a source of audio such as a sound card line input or microphone. A sink is a place to send audio such as a sound card headphone output.

Whenever PulseAudio creates a sink, it also automatically creates a corresponding 'monitor' source that can be used to listen to the sink.

In the instructions below, we'll set up two PulseAudio sinks to send demodulated audio from two different FM frequencies to using rtl-airband. We'll then configure two different instances of TwoToneDetect (or any other program) to use the 'monitor' sources of those newly created sinks as audio input sources.

Setup Instructions

These instructions summarize how to set up an RTL-SDR to stream multiple FM radio channels to multiple instances of TwoToneDetect. However, this method is not limited to TwoToneDetect, but can be used with any downstream software capable of using PulseAudio (pulse) as the input audio source. These instructions assume that PulseAudio, rtl-airband, and TwoToneDetect are already installed on the Raspberry Pi.

  • Use rtl-airband to receive one or more FM frequencies from an RTL-dongle. If sending audio to TwoToneDetect, be sure to use multichannel mode, not scan mode.
  • Use pacmd to create a null sink in pulse audio for each frequency being monitored:
 pacmd load-module module-null-sink sink_name=myfreq1sink
 pacmd load-module module-null-sink sink_name=myfreq2sink
  • Use pacmd to update the descriptions of the null sinks so that they show up as something helpful in pavucontrol for debugging:
 pacmd update-sink-proplist myfreq1sink device.description=myfreq1sink
 pacmd update-sink-proplist myfreq2sink device.description=myfreq2sink
  • Use pacmd to update the descriptions of the corresponding (automatically created) pulse audio monitor sources:
 pacmd update-source-proplist myfreq1sink.monitor device.description=myfreq1monitor
 pacmd update-source-proplist myfreq2sink.monitor device.description=myfreq2monitor
  • For each instance of TwoToneDetect (each instance is typically in a different directory), set the pulse audio source to use when starting from the command line (use the .monitor corresponding to the sink previously created):
 PULSE_SOURCE=myfreq1sink.monitor /home/pi/TTD1/TwoToneDetect73g
 PULSE_SOURCE=myfreq2sink.monitor /home/pi/TTD2/TwoToneDetect73g
  • For any frequency that you want to listen to via the Pi's speaker output (in addition to or instead of sending the audio to TwoToneDetect), use pacmd to create a loopback from the null sink monitor to the speakers:
 pacmd load-module module-loopback source=myfreq2sink.monitor sink=default (or whatever sink you want to send it to)
outputs: (
 {
   type = "pulse";
   sink = "myfreq1sink";
 },
 {
   type = "pulse";
   sink = "myfreq2sink";
 }
);