FM Stations in Radio++

Write tutorials for LMDE here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post please read forum rules
Post Reply
duracell80
Level 3
Level 3
Posts: 111
Joined: Fri Sep 23, 2022 5:51 pm

FM Stations in Radio++

Post by duracell80 »

I have a fun little setup running local FM stations into the Radio++ applet using an SDR dongle.

Obtain hardware (RTL2832U)
https://www.amazon.com/NooElec-NESDR-Mi ... C95&sr=8-3

Any of the RTL's should work, I even got this working with one of the flight aware ADSB dongles and its 1090 antenna!

Install Radio++ from Cinnamon Spices
- Right Click the Cinnamon Panel, choose Applets
- Click Download tab and search for Radio++
- Install

Add Station To Radio++
- Right Click the Radio applet icon on your Cinnamon Panel
- Choose Configure
- Click My Stations tab and click +
- Title: Local Radio - 90.3FM
- URL: http://127.0.0.1:3344/90300000/1
- Click OK

- Add another station to Radio++ for example 91.1FM: http://127.0.0.1:3344/91100000/1


Setup RTL-SDR
Open Terminal

If you have a working RTL SDR install from apt and everything is blacklisted in /etc/modprobe.d/blacklist-rtl.conf, use that rtl-sdr else:

Code: Select all

$ sudo apt remove rtl-sdr
$ sudo apt install -y git vlc sox cmake libffi-dev libev-dev libssl-dev build-essential libusb-1.0-0-dev pkg-config
$ mkdir -p ~/git
$ cd ~/git
Now build from source

Code: Select all

$ sudo git clone git://git.osmocom.org/rtl-sdr.git
$ cd rtl-sdr
$ sudo mkdir build
$ cd build
$ sudo cmake ../ -DINSTALL_UDEV_RULES=ON
$ sudo make
$ sudo make install
$ sudo cp ../rtl-sdr.rules /etc/udev/rules.d/
$ sudo ldconfig
If building from source fails, use apt to install rtl-sdr, I just much rather compile for my hardware, the blacklist-rtl.conf is the crucial part in getting the hardware to work.

Code: Select all

$ sudo touch /etc/modprobe.d/blacklist-rtl.conf
copy into /etc/modprobe.d/blacklist-rtl.conf

blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830

Check entries and permissions in blacklist

Code: Select all

$ cat /etc/modprobe.d/blacklist-rtl.conf
$ sudo chown root /etc/modprobe.d/blacklist-rtl.conf
$ sudo chmod 644 /etc/modprobe.d/blacklist-rtl.conf
Plug In RTL-SDR USB Dongle with antenna attached - Reboot System

Code: Select all

$ reboot
Build RTL_FM_STREAMER
Open terminal again

Code: Select all

$ sudo apt install -y libev-dev
$ cd ~/git
$ git clone https://github.com/AlbrechtL/rtl_fm_streamer.git
$ cd rtl_fm_streamer
$ mkdir build
$ cd build
$ cmake ../
$ make
$ sudo make install

Test The Reception
This may require some exploration to get the right frequency and antenna placement. For the FM Station 90.3Mhz:

Code: Select all

$ rtl_fm -f 90.3M -s 200k -E deemp |  play -r 200k -t raw -e s -b 16 -c 1 -V1 - lowpass 16k
- Once there is a radio station coming in as clear as can be, take the FM frequency and multiply by 1,000,000 to use in the URL
- So 90.3Mhz becomes 90300000
- Run the server on port 3344

Test The Server

Code: Select all

$ rtl_fm_streamer -d 0 -P 3344 -s 200k
- Open VLC, Choose Media > Open Network Stream and type http://127.0.0.1:3344/90300000/1 as the network URL
- Hit Play
- If all is good in VLC you should be good for Radio++ too

Finally - Add Server To Autostart Apps
- In the Cinnamon Start Menu search for Startup Applications
- Click + and select Custom Command
- Name: Local Radio Server
- Command: rtl_fm_streamer -d 0 -P 3344 -s 200k
- Comment: FM to IP Radio Server
- Startup Delay: 30

Logout and back in again and wait for the streaming server to start on port 3344.

Now you can listen to local FM stations in Radio++! Note though that only one client can listen at a time, this is a limitation with rtl_fm_streamer. You can pipe the audio into icecast to listen to the same station from one dongle across multiple computers on the network.

In the US you might even be able to pick up your local weather tower:
https://www.weather.gov/nwr/Maps
Last edited by duracell80 on Tue Jan 03, 2023 10:54 pm, edited 3 times in total.
User avatar
Termy
Level 12
Level 12
Posts: 4248
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: FM Stations in Radio++

Post by Termy »

This is pretty cool. I love the idea of listening to FM radio from the PC.

You forgot an important step after this point:

Code: Select all

sudo touch /etc/modprobe.d/blacklist-rtl.conf
If the file is created, you should ensure it's in the 'root' group, owned by 'root', and is at most rw-r--r-- (644), to use the ls(1) symbolic form of the mode. Since the file is created by 'root', it should be owned by 'root', and will likely be in the 'root' group. The mode, however, is not guaranteed to be 644.

BTW, 'root' access is not required to reboot or systemctl reboot Linux Mint.
I'm also Terminalforlife on GitHub.
duracell80
Level 3
Level 3
Posts: 111
Joined: Fri Sep 23, 2022 5:51 pm

Re: FM Stations in Radio++

Post by duracell80 »

Ah-ha thank you for the permissions tip. Hope this setup is helpful, I use it quite a lot. I wonder if maybe there is a buffering consideration with rtl_fm_streamer, I find VLC to the the smoothest playback but Radio++ is right there.
Post Reply

Return to “Tutorials”