0
$\begingroup$

External pps equipment connected with USRP.
In soapy_power,I set --device-settings 'clock_source=external' but failed.

Traceback (most recent call last):
  File "/usr/local/bin/soapy_power", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/soapypower/__main__.py", line 317, in main
    sdr = power.SoapyPower(
  File "/usr/local/lib/python3.8/dist-packages/soapypower/power.py", line 35, in __init__
    self.device = simplesoapy.SoapyDevice(
  File "/usr/local/lib/python3.8/dist-packages/simplesoapy.py", line 125, in __init__
    self.set_setting(setting_name, value)
  File "/usr/local/lib/python3.8/dist-packages/simplesoapy.py", line 414, in set_setting
    raise ValueError('Unknown device setting!')
ValueError: Unknown device setting!

SoapySDRUtil --probe --sparse output as below:

----------------------------------------------------
-- Device identification
----------------------------------------------------
  driver=b200
  hardware=B210
  fpga_version=16.0
  fw_version=8.0
  mboard_id=B210
  mboard_name=usrp
  mboard_serial=8adh058
  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: FP0, RXA, TXA

----------------------------------------------------
-- RX Channel 0
----------------------------------------------------
  Full-duplex: YES
  Supports AGC: NO
  Stream formats: CS8, CS12, CS16, CF32, CF64
  Native format: CS16 [full-scale=32768]
  Stream args:
     * Samples per packet - The number of samples per packet.
       [key=spp, units=samples, default=0, type=int]
     * Bus format - The format of samples over the bus.
       [key=WIRE, type=string, options=(sc8, sc16)]
     * Peak value - The peak value for scaling in complex byte mode.
       [key=peak, default=1.0, type=float]
     * Receive frame buffer size - The size an individual datagram or frame in bytes.
       [key=recv_frame_size, units=bytes, type=int]
     * Receive number of buffers - The number of available buffers.
       [key=num_recv_frames, units=buffers, type=int]
  Antennas: TX/RX, RX2
  Corrections: DC removal, DC offset, IQ balance
  Full gain range: [0, 76, 1] dB
    PGA gain range: [0, 76, 1] dB
  Full freq range: [42, 6008] MHz
    RF freq range: [42, 6008] MHz
    BB freq range: [-8, 8] MHz
  Tune args:
     * LO Offset - Tune the LO with an offset and compensate with the baseband CORDIC.
       [key=OFFSET, units=Hz, default=0.0, type=float, range=[-8e+06, 8e+06, 0.00372529]]
     * BB - Specify a specific value for this component or IGNORE to skip tuning it.
       [key=BB, units=Hz, default=DEFAULT, type=float, range=[-8e+06, 8e+06, 0.00372529], options=(DEFAULT, IGNORE)]
  Sample rates: 0.03125, 0.0314961, 0.031746, 0.032, 0.0322581, ..., 3.2, 4, 5.33333, 8, 16 MSps
  Filter bandwidths: [0.2, 56] MHz
  Sensors: temp, rssi, lo_locked

How to set external clock of --device-settings in soapy_power?

$\endgroup$
5
  • 3
    $\begingroup$ needs detail or clarity: what does "but failed" mean, how do you know, what is your setup, does it work when you directly use UHD instead of going through the Soapy abstraction layer? $\endgroup$ Commented Feb 7, 2022 at 10:53
  • 1
    $\begingroup$ Show the output from SoapySDRUtil for this device. Show your entire command lines when running either command. Have you enabled --debug on soapy_power? $\endgroup$
    – user21417
    Commented Feb 10, 2022 at 14:24
  • 1
    $\begingroup$ Either that setting is wrong, the --device is wrong (and, thus, the setting is wrong). Use the tools provided to make sure your expectations match reality. $\endgroup$
    – user21417
    Commented Feb 10, 2022 at 14:30
  • $\begingroup$ It is unlikely (but possible, I guess) that this setting takes a string. It probably takes an int to mean one of those three options. To help us debug this, you are going to have to be our fingers and do what we would do to figure this out. $\endgroup$
    – user21417
    Commented Feb 10, 2022 at 14:47
  • $\begingroup$ If my vote matters, this is a reasonable question that I'm sure others will ask, especially since SoapySDRUtil output mixes info and settings in the same section. The immediate question is complete, and has been answered to the best of my ability. I've hand-waved the actual problem of how to interface this equipment with external clocks, but that sounds like a different question. $\endgroup$
    – user21417
    Commented Feb 11, 2022 at 22:09

1 Answer 1

2
$\begingroup$

SoapySDR (the package) comes with a very useful utility called SoapySDRUtil. This is what you should use to discover the settings that the Soapy layer knows about your equipment.

Use this to find the supported settings and the syntax it supports. If the clock_source isn't discovered during this probe, then the Soapy layer doesn't know about it. Either that setting is not supported by Soapy or the setting is not supported by the hardware at all.

In this case you should be sure that accessing the hardware directly with supported software supports this setting, as indicated in the comments.

e.g.:

jdv@sigyn:~$ SoapySDRUtil --probe --sparse
Probe device 
Found Rafael Micro R820T tuner
Found Rafael Micro R820T tuner

----------------------------------------------------
-- Device identification
----------------------------------------------------
  driver=RTLSDR
  hardware=R820T
  origin=https://github.com/pothosware/SoapyRTLSDR
  rtl=0

----------------------------------------------------
-- Peripheral summary
----------------------------------------------------
  Channels: 1 Rx, 0 Tx
  Timestamps: NO
  Other Settings:
     * Direct Sampling - RTL-SDR Direct Sampling Mode
       [key=direct_samp, default=0, type=string, options=(0, 1, 2)]
     * Offset Tune - RTL-SDR Offset Tuning Mode
       [key=offset_tune, default=false, type=bool]
     * I/Q Swap - RTL-SDR I/Q Swap Mode
       [key=iq_swap, default=false, type=bool]
     * Digital AGC - RTL-SDR digital AGC Mode
       [key=digital_agc, default=false, type=bool]

----------------------------------------------------
-- RX Channel 0
----------------------------------------------------
  Full-duplex: YES
  Supports AGC: YES
  Stream formats: CS8, CS16, CF32
  Native format: CS8 [full-scale=128]
  Stream args:
     * Buffer Size - Number of bytes per buffer, multiples of 512 only.
       [key=bufflen, units=bytes, default=262144, type=int]
     * Ring buffers - Number of buffers in the ring.
       [key=buffers, units=buffers, default=15, type=int]
     * Async buffers - Number of async usb buffers (advanced).
       [key=asyncBuffs, units=buffers, default=0, type=int]
  Antennas: RX
  Full gain range: [0, 49.6] dB
    TUNER gain range: [0, 49.6] dB
  Full freq range: [23.999, 1764] MHz
    RF freq range: [24, 1764] MHz
    CORR freq range: [-0.001, 0.001] MHz
  Sample rates: 0.25, 1.024, 1.536, 1.792, 1.92, 2.048, 2.16, 2.56, 2.88, 3.2 MSps

Here we see that digital_agc takes a boolean value, and is set to false by default. You need to check your own hardware for the settings that are exposed via Soapy.


We can see from your recent update (thanks for that) that clock_source key does not exist as a settable parameter that takes three options for this device. Rather, it is provided as information about the capabilities of the hardware that is provided in a summary of the equipment as a convenience.

That is, we see that the device can take a variety of clock sources described as "Clock sources: internal, external, gpsdo". Similarly we see it has a "Sensor" that is "ref_locked". Like Clock sources, this is informational as there is nothing to set. Not via Soapy, anyway.

What we would expect to see is something like the [key=clock_source, default=0, type=string, options=(0, 1, 2)] key-value format in various sections of the output if clock_source was a param that was exposed by the equipment to the Soapy layer.

My guess is that this is a hardware specific thing, where it simply finds and uses an external clock source if wired up that way1. I'd check the technical docs for the device. Or, maybe the author of the Soapy module (I'll bet this is on GitHub somewhere...) for this equipment didn't, or couldn't, expose some settings, or it is special for a particular model. More research on your part will be required.

But soapy_power is correctly telling you that setting does not exist. Because it does not exist; not as a Soapy SDR settable parameter.


1 Looking at the documentation for most of the USRP models that accept a clock in, it is clear that the FPGA will detect and use a clock reference if it finds one. Probably on initial power-on. I suspect it also disables the TCXO internal reference clock when doing so.

$\endgroup$
1
  • $\begingroup$ update SoapySDRUtil --probe --sparse output in OP. $\endgroup$
    – kittygirl
    Commented Feb 11, 2022 at 18:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .