Raspbian 64位下安装SDRplay RSP1驱动

Raspbian 64bit其实并不是纯的64位,虽然是aarch64,但还是有很多动态库、可执行文件都是32位的,甚至编译出来的文件默认都是32位

比如

$ file /usr/local/bin/SoapySDRUtil
/usr/local/bin/SoapySDRUtil: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=c5236a15f0708fb3213f4ceda6f8bcf2bec88659, for GNU/Linux 3.2.0, not stripped

SDRplay的官方提供了64位的API库,但默认安装后会有问题,虽然文件存在,但会提示文件不存在

pi@pi:~ $ ls -lha /usr/local/bin/sdrplay_apiService
-rwxr-xr-x 1 root root 863K  4月 16 18:01 /usr/local/bin/sdrplay_apiService
pi@pi:~ $ /usr/local/bin/sdrplay_apiService
-bash: /usr/local/bin/sdrplay_apiService: 没有那个文件或目录

看情况应该是动态链接库的问题。

如果直接使用官方的32位API,会提示平台不对

$ ./SDRplay_RSP_API-ARM32-3.07.2.run

Architecture: aarch64
API Version: 3.07
The architecture on this device (aarch64) is not supported in this installer.
Please contact software@sdrplay.com for details on platform support.

懒得折腾了,手工搞吧

SDRplay_RSP_API-ARM32-3.07.2.run是一个脚本+压缩包,直接先解压出来

sudo ./SDRplay_RSP_API-ARM32-3.07.2.run --noexec --target /tmp/sdrplay

修改下安装脚本,绕过判断

vim install_lib.sh

# 找到下面这行
ARCH=`uname -m`
# 改为
ARCH='armv7l'

# 安装
sudo ./install_lib.sh

然后再编译SoapySDRPlay就可以了

$ cd SoapySDRPlay
$ mkdir build
$ cd build
$ cmake ..
$ make && sudo make install
$ sudo ldconfig
$ SoapySDRUtil --find
######################################################
##     Soapy SDR -- the SDR abstraction library     ##
######################################################

usb_claim_interface error -6
Found device 0
  driver = rtlsdr
  label = Generic RTL2832U :: 0000000000000
  manufacturer = Generic
  product = RTL2832U
  serial = 0000000000000
  tuner = unavailable

Found device 1
  driver = sdrplay
  label = SDRplay Dev0 RSP1 B0001P0002
  serial = B0001P0002