Coder Social home page Coder Social logo

nrsc5-gui's Introduction

NRSC5-GUI is a graphical interface for nrsc5.
It makes it easy to play your favorite FM HD radio stations using an RTL-SDR dongle.
It will also display weather radar and traffic maps if the radio station provides them.

Dependencies

The folowing programs are required to run NRSC5-GUI

Setup

  1. Install the latest version of Python 3, PyGObject, Pillow and PyAudio.
  2. Compile and install nrsc5.
  3. Install nrsc5-gui files in a directory where you have write permissions.

The configuration files will be created in the same directory as nrsc5-gui.py. An aas directory will be created for downloaded files and a map directory will be created to store weather & traffic maps in.

Usage

Open the Settings tab and enter the frequency in MHz of the station you want to play.
Select the stream (1 is the main stream, some stations have additional streams).
Set the gain to Auto (you can specify the RF gain in dB in case auto doesn't work for your station).
You can enter a PPM correction value if your RTL-SDR dongle has an offset.
If you have more than one RTL-SDR dongle, you can enter the device number for the one you want to use.

After setting your station, click the play button to start playing the station.
It will take about 10 seconds to begin playing if the signal strength is good.
Note: The settings cannot be changed while playing.

Album Art & Track Info

Some stations will send album art and station logos. These will be displayed in the Album Art tab if available.
Most stations will send the song title, artist, and album. These are displayed in the Track Info pane if available.

Bookmarks

When a station is playing, you can click the Bookmark Station button to add it to the bookmarks list.
You can click on the name in the bookmarks list to edit it.
Double click the station to switch to it.
Click the Delete Bookmark button to delete it.

Station Info

The station name and slogan is displayed in the Info tab.
The current audio bit rate is displayed in the Info tab. The bit rate is also shown on the status bar.

Signal Strength

The Modulation Error Ratio for the lower and upper sidebands is displayed in the Info tab.
High MER values for both sidebands indicates a strong signal.
The Bit Error Rate is shown in the Info tab. High BER values will cause the audio to glitch or drop out.
The average BER is also shown on the status bar.

Maps

When listening to radio stations operated by iHeartMedia, you can view live traffic maps and weather radar. The maps are typically sent every few minutes and will be displayed once loaded.
Clicking the Map Viewer button on the toolbar will open a larger window to view the maps at full size.
The weather radar information from the last 12 hours will be stored and can be played back by selecting the Animate Radar option. The delay between frames (in seconds) can be adjusted by changing the Animation Speed value.

Map Customization

The default map used for the weather radar comes from OpenStreetMap. You can replace the map.png image with a map from any website that will let you export map tiles.
The tiles used are (35,84) to (81,110) at zoom level 8. The image is 12032x6912 pixels.
The portion of the map used for your area is cached in the map directory. If you change the map image, you will have to delete the base_map images in the map directory so they will be recreated with the new map.

Screenshots

album art tab info tab settings tab

bookmarks tab map tab

Version History

1.0.0 Initial Release
1.0.1 Fixed compatibility with display scaling
1.1.0 Added weather radar and traffic map viewer
2.0.0 Updated to use the nrsc5 API

nrsc5-gui's People

Contributors

argilo avatar cmnybo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nrsc5-gui's Issues

Installing nrsc5-gui-2.0.0 in MSYS2 MinGW x64 under Win. 11

Hi, I was wondering if anyone was able to install nrsc5-gui within MSYS2 MinGW x86/x64? I don't know how to build the program or run it in MSYS2. I installed all of the prerequisite packages that were listed for nrsc5_gui under the code tab, but I'm not sure if I should type CMAKE, or INSTALL, or some other command?
Screenshot 2022-01-26 223042

cannot complete long list of dependencies. Pillow will not install.

python3 -m pip install --upgrade Pillow
Collecting Pillow
Using cached Pillow-7.1.2.tar.gz (38.9 MB)
Building wheels for collected packages: Pillow
Building wheel for Pillow (setup.py) ... error
ERROR: Command errored out with exit status 1:
Complete output (155 lines):
'gcc' is not recognized as an internal or external command,
operable program or batch file.

Is it possible to build a windows executable and make this a little easier to install?

Feature Request: integrating Traffic and Weather Maps

I'm currently trying nrsc5-gui on a stand-alone Raspberry Pi 3 B+ as my work desk radio. I also often use the hdfm.py program from KYDronePilot/hdfm to check out traffic and weather maps. Switching back and forth is do-able, but integrating the two together would be awesomeness. Incorporating the two maps as additional tabs, similar to the Album Art tab.

Audio keeps momentarily going silent with a underrun error

On any station I go to I get the error ALSA lib pcm.c:8424:(snd_pcm_recover) underrun occurred about every 9 seconds. The error rate is always 0.00% and if I listen with the command line application it's perfectly fine so it's not a problem with my setup.

Enhancement Requests: UI Tweaks for Usability

I have a question and a few suggestions for things that may make the software a bit friendlier. I love it as-is, of course, but could see benefits from minor adjustments.

  1. Are the Station Logos, as opposed to the Album Art, shown anywhere in the software? I ask because on WTOP (for example) I see the logos in the appropriate folder, but didn't happen to observe them in the software. If not, perhaps this can be integrated somehow. I don't have any brilliant ideas off-hand for a good location. (I also cannot see Album Art, even though it's present in the folder. I assume I'm missing a dependency or something.)

  2. Move the Frequency and Stream selector out of the Settings menu and into its own pane above the tabs. This is likely the most used feature in the software, and it would be much easier to not have to switch tabs in order to make changes to it, just Stop, change Freq/Stream, then Play and continue use.

  3. When the gain is set to Auto, add the gain value to the status bar, perhaps to the right of the error count. It may also make sense to have Auto checked by default.

  4. Make each of the current status bar entries one character wider. On my Linux system, the last "r" in "Error" gets cut off, as does the last letter in the call sign sometimes. On my Mac this does not happen, so I know it's ultimately a font issue, but widening it by one character seems straight-forward and might help people out.

Python 3x -> no 'md5' module

Doesn't want to work with Python 3x. It says it can't find 'md5'. Where would I get that from since it's been replaced with hashlib?

`D:\projects\nrsc5-gui-master>python ./nrsc5-gui.py
Traceback (most recent call last):
File "./nrsc5-gui.py", line 20, in
import os, sys, shutil, re, tempfile, md5, gtk, gobject, json, datetime, ImageFont, ImageDraw, numpy, glob, time
ModuleNotFoundError: No module named 'md5'

D:\projects\nrsc5-gui-master>`

Map/Radar image size on "Maps" tab

Took some work, mostly around getting PIL happy, but got NRSC5-GUI running under Ubuntu 18 LTS. Audio plays, album-art works, external window radar/maps scaling and working just fine.

However, the views on the "Album Art" and "Maps" tabs are small. 20% of the window or so, centered, don't scale when the window is resized. Working as intended, or bug?

Display of additional metadata (genre, audio/data service types)

Pretty new to this and late to the party...

After a few days playing around with this, was thinking about adding the following:

  1. Adding "Genre" to the track listing. Like "Album", it's not often used, but it's there sometimes.
  2. Adding the various audio types for each stream to the Info tab. For one thing, it helps to know how many streams are actually being used by each station, and what each is providing. Ultimately this could be used to limit the stream selector at the top to just the number of streams actually being used.
  3. Adding the various data types for each station to the Info tab. Like the audio types, this helps to know which ones are providing image maps/navigation for weather and traffic.

I'm not a Python developer, but I've made some preliminary changes to nrsc5_gui.py and main_form.glade to display these things. I can provide a diff to the one provided in 2.0.0 if interested.

Some images:
Screen Shot 2021-01-24 at 9 27 19 PM
Screen Shot 2021-01-24 at 9 28 14 PM

Excellent GUI + NOAA WX enhancement.

Just dropping a note to say thank you for the ability to get maps easily and the general well thought out UI.

I could imagine NOAA weather radios being able to show radar images if the right folks got together to hash it out. When our tornado came through we lost power and our cellphone signals were jacked up for a week. No TV, no real way to get radar images on phone without driving into a signal, all the weather apps failed to get data and another storm was coming in behind the tornado.

Your software shows the potential to get weather information on laptop in an emergency when the cell towers are down and Internet is harder to access.

Is there a python script that you could help me write to dump the map images to a folder every few minutes without running the GUI?

Audio starts but no data is read

When I start a station it will play the audio and images are downladed into aas but there's no song info, album art dosen't show, and no maps work. I'm running this on Ubuntu 18.10

New Service Data Type / MIME Type found

Came across a station (99.1, Zarephath, NJ) with the following:
Data service: public, type: Unknown, MIME type aa8
and
SIG Service: type=data number=38 name=TEST_STR_E
Data component: id=0 port=2001 service_data_type=511 type=0 mime=B81FFAA8

511 is not enumerated as a valid Service Data Type, nor is 0xB81FFAA8 as a valid MIME Type, which causes some errors to be displayed.

Added as 'UNKNOWN' under class ServiceDataType and class MIMEType respectively in nrsc5.py to quiet the errors.

Running under MacOS 10.15

Just wondering if anyone has gotten this to work properly under MacOS. I have all the prerequisites brewed (installed) and I can launch the GUI, but there are many errors generated, and eventually, python crashes.

Just wondering if there are any good folks out there running this on a Mac that could help me figure this out.

Thanks for the cool project!

Error leading to choppy Audio (May be caused by PyAudio)

Hi Devs,

I gave this project a try because it looks neat. It works okay but I get a slight problem on my Ubuntu 20.04 Laptop that causes choppy audio. Here is the output to console.

ALSA lib pcm.c:8526:(snd_pcm_recover) underrun occurred.

Not sure what that is, but it causes audio to be choppy. I tried the solution posted in the Raspberry Pi Solution but it did not work. I'm not sure if this has to do with my signal quality but when I run programs like hdfm I have absolutely no issue. I know Nrsc5 itself has no problems either. Like what does those programs do right that this one does not?

Previous Stream "Sticking" After Change

I'm not sure this is a bug so much as an odd behavior, which may be inherent to Gtk or something. For example, I'm tuned to an HD1 right now. If I hit Stop, then replace the Stream ID with a "2", then immediately hit Play, it tunes back into the HD1. Now, if I hit Stop again, then without touching anything, hit Play, now I'm tuned to HD2.

It appears that what's happening is that although I've replaced the text, because I've not hit Tab or Enter before hitting Play, it's not registering that I've changed it to a HD2 until I hit Stop again. Then, when I again hit Play, it properly registers.

I'm not sure this is worth fixing or fixable at all, but thought I would flag it in case someone else runs into it. It took me a day or two to figure out why it kept "sticking" like that.

Choppy audio on Raspberry Pi

I've got nrsc5 compiled for Raspberry Pi and that is working fine (40% CPU usage on a single core of a 3B+, audio is smooth, signal comes in great). Playing through a USB sound card rather than the Pi audio out.

nrsc5-gui however seems to play very choppy, even on a Pi 4. This is not the case when I run it on an x86-64 PC. I've tried fiddling around with the queue size but it doesn't seem to have any effect.

The Pi does not seem to be sweating too hard at decoding the audio itself, when running just nrsc5, it's just when it's run through the gui.

Any ideas?

nrsc5-gui works in MSYS2MINGW64, however it can't find certain .dll files

Hi, I was almost able to get nrsc5-gui to run perfectly well on my laptop running Windows 11, it just can't find a .dll file however called "libnrsc5.dll". I know that the command line program nrsc5.exe and libnrsc5.dll are supposed to be together after building nrsc5.exe, however I don't know where to place those files in the nrsc5-gui folder. Can someone help direct me to the last few steps needed to get nrsc5-gui working?
2022-12-23 (2)
2022-12-23 (3)
2022-12-23 (4)

rtl_tcp support

So I typically have my SDR attached to a remote Raspberry Pi, and then I connect to that so I can listen to things over the network. Does the GUI support this setup? I typically do the following from the command line:

On my raspberrypi: sudo rtl_tcp -a 10.0.3.72 <-- starting the radio server
Then from my computer: nrsc5 -H 10.0.3.72:1234 94.9 0 <-- connecting to it so I can listen to a station

I see a place to put in a number for the device assuming it's connected locally, but not a specific way to point it at an IP address. Any ideas? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.