Actions

Difference between revisions of "RTL SDR multiple FM channels"

From The RadioReference Wiki

Line 16: Line 16:
  
 
Whenever PulseAudio creates a '''sink''', it also automatically creates a corresponding 'monitor' '''source''' that can be used to listen to the '''sink'''.   
 
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==
 
==Setup Instructions==

Revision as of 21:02, 29 March 2021

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.

Background

RTL-SDR dongles are capable of monitoring a ~2.2 MHz while 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

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.

  1. Use rtl-airband to receive one or more FM frequencies from an RTL-dongle
  2. Use pacmd to create a null sink in pulse audio for each instance of TwoToneDetect:
 pacmd load-module module-null-sink sink_name=myfreq1sink
 pacmd load-module module-null-sink sink_name=myfreq2sink
  1. 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
  1. Use pacmd to update the descriptions of the corresponding (automatically created) pulse audio monitor sources:
 pacmd update-source-proplist myfreq1sink.monitor device.description=myfreq1sink
 pacmd update-source-proplist myfreq2sink.monitor device.description=myfreq2sink
  1. For each instance of TwoToneDetect, 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
  1. In the rtl-airband configuration for the corresponding frequency, send the audio to pulse audio with the sink name created above:

outputs: (

 {
   type = "pulse";
   sink = "myfreq1sink";
 },
 {
   type = "pulse";
   sink = "myfreq2sink";
 }

);