Décoder les messages RDS en ligne de commandes avec un récepteur RTL-SDR

Suite à ce billet de Oona Räisänen sur son blog j’ai tenté de faire fonctionner son sympathique outil Redsea.

Récupération de Liquid-dsp depuis un fork disposant des éléments pour produire un paquet Debian (./configure && make && sudo make install, je fais pas, c’est un appeau à problème pour plus tard) , puis clonage du dépôt officiel pour y inclure le répertoire debian :

% git clone https://github.com/dsx/liquid-dsp.git
% mv liquid-dsp liquid-dsp.DEB
% cd liquid-dsp.DEB
% git checkout debianize
% cd ..
% git clone https://github.com/jgaeddert/liquid-dsp.git
% cd liquid-dsp
% cp -r ../liquid-dsp.DEB/debian .
% dpkg-buildpackage -b
% cd ..
% sudo dpkg -i liquid-dsp_1.2.0-git-1_i386.deb

Ok, on a Liquid-dsp d’installé bien proprement. On passe à Redsea :

% git clone https://github.com/windytan/redsea.git
% cd redsea
% ./autogen.sh
% ./configure
% make
[...]
subcarrier.cc: In member function ‘void redsea::Subcarrier::demodulateMoreBits()’:
subcarrier.cc:171:9: error: ‘tie’ is not a member of ‘std’
 std::tie(is_clock,biphase) = biphase_decoder_.push(symbol);
 ^~~

Oh !?

Ok, on édite src/subcarrier.cc et on ajoute #include <tuple> en début de fichier (étrange que ça marche pour d’autres utilisateurs), et là la compilation se passe sans problème. On peut jouer :

% ./rtl-rx.sh -f 89M | jq -c
Found 1 device(s):
 0: Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Detached kernel driver
Found Rafael Micro R820T tuner
Tuner gain set to 40.20 dB.
Tuned to 89342000 Hz.
Oversampling input by: 8x.
Oversampling output by: 1x.
Buffer size: 5.99ms
Exact sample rate is: 1368000.013046 Hz
Sampling at 1368000 S/s.
Output at 171000 Hz.
{"pi":"0xf784","group":"0A","tp":true,"prog_type":"No PTY","ta":false,"is_music":true,"partial_ps":" F "}
{"pi":"0xf784","group":"0A","tp":true,"prog_type":"No PTY","ta":false,"is_music":true,"alt_freqs":[89,91.9,93.3],"partial_ps":" FM "}
{"pi":"0xf784","group":"0A","tp":true,"prog_type":"No PTY","ta":false,"is_music":true,"partial_ps":"AZ "}
{"pi":"0xf784","group":"2A","tp":true,"prog_type":"No PTY","partial_radiotext":" M.CO"}
{"pi":"0xf784","group":"0A","tp":true,"prog_type":"No PTY","ta":false,"is_music":true,"alt_freqs":[89,91.9,93.3],"partial_ps":"AZUR "}
{"pi":"0xf784","group":"0A","tp":true,"prog_type":"No PTY","ta":false,"is_music":true,"partial_ps":"AZUR F "}
{"pi":"0xf784","group":"0A","tp":true,"prog_type":"No PTY","ta":false,"is_music":true,"alt_freqs":[89,91.9,93.3],"ps":"AZUR FM "}
{"pi":"0xf784","group":"0A","tp":true,"prog_type":"No PTY","ta":false,"is_music":true,"partial_ps":"AZ "}
{"pi":"0xf784","group":"0A","tp":true,"prog_type":"No PTY","ta":false,"is_music":true,"alt_freqs":[89,91.9,93.3],"partial_ps":"AZUR "}
{"pi":"0xf784","group":"0A","tp":true,"prog_type":"No PTY","ta":false,"is_music":true,"partial_ps":"AZUR F "}
{"pi":"0xf784","group":"0A","tp":true,"prog_type":"No PTY","ta":false,"is_music":true,"alt_freqs":[89,91.9,93.3],"ps":"AZUR FM "}
{"pi":"0xf784","group":"0A","tp":true,"prog_type":"No PTY","ta":false,"is_music":true,"partial_ps":"AZ "}
{"pi":"0xf784","group":"2A","tp":true,"prog_type":"No PTY","partial_radiotext":" M.COM"}
{"pi":"0xf784","group":"0A","tp":true,"prog_type":"No PTY","ta":false,"is_music":true,"alt_freqs":[89,91.9,93.3],"partial_ps":"AZUR "}
{"pi":"0xf784","group":"0A","tp":true,"prog_type":"No PTY","ta":false,"is_music":true,"partial_ps":"AZUR F "}
{"pi":"0xf784","group":"0A","tp":true,"prog_type":"No PTY","ta":false,"is_music":true,"alt_freqs":[89,91.9,93.3],"ps":"AZUR FM "}
{"pi":"0xf784","group":"0A","tp":true,"prog_type":"No PTY","ta":false,"is_music":true,"partial_ps":"AZ "}
^CSignal caught, exiting!
User cancel, exiting...
Reattached kernel driver
Signal caught, exiting!

jq s’installe avec le paquet du même nom, c’est un colorisateur syntaxique JSON.