View on GitHub


A lightweight RDS decoder

Download this project as a .zip file Download this project as a tar.gz file

redsea is a lightweight command-line RDS decoder for Linux/macOS. It works best with the RTL-SDR tool rtl_fm and any program that can handle JSON, such as jq.

See in the repository for further information.

Simple usage with rtl_fm

Receive a station at 104.1 MHz:

rtl_fm -M fm -l 0 -A std -p 0 -s 171k -g 40 -F 9 -f 104.1M | redsea

Output filtering and formatting

redsea outputs line-delimited JSON (see the schema). It can be further processed using any JSON-aware tool, such as jq, and common Unix tools.

# Extract radiotext field
redsea ... | jq .radiotext | grep -v null

# Print changed radiotext only using uniq
redsea ... | jq .radiotext | grep -v null | uniq

# Pretty-formatted TMC messages
redsea ... | grep tmc | jq .tmc

# Composer name (RT+ stations)
redsea ... | jq '.radiotext_plus."item.composer"' | grep -v null | uniq

Input formats


By default, redsea expects a demodulated FM multiplex signal as raw 16-bit single-channel PCM at 171,000 Hz via stdin. This is the format that rtl_fm outputs. The sample rate can be changed using --samplerate, but 171k will work fastest.

If you have sox installed and your sound card supports recording at high sample rates (e.g. 192 kHz) you can also decode the MPX output of an FM tuner or RDS encoder:

rec -t .s16 -r 171k -c 1 - | redsea

The signal can also be read from a WAV or FLAC file (--file signal.wav).

Hex groups

The hex format (--input-hex) is compatible with RDS Spy. Single group per line, four blocks per group.

6403 0442 5541 484B
6403 0447 1C41 4920
6403 8449 506C 716D
6403 245F 2020 2020
6403 0440 6841 594C
6403 0441 5E41 4520
6403 1440 7111 7C54
6403 E44C 0000 6202
6403 0442 414B 484B

ASCII bits

This format (--input-bits) can be used to decode the serial output from an RDS receiver chip, for instance.