Skip to content
Josh Blum edited this page Sep 8, 2017 · 8 revisions

Soapy SDR plugins for UHD devices

https://raw.githubusercontent.com/wiki/pothosware/SoapySDR/images/soapy_sdr_logo.png

The Soapy UHD project provides a plugin module to use UHD devices within the SoapySDR API and software that supports SoapySDR. In addition, the project provides a UHD module to use any SoapySDR device within the UHD API and UHD supported software.

Pre-built installers for various systems are available through the Pothos SDR environment.

The CMake build system will locate boost, UHD, and SoapySDR development files on your system. Plugin modules will be built and installed into UHD and SoapySDR modules directories.

git clone https://github.com/pothosware/SoapyUHD.git
cd SoapyUHD
mkdir build
cd build
cmake ..
make
sudo make install

Use the SoapySDRUtil application to see if SoapySDR can detect your device. In this example, lets use the --probe option to print information about the USRP:

SoapySDRUtil --probe="driver=uhd,type=b200"
######################################################
## Soapy SDR -- the SDR abstraction library
######################################################

Probe device driver=uhd,type=b200
linux; GNU C++ version 4.8.2; Boost_105400; UHD_003.008.004-0-unknown

[INFO] Operating over USB 2.
[INFO] Initialize CODEC control...
[INFO] Initialize Radio control...
[INFO] Performing register loopback test...
[INFO] pass
[INFO] Performing register loopback test...
[INFO] pass
[INFO] Performing CODEC loopback test...
[INFO] pass
[INFO] Performing CODEC loopback test...
[INFO] pass
[INFO] Asking for clock rate 32.000000 MHz
[INFO] Actually got clock rate 32.000000 MHz
[INFO] Performing timer loopback test...
[INFO] pass
[INFO] Performing timer loopback test...
[INFO] pass

----------------------------------------------------
-- Device identification
----------------------------------------------------
  driver=b200
  hardware=B210
  fpga_version=6.0
  fw_version=7.0
  mboard_id=B210
  mboard_name=
  mboard_serial=123456
  rx0_antenna=RX2
  rx0_id=Unknown (0xffff)
  rx0_serial=
  rx0_subdev_name=FE-RX2
  rx0_subdev_spec=A:A A:B
  rx1_antenna=RX2
  rx1_id=Unknown (0xffff)
  rx1_serial=
  rx1_subdev_name=FE-RX1
  rx1_subdev_spec=A:A A:B
  tx0_antenna=TX/RX
  tx0_id=Unknown (0xffff)
  tx0_serial=
  tx0_subdev_name=FE-TX2
  tx0_subdev_spec=A:A A:B
  tx1_antenna=TX/RX
  tx1_id=Unknown (0xffff)
  tx1_serial=
  tx1_subdev_name=FE-TX1
  tx1_subdev_spec=A:A A:B

----------------------------------------------------
-- Peripheral summary
----------------------------------------------------
  Channels: 2 Rx, 2 Tx
  Timestamps: YES
  Clock sources: internal, external, gpsdo
  Time sources: none, internal, external, gpsdo
  Sensors: ref_locked
  GPIOs: RXA, TXA

----------------------------------------------------
-- RX Channel 0
----------------------------------------------------
  Full-duplex: YES
  Antennas: TX/RX, RX2
  Corrections: DC removal, DC offset, IQ balance
  Full gain range: [0, 76] dB
    PGA gain range: [0, 76] dB
  Full freq range: [34, 6016] MHz
    RF freq range: [34, 6016] MHz
    BB freq range: [-16, 16] MHz
  Sample rates: [0.0625, 32] MHz
  Filter bandwidths: [0.2, 56] MHz
  Sensors: lo_locked, rssi

----------------------------------------------------
-- RX Channel 1
----------------------------------------------------
  Full-duplex: YES
  Antennas: TX/RX, RX2
  Corrections: DC removal, DC offset, IQ balance
  Full gain range: [0, 76] dB
    PGA gain range: [0, 76] dB
  Full freq range: [34, 6016] MHz
    RF freq range: [34, 6016] MHz
    BB freq range: [-16, 16] MHz
  Sample rates: [0.0625, 32] MHz
  Filter bandwidths: [0.2, 56] MHz
  Sensors: lo_locked, rssi

----------------------------------------------------
-- TX Channel 0
----------------------------------------------------
  Full-duplex: YES
  Antennas: TX/RX
  Corrections: DC offset, IQ balance
  Full gain range: [0, 89.75] dB
    PGA gain range: [0, 89.75] dB
  Full freq range: [34, 6016] MHz
    RF freq range: [34, 6016] MHz
    BB freq range: [-16, 16] MHz
  Sample rates: [0.0625, 32] MHz
  Filter bandwidths: [0.2, 56] MHz
  Sensors: lo_locked

----------------------------------------------------
-- TX Channel 1
----------------------------------------------------
  Full-duplex: YES
  Antennas: TX/RX
  Corrections: DC offset, IQ balance
  Full gain range: [0, 89.75] dB
    PGA gain range: [0, 89.75] dB
  Full freq range: [34, 6016] MHz
    RF freq range: [34, 6016] MHz
    BB freq range: [-16, 16] MHz
  Sample rates: [0.0625, 32] MHz
  Filter bandwidths: [0.2, 56] MHz
  Sensors: lo_locked

On the other hand, the UHD utilities and API can be used for Soapy SDR supported devices. This feature also allows USRP owners to user their devices remotely through the UHD API using Soapy Remote.

In this example, lets find the RTL dongle using uhd_find_devices:

uhd_find_devices
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.009.001-0-unknown

Detached kernel driver
Found Rafael Micro R820T tuner
Reattached kernel driver
--------------------------------------------------
-- UHD Device 0
--------------------------------------------------
Device Address:
    available: Yes
    driver: rtlsdr
    label: Generic RTL2832U OEM :: 00000001
    manufacturer: Realtek
    product: RTL2838UHIDIR
    rtl: 0
    serial: 00000001
    tuner: Rafael Micro R820T
    type: soapy

Having trouble? If SoapySDRUtil can find your device and UHD cannot, try these two fixes:

  • Make sure that UHD came from the open-source code-base. Closed source binaries may not support module loading.
  • Set the UHD_MODULE_PATH environment variable to the directory where libsoapySupport.so was installed.
    • Example: export UHD_MODULE_PATH=/opt/lib/uhd/modules