Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser improvements #86

Merged
merged 4 commits into from
Nov 7, 2024
Merged

Conversation

argilo
Copy link
Collaborator

@argilo argilo commented Nov 2, 2024

Here I have made some improvements to the RDS Parser block, which should make the output nicer to work with:

  1. Reset the parser if a new PI code is seen. This prevents data from different stations from being mixed together.
  2. Only report the Program Service name after it has fully loaded. At present, gr-rds reports partially-received PS data with ".." replacing the missing pieces, and shows a mixture of old & new PS data during changes. This behaviour is particularly problematic in North America, where the RDS standard allows PS data to be updated dynamically (and most broadcasters do this).
  3. Only report radiotext after it has fully loaded, and return only the valid portion of the buffer. At present, gr-rds returns the entire radiotext buffer every time it is touched. The buffer includes the string terminator (carriage return) as well as subsequent filler data (typically null bytes) which corrupts the display in the RDS Panel block. The current behaviour also has the effect of clearing the radiotext immediately when a new radiotext message begins, and this can make it very difficult to read radiotext messages that change frequently.
  4. Clear the alternate frequency string before processing each type 0 group. At present, gr-rds stores this in a static variable which is never cleared. This causes alternate frequencies from one station to appear when receiving other stations that do not specify alternate frequencies.

Update: I replaced part 4 with a more complete implementation of alternate frequency parsing. At present, gr-rds processes fragments of the alternate frequency list one at a time, which causes the RDS panel to rapidly cycle between alternate frequencies whenever a station defines more than one. In addition, it does not handle "AF method B", which allows the broadcaster to distinguish between frequencies that are the same program vs. those that are regional variants. (This method is used by our national broadcaster here in Canada.) I modified the code to collect fragments of the alternate frequency list until the entire list is available, parse it (using method A or B, as appropriate), and display it as a single list. Here's what it looks like:

Screenshot from 2024-11-02 22-48-49

@argilo
Copy link
Collaborator Author

argilo commented Nov 2, 2024

I kept the changes in four separate commits, in case there are any that are problematic and need to be taken out or moved into a separate pull request.

@argilo
Copy link
Collaborator Author

argilo commented Nov 2, 2024

Part of the motivation for parts 2 and 3 is to make retrieving PS & radiotext through Gqrx's remote control interface more reliable: gqrx-sdr/gqrx#1373

@argilo argilo force-pushed the parser-improvements branch from 30e214a to 3f18324 Compare November 3, 2024 02:41
@bastibl bastibl merged commit 7cf1cbd into bastibl:maint-3.10 Nov 7, 2024
@bastibl
Copy link
Owner

bastibl commented Nov 7, 2024

Awesome, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants