Trying to get SDRplay RSP2 to work on Linux

General discussions
StandingWave
Posts: 56
Joined: Mon Feb 18, 2019 6:54 pm

Trying to get SDRplay RSP2 to work on Linux

Post by StandingWave » Mon Feb 18, 2019 7:08 pm

I have recently purchased an RSP2 and am trying to get it to work on Linux. I have followed the Non-Windows Workflow on the SDRplay website using the SoapySDR built from source code option. I am running Linux Mint 19, 64-bit and have the 32-bit architecture installed.

I have successfully installed the API and compiled both SoapySDR and SoapySDRPlay and ran sudo make install on both successfully.

I am getting the following in response to SoapySDRUtil -info:
######################################################
## Soapy SDR -- the SDR abstraction library ##
######################################################

Lib Version: v0.7.1-g7bb9ca15
API Version: v0.7.1
ABI Version: v0.7
Install root: /usr/local
Search path: /usr/local/lib/SoapySDR/modules0.7
Module found: /usr/local/lib/SoapySDR/modules0.7/libsdrPlaySupport.so (0.3.0-31a3a36)
Available factories... sdrplay
Available converters...
- CF32 -> [CF32, CS16, CS8, CU16, CU8]
- CS16 -> [CF32, CS16, CS8, CU16, CU8]
- CS32 -> [CS32]
- CS8 -> [CF32, CS16, CS8, CU16, CU8]
- CU16 -> [CF32, CS16, CS8]
- CU8 -> [CF32, CS16, CS8]
- F32 -> [F32, S16, S8, U16, U8]
- S16 -> [F32, S16, S8, U16, U8]
- S32 -> [S32]
- S8 -> [F32, S16, S8, U16, U8]
- U16 -> [F32, S16, S8]
- U8 -> [F32, S16, S8]
I am getting the following in response to SoapySDRUtil --probe=sdrplay:
######################################################
## Soapy SDR -- the SDR abstraction library ##
######################################################

Probe device sdrplay

----------------------------------------------------
-- Device identification
----------------------------------------------------
driver=SDRplay
hardware=160400AF00
mir_sdr_api_version=2.130000
mir_sdr_hw_version=2

----------------------------------------------------
-- Peripheral summary
----------------------------------------------------
Channels: 1 Rx, 0 Tx
Timestamps: NO
Other Settings:
* RF Gain Select - RF Gain Select
[key=rfgain_sel, default=4, type=string, options=(0, 1, 2, 3, 4, 5, 6, 7, 8)]
* IF Mode - IF frequency in kHz
[key=if_mode, default=Zero-IF, type=string, options=(Zero-IF, 450kHz, 1620kHz, 2048kHz)]
* IQ Correction - IQ Correction Control
[key=iqcorr_ctrl, default=true, type=bool]
* AGC Setpoint - AGC Setpoint (dBfs)
[key=agc_setpoint, default=-30, type=int, range=[-60, 0]]
* ExtRef Enable - External Reference Control
[key=extref_ctrl, default=true, type=bool]
* BiasT Enable - BiasT Control
[key=biasT_ctrl, default=true, type=bool]
* RfNotch Enable - RF Notch Filter Control
[key=rfnotch_ctrl, default=true, type=bool]

----------------------------------------------------
-- RX Channel 0
----------------------------------------------------
Full-duplex: YES
Supports AGC: YES
Stream formats: CS16, CF32
Native format: CS16 [full-scale=32767]
Antennas: Antenna A, Antenna B, Hi-Z
Corrections: DC removal
Full gain range: [0, 47] dB
IFGR gain range: [20, 59] dB
RFGR gain range: [0, 8] dB
Full freq range: [0.01, 2000] MHz
RF freq range: [0.01, 2000] MHz
CORR freq range: MHz
Sample rates: 0.25, 0.5, 1, 2, 2.048, 6, 7, 8, 9, 10 MSps
Filter bandwidths: 0.2, 0.3, 0.6, 1.536, 5, 6, 7, 8 MHz
So it seems that the device is being recognized.

