Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clock or time source can be silently altered by UHD on N3xx #556

Open
draeman-synoptic opened this issue Feb 7, 2022 · 0 comments
Open
Labels

Comments

@draeman-synoptic
Copy link
Contributor

draeman-synoptic commented Feb 7, 2022

Issue Description

When calling set_time_source or set_clock_source with a combination that isn't present in the list of valid sync sources, usrp_mpm/periph_manager/n3xx.py silently changes the other source to coerce a valid combination.

I want to use clock_source=external and time_source=gpsdo because I planned to use an external OCXO but wanted the internal GPS receiver's PPS for coarse time sync across distributed radios. I was calling set_clock_source("external") followed by set_time_source("gpsdo"). Both succeed with no unusual log output. It took a while to realize the second call was silently changing the clock_source to also be gpsdo.

The x4xx.py implementation is somewhat better because it at least logs a warning. However, my perspective is this case is better handled by throwing an exception - if a user application is explicitly requesting a clock/time combination that the radio can't honor, the user likely needs to revisit the planned use case. Automatically changing something else under the hood is unexpected behavior and is more likely to be confusing rather than helpful.

The e3xx.py and e31x.py implementations don't come into play yet because they're missing support for the concept of sync sources (see #555).

Setup Details

N320 running UHD 4.1.0.1 and using the multi_usrp API.

Expected Behavior

Attempting to set unsupported clock/time combination using sequential calls to set_clock_source/set_time_source throws an exception.

Actual Behaviour

Attempting to set unsupported clock/time combination using sequential calls to set_clock_source/set_time_source seems successful, but actually performs silent coercion of whichever value was set first.

Steps to reproduce the problem

  1. Create a multi_usrp object to an N320 that has an external clock reference present.
  2. Call set_clock_source("external"). It succeeds and readback confirms the value was set.
  3. Call set_time_source("gpsdo"). It succeeds and readback confirms the value was set.
  4. At this point, clock_source was silently changed to gpsdo.

Additional Information

@mbr0wn mbr0wn added the bug label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants