Skip to content
Oona Räisänen edited this page Dec 21, 2017 · 22 revisions

Live decoding with rtl_fm

The full command to decode RDS live via rtl_fm is:

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

For Raspberry Pi 1 it's necessary to change -A std to -A fast. This way more CPU cycles will be left to redsea.

Note that rtl_fm will tune the receiver a bit off-center; this is normal and is done to avoid the DC spike. See the rtl_fm FAQ for more about this behavior.

Listening and decoding live

The --feed-through option lets you use both the original signal and the decoded RDS via different streams. For example, the signal can be listened to using sox, while RDS groups are printed to stderr:

$ rtl_fm -M fm -l 0 -A std -p 0 -s 171k -g 40 -F 9 -f 87.9M |\
> redsea --feed-through |\
> play -t .s16 -r 171k -c 1 -

Decoding MPX from a file or via sound card

It's easy to decode audio files containing a demodulated FM carrier. Note that the file must have around 128k samples per second or more; 171k will work fastest.

$ redsea -f multiplex.wav

If your sound card supports recording at high sample rates (192 kHz) you can also decode the MPX output of an FM tuner or RDS encoder, for instance with this sox command:

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

By default, the raw MPX input is assumed to be 16-bit signed-integer single-channel samples at 171 kHz.

Clone this wiki locally