SDRPlay/CubicSDR on Fedora 32

Posted by James Watson on 03 Apr, 2020

I recently purchased an SDRPlay RSPdx SDRdx receiver which I was originally using with SDRUno on a Win10 Gnome Box virtual machine. Although this was very quick and easy to set up, I prefer to run directly on Linux wherever possible. The following are a few notes describing how I got CubicSDR running on a Dell XPS with Fedora 32 (beta).

Note: Much of the following is derived from directions presented at the SDRPlay Site and the CubicSDR Wiki.

Prepare a Build Area

The following command creates a directory named 'sdrdev' in your home directory. This will be used as a temporary staging area for downloading sources and building the binaries. This directory may be deleted once CubicSDR is installed. However, it may be safer to keep the directory to facilitate uninstalling the binaries at a later date, by running 'sudo make uninstall' from the various build directories.

$ mkdir -p ~/sdrdev

Download and Install the SDRPlay Driver

The RSPdx requires version 3.06 of the driver which may be downloaded and installed as follows;

$ cd ~/sdrdev
$ wget https://www.sdrplay.com/software/SDRplay_RSP_API-Linux-3.06.1.run
$ chmod 755 SDRplay_RSP_API-Linux-3.06.1.run
$ ./SDRplay_RSP_API-Linux-3.06.1.run

[This will run the installer after agreeing to the end user licence and providing your root password]

By default the driver service needs to be started manually each time the computer is started. It can be made to start up automatically when booting with the following command.

$ sudo systemctl enable sdrplay.service

In the event that the driver requires restarting, the following command may be used;

$ sudo systemctl restart sdrplay.service

Once the driver is installed, reload the USB rules with following command then unplug/replug the SDRdx.

$ sudo udevadm trigger

Build and Install SoapySDR

$ cd ~/sdrdev
$ git clone https://github.com/pothosware/SoapySDR.git
$ cd SoapySDR
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install
$ sudo ldconfig

Build and Install SoapySDRPlay

$ cd ~/sdrdev
$ git clone -b API3+RSPduo https://github.com/fventuri/SoapySDRPlay
$ cd SoapySDRPlay

The standard build didn't work on Fedora, the linker couldn't locate the pthread library. Modify the file SoapySDRPlay/CMakeLists.txt, inserting the following four lines after line 19 in the original file;

set(CMAKE_LINKER_FLAGS "-pthread" CACHE STRING "Linker Flags" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_LINKER_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS    "${CMAKE_LINKER_FLAGS}" CACHE STRING "" FORCE)

i.e. the original file

...
...
message(STATUS "LIBSDRPLAY_INCLUDE_DIRS - ${LIBSDRPLAY_INCLUDE_DIRS}")
message(STATUS "LIBSDRPLAY_LIBRARIES - ${LIBSDRPLAY_LIBRARIES}")

include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${LIBSDRPLAY_INCLUDE_DIRS})
...
...

is modified to become;

...
...
message(STATUS "LIBSDRPLAY_INCLUDE_DIRS - ${LIBSDRPLAY_INCLUDE_DIRS}")
message(STATUS "LIBSDRPLAY_LIBRARIES - ${LIBSDRPLAY_LIBRARIES}")

set(CMAKE_LINKER_FLAGS "-pthread" CACHE STRING "Linker Flags" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_LINKER_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS    "${CMAKE_LINKER_FLAGS}" CACHE STRING "" FORCE)

include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${LIBSDRPLAY_INCLUDE_DIRS})
...
...

With this modification in place, the build can continue.

$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install
$ sudo ldconfig

It's now posible to test the installation with the following commands;

$ SoapySDRUtil --info
$ SoapySDRUtil --probe="driver=sdrplay"

Build and install liquid-dsp

$ sudo dnf install pulseaudio-libs-devel gtk3-devel freeglut3 freeglut3-dev swig
$ cd ~/sdrdev
$ git clone https://github.com/jgaeddert/liquid-dsp
$ cd liquid-dsp
$ ./bootstrap.sh
$ CFLAGS="-march=native -O3" ./configure --enable-fftoverride 
$ make -j4
$ sudo make install
$ sudo ldconfig

Build static wxWidgets:

The following will build and install into a local directory for use when CubicSDR is built in the next section. (Note that when the final 'make install' is executed, it should be performed with your normal user privillages, not with 'sudo'.)

$ cd ~/sdrdev
$ wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.3/wxWidgets-3.1.3.tar.bz2
    [ downloading... ]
$ tar -xvjf wxWidgets-3.1.3.tar.bz2
    [ unpacking... ]
$ mkdir wxWidgets-staticlib
$ cd wxWidgets-3.1.3/
$ ./autogen.sh 
$ ./configure --with-opengl --disable-shared --enable-monolithic --with-libjpeg --with-libtiff --with-libpng --with-zlib --disable-sdltest --enable-unicode --enable-display --enable-propgrid --disable-webkit --disable-webview --disable-webviewwebkit --prefix=`echo ~/sdrdev/wxWidgets-staticlib` CXXFLAGS="-std=c++0x"
    [ configuring... ]   
$ make -j4
$ make install

Build and Install CubicSDR

$ cd ~/sdrdev
$ git clone https://github.com/cjcliffe/CubicSDR.git
$ cd CubicSDR

Users with HiDPI Monitors

When originally built, the dialog window used for entering frequencies (opened with spacebar) was too small to display the digits. This is fixed by adjusting the size of the dialog in the file src/CubicSDR.cpp, line 974.

Original; FrequencyDialog fdialog(appframe, -1, title, activeModem, wxPoint(-100,-100), wxSize(350, 75), wxDEFAULT_DIALOG_STYLE, targetMode, initString);

Modified for HiDPI screens; FrequencyDialog fdialog(appframe, -1, title, activeModem, wxPoint(-100,-100), wxSize(700, 150), wxDEFAULT_DIALOG_STYLE, targetMode, initString);

Building CubicSDR

Note: add -DUSE_HAMLIB=1 to cmake command line to include hamlib support.

$ mkdir build
$ cd build
$ cmake ../ -DCMAKE_BUILD_TYPE=Release -DwxWidgets_CONFIG_EXECUTABLE=~/sdrdev/wxWidgets-staticlib/bin/wx-config
$ make
$ sudo make install

With that step, you should be done. Let me know if you have any problems and I'll amend the instructions accordingly.


   SDR    SDRPLAY    FEDORA   

 Share on: Twitter / Facebook / Google+ / Email