I downloaded the CubicSDR image as pointed to in the workflow and ran it, but it does not detect the presence of the receiver. It seems as though a step is missing? Can anyone help me get this working please?
Last edited by StandingWave on Thu Jan 01, 1970 12:00 am, edited 0 times in total.
Reason: No reason

fventuri
Posts: 37
Joined: Sun Dec 25, 2016 4:24 pm

Re: Trying to get SDRplay RSP2 to work on Linux

Post by fventuri » Mon Feb 18, 2019 11:48 pm

Just to make sure, you downloaded this AppImage (https://github.com/cjcliffe/CubicSDR/fi ... DRPlay.zip), right?
If this is the case (i.e. the file you downloaded was called 'CubicSDR-0.2.3-x86_64.AppImage-Deb8-with-SDRPlay.zip', and you had to unzip it first), then you might need to have version 2.11 of the SDRplay Linux API installed instead, because it looks like the 'libsdrPlaySupport.so' shared library inside that AppImage was linked with the version 2.11 of 'libmirsdrapi-rsp':

Code: Select all

$ mount -o ro,loop CubicSDR-0.2.3-x86_64.AppImage /tmp/CubicSDR-0.2.3-x86_64
$ ldd /tmp/CubicSDR-0.2.3-x86_64/usr/lib/SoapySDR/modules0.6/libsdrPlaySupport.so | grep mirsdrapi
	libmirsdrapi-rsp.so.2.11 => not found
I am not sure if you can still download that older version of the SDRplay Linux API, but one way to work around this issue could be to create a symbolic link under '/usr/local/lib' (assuming that this is where you have 'libmirsdrapi-rsp.so.2.13' installed), as follows:

Code: Select all

$ cd /usr/local/lib
$ ln -s libmirsdrapi-rsp.so.2.13 libmirsdrapi-rsp.so.2.11
Hope this helps,
Franco

Reason: No reason

StandingWave
Posts: 56
Joined: Mon Feb 18, 2019 6:54 pm

Re: Trying to get SDRplay RSP2 to work on Linux

Post by StandingWave » Tue Feb 19, 2019 9:16 am

Yes, that it correct. I downloaded everything as per the workflow and from the indicated links. I downloaded the CubicSDR that you mention: CubicSDR-0.2.3-x86_64.AppImage-Deb8-with-SDRPlay.zip. So it would seem that SDRplay have updated the API but the CubicSDR image has not been updated to include the new version of the SDR?

I tried your suggestion with the symlink but unfortunately it didn't work. I also did a 'sudo ldconfig' after creating the symlink just to make sure. Unfurtunately I can't see a download link for the previous version of the API anywhere.

BTW, I have noticed that I have the same issue on Windows7. SDRuno works OK, but CubicSDR does not see the radio.

I have now logged a support ticked on the SDRplay website.
Last edited by StandingWave on Thu Jan 01, 1970 12:00 am, edited 0 times in total.
Reason: No reason

ON5HB
Posts: 140
Joined: Sat Dec 29, 2018 1:07 pm

Re: Trying to get SDRplay RSP2 to work on Linux

Post by ON5HB » Tue Feb 19, 2019 3:38 pm

You have the wrong CubicSDR, it's version 0.2.5, that one works fine.

https://github.com/cjcliffe/CubicSDR/releases

Works fine here.

Reason: No reason

StandingWave
Posts: 56
Joined: Mon Feb 18, 2019 6:54 pm

Re: Trying to get SDRplay RSP2 to work on Linux

Post by StandingWave » Tue Feb 19, 2019 7:03 pm

Well, some progress being made.

I got a response to my ticket from SDRplay. They provided me with a link where I could download API version 2.11:
wget https://www.sdrplay.com/software/SDRpla ... 2.11.1.run

I downloaded and installed this version of the API and CubicSDR 0.2.3 now recognizes the radio and works.

ON5HB, I also downloaded and tried the later version of the appimage from the link you provided, with API version 2.13 and 2.11, but it did not work with either of them. Rather strangely, going to that page solved a similar issue for me on Windows. I noted that is said this:
**Note that SDRPlay requires either C:\Program Files\SDRplay\API\x64\mir_sdr_api.dll for win64 or C:\Program Files\SDRplay\API\x86\mir_sdr_api.dll for win32 to be copied to the CubicSDR installation directory ( C:\Program Files\CubicSDR by default) for Windows.
Without installing any new versions of anything, I copied the mir_sdr_api.dll to C:\Program Files\CubicSDR and now both CubicSDR (v0.2.3) and HDSDR work! I can see how that might have fixed CubicSDR, but I'm not sure how it fixed HDSDR? I then upgraded CubicSDR to version 0.2.5 and that works fine as well. So it is sorted, at least on Windows.

It also now works on Linux, but but with an older version of the application and API.

Thanks to everyone who helped.

Reason: No reason

fventuri
Posts: 37
Joined: Sun Dec 25, 2016 4:24 pm

Re: Trying to get SDRplay RSP2 to work on Linux

Post by fventuri » Wed Feb 20, 2019 2:00 am

First of all I am glad to hear that you got CubicSDR to work on Linux, thanks to the help of SDRplay support.

I also have a few notes that might provide some help, if not to you, perhaps to someone else who comes across this thread because they have a similar problem.
  1. One of the reasons the symbolic link I suggested as a work around last night didn't work for you, is that I forgot to mention that you have to run the 'ldconfig' command after you add a new shared library, because the 'ld' dynamic linker/loader caches the list of shared libraries it is aware of and until you run 'ldcondig', it won't be able to use your new library/sym link.
    The command you can run to see which shared libraries 'ld' knows about is 'ldconfig -p'

    Code: Select all

    $ ldconfig -p | grep mirsdrapi
    
    If you run it, you should be able to see version 2.11 of the SDRplay API library there.
  2. As ON5HB mentioned, there's a newer version of CubicSDR (version 0.2.5) available here (https://github.com/cjcliffe/CubicSDR/releases/tag/0.2.5). If you choose to go this route and use the AppImage provided there (CubicSDR-0.2.5-x86_64.AppImage), please be aware that it expects to find 'libSoapySDR.so.0.7' installed under '/usr/local/lib64' (not '/usr/local/lib'):

    Code: Select all

    $ mkdir /tmp/CubicSDR-0.2.5-x86_64
    $ mount -o ro,loop /tmp/CubicSDR-0.2.5-x86_64.AppImage /tmp/CubicSDR-0.2.5-x86_64
    $ ldd /tmp/CubicSDR-0.2.5-x86_64/usr/bin/CubicSDR | grep SoapySDR
    	libSoapySDR.so.0.7 => /usr/local/lib64/libSoapySDR.so.0.7 (0x00007f677d9d0000)
    
    Looking at the output from 'SoapySDRUtil' that you show in your first post, I see that the 'Search path' variable is set to '/usr/local/lib/SoapySDR/modules0.7', which makes me think you either compiled/installed the 32 bit version of SoapySDR, or you have the 64 bit version installed in the wrong place for that AppImage (i.e. '/usr/local/lib' as opposed to '/usr/local/lib64'). In either case you may have to recompile for 64 bit or move the existing shared library (and its associated symbolic links) to '/usr/local/lib64'
  3. Finally many of us (me included) prefer to compile CubicSDR from source - the instructions to do it for Linux are here: https://github.com/cjcliffe/CubicSDR/wiki/Build-Linux. If you choose this path, you need to have some patience, follow the instructions, and don't go to the next step until you are comfortable that the previous step went OK.
Franco

Reason: No reason

StandingWave
Posts: 56
Joined: Mon Feb 18, 2019 6:54 pm

Re: Trying to get SDRplay RSP2 to work on Linux

Post by StandingWave » Wed Feb 20, 2019 1:09 pm

Well, unfortunately it had a sting in the tail.... It no longer worked after a re-boot...

Just to confirm, I am on a 64-bit system so I'm using 64-bit versions only, although I do have the 32-bit architecture installed as well for the odd package.

I re-installed version 2.13 of the library and ran ldconfig as you suggested. I then tried version 0.2.5 of CubicSDR and this time it worked and also survived a reboot, so thanks for that. I did run ldconfig when I first installed the API and modules, but must have omitted to do so when I upgraded the API.

With regards to compiling, one needs to have a LOT of patience but I agree with your advice to take it one step at a time and confirm that each step is successful before going on to the next. Even though I have some modest experience of compiling various software, I still find it a very frustrating experience not to mention ending up with a very cluttered system (prime example yesterday - had to download 10Gb of QT 5.10 stuff to compile a DAB program - which in the end didn't work), which is why I only do so as a last resort. Hopefully avoided this time, but I have bookmarked that page for future reference just in case.

Reason: No reason

ON5HB
Posts: 140
Joined: Sat Dec 29, 2018 1:07 pm

Re: Trying to get SDRplay RSP2 to work on Linux

Post by ON5HB » Wed Feb 20, 2019 4:18 pm

Hang on, did you connect / install anything before the API-HW driver?

Because if you did the kernel driver will be loaded and keeping you from using it as a receiver the way we want.

Do you have the 66-mirics.rules in /etc/udev/rules.d ?

It should contain this:

Code: Select all

SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",ATTRS{idVendor}=="1df7",ATTRS{idProduct}=="2500",MODE:="0666"
SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",ATTRS{idVendor}=="1df7",ATTRS{idProduct}=="3000",MODE:="0666"
SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",ATTRS{idVendor}=="1df7",ATTRS{idProduct}=="3010",MODE:="0666"
SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",ATTRS{idVendor}=="1df7",ATTRS{idProduct}=="3020",MODE:="0666"
That makes it's properly recognised.

The API-HW driver should do this automaticly, unless you missed something.
Then after this driver is installed, only then install and compile SoapySDR, however DO NOT install it with apt as it's not up to date and messes up your installation.

Then run the 0.2.5 appimage and it should work, but if you did stuff via apt, then you made a mix of things.
Also the API above 2.13 is not for users, only for developers and does not work with current programs, do not install it.

Reason: No reason

StandingWave
Posts: 56
Joined: Mon Feb 18, 2019 6:54 pm

Re: Trying to get SDRplay RSP2 to work on Linux

Post by StandingWave » Wed Feb 20, 2019 4:35 pm

API 2.13 seems to the the current version being offered to users on the SDR play website.

https://www.sdrplay.com/downloads/

I was able to obtain 2.11 only by raising a support ticket. There is no earlier 2.x version supplied on the SDR website.

I can confirm that I do have the 66-mirics.rules in /etc/udev/rules.d. It might be as you say, that I didn't unplug the radio before applying changes. I wasn't paying attention to that so its quite possible that the driver was still hooked until I rebooted. That would certainly explain it.

I do have it working with the recent API v2.13 and CubicSDR 0.2.5 so am happy with that. I haven't attempted to use any of the v3.x drivers, one of which is described as "for developers" and that currently have only "single tuner" support.

I do appreciate all the help in getting this resolved.

Reason: No reason

ON5HB
Posts: 140
Joined: Sat Dec 29, 2018 1:07 pm

Re: Trying to get SDRplay RSP2 to work on Linux

Post by ON5HB » Wed Feb 20, 2019 4:48 pm

https://cubicsdr.readthedocs.io/en/latest/

I do not know if it supports multiple tuners at the same time.

Reason: No reason

Post Reply