Skip to content

SDRPlay and SoapySDR (obsolete)

Edouard Griffiths edited this page Jan 14, 2021 · 1 revision

This is how SDRplay support used to be built with the binary only library and is now obsolete. This note is kept for reference as including binary only libraries can be done in a similar way

SDRplay case

SDRplay interface libraries are not provided in source form. You have to download them from https://www.sdrplay.com/downloads/:

  • Click on the Linux x86 tab
  • Select API/HW DRIVER and follow instructions to download

This will download a run file: SDRplay_RSP_API-Linux-2.13.1.run. You have to make it executable and run it as sudo. This will create files in /usr/local/lib: libmirsdrapi-rsp.so libmirsdrapi-rsp.so.2 libmirsdrapi-rsp.so.2.13 and put the include file in /usr/local/include/

But remember that we don't like to have this stuff in the /usr structure so let's move it to /opt/install and create a structure like this:

/opt/install/libsdrplay
├── include
│   └── mirsdrapi-rsp.h
└── lib
    ├── libmirsdrapi-rsp.so -> libmirsdrapi-rsp.so.2
    ├── libmirsdrapi-rsp.so.2 -> libmirsdrapi-rsp.so.2.13
    └── libmirsdrapi-rsp.so.2.13

So do the following assuming your user is user and group users:

mkdir -p /opt/install/libsdrplay/include
mkdir /opt/install/libsdrplay/lib
cd /usr/local/include
sudo mv mirsdrapi-rsp.h /opt/install/libsdrplay/include
cd ../lib
sudo mv libmirsdrapi-rsp.so.2.13 /opt/install/libsdrplay/lib
sudo rm libmirsdrapi-rsp.so*
sudo chown -R user:users /opt/install/libsdrplay/include
sudo chown -R user:users /opt/install/libsdrplay/lib
cd /opt/install/libsdrplay/lib
ln -s libmirsdrapi-rsp.so.2.13 libmirsdrapi-rsp.so.2
ln -s libmirsdrapi-rsp.so.2 libmirsdrapi-rsp.so

Then clone, build and install the support library like this:

cd /opt/build
git clone https://github.com/pothosware/SoapySDRPlay.git
cd SoapySDRPlay
git reset --hard "soapy-sdrplay-0.2.0"
mkdir build; cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/install/SoapySDR -DLIBSDRPLAY_INCLUDE_DIRS=/opt/install/libsdrplay/include -DLIBSDRPLAY_LIBRARIES=/opt/install/libsdrplay/lib/libmirsdrapi-rsp.so -DSOAPY_SDR_INCLUDE_DIR=/opt/install/SoapySDR/include -DSOAPY_SDR_LIBRARY=/opt/install/SoapySDR/lib/libSoapySDR.so ..
make -j4 install

Before starting any program that uses it (thus SDRangel) you will have to add /opt/install/libsdrplay/lib to the LD_LIBRARY_PATH system variable with export LD_LIBRARY_PATH=/opt/install/libsdrplay/lib:$LD_LIBARY_PATH

Clone this wiki locally