Quick start RTL2832 USB SDR receiver on Linux

1 minute read

GQRX is popular for RTL-SDR receivers on Linux:

adduser $(whoami) plugdev

apt install gqrx-sdr rtl-sdr librtlsdr-dev

You can also download the latest release of GQRX.

Examples

In GNU Radio Companion, look for the RTL-SDR Source block.

Test RTL2832 PLL Frequency range

rtl_test -t

Output should be like:

E4000 tuner

Found 1 device(s): 0: ezcap USB 2.0 DVB-T/DAB/FM dongle
Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle
Found Elonics E4000 tuner
Supported gain values (18): -1.0 1.5 4.0 6.5 9.0 11.5 14.0 16.5 19.0 21.5 24.0 29.0 34.0 42.0 43.0 45.0 47.0 49.0
Benchmarking E4000 PLL...
E4K PLL not locked for 53000000 Hz!
E4K PLL not locked for 2217000000 Hz!
E4K PLL not locked for 1109000000 Hz!
E4K PLL not locked for 1248000000 Hz!
E4K range: 54 to 2216 MHz
E4K L-band gap: 1109 to 1248 MHz

R820

Found 1 device(s):  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Detached kernel driver
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6 
[R82XX] PLL not locked!
Sampling at 2048000 S/s.
No E4000 tuner found, aborting.
Reattached kernel driver

Record

Note, this is the entire passband ~ 2 MHz bandwidth, not just the demodulated audio. Example command:

rtl_sdr /tmp/cap.bin -s 1.8e6 -f 90.1e6

Press Ctrl+C to stop recording after several seconds so that your hard drive doesn’t fill up. You can read the cap.bin file in MATLAB, Python or GNU Radio.

Troubleshooting

  • is RTL-SDR recognized? Before and after inserting the RTL-SDR receiver into the USB port of your Linux PC, type:
    lsusb
    

    should show Realtek device.

  • try a different, non-USB 3 port (USB 2).
  • librtlsdr0 provides file /lib/udev/rules.d/60-librtlsdr0.rules that allows the RTL-SDR stick to be recognized upon USB plugin.
  • dmesg should show dozens of messages with RTL2832 when the USB receiver is plugged in

Other programs

Here are other popular programs for the RTL-SDR.

  • MATLAB RTL-SDR support has several examples and a free eBook. Matlab also supports USRP and PLUTO SDR hardware among others.
  • GNU Radio (start with GNU Radio Companion graphical SDR IDE)
    apt install gnuradio
    
  • pyrtlsdr: pure Python wrapper for librtlsdr and less bulky than GNU Radio.
  • SDR#
  • CubicSDR

Leave a Comment