Coder Social home page Coder Social logo

markjfine / nrsc5-dui Goto Github PK

View Code? Open in Web Editor NEW
139.0 13.0 9.0 21.65 MB

An enhanced, user-friendly version of nrsc5-gui that is not heavily dependent upon Python processing for audio generation.

License: GNU General Public License v3.0

Python 100.00%
radio sdr python

nrsc5-dui's Introduction

NRSC5-DUI is a graphical interface for nrsc5. It makes it easy to play your favorite FM HD radio stations using an RTL-SDR or SDRPlay dongle. It will also display weather radar and traffic maps found on most iHeart radio stations.

This version is really a fork of a fork of the original nrsc5-gui: The first was developed by cmnybo and subsequently modified by zefie. It merges the features of the former to the architecture of the latter, while adding several additional control and display features.

As such, we have changed the name to 'DUI' as a play on the Italian word for 'two', this being a second generation graphical user interface for nrsc5. (I'll be here all week. Please tip your waitresses.)

Dependencies

The following programs are required to run NRSC5-DUI

It is also assumed you have a fully operational Gtk3 environment installed from Homebrew, if running on macOS.

Setup

  1. Install the latest version of Python, PyGObject, Pillow, and other python dependencies. Once Python is installed, you may install the dependencies by giving the command pip install -r <path_to requirements.txt>
  2. Compile and install nrsc5. Certain features of nrsc5-dui use nrsc5's debug output. Please remember to add the -DLIBRARY_DEBUG_LEVEL=1 option during the cmake build phase. If using an SDRPlay, you must compile and install the version provided by fventuri.
  3. Install nrsc5-dui files in a directory where you have write permissions.

The configuration and resource directories will be created in a new cfg and res directory under where nrsc5-dui.py resides. Similarly, an aas directory will be created for downloaded files and a map directory will be created to store weather & traffic maps. The aas, cfg, and map directories may optionally be created in a separate user-defined path as specified within a $NRSC5DUI_DATA environment variable.

nrsc5 should be installed in a directory that is in your $PATH environment variable. Otherwise the full path to nrsc5 (e.g., /usr/local/bin/) may be entered at runtime (see Usage for details, below).

Windows 10 setup notes

One of the goals of this project was to provide a stand-alone, cross-platform application. Please note that NRSC5-DUI will not operate natively in this manner under Windows 10 at this time. This is even when built under a MinGW environment (such as MSYS2) or cross-compiled using MinGW-compatible compilers. The issues found are as follows:

  1. The resulting RTL_SDR library used by NRSC5.EXE doesn't seem to work correctly with respect to communicating with the RTL-SDR dongle, as well as any appropriate signal detection and bit error rate evaluation. There has been some success in getting NRSC5.EXE to run using the -H option when the dongle is operating under RTL_TCP on another platform, but again, that's outside a stand-alone operating environment. There is also a question of whether NRSC5.EXE responds to keyboard input properly under a MinGW-environment, which may preclude changing streams (0 thru 3 keypress) as well as exiting it properly (qkeypress) without typing Ctrl-C.
  2. PyGObject, which is a critical module, seems to require an older version of Microsoft C/C++ in order to properly build the gi library. This is true when trying to install it using either pip or pacman, however, some have had success installing PyGObject using conda.
  3. Win10, which is not Posix-compliant, does not provide a good pty solution under Python. This is required to spawn and interact with NRSC5.EXE via a pipe. WinPty does exist as an alternative, however it requires a complete rewrite of how the current version of NRSC5-DUI operates. This does not appear to be an issue when running under a MinGW environment.

The bottom line is that some have had success installing and running the application and it's dependencies under specific MinGW environments such as WSL2, but may still require the dongle to operate under RTL_TCP and not directly via NRSC5.EXE. Some legacy Windows executables and libraries have been provided in the bin directory for those that wish to experiment further. Feel free to use them at your own risk.

Usage

Please ensure your RTL-SDR dongle or SDRPlay is first connected to an available USB port. Then, from the terminal, start nrsc5-dui by entering: python3 nrsc5-dui.py or something like: python3 nrsc5-dui.py /usr/local/bin/ The latter includes the path to nrsc5 when using scripts (like Apple Script) that seemingly ignore the environment.

Settings

You may first change some optional parameters of how nrsc5 works from the Settings tab in nrsc5-dui:
Set the radio you are using to either RTL_SDR or SDRPlay.
Set the gain to Auto, or optionally enter an RF gain in dB that has known to work well for some stations.
Enter a PPM correction value if your RTL-SDR dongle has an offset.

If using an RTL_SDR:
Enter the number of the desired device if you have more than one RTL-SDR dongle.
Enter the IP address that rtl_tcp is listening to and check the Enabled box if you are using a remote RTL-SDR.

If using an SDRPlay:
Enter the serial number of the SDRPlay.
Enter the antenna port used by the SDRPlay.

Other settings:
Check Log to file to enable writing debug information from nrsc5 to nrsc5.log.
Check Download Album Art to enable automated downloading of album art from MusicBrainz.
Check Include Station Art to display album art that is generated by the station in addition to downloading from MusicBrainz.
Check Extended Queries to apply several MusicBrainz queries to find album art. Turning this option on may be slower than non-extended queries.

Playing

Enter the frequency in MHz of the station you want to play and either click the triangular Play button on the toolbar, or just hit return. When the receiver attains synchronization, the pilot in the lower left corner of the status bar will turn green. It will return to gray if synchronization is lost. If the device itself becomes 'lost', the pilot will turn red to indicate an error has occurred (this is the theory, though I've yet to see this status message happen in practice). The synchronization process may take about 10 seconds, and the station will begin to play. This depends upon signal strength and whether it's relatively free from adjacent interference. After a short while, the station name will appear to the right of the frequency, and the available streams will show on the two rows of buttons just beneath the frequency entry. Clicking one of these buttons will change to that particular stream. Note: No settings other than stream may be changed while the device is playing.

Album Art & Track Info

Some stations will send album art and station logos. These will fill the Album Art tab, as they are made available by the station. Most stations will send the song title, artist, album, and genre. These are displayed in the Track Info pane, also if available. The user can override what the stations send by enabling the DL Album Art setting. This will use the Title and Artist information to retrieve album art from MusicBrainz. If no album art is found, the station logo will be used, if available. The title, artist, album, and genre (if available) will be cached when new album art is found, and will be automatically displayed when that art is used. The user can change the logo of the playing station by right-clicking in the Album Art area. This will display a popup prompting you for the URL of an image found on the web. Pasting the URL in the box and clicking 'Ok' will download the image and set the logo of the playing station with it.

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 tune to that particular station and stream. Click the Delete Bookmark button to delete it. Note that some stations use the default MPS/SPS or HDn naming for their streams. In this case, the respective bookmark will be used to name the stream button.

Station Info

The station name, slogan, message, and optional alert message will display if the station as pre-programmed them. The current audio bit rate will be displayed here as well as on the status bar. The station's available streams and data services, with a description of each will display, as the station has pre-programmed them. This is a useful feature for noting which stations have Total Traffic & Weather Network traffic and weather images.

Signal Strength

The Modulation Error Ratio for the lower and upper sidebands are displayed as they are determined. Important: High MER values for both sidebands indicates a strong signal. The current, average, minimum and maximum Bit Error Rates will also be displayed as they are determined. High BER values will cause the audio to glitch or drop out. The current BER is also shown on the status bar and may be used as a tuning tool.

Maps

When listening to radio stations operated by iHeartMedia, you may view live traffic maps and weather radar. The images are typically sent every few minutes and will fill the tab area once received, processed, and 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. Other stations provide Navteq/HERE navigation information... it's on the TODO 'like to have' list.

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 BaseMap 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
1.2.0 zefie update to modern nrsc5 build
2.0.0 Updated to use the nrsc5 API
2.1.0 Updated and enhanced operation and use
2.2.0 Updated for use with SDRPlay and operates with up to 8 possible audio channels (per nrsc5 spec)

nrsc5-dui's People

Contributors

andylhxu avatar bleonard252 avatar markjfine 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nrsc5-dui's Issues

Installing nrsc5-dui on Windows 11

Hi, I understand that at this point of time, there isn't an official .exe version of nrsc5-dui for Windows computers, so yesterday I tried to compile the source code for nrsc5-dui in MSYS2 MinGWx64 and MSYS2 MinGWx86. I keep running into this problem where the setup.py file can't find a module called gtk+ and I know that I have gtk2 and gtk3 installed in MSYS2 MinGWx64, so I'm not sure how to fix this error message.
image

[macOS] Album Art does not display in the UI.

In the title. For some reason even if musicbrainz or a stations album art is downloaded and is present in nrsc5-duis files, in macOS, the UI does not display it. This problem does not happen in Ubuntu Linux though. I don't know if its my packages but I did use pip to install the requirements.txt. nrsc5-dui 2.2.1 is the last version able to display album art in the UI. This also affects the traffic and weather map features as well.

GUI Too Big for smaller screen resolutions.

This program has been working very well on my 1080p+ displays however I recently got a older laptop with a 1366x768 display and the GUI is cut off by the "taskbar". I am running Ubuntu 20.04 with KDE.

Segmentation fault when tuned to certain radio stations

Reproed on ubuntu 22.04 running on certain stations at certain times. I’m guessing that certain metadata would cause the program to crash.

(venv) ➜  nrsc5-dui git:(master) ✗ python nrsc5-dui.py
Using Pillow v9.4.0
['nrsc5', '--dump-aas-files', '/home/andyxu/Documents/nrsc5-dui/aas', '-H', '192.168.1.6:1234', '105.9', '0']
[1]    88793 segmentation fault (core dumped)  python nrsc5-dui.py

What logs could be helpful to debug?

Possible to run without an audio device?

I'd like to capture to files, and the dusty machine nearest to where I can plug in the antenna doesn't have an audio device. Is there a way to configure the app to only dump to audio files?

I did get it to compile and run in Ubuntu, and got as far as

$ more nrsc5.log 
15:32:17 Unable to open audio device.

Testing Notes

Thank you for doing this! The audio works very well.

My System- Ubuntu 20.04

I do have only one issue I see right now and it's this

Mar 27 17:22:02 : Error: Unable to load station logo database
Mar 27 17:22:02 : Error: Unable to load config
Mar 27 17:22:43 : Error: Unable to save config

Not sure if this is a WIP still but I cannot save favorites or save the station logos. The album art works fine though. Do you know any fixes? besides that it works awesome!

Analog (analogue) Radio Implmentation [Long Term Goal]

Starting this issue in case someone starts working or wants to start working on implementing the following features and want's a good place to document problems and progress. This is somewhat extended from the original goal but not by much.

  • Broadcast FM Support with RDS
  • Broadcast AM Support with C-QUAM
  • SW Radio support (would just require a change of frequency range of AM)
  • DRM Support for AM/SW (I'm assuming)
  • NOAA Weather Radio (Narrow Band FM, 162-164Mhz)
  • Scanning functionality

I think building it off of something like rtl_fm might be a good starting point. Since Nrsc5-DUI is just a frontend, it's better to have a way to do the demodulation and audio processing outside of the python program.

TODO List

  • 1. Code Cleanup. I've been fooling around with the app on Linux as well and seems like it's doing what it's supposed to do. I'd really like to start cleaning up the code style and make it look closer to 2.0... given time.
  • 2.a. Stream Names: I'm a little disappointed in some of these stations' sloppy implementation. Naming a stream MPS/SPS1/SPS2 is pretty lazy. Think I'll write something that looks in the bookmarks and uses the name in there as an alternative.
  • 2.b. Stream buttons or labels should not change the stream if they have no text. No point in selecting a stream that is not used.
  • 3.a. Logos: Right now, the stations broadcast logos for each stream, but the app only applies it to the logo list if you're tuned to it when it's received. I understand the reasoning for that, but think it should be applied when received whether you're turned to the stream or not.
  • 3.b. Investigate why new logos aren't showing unless already cached in stationLogos.json, requiring a restart.
  • 3.c. Added quick capability to change the station logo of the playing station.
  • 4.a. Covers: Modify the way the album art works as a repository to move and consolidate the images out of the main aas directory that can be recalled later when the ID3 info changes. Hierarchy should be set up as: Artist, album, and song (the latter solely for image reference purposes).
  • 4.b. Also provide a means for the user to correct an image using an online database such as Discogs.
  • 4.c. Investigate why/how Discogs is now 403-ing automated searches and/or find another source - Now coming from MusicBrainz via the musicbrainzngs pip3 module.
  • 4.d. Need to fix downloading of cover images using musicbrainzngs.
  • 4.e. Add ability to display or not display any station-generated cover art when downloading from MusicBrainz.
  • 4.f. Add facility to manually import cover art in case automated download fails: Add a magifying glass button on the toolbar. When clicked, it displays a dialog with the Title and Artist. Button on dialog spawns a web browser with the appropriate MusicBrainz query. Copy/Paste the URL for the image you want, as well as the applicable Album and Genre metadata, and click Ok (or Cancel). Image would then be downloaded to the repository and metadata is cached in the database as if it was an automated download.
  • 5. Album Art Tab Redesign: Also thinking about redesigning the Album Art tab to look more like how a car radio might actually look. Maybe split the area into a line at the top that shows the station call and small image of the logo in the upper right (or to the right of where I have the call showing now), a couple of small lines at the bottom that show the slogan and message, and then flash the covers as they come in the center between them. Some don't have covers, so that would be a larger static version of the logo. If I find a way to do it, I'll put the slogan and message on one line, and make it crawl across the bottom.
  • 6. Alternate Nav Data: I want to research how Navteq/HERE works and see what can be done with it. Seems like another source of info in case an iHeart station isn't available. There are other digital services that are used that can also be taken advantage of.
  • 7. Traffic Timestamps: I have no idea why they left the timestamp off the traffic maps. That thing could be five days old and you'd never know it. At the least I'll add the timestamp, or have something on there that displays the dtg that the file was saved so it doesn't obscure part of the map.
  • 8. Use With Other Radios: I'd like to modify nrsc5 to work with my AirSpy HF Discovery, maybe my first priority. The RTL-SDR is a nice toy, and it does a lot of things, but there are a lot of problems trying to use it for something like this. There are a lot of other stations that I'm sure an AirSpy would be able to pick up that are otherwise getting washed out on an RTL-SDR. I put a feeler out to see if anything's being done to use other receivers, but that kind of fell flat.
  • 8.a. AirSpy HF+ Discovery
  • 8.b. SDRPlay (various models)
  • 9. Long-term goal: Expand operation past nrsc5 into other modes for broadcast and utility listening.
  • 9.a. Add Other Modes: Add standard FM Stereo with RDS, AM with C-QUAM, SW with DRM.
  • 9.b. Add VHF utility support: Weather band radio, scanning, decoding of trunked transmissions, etc.
  • 10. NRSC5 Path: Automate finding the absolute path to nrsc5. Hardcoding line 68 of nrsc5-dui.py won't work for everyone.
  • 11. Redundant Files: Remove redundant files in the repository to reduce clutter and confusion. No need to have images and glade files in root, when the app looks for them in res
  • 12. Ellipcize and add tooltips to ID3 info (title, artist, album, genre) in case text exceeds display limitations.
  • 13. Eliminate threading and stock icon deprication warnings.
  • 14. Detect if RTL-SDR is actually connected before starting nrsc5.
  • 15. Add feature to run nrsc5 remote via rtl_tcp (-H <IP>). Save setting and IP to cfg for next run.
  • 16. Convert for Win11 operation.
  • 17. Add an alternate layout with eight buttons in one row at the top, with the body underneath consisting of the tabbed section on the left and the id3 details on the right.
  • 18. Add a Docker container for Linux installations.
  • 19. Add a capability to read/write IQ files as well as to save audio to wav files in lieu of a PC sound system.

Reception Notes

Not an issue, per se, but thought I'd start a section specifically for general reception discussion.

In addition to many on FM, there are now several all-digital AM stations listed, with one starting 24 May 21. I'd be interested to hear how well nrsc5 can decode to determine if it's worth adding such functionality in nrsc5-dui (requires several additional switches to be set):

  1. 820kHz WWFD Frederick MD.
  2. 1230kHz WFAS White Plains, NY (b. 24 May 21)
  3. 1310KHz WTLC Indianapolis, IN (some doubt about this one)
  4. 1450kHz WIOE South Whitley, IN (may have ceased)

Support for NRSC5 executables built for SDRplay functionality?

Hi, I use an SDRplay RSPdx device instead of the RTL ones and was able to build and use a forked version of nrsc5 that supports it no problem. A few of the command-line arguments are a little different than the RTL ones though and I wondered if you might be able to add a few tweaks so that nrsc5-dui can spit out the right flags for device id and allow you to tweak the gain settings? I don't know if you are still actively working on the project, but just figured i'd ask! nrsc5-dui is an awesome program!

Feature Request/Dark Mode

Would it be possible to implement a dark mode? The white window background can be particularly eye-searing in dim settings. Maybe a black background with light gray text. Thanks for all the work you've put into this app. I've enjoyed it immensely. I set aside an entire mini-HTPC as my HD Radio infotainment center and placed it in my kitchen.

IMG_20220217_104836

GUI fails sporadically

Linux HOLLIN 6.1.0-10-amd64 theori-io/nrsc5#1 SMP PREEMPT_DYNAMIC Debian 6.1.38-2 (2023-07-27) x86_64 GNU/Linux

MX Linux MX-23.1, KDE Plasma 5.27.5, Debian 12.2

NRSC5-DUI 2.2.2, newly downloaded and installed.

nrsc5 revision theori-io/nrsc5@80ab64e, RTL-SDR v3 receiver, using the dipole attenna.

Often, but not everytime, the nrsc5-dui gui will crash. The nrsc5 process it spawned to play the SDR feed continues. As I type this, the GUI is gone, yet I'm hearing the Channel. This is the output for this event (note that I'm starting it in the background, which is what the &! is for, a ZSH shell command; the behavior occurs whether I do this 'start in the background' or not):

*[master][~/bin/nrsc5-dui]$ ./nrsc5-dui.py &!
*[master][~/bin/nrsc5-dui]$ Using Pillow v9.4.0
['nrsc5', '--dump-aas-files', '/home/guyst/bin/nrsc5-dui/aas', '89.90000000000002', '0']

*[master][~/bin/nrsc5-dui]$ ['nrsc5', '--dump-aas-files', '/home/guyst/bin/nrsc5-dui/aas', '104.1', '1']
**
Gtk:ERROR:../../../gtk/gtkcssinheritvalue.c:33:gtk_css_value_inherit_free: code should not be reached
Bail out! Gtk:ERROR:../../../gtk/gtkcssinheritvalue.c:33:gtk_css_value_inherit_free: code should not be reached
**
Gtk:ERROR:../../../gtk/gtkcssinheritvalue.c:33:gtk_css_value_inherit_free: code should not be reached
Bail out! Gtk:ERROR:../../../gtk/gtkcssinheritvalue.c:33:gtk_css_value_inherit_free: code should not be reached

*[master][~/bin/nrsc5-dui]$ ps | grep nrsc5 
guyst    3676075       1  3 20:38 pts/14   00:00:00 nrsc5 --dump-aas-files /home/guyst/bin/nrsc5-dui/aas 104.1 1
guyst    3676385  864985  0 20:38 pts/14   00:00:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox nrsc5

I can restart nrsc5-dui, but it does not recognize that nrsc5 is currently running and was started by it before it crashed.

Potential New Issue (caused by new Python 3.12 build)

Hello everyone,

One of Numpy's dependencies that NRSC5-DUI uses "distutils" is no longer available for use in Python 3.12 (Python 3.11 and below is unaffected) Here's the log proving this:

pauld@Pauls-Air nrsc5-dui-master-3 % pip3 install numpy==1.25.1
Collecting numpy==1.25.1
Using cached numpy-1.25.1.tar.gz (10.4 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
ERROR: Exception:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 180, in exc_logging_wrapper
status = run_func(*args)
^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_internal/cli/req_command.py", line 245, in wrapper
return func(self, options, args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_internal/commands/install.py", line 377, in run
requirement_set = resolver.resolve(
^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 95, in resolve
result = self._result = resolver.resolve(
^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers.py", line 397, in resolve
self._add_to_criteria(self.state.criteria, r, parent=None)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _add_to_criteria
if not criterion.candidates:
^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_vendor/resolvelib/structs.py", line 156, in bool
return bool(self._sequence)
^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 155, in bool
return any(self)
^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, in
return (c for c in iterator if id(c) not in self._incompatible_ids)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 47, in _iter_built
candidate = func()
^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 211, in _make_candidate_from_link
self._link_candidate_cache[link] = LinkCandidate(
^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 293, in init
super().init(
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 156, in init
self.dist = self._prepare()
^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 225, in _prepare
dist = self._prepare_distribution()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 304, in _prepare_distribution
return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_internal/operations/prepare.py", line 525, in prepare_linked_requirement
return self._prepare_linked_requirement(req, parallel_builds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_internal/operations/prepare.py", line 640, in _prepare_linked_requirement
dist = _get_prepared_distribution(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_internal/operations/prepare.py", line 71, in _get_prepared_distribution
abstract_dist.prepare_distribution_metadata(
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_internal/distributions/sdist.py", line 54, in prepare_distribution_metadata
self._install_build_reqs(finder)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_internal/distributions/sdist.py", line 124, in _install_build_reqs
build_reqs = self._get_build_requires_wheel()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_internal/distributions/sdist.py", line 101, in _get_build_requires_wheel
return backend.get_requires_for_build_wheel()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_internal/utils/misc.py", line 751, in get_requires_for_build_wheel
return super().get_requires_for_build_wheel(config_settings=cs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_impl.py", line 166, in get_requires_for_build_wheel
return self._call_hook('get_requires_for_build_wheel', {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_impl.py", line 321, in _call_hook
raise BackendUnavailable(data.get('traceback', ''))
pip._vendor.pyproject_hooks._impl.BackendUnavailable: Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend
obj = import_module(mod_path)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1381, in _gcd_import
File "", line 1354, in _find_and_load
File "", line 1304, in _find_and_load_unlocked
File "", line 488, in _call_with_frames_removed
File "", line 1381, in _gcd_import
File "", line 1354, in _find_and_load
File "", line 1325, in _find_and_load_unlocked
File "", line 929, in _load_unlocked
File "", line 994, in exec_module
File "", line 488, in _call_with_frames_removed
File "/private/var/folders/km/54dq7_d51zqf9m4tvl7ym_dm0000gn/T/pip-build-env-2au57ow3/overlay/lib/python3.12/site-packages/setuptools/init.py", line 10, in
import distutils.core
ModuleNotFoundError: No module named 'distutils'

Trying to install distutils manually also does not work. Though I realize it may not be fixable at the moment, it might be useful to note it in README.md that Python 3.12 may break the application entirely and to use Python 3.11. Hopefully this whole numpy issue will be fixed soon.

Feature Request/Docker container?

I love this app. Got it working great on an Ubuntu VM on my Windows 11 box using VMWare. Since running this app natively on Windows is problematic at best, would it be possible to create a Docker app to preclude running this on a VM?

Cannot bookmark a subchannel without switching the frequency and/or subchannel, stopping, and starting.

Environment:
RPi3 with Raspbian, RTL-SDR Blog v3 device.

Issue:
Cannot bookmark a subchannel without switching the frequency and/or subchannel, stopping, and starting

Steps to replicate:
Tune to 93.3 HD-1 (as an example, this is for any frequency & subchannel). Bookmark the frequency & subchannel. Cannot bookmark anything else.

If I stop and start on 93.3 HD-1, I still cannot bookmark anything else. Must start on a non-bookmarked frequency & subchannel to then bookmark another frequency & subchannel.

Once that frequency & subchannel are bookmarked, I must again select another unbookmarked frequency & subchannel to stop, start, and proceed.

Current workaround:
Just following the steps above, or personally modifying the JSON.

Thank you for this software, it has otherwise performed flawlessly!

Images/Maps not displaying at all on current version

Hi Mark, so I was trying to get the current version working on my system and for some reason, no album art, station art, or maps are ever displayed. I went back to an old version 2.2.0 and it works fine there, but not on the current. I am using Python 3.10 and tried it both with Pillow 9.0.x and 10.x. The app otherwise works perfectly, just no image displays. What am I doing wrong? lol.

Also, side-question, i'm trying to get my feet wet with visual studio coding and figured as a learning experience, id try my hand at a nrsc5-dui-inspired Windows .NET frontend. How the heck do you get the weather maps to work? As far as I can tell, nrsc5 LOT files only provide the transparent Doppler layer. Are you pulling the actual background map from the network? Thanks as always for all your work on this project!

I got a couple questions.

First question. Can you add an option to this program to load a WAV file as a source? I used HDSDR in upper-sideband mode and with output bandwidth at 192kHz which gives me 96kHz (just enough for one of the 2 copies of the HD Radio signal, as each FM station transmits 2 copies of the HD Radio signal), and saved some of this signal to a WAV file. I would like to be able to load a copy of this WAV file as input to your software, so it can output a WAV file of the decoded audio.

Second question. Are the upper and lower copies of the HD Radio signal (one above the FM carrier and one below the FM carrier) just 2 copies of the same signal for redundancy? Or do they carry separate data streams, thus requiring an even wider bandwidth, and the decoding of both of them, in order to get the actual audio signal?

Deprecation Errors

image

Something I'd like to see fixed or suppressed is the constant console spam from the Gtk libraries.

I usually leave the console open in the background in order to see and determine if there's any errors, but when this is constantly spamming me it would be nice to fix it.

Need help with MacOS

Looking for help! Running MacOS Monterey Beta 10.
nrsc5 compiles and runs like a champ. No issues here.

nrsc5-dui will not run. I carefully followed the steps given in the Read Me install section. Get this message and a Black Screen with a Title Bar upon launch. Here are the first two error messages. I'm lost!

(nrsc5-dui.py:75486): Gtk-WARNING **: 01:57:37.670: Could not load a pixbuf from /org/gtk/libgtk/theme/Adwaita/assets/check-symbolic.svg.
This may indicate that pixbuf loaders or the mime database could not be found.

(nrsc5-dui.py:75486): Gtk-WARNING **: 01:57:37.690: Error loading theme icon 'media-playback-start' for stock:

Any help would be appreciated.

73 de Dale - K0HYD

Syntax Warnings after upgrading to Ubuntu 24.04

I just upgraded from Ubuntu 22 to 24.04. I've updated all my python dependencies and nrsc5-dui runs, but with the following syntax warnings. Everything appears to function properly in spite of the warnings with the exception of the db signal gain, it remains at 0.0 all the time.

/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:286: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} Station name: (.)$"), # 0 match station name
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:287: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} Station location: (-?[\d]+.[\d]+) (-?[\d]+.[\d]+), ([\d]+)m$"), # 1 match station location
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:288: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} Slogan: (.
)$"), # 2 match station slogan
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:289: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} Audio bit rate: (.) kbps$"), # 3 match audio bit rate
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:290: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} Title: (.
)$"), # 4 match title
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:291: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} Artist: (.)$"), # 5 match artist
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:292: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} Album: (.
)$"), # 6 match album
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:293: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} LOT file: port=([\d]+) lot=([\d]+) name=(..(?:jpg|jpeg|png|txt)) size=([\d]+) mime=([\w]+) .$"), # 7 match file (album art, maps, weather info)
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:294: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} MER: (-?[\d]+.[\d]+) dB (lower), (-?[\d]+.[\d]+) dB (upper)$"), # 8 match MER
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:295: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} BER: (0.[\d]+), avg: (0.[\d]+), min: (0.[\d]+), max: (0.[\d]+)$"), # 9 match BER
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:296: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} Best gain: (.) dB,.$"), # 10 match gain
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:297: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} SIG Service: type=(.) number=(.) name=(.)$"), # 11 match stream
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:298: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} .Data component:. id=([\d]+).
port=([\d]+).* service_data_type=([\d]+) .$"), # 12 match port (and data_service_type)
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:299: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} XHDR: (.
) ([0-9A-Fa-f]{8}) (.)$"), # 13 match xhdr tag
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:300: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} Unique file identifier: PPC;07; ([\S]+).
$"), # 14 match unique file id
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:301: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} Genre: (.)$"), # 15 match genre
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:302: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} Message: (.
)$"), # 16 match message
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:303: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} Alert: (.)$"), # 17 match alert
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:304: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} .Audio component:. id=([\d]+).
port=([\d]+).* type=([\d]+) .$"), # 18 match port (and type)
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:305: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} Synchronized$"), # 19 synchronized
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:306: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} Lost synchronization$"), # 20 lost synch
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:307: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} Lost device$"), # 21 lost device
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:308: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} Open device failed.$"), # 22 No device
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:309: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} Stream data: port=([\d]+).
mime=([\w]+) size=([\d]+)$"), # 23 Navteq/HERE stream info
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:310: SyntaxWarning: invalid escape sequence ':'
re.compile("^[0-9:]{8,8} Packet data: port=([\d]+).* mime=([\w]+) size=([\d]+)$") # 24 Navteq/HERE packet info
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:1110: SyntaxWarning: invalid escape sequence '\d'
r = re.compile("^([\d]+).$")
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:1228: SyntaxWarning: invalid escape sequence '\d'
r = re.compile("^[\d]+TMT.
([1-3])([1-3])([\d]{4})([\d]{2})([\d]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{4})..$") # match file name
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:1295: SyntaxWarning: invalid escape sequence '\d'
r = re.compile("^[\d]+DWRO(.
).*([\d]{4})([\d]{2})([\d]{2})([\d]{2})([\d]{2})([0-9A-Fa-f]+)..$") # match file name
/home/steve/Desktop/nrsc5-dui/./nrsc5-dui.py:1379: SyntaxWarning: invalid escape sequence '('
r = re.compile("^Coordinates=.
((-?[\d]+.[\d]+),(-?[\d]+.[\d]+)).((-?[\d]+.[\d]+),(-?[\d]+.[\d]+)).$")
Using Pillow v10.2.0

Windows Support Thread

Creating this as a thread for RTL-SDR Users on Microsoft Windows Operating Systems. Since neither myself or Mark use Windows, we will be relying on other users to test and give issues. Based on what I know, you just need to install python 3.8 or 3.9 and install the required modules from Pip, then install nrsc5 for Windows and try and run the application. You might have to change the /usr/local/bin/nrsc5 hard-coded path to the nrsc5.exe file installed on Windows or the one in the nrsc5-dui folder. We could really use some Windows testers, so if you are using that OS and are skilled enough with how python works then feel free to help out!

Getting more unusable on small screens

Hey Mark,

As I mentioned in a past issue at Nrsc5 DUI is getting harder to use on Lower resolution displays such as on my old laptop.

I think there's a redesign or second layout option needed that supports wider window with shorter window height instead of this vertical style alone.

Obviously this is an edge case so it's up to you if you think it's worth implementing. Maybe having a short and wide layout that can be enabled with a command line switch would be a good option.

nrsc5-dui.py parseFeedback self.debugLog fileSize actualFileSize TypeError: must be str, not int

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "nrsc5-dui.py", line 934, in play
    self.parseFeedback(output)
  File "nrsc5-dui.py", line 1390, in parseFeedback
    self.debugLog("Corrupt file: " + fileName + " (expected: "+fileSize+" bytes, got "+actualFileSize+" bytes)")
TypeError: must be str, not int

The fix for this particular error should be replacing fileSize with str(fileSize) and actualFileSize with str(actualFileSize).

(Question) Does this support rtl_tcp

I run a personal rtl_tcp server to get my antenna in a better reception spot in my house, while still using RTL-SDR anywhere around the house, and i would like to know if this supports it.

Simple Fix for Windows users/WSL2

I found a very simple fix to get your app running under Windows/WSL2 without any issues. No need for pulseaudio or complicated USB pass-through solutions. WSL2 accesses the Windows file system from the /mnt folder. I.e., to access files on the Windows C: drive, provide the following path: /mnt/c and to access the D: drive, /mnt/d/ and so on.

By editing line 74 of nrsc5-dui.py and adding the path for the nrsc5.exe and libnrsc5.dll, the app runs fine. The edited line reads: self.nrsc5Path = arg1+"/mnt/d/nrsc5/nrsc5.exe"

My EXE and DLL are in my D: drive in a folder named nrsc5. For users who have their nrsc5 files in another location, simply edit line 74 to reflect where your files are stored.

I have to invoke the app as root using sudo, like so: sudo python3 ./nrsc5-dui.py
Not sure why, but without sudo, python will throw an error.

Here are some screenshots:

image

image

image

Unable to load audio device

I get the error 21:16:15 Unable to open audio device.
when using it

Also isn't able to connect to my RTL, whilst the regular nrsc5-gui doesn't have any issues connecting.

Using Kubuntu 20.04

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.