RTL_FM_PLAYER allows FM Stereo listening with TimeShift and Recording functions, using RTL DVB-T compatible USB dongles on Linux and Windows. TimeShift function can go back some minutes in time to listen your song again. :musical_note: Use recording function save Stereo WAV files.
RTL FM Player is a small tool to listen FM stereo radio by using a compatible RTL DVB-T dongle. Is a console application that runs on Linux and Windows, all commands like changing stations and timeshifting is controlled by keyboard keys. Outputs stereo audio to soundcard using SDL library. Record stereo .wav file format.
The DVB-T dongle has to be based on the Realtek RTL2832U. See http://sdr.osmocom.org/trac/wiki/rtl-sdr for more RTL SDR details.
Or you can buy from Ebay, Aliexpress searching for "RTL SDR BLOG".
You need to install a new driver to use this dongle.
First time configuration, open a new terminal as root (sudo -s
or su
):
cd /etc/modprobe.d/
gedit ban-rtl.conf
Type this line in the text file you created:
blacklist dvb_usb_rtl28xxu
Save and exit.
Download project file rtl-sdr.rules and save as /etc/udev/rules.d/10-rtl-sdr.rules
cd /etc/udev/rules.d/
wget -O 10-rtl-sdr.rules https://raw.githubusercontent.com/rafaelferrari0/rtl_fm_player/master/rtl-sdr.rules
Install required libraries
apt-get install libusb-1.0 libsdl2-2.0
Download a compiled RTL FM Player here: >> Releases << (Linux versions)
[!TIP] Or you can compile a new one, see below in Building section.
Reboot.
1. Download Zadig driver https://zadig.akeo.ie/
2. Plug in the RTL-SDR USB.
3. Run Zadig as administrator by right clicking it and choosing run as administrator.
4. Go to Options -> List all devices and make sure it is checked.
5. In the drop down box choose Bulk-In, Interface (Interface 0). This may also sometimes show up as something prefixed with “RTL28328U”. That choice is also valid.
6. Make sure that WinUSB is selected as the target driver and click on Replace Driver.
1. Download version **zadig_xp-2.2.exe** from https://zadig.akeo.ie/downloads/
2. Plug in the RTL-SDR USB. Windows XP does not have drivers for it, just proceed "New Hardware Wizard" window to the end.
3. Run Zadig.
4. Go to Options -> List all devices and make sure it is checked.
5. In the drop down box choose Bulk-In, Interface (Interface 0). This may also sometimes show up as something prefixed with “RTL28328U”. That choice is also valid.
6. Make sure that WinUSB is selected as the target driver and click on Replace Driver.
On Linux open a console, extract one of the compiled release file, and type ./rtl_fm_player
On Windows just double click rtl_fm_player.exe
Type S
or W
to change frequency.
Use keyboard to control frequency, timeshift, mute and recording.
You can also open Command Prompt and type parameters manually:
C:\>rtl_fm_player.exe -h
./rtl_fm_player -h
Show all available parameters
rtl_fm_player -h
Start and tune to frequency in Hz
(97.7Mhz)
rtl_fm_player -f 97700000
Tune to frequency and record audio to FileName.wav
(Keyboard controls disabled)
rtl_fm_player -f 97700000 FileName.wav
On "modern" PCs (x86, x64) mono and stereo decoding should be possible easily. "Modern" is any processor from 2002 Year and UP. :satisfied:
Latency increase as SDL2 audio queue becomes larger. Buffer cleared when changing stations or Timeshifting.
[!NOTE] Tested on Debian 10 "buster" and Debian 12 "bookworm"
apt-get install cmake
apt-get install libusb-1.0-0-dev
apt-get install libsdl2-dev
[projectsourcedirectory]\build\linux
./1st-cmake.sh
./2nd-make.sh
MinGW64 manual installation. You can install to any directory name without spaces in root drive, (eg: C:\MinGW64-RTL, D:\MinGWTemp). In this example we install to C:\MinGW64
[!NOTE] Target is 64bit, compiler is 64bit.
Download latest mingw-w64 toolchain targeting architecture x86_64, win32 threads, seh exception
Extract the mingw-w64 toolchain 7zip file to root directory, keeping the structure:
C:\mingw64\
\bin
\etc
...
Download CMake Windows win64-x64 Zip file (not the installer)
Extract CMake Zip file inside C:\MinGW64\CMake
directory, keeping the structure:
C:\mingw64\cmake\
\cmake\bin
\cmake\doc
\cmake\man
\cmake\share
Download SDL2 Development Libraries for MinGW
Extract SDL2 zip file x86_64-w64-mingw32\lib\libSDL2.dll.a
to c:\mingw64\x86_64-w64-mingw32\lib\
Extract SDL2 zip directory x86_64-w64-mingw32\include\SDL2
to c:\mingw64\x86_64-w64-mingw32\include\SDL2
check the directory structure:
C:\mingw64\x86_64-w64-mingw32\include\SDL2\
\SDL.h
[!TIP] Note the x86_64-w64-mingw32 folder name.
Download libusb-1.0 7zip file
Extract libusb-1.0 Zip MinGW64\dll\libusb-1.0.dll.a
to c:\mingw64\x86_64-w64-mingw32\lib\
Extract libusb-1.0 Zip include\libusb-1.0\libusb.h
to c:\mingw64\x86_64-w64-mingw32\include\
Extract this project source to any subdirectory below c:\mingw64\
Enter subdirectory c:\mingw64\[projectsourcedirectory]\build\mingw64
Run:
1st-cmake.bat
2nd-make.bat
If successfull, compiled rtl_fm_player.exe
will be on [projectsourcedirectory]\build\mingw64\src
subdirectory.
\x86_64-w64-mingw32\bin\SDL2.dll
to src
\MinGW64\dll\libusb-1.0.dll
to src
MinGW32 manual installation. You can install to any directory name without spaces in root drive, (eg: C:\MinGW32-RTL, D:\MinGWTemp). In this example we install to C:\MinGW32
[!NOTE] Target is 32bit, compiler is 32bit.
Download latest mingw-w64 toolchain targeting architecture i686, win32 threads, dwarf exception
Extract the mingw-w64 toolchain 7zip file to root directory, keeping the structure:
C:\mingw32\
\bin
\etc
...
Download CMake Windows win32-x86 Zip file (not the installer)
Extract CMake zip file inside C:\MinGW32\CMake
directory, keeping the structure:
C:\mingw32\cmake\
\cmake\bin
\cmake\doc
\cmake\man
\cmake\share
Download SDL2 Development Libraries for MinGW
Extract in SDL2 tar.gz, the file i686-w64-mingw32\lib\libSDL2.dll.a
to c:\mingw32\i686-w64-mingw32\lib\
Extract in SDL2 tar.gz, the folder i686-w64-mingw32\include\SDL2
to c:\mingw32\i686-w64-mingw32\include\SDL2
check the directory structure:
C:\mingw32\i686-w64-mingw32\include\SDL2\
\SDL.h
[!TIP] Note the i686-w64-mingw32 folder name.
Download libusb-1.0 7zip file
Extract in libusb-1.0 7zip, the file \MinGW32\dll\libusb-1.0.dll.a
to c:\mingw32\i686-w64-mingw32\lib\
Extract in libusb-1.0 7zip, the file \include\libusb-1.0\libusb.h
to c:\mingw32\i686-w64-mingw32\include\
Extract this project source to any subdirectory below c:\mingw32\
Enter subdirectory c:\mingw32\[projectsourcedirectory]\build\mingw32
Run:
1st-cmake.bat
2nd-make.bat
If successfull, compiled rtl_fm_player.exe
will be on [projectsourcedirectory]\build\mingw32\src
directory.
\i686-w64-mingw32\bin\SDL2.dll
to src
\MinGW32\dll\libusb-1.0.dll
to src
Using old MinGW installer for Win32
\MinGW
(C:, D: ...) with packages mingw32-base-bin
and mingw32-pthreads-w32
\MinGW\CMake
(tar.gz file)\i686-w64-mingw32\lib\libSDL2.dll.a
to \MinGW\lib
(tar.gz file)\i686-w64-mingw32\include\SDL2
to \MinGW\include\SDL2
(tar.gz file)\i686-w64-mingw32\bin\SDL2.dll will be requered when runing rtl_fm_streamer.exe
(7zip file)\MinGW32\dll\libusb-1.0.dll will be requered when runing rtl_fm_streamer.exe
[projectsourcedirectory]\build\mingw
1st-cmake.bat
2nd-make.bat
This project is based on RTL SDR FM Streamer by Albrecht Lohoefener
RTL-SDR-BLOG library files from https://github.com/rtlsdrblog/rtl-sdr-blog
Libusb. A cross-platform library that gives apps easy access to USB devices
SDL. Simple DirectMedia Layer development library