2.2 KiB
SDRPlay RSP1A demo code
This repository is a demo - it isn't a fully fleshed out system and isn't intended to be. Things might break. It also makes use of some 3rd-party code that we don't have a commercial licence for, so legally this can only be used for demonstration purposes, and only interally.
Getting started
- Install the SDRPlay device driver & install the project dependencies.
./SDRplay_RSP_API-Linux-3.07.1.run- Follow the prompts, there is some audience participation getting the driver installed.
- Beyond that it should be mostly unattended. SoapySDR & plugins will be installed in the system directories.
- Run the demos. The demo code is provided by SoapySDR and required minimal modification.
cd ./examples/- C++ demo:
make && ./Example - Python demo:
./example.py
Using the radio
The project is currently structured as several independent scripts that pipe raw data to one another. It was easier to integrate everything this way, rather than trying to manage it all as one monolithic program.
nooelec/NESDR Smart
The NESDR Smart is a good starting place as it has a command line utility already, rtl_sdr. This is available as the system package rtl-sdr, which should be automatically installed by the ./setup script.
SDRPlay radio
The script ./sdrplay_sample was built to mimic the interface provided by rtl_sdr, and is nearly a slot in replacement but for the SDRPlay hardware. It is used for producing raw I/Q samples from the radio device, which (assuming you tune to a frequency where an FM radio station is available) can be piped into the FM demodulator fm_demod.py, which itself outputs raw PCM audio.
To run the whole chain at once, tuning to a radio station frequency, demodulating the IQ samples to PCM and rendering to the system audio sink, run the following:
# FM broadcasting is in the VHF Band II space -
# in Australia this is 87.5 MHz to 108 MHz. You can specify the
# frequency as either a plan integer (87500000) or using a suffix:
export station="87.5M"
# You'll want to replace that number with an actual radio station.
./sdrplay_sample -d sdrplay --format CS16 -f ${station} -s 384k | \
./fm_demod.py -f CS16 -s 384k -d 32k | \
sox -t raw -r 32000 -b 16 -c 2 -L -e signed-integer - -d