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

Incorrect RDS flags #1360

Closed
KubaPro010 opened this issue Jul 2, 2024 · 2 comments · Fixed by #1361
Closed

Incorrect RDS flags #1360

KubaPro010 opened this issue Jul 2, 2024 · 2 comments · Fixed by #1361

Comments

@KubaPro010
Copy link

Both on FM stereo and mono the RDS flags are wrong, it should be the value 9 (0b1001 indicating stereo and dynamic pty) however in gqrx the flags say Music Mono stPTY which is not correct as it should be Music Stereo, RDS Spy does say the correct flags so something is wrong here (for the future: i wont debug)

@vladisslav2011
Copy link
Contributor

Confirmed.
Thanks.
Possible fix: #1361

@KubaPro010
Copy link
Author

KubaPro010 commented Jul 3, 2024

The fix looks correct, i did make a python RDS encoder and somewhat decoder (librds), the decoder part looks like this:

match segment:
                case 0:
                    det.di_dpty = is_di
                case 1:
                    det.di_compressed = is_di
                case 2:
                    det.di_artificial_head = is_di
                case 3:
                    det.di_stereo = is_di

where is_di is the di bit and match is just a switch alternative in python

and here's the encoder part:

( basic.b | int(ta) << 4 | int(ms) << 3 | ( ( di >> (3-segment) ) << 2) | segment ) & 0xFFFF,

Specifically ( ( di >> (3-segment) ) << 2)

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 a pull request may close this issue.

2 participants