Experimental R820T/R820T2 rtl-sdr tuner driver that tunes down to 13 MHz or lower.
(From my experiments up to 3.4 MHz on R820T2)
Realtek RTL2832U based hardware can be used as a cheap SDR (Software-defined radio).
This device allows transferring the raw I/Q samples to the your PC/laptop/etc via USB.
History:
2017-2018: Backporting features and bug fixes from upstream and newer forks.
2021: Fully migrated to the CMake build system.
2022-2023: More fixes, add's, and improvements.
2023-2026: Driver optimizations, direct sampling improvements, expanded tuner/hardware support, and Modern CMake integration.
Debian/Ubuntu:
sudo apt install build-essential pkg-config cmake git libusb-1.0-0-dev
Arch/Manjaro:
Note: package has added to the AUR, or you can use PKGBUILD.
pacman -S cmake libusb
Visual Studio or MinGW/msys/LLVM Clang MinGW etc...
libusb libusb/releases
pthread-win32 library
Latest CMake or Old CMake for 2003/XP
Recommended for use: Precompiled static libs (build kit)
brew install libusb pkg-config cmake
git clone https://github.com/Mr-Precise/rtl-sdr/
cd rtl-sdr
run cmake and start compilation. cmake will accept some options, e.g.
-DINSTALL_UDEV_RULES=ON, default isOFF-DDETACH_KERNEL_DRIVER=ON, default isOFF-DENABLE_ZEROCOPY=ON, default isOFF-DLINK_RTL_APPS_WITH_STATIC_LIB=ON, default isOFF-DINSTALL_STATIC_LIB=ON, default isON
all cmake options are optional
-DCMAKE_INSTALL_PREFIX=/usrdefault install prefix on ubuntu.
mkdir build && cd build
cmake .. -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON
using make utility:
make -j$(($(nproc) + 1))
or build using cmake:
cmake --build . --config Release
setup into prefix, usually will require sudo:
sudo make install
sudo ldconfig
or build & install using cmake:
cmake --build . --config Release --target install
or if you manually build the package from the directory:
make install DESTDIR=build_folder_name
Latest releases builds - for Linux (amd64, i386, amrhf, arm64), macOS intel, Windows: (x86 32/64 + ARM64 MSVC and MinGW cross-builds), Android.
GitHub Actions builds - for Linux amd64 and macOS.
Nightly releases builds - for Linux, macOS, Windows: MSVC and MinGW cross-builds.
- Gqrx
- SDR++
- GNU Radio
- OpenWebRX
- SDRSharp
- CubicSDR
- HDSDR and other Winrad compatible programs using ExtIO_RTL
- etc
- a special USB vendor/product id got reserved at http://pid.codes/ : 0x1209/0x2832
- for such devices the linux kernel's DVB modules are not loaded automatically, thus can be used without blacklisting dvb_usb_rtl28xxu below /etc/modprobe.d/
- this allows to use a second RTL dongle for use with DVB in parallel
- the IDs can be programmed with 'rtl_eeprom -n' or 'rtl_eeprom -g realtek_sdr'
If your dongle is broken or unrecognized due to corrupted EEPROM data or a bad VID:PID (e.g. 0000:0000, ffff:ffff, 0bda:2831), you can restore it via rtl_eeprom -B without opening the case or shorting pins:
# Detect dongles with broken or corrupted IDs:
rtl_eeprom -B
# Restore default Realtek configuration:
rtl_eeprom -B -g realtek
# Or recover a specific bad VID:PID:
rtl_eeprom -B 1234:5678 -g realtekOn Windows, if the device has an invalid VID/PID (such as 0000:0000), it appears as an "Unknown USB Device". Open Zadig ("Options -> List All Devices") and install the WinUSB driver for it before running rtl_eeprom -B.
find_package(rtlsdr REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE
rtlsdr::rtlsdr # Recommended: automatically selects shared or static
# rtlsdr::rtlsdr_shared # Or link shared explicitly
# rtlsdr::rtlsdr_static # Or link static explicitly
)Classic/legacy CMake variables are also supported:
find_package(rtlsdr REQUIRED)
include_directories(${RTLSDR_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} PRIVATE ${RTLSDR_LIBRARIES})add_subdirectory(rtl-sdr)
# Target names and include directories are fully identical to find_package:
target_link_libraries(${PROJECT_NAME} PRIVATE
rtlsdr::rtlsdr # (or rtlsdr::rtlsdr_static / rtlsdr::rtlsdr_shared)
)find_package(PkgConfig REQUIRED)
pkg_check_modules(RTLSDR REQUIRED librtlsdr)
target_include_directories(${PROJECT_NAME} PRIVATE ${RTLSDR_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} PRIVATE ${RTLSDR_LIBRARIES})Based on developments by Oliver Jowett from mutability repo