Closed AlexandreRouma closed 1 year ago
Hi @AlexandreRouma, thanks for this report! In fact, we almost never provide step sizes for our frequencies in UHD. For frequencies and clock rates, we usually use a coercion paradigm, where the setters won't throw, but will return the coerced value (or you need to call a getter).
The frequency accuracy on B2xx devices is much better than 100 kHz, usually, it's in the sub-Hz range. Let's say we had exactly 1 Hz accuracy, then for B2xx, you'd have to store a list of approx. 6 billion floats (70000000 Hz, 70000001 Hz, 70000002 Hz, all the way up to 6000000000 Hz). Even for the master clock rates, you'd be storing around 60 million values.
This is pretty inefficient, which is why you need a more efficient data structure. In UHD that is, you've guessed it, it's the uhd::freq_range_t
, which stores (for contiguous ranges) start/stop/step, and for non-contiguous ranges multiple start and stop values (potentially with different step values for different sections).
Another reason we don't provide a step size here is b/c the steps to program BBPLL and all the various dividers is not straightforward and it's more complicated than stating a fixed step size over a bunch of ranges. It's not impossible to figure out the precise available rates, but given our coerce-and-query paradigm, it's of limited value. And again, it might have negative value if it would mean dragging around a massive data structure.
Issue Description
The step values for bandwidth and master clock ranges when querying a B series board are zero. This happens both with
uhd_usrp_probe
and by calling UHD from C++, indicating that this is not a bug on the application side.Setup Details
Expected Behavior
The step value describes the actual allowed steps for the parameter.
Actual Behaviour
Steps to reproduce the problem
uhd_usrp_probe
and look at the returned min/max/step values for bandwidth, or calldev->get_rx_bandwidth_range(channelID)
dev->get_master_clock_rate()
and inspect returned range(s).Additional Information
Sample output from
uhd_usrp_probe
:Why this is problematic: Apps usually use fixed values for these settings which means people rarely run into this issue. For apps like SDR++ however, a comprehensive list of sample rates (which knowing the available master clock rates is needed for) and bandwidths must be generated. At the moment, since the step values are 0 I assumed that any multiple of 100KHz will work, but this is not general and probably wrong.