usrp-users@lists.ettus.com

Discussion and technical support related to USRP, UHD, RFNoC

View all threads

Timed Commands Not Working

JP
Jim Palladino
Tue, Feb 1, 2022 6:55 PM

Hello,

I've been trying to get an app working with timed commands for an E320 or N320 using UHD 4.1. It seems that all commands are processed immediately, not at the time I tell them to. Setting the time to start RX streaming does seem to work fine, but that is a time_spec passed to the streaming function -- not a "timed command".

If, on the other hand, I use timed commands to set a series of RX frequency tunes in the future -- to retune says every 100ms -- that isn't working. All retunes get processed immediately, one after another, with no 100ms gap in between. I would post the code I'm using here, but I went ahead and ran the UHD-included "test_timed_commands" example on both the E320 and N320. The example application does not seem to work right on either device and exhibits the same behaviour I'm seeing with my code. You can see from the results below, that instead of a 100ms gap between get_time_now() calls, as the example app is setup to do, the calls to get_time_now() return immediately.

Here is the output of "test_timed_commands" on the N320. The code is unmodified from the provided example source:

$ ./test_timed_commands

Creating the usrp device with: ...
[INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_4.1.0.4-0-g25d617ca
[INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=192.168.40.2,type=n3xx,product=n320,serial=31EDED4,fpga=XG,claimed=False,addr=192.168.40.2
[INFO] [MPM.PeriphManager] init() called with device args fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'. [INFO] [MPM.Rhodium-0] init() called with args fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'
[INFO] [MPM.Rhodium-1] init() called with args `fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'
Using Device: Single USRP:
Device: N300-Series Device
Mboard 0: n320
RX Channel: 0
RX DSP: 0
RX Dboard: A
RX Subdev: Rhodium
RX Channel: 1
RX DSP: 1
RX Dboard: B
RX Subdev: Rhodium
TX Channel: 0
TX DSP: 0
TX Dboard: A
TX Subdev: Rhodium
TX Channel: 1
TX DSP: 1
TX Dboard: B
TX Subdev: Rhodium

Testing support for timed commands on this hardware... pass

Perform fast readback of registers:
Difference between paired reads: 2016.288086 us

Testing control timed command:
Span      : 100000.000000 us
Now      : 416299.532064 us
Response 1: 418303.910319 us
Response 2: 420352.290853 us
Difference of response time 1: -97995.621745 us
Difference of response time 2: -195947.241211 us
Difference between actual and expected time delta: -97951.619466 us

About to start streaming using timed command:
Received packet: 100 samples, 0 full secs, 0.524535 frac secs
Stream time was: 0 full secs, 0.524535 frac secs
Difference between stream time and first packet: 0.000000 us

Done!

Any thoughts on this would be appreciated, as timed commands are important to the application we are developing.

Thanks,
Jim

Hello, I've been trying to get an app working with timed commands for an E320 or N320 using UHD 4.1. It seems that all commands are processed immediately, not at the time I tell them to. Setting the time to start RX streaming does seem to work fine, but that is a time_spec passed to the streaming function -- not a "timed command". If, on the other hand, I use timed commands to set a series of RX frequency tunes in the future -- to retune says every 100ms -- that isn't working. All retunes get processed immediately, one after another, with no 100ms gap in between. I would post the code I'm using here, but I went ahead and ran the UHD-included "test_timed_commands" example on both the E320 and N320. The example application does not seem to work right on either device and exhibits the same behaviour I'm seeing with my code. You can see from the results below, that instead of a 100ms gap between get_time_now() calls, as the example app is setup to do, the calls to get_time_now() return immediately. Here is the output of "test_timed_commands" on the N320. The code is unmodified from the provided example source: -------------------------------- $ ./test_timed_commands Creating the usrp device with: ... [INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_4.1.0.4-0-g25d617ca [INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=192.168.40.2,type=n3xx,product=n320,serial=31EDED4,fpga=XG,claimed=False,addr=192.168.40.2 [INFO] [MPM.PeriphManager] init() called with device args `fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'. [INFO] [MPM.Rhodium-0] init() called with args `fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external' [INFO] [MPM.Rhodium-1] init() called with args `fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external' Using Device: Single USRP: Device: N300-Series Device Mboard 0: n320 RX Channel: 0 RX DSP: 0 RX Dboard: A RX Subdev: Rhodium RX Channel: 1 RX DSP: 1 RX Dboard: B RX Subdev: Rhodium TX Channel: 0 TX DSP: 0 TX Dboard: A TX Subdev: Rhodium TX Channel: 1 TX DSP: 1 TX Dboard: B TX Subdev: Rhodium Testing support for timed commands on this hardware... pass Perform fast readback of registers: Difference between paired reads: 2016.288086 us Testing control timed command: Span : 100000.000000 us Now : 416299.532064 us Response 1: 418303.910319 us Response 2: 420352.290853 us Difference of response time 1: -97995.621745 us Difference of response time 2: -195947.241211 us Difference between actual and expected time delta: -97951.619466 us About to start streaming using timed command: Received packet: 100 samples, 0 full secs, 0.524535 frac secs Stream time was: 0 full secs, 0.524535 frac secs Difference between stream time and first packet: 0.000000 us Done! --------------------------------------------------- Any thoughts on this would be appreciated, as timed commands are important to the application we are developing. Thanks, Jim
MD
Marcus D. Leech
Tue, Feb 1, 2022 6:59 PM

On 2022-02-01 13:55, Jim Palladino wrote:

Hello,

I've been trying to get an app working with timed commands for an E320
or N320 using UHD 4.1. It seems that all commands are processed
immediately, not at the time I tell them to. Setting the time to start
RX streaming does seem to work fine, but that is a time_spec passed to
the streaming function -- not a "timed command".

If, on the other hand, I use timed commands to set a series of RX
frequency tunes in the future -- to retune says every 100ms -- that
isn't working. All retunes get processed immediately, one after
another, with no 100ms gap in between. I would post the code I'm using
here, but I went ahead and ran the UHD-included "test_timed_commands"
example on both the E320 and N320. The example application does not
seem to work right on either device and exhibits the same behaviour
I'm seeing with my code. You can see from the results below, that
instead of a 100ms gap between get_time_now() calls, as the example
app is setup to do, the calls to get_time_now() return immediately.

Here is the output of "test_timed_commands" on the N320. The code is
unmodified from the provided example source:

$ ./test_timed_commands

Creating the usrp device with: ...
[INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501;
UHD_4.1.0.4-0-g25d617ca
[INFO] [MPMD] Initializing 1 device(s) in parallel with args:
mgmt_addr=192.168.40.2,type=n3xx,product=n320,serial=31EDED4,fpga=XG,claimed=False,addr=192.168.40.2
[INFO] [MPM.PeriphManager] init() called with device args
fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'. [INFO] [MPM.Rhodium-0] init() called with args fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'
[INFO] [MPM.Rhodium-1] init() called with args
`fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'
Using Device: Single USRP:
  Device: N300-Series Device
  Mboard 0: n320
  RX Channel: 0
    RX DSP: 0
    RX Dboard: A
    RX Subdev: Rhodium
  RX Channel: 1
    RX DSP: 1
    RX Dboard: B
    RX Subdev: Rhodium
  TX Channel: 0
    TX DSP: 0
    TX Dboard: A
    TX Subdev: Rhodium
  TX Channel: 1
    TX DSP: 1
    TX Dboard: B
    TX Subdev: Rhodium

Testing support for timed commands on this hardware... pass

Perform fast readback of registers:
 Difference between paired reads: 2016.288086 us

Testing control timed command:
 Span      : 100000.000000 us
 Now       : 416299.532064 us
 Response 1: 418303.910319 us
 Response 2: 420352.290853 us
 Difference of response time 1: -97995.621745 us
 Difference of response time 2: -195947.241211 us
 Difference between actual and expected time delta: -97951.619466 us

About to start streaming using timed command:
 Received packet: 100 samples, 0 full secs, 0.524535 frac secs
 Stream time was: 0 full secs, 0.524535 frac secs
 Difference between stream time and first packet: 0.000000 us

Done!

Any thoughts on this would be appreciated, as timed commands are
important to the application we are developing.

Thanks,
Jim

How are you setting device time at startup?

On 2022-02-01 13:55, Jim Palladino wrote: > Hello, > > I've been trying to get an app working with timed commands for an E320 > or N320 using UHD 4.1. It seems that all commands are processed > immediately, not at the time I tell them to. Setting the time to start > RX streaming does seem to work fine, but that is a time_spec passed to > the streaming function -- not a "timed command". > > If, on the other hand, I use timed commands to set a series of RX > frequency tunes in the future -- to retune says every 100ms -- that > isn't working. All retunes get processed immediately, one after > another, with no 100ms gap in between. I would post the code I'm using > here, but I went ahead and ran the UHD-included "test_timed_commands" > example on both the E320 and N320. The example application does not > seem to work right on either device and exhibits the same behaviour > I'm seeing with my code. You can see from the results below, that > instead of a 100ms gap between get_time_now() calls, as the example > app is setup to do, the calls to get_time_now() return immediately. > > Here is the output of "test_timed_commands" on the N320. The code is > unmodified from the provided example source: > -------------------------------- > $ ./test_timed_commands > > Creating the usrp device with: ... > [INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; > UHD_4.1.0.4-0-g25d617ca > [INFO] [MPMD] Initializing 1 device(s) in parallel with args: > mgmt_addr=192.168.40.2,type=n3xx,product=n320,serial=31EDED4,fpga=XG,claimed=False,addr=192.168.40.2 > [INFO] [MPM.PeriphManager] init() called with device args > `fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'. > [INFO] [MPM.Rhodium-0] init() called with args > `fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external' > [INFO] [MPM.Rhodium-1] init() called with args > `fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external' > Using Device: Single USRP: >   Device: N300-Series Device >   Mboard 0: n320 >   RX Channel: 0 >     RX DSP: 0 >     RX Dboard: A >     RX Subdev: Rhodium >   RX Channel: 1 >     RX DSP: 1 >     RX Dboard: B >     RX Subdev: Rhodium >   TX Channel: 0 >     TX DSP: 0 >     TX Dboard: A >     TX Subdev: Rhodium >   TX Channel: 1 >     TX DSP: 1 >     TX Dboard: B >     TX Subdev: Rhodium > > > Testing support for timed commands on this hardware... pass > > Perform fast readback of registers: >  Difference between paired reads: 2016.288086 us > > Testing control timed command: >  Span      : 100000.000000 us >  Now       : 416299.532064 us >  Response 1: 418303.910319 us >  Response 2: 420352.290853 us >  Difference of response time 1: -97995.621745 us >  Difference of response time 2: -195947.241211 us >  Difference between actual and expected time delta: -97951.619466 us > > About to start streaming using timed command: >  Received packet: 100 samples, 0 full secs, 0.524535 frac secs >  Stream time was: 0 full secs, 0.524535 frac secs >  Difference between stream time and first packet: 0.000000 us > > Done! > --------------------------------------------------- > > Any thoughts on this would be appreciated, as timed commands are > important to the application we are developing. > > Thanks, > Jim > > > How are you setting device time at startup?
JP
Jim Palladino
Tue, Feb 1, 2022 7:10 PM

Hi Marcus,

In the app I'm writing, for now I'm just setting the time to '0.0' after startup, like:
usrp->set_time_now(uhd::time_spec_t(0.0));

For the "test_timed_commands.cpp" test app, I'm just executing what is here:
https://github.com/EttusResearch/uhd/blob/UHD-4.1/host/examples/test_timed_commands.cpp

It doesn't appear to matter, but my E320 is setup to use an internal reference, the N320 is external.

Thanks,
Jim


From: Marcus D. Leech patchvonbraun@gmail.com
Sent: Tuesday, February 1, 2022 1:59 PM
To: usrp-users@lists.ettus.com usrp-users@lists.ettus.com
Subject: [USRP-users] Re: Timed Commands Not Working

On 2022-02-01 13:55, Jim Palladino wrote:
Hello,

I've been trying to get an app working with timed commands for an E320 or N320 using UHD 4.1. It seems that all commands are processed immediately, not at the time I tell them to. Setting the time to start RX streaming does seem to work fine, but that is a time_spec passed to the streaming function -- not a "timed command".

If, on the other hand, I use timed commands to set a series of RX frequency tunes in the future -- to retune says every 100ms -- that isn't working. All retunes get processed immediately, one after another, with no 100ms gap in between. I would post the code I'm using here, but I went ahead and ran the UHD-included "test_timed_commands" example on both the E320 and N320. The example application does not seem to work right on either device and exhibits the same behaviour I'm seeing with my code. You can see from the results below, that instead of a 100ms gap between get_time_now() calls, as the example app is setup to do, the calls to get_time_now() return immediately.

Here is the output of "test_timed_commands" on the N320. The code is unmodified from the provided example source:

$ ./test_timed_commands

Creating the usrp device with: ...
[INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_4.1.0.4-0-g25d617ca
[INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=192.168.40.2,type=n3xx,product=n320,serial=31EDED4,fpga=XG,claimed=False,addr=192.168.40.2
[INFO] [MPM.PeriphManager] init() called with device args fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'. [INFO] [MPM.Rhodium-0] init() called with args fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'
[INFO] [MPM.Rhodium-1] init() called with args `fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'
Using Device: Single USRP:
Device: N300-Series Device
Mboard 0: n320
RX Channel: 0
RX DSP: 0
RX Dboard: A
RX Subdev: Rhodium
RX Channel: 1
RX DSP: 1
RX Dboard: B
RX Subdev: Rhodium
TX Channel: 0
TX DSP: 0
TX Dboard: A
TX Subdev: Rhodium
TX Channel: 1
TX DSP: 1
TX Dboard: B
TX Subdev: Rhodium

Testing support for timed commands on this hardware... pass

Perform fast readback of registers:
Difference between paired reads: 2016.288086 us

Testing control timed command:
Span      : 100000.000000 us
Now      : 416299.532064 us
Response 1: 418303.910319 us
Response 2: 420352.290853 us
Difference of response time 1: -97995.621745 us
Difference of response time 2: -195947.241211 us
Difference between actual and expected time delta: -97951.619466 us

About to start streaming using timed command:
Received packet: 100 samples, 0 full secs, 0.524535 frac secs
Stream time was: 0 full secs, 0.524535 frac secs
Difference between stream time and first packet: 0.000000 us

Done!

Any thoughts on this would be appreciated, as timed commands are important to the application we are developing.

Thanks,
Jim

How are you setting device time at startup?

Hi Marcus, In the app I'm writing, for now I'm just setting the time to '0.0' after startup, like: usrp->set_time_now(uhd::time_spec_t(0.0)); For the "test_timed_commands.cpp" test app, I'm just executing what is here: https://github.com/EttusResearch/uhd/blob/UHD-4.1/host/examples/test_timed_commands.cpp It doesn't appear to matter, but my E320 is setup to use an internal reference, the N320 is external. Thanks, Jim ________________________________ From: Marcus D. Leech <patchvonbraun@gmail.com> Sent: Tuesday, February 1, 2022 1:59 PM To: usrp-users@lists.ettus.com <usrp-users@lists.ettus.com> Subject: [USRP-users] Re: Timed Commands Not Working On 2022-02-01 13:55, Jim Palladino wrote: Hello, I've been trying to get an app working with timed commands for an E320 or N320 using UHD 4.1. It seems that all commands are processed immediately, not at the time I tell them to. Setting the time to start RX streaming does seem to work fine, but that is a time_spec passed to the streaming function -- not a "timed command". If, on the other hand, I use timed commands to set a series of RX frequency tunes in the future -- to retune says every 100ms -- that isn't working. All retunes get processed immediately, one after another, with no 100ms gap in between. I would post the code I'm using here, but I went ahead and ran the UHD-included "test_timed_commands" example on both the E320 and N320. The example application does not seem to work right on either device and exhibits the same behaviour I'm seeing with my code. You can see from the results below, that instead of a 100ms gap between get_time_now() calls, as the example app is setup to do, the calls to get_time_now() return immediately. Here is the output of "test_timed_commands" on the N320. The code is unmodified from the provided example source: -------------------------------- $ ./test_timed_commands Creating the usrp device with: ... [INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_4.1.0.4-0-g25d617ca [INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=192.168.40.2,type=n3xx,product=n320,serial=31EDED4,fpga=XG,claimed=False,addr=192.168.40.2 [INFO] [MPM.PeriphManager] init() called with device args `fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'. [INFO] [MPM.Rhodium-0] init() called with args `fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external' [INFO] [MPM.Rhodium-1] init() called with args `fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external' Using Device: Single USRP: Device: N300-Series Device Mboard 0: n320 RX Channel: 0 RX DSP: 0 RX Dboard: A RX Subdev: Rhodium RX Channel: 1 RX DSP: 1 RX Dboard: B RX Subdev: Rhodium TX Channel: 0 TX DSP: 0 TX Dboard: A TX Subdev: Rhodium TX Channel: 1 TX DSP: 1 TX Dboard: B TX Subdev: Rhodium Testing support for timed commands on this hardware... pass Perform fast readback of registers: Difference between paired reads: 2016.288086 us Testing control timed command: Span : 100000.000000 us Now : 416299.532064 us Response 1: 418303.910319 us Response 2: 420352.290853 us Difference of response time 1: -97995.621745 us Difference of response time 2: -195947.241211 us Difference between actual and expected time delta: -97951.619466 us About to start streaming using timed command: Received packet: 100 samples, 0 full secs, 0.524535 frac secs Stream time was: 0 full secs, 0.524535 frac secs Difference between stream time and first packet: 0.000000 us Done! --------------------------------------------------- Any thoughts on this would be appreciated, as timed commands are important to the application we are developing. Thanks, Jim How are you setting device time at startup?
MD
Marcus D. Leech
Tue, Feb 1, 2022 7:13 PM

On 2022-02-01 14:10, Jim Palladino wrote:

Hi Marcus,

In the app I'm writing, for now I'm just setting the time to '0.0'
after startup, like:
   usrp->set_time_now(uhd::time_spec_t(0.0));

That may be part of your problem--that may produce two separate
transactions for the radio timestamp registers.

Use set_time_unknown_pps() instead, and see if this changes things.

Also, make sure you're setting master_clock_rate  in the device arguments.

For the "test_timed_commands.cpp" test app, I'm just executing what is
here:
https://github.com/EttusResearch/uhd/blob/UHD-4.1/host/examples/test_timed_commands.cpp

It doesn't appear to matter, but my E320 is setup to use an internal
reference, the N320 is external.

Thanks,
Jim


From: Marcus D. Leech patchvonbraun@gmail.com
Sent: Tuesday, February 1, 2022 1:59 PM
To: usrp-users@lists.ettus.com usrp-users@lists.ettus.com
Subject: [USRP-users] Re: Timed Commands Not Working
On 2022-02-01 13:55, Jim Palladino wrote:

Hello,

I've been trying to get an app working with timed commands for an
E320 or N320 using UHD 4.1. It seems that all commands are processed
immediately, not at the time I tell them to. Setting the time to
start RX streaming does seem to work fine, but that is a time_spec
passed to the streaming function -- not a "timed command".

If, on the other hand, I use timed commands to set a series of RX
frequency tunes in the future -- to retune says every 100ms -- that
isn't working. All retunes get processed immediately, one after
another, with no 100ms gap in between. I would post the code I'm
using here, but I went ahead and ran the UHD-included
"test_timed_commands" example on both the E320 and N320. The example
application does not seem to work right on either device and exhibits
the same behaviour I'm seeing with my code. You can see from the
results below, that instead of a 100ms gap between get_time_now()
calls, as the example app is setup to do, the calls to get_time_now()
return immediately.

Here is the output of "test_timed_commands" on the N320. The code is
unmodified from the provided example source:

$ ./test_timed_commands

Creating the usrp device with: ...
[INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501;
UHD_4.1.0.4-0-g25d617ca
[INFO] [MPMD] Initializing 1 device(s) in parallel with args:
mgmt_addr=192.168.40.2,type=n3xx,product=n320,serial=31EDED4,fpga=XG,claimed=False,addr=192.168.40.2
[INFO] [MPM.PeriphManager] init() called with device args
fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'. [INFO] [MPM.Rhodium-0] init() called with args fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'
[INFO] [MPM.Rhodium-1] init() called with args
`fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'
Using Device: Single USRP:
  Device: N300-Series Device
  Mboard 0: n320
  RX Channel: 0
    RX DSP: 0
    RX Dboard: A
    RX Subdev: Rhodium
  RX Channel: 1
    RX DSP: 1
    RX Dboard: B
    RX Subdev: Rhodium
  TX Channel: 0
    TX DSP: 0
    TX Dboard: A
    TX Subdev: Rhodium
  TX Channel: 1
    TX DSP: 1
    TX Dboard: B
    TX Subdev: Rhodium

Testing support for timed commands on this hardware... pass

Perform fast readback of registers:
 Difference between paired reads: 2016.288086 us

Testing control timed command:
 Span      : 100000.000000 us
 Now       : 416299.532064 us
 Response 1: 418303.910319 us
 Response 2: 420352.290853 us
 Difference of response time 1: -97995.621745 us
 Difference of response time 2: -195947.241211 us
 Difference between actual and expected time delta: -97951.619466 us

About to start streaming using timed command:
 Received packet: 100 samples, 0 full secs, 0.524535 frac secs
 Stream time was: 0 full secs, 0.524535 frac secs
 Difference between stream time and first packet: 0.000000 us

Done!

Any thoughts on this would be appreciated, as timed commands are
important to the application we are developing.

Thanks,
Jim

How are you setting device time at startup?

On 2022-02-01 14:10, Jim Palladino wrote: > Hi Marcus, > > In the app I'm writing, for now I'm just setting the time to '0.0' > after startup, like: >    usrp->set_time_now(uhd::time_spec_t(0.0)); That may be part of your problem--that may produce two separate transactions for the radio timestamp registers. Use set_time_unknown_pps() instead, and see if this changes things. Also, make sure you're setting master_clock_rate  in the device arguments. > > For the "test_timed_commands.cpp" test app, I'm just executing what is > here: > https://github.com/EttusResearch/uhd/blob/UHD-4.1/host/examples/test_timed_commands.cpp > > It doesn't appear to matter, but my E320 is setup to use an internal > reference, the N320 is external. > > Thanks, > Jim > > > ------------------------------------------------------------------------ > *From:* Marcus D. Leech <patchvonbraun@gmail.com> > *Sent:* Tuesday, February 1, 2022 1:59 PM > *To:* usrp-users@lists.ettus.com <usrp-users@lists.ettus.com> > *Subject:* [USRP-users] Re: Timed Commands Not Working > On 2022-02-01 13:55, Jim Palladino wrote: >> Hello, >> >> I've been trying to get an app working with timed commands for an >> E320 or N320 using UHD 4.1. It seems that all commands are processed >> immediately, not at the time I tell them to. Setting the time to >> start RX streaming does seem to work fine, but that is a time_spec >> passed to the streaming function -- not a "timed command". >> >> If, on the other hand, I use timed commands to set a series of RX >> frequency tunes in the future -- to retune says every 100ms -- that >> isn't working. All retunes get processed immediately, one after >> another, with no 100ms gap in between. I would post the code I'm >> using here, but I went ahead and ran the UHD-included >> "test_timed_commands" example on both the E320 and N320. The example >> application does not seem to work right on either device and exhibits >> the same behaviour I'm seeing with my code. You can see from the >> results below, that instead of a 100ms gap between get_time_now() >> calls, as the example app is setup to do, the calls to get_time_now() >> return immediately. >> >> Here is the output of "test_timed_commands" on the N320. The code is >> unmodified from the provided example source: >> -------------------------------- >> $ ./test_timed_commands >> >> Creating the usrp device with: ... >> [INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; >> UHD_4.1.0.4-0-g25d617ca >> [INFO] [MPMD] Initializing 1 device(s) in parallel with args: >> mgmt_addr=192.168.40.2,type=n3xx,product=n320,serial=31EDED4,fpga=XG,claimed=False,addr=192.168.40.2 >> [INFO] [MPM.PeriphManager] init() called with device args >> `fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'. >> [INFO] [MPM.Rhodium-0] init() called with args >> `fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external' >> [INFO] [MPM.Rhodium-1] init() called with args >> `fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external' >> Using Device: Single USRP: >>   Device: N300-Series Device >>   Mboard 0: n320 >>   RX Channel: 0 >>     RX DSP: 0 >>     RX Dboard: A >>     RX Subdev: Rhodium >>   RX Channel: 1 >>     RX DSP: 1 >>     RX Dboard: B >>     RX Subdev: Rhodium >>   TX Channel: 0 >>     TX DSP: 0 >>     TX Dboard: A >>     TX Subdev: Rhodium >>   TX Channel: 1 >>     TX DSP: 1 >>     TX Dboard: B >>     TX Subdev: Rhodium >> >> >> Testing support for timed commands on this hardware... pass >> >> Perform fast readback of registers: >>  Difference between paired reads: 2016.288086 us >> >> Testing control timed command: >>  Span      : 100000.000000 us >>  Now       : 416299.532064 us >>  Response 1: 418303.910319 us >>  Response 2: 420352.290853 us >>  Difference of response time 1: -97995.621745 us >>  Difference of response time 2: -195947.241211 us >>  Difference between actual and expected time delta: -97951.619466 us >> >> About to start streaming using timed command: >>  Received packet: 100 samples, 0 full secs, 0.524535 frac secs >>  Stream time was: 0 full secs, 0.524535 frac secs >>  Difference between stream time and first packet: 0.000000 us >> >> Done! >> --------------------------------------------------- >> >> Any thoughts on this would be appreciated, as timed commands are >> important to the application we are developing. >> >> Thanks, >> Jim >> >> >> > How are you setting device time at startup? > >
JP
Jim Palladino
Wed, Feb 2, 2022 12:30 PM

Marcus, thanks for the suggestions. I made sure to set the master clock rate on both the E320 and N320. In the app I'm developing, I also tried set_time_unknown_pps() instead of set_time_now() as you suggested. Unfortunately, neither one of those made a difference.

On the E320, I reflashed the FPGA to the standard E320_1G image and rebooted. This is the output of USRP probe:

[INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_4.1.0.HEAD-0-g8ce6e64f
[INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=11.200.111.66,type=e3xx,product=e320,serial=31B05E5,fpga=1G,claimed=False,addr=11.200.111.66
[INFO] [MPM.main] Launching USRP/MPM, version: 4.1.0.2-g8ce6e64f
[INFO] [MPM.main] Spawning RPC process...
[INFO] [MPM.PeriphManager] Device serial number: 31B05E5
[INFO] [MPM.PeriphManager] Found 1 daughterboard(s).
[INFO] [MPM.RPCServer] RPC server ready!
[INFO] [MPM.RPCServer] Spawning watchdog task...
[INFO] [MPM.PeriphManager] init() called with device args `fpga=1G,mgmt_addr=11.200.111.66,product=e320'.
[INFO] [0/Radio#0] Performing CODEC loopback test on channel 0 ...
[INFO] [0/Radio#0] CODEC loopback test passed
[INFO] [0/Radio#0] Performing CODEC loopback test on channel 1 ...
[INFO] [0/Radio#0] CODEC loopback test passed
[INFO] [0/DmaFIFO#0] BIST passed (Estimated Minimum Throughput: 1361 MB/s)
[INFO] [0/DmaFIFO#0] BIST passed (Estimated Minimum Throughput: 1361 MB/s)


/
|      Device: E300-Series Device
|    _____________________________________________________
|    /
|  |      Mboard: ni-e320-31B05E5
|  |  eeprom_version: 2
|  |  fs_version: 20210910211129
|  |  mender_artifact: v4.1.0.2_e320
|  |  mpm_sw_version: 4.1.0.2-g8ce6e64f
|  |  pid: 58144
|  |  product: e320
|  |  rev: 2
|  |  rpc_connection: remote
|  |  serial: 31B05E5
|  |  type: e3xx
|  |  MPM Version: 4.0
|  |  FPGA Version: 6.0
|  |  FPGA git hash: d5c2750.clean
|  |
|  |  Time sources:  internal, external, gpsdo
|  |  Clock sources: external, internal, gpsdo
|  |  Sensors: ref_locked, gps_locked, fan, temp_fpga, temp_internal, temp_rf_channelA, temp_rf_channelB, temp_main_power, gps_gpgga, gps_sky, gps_time, gps_tpv
|    _____________________________________________________
|    /
|  |      RFNoC blocks on this device:
|  |
|  |  * 0/DDC#0
|  |  * 0/DUC#0
|  |  * 0/DmaFIFO#0
|  |  * 0/Radio#0
|    _____________________________________________________
|    /
|  |      Static connections on this device:
|  |
|  |  * 0/SEP#0:0==>0/DUC#0:0
|  |  * 0/DUC#0:0==>0/Radio#0:0
|  |  * 0/Radio#0:0==>0/DDC#0:0
|  |  * 0/DDC#0:0==>0/SEP#0:0
|  |  * 0/SEP#1:0==>0/DUC#0:1
|  |  * 0/DUC#0:1==>0/Radio#0:1
|  |  * 0/Radio#0:1==>0/DDC#0:1
|  |  * 0/DDC#0:1==>0/SEP#1:0
|  |  * 0/SEP#2:0==>0/DmaFIFO#0:0
|  |  * 0/DmaFIFO#0:0==>0/SEP#2:0
|  |  * 0/SEP#3:0==>0/DmaFIFO#0:1
|  |  * 0/DmaFIFO#0:1==>0/SEP#3:0
|    _____________________________________________________
|    /
|  |      TX Dboard: 0/Radio#0
|  |    _____________________________________________________
|  |    /
|  |  |      TX Frontend: 0
|  |  |  Name: E3xx
|  |  |  Antennas: TX/RX
|  |  |  Freq range: 47.000 to 6000.000 MHz
|  |  |  Gain range PGA: 0.0 to 89.8 step 0.2 dB
|  |  |  Bandwidth range: 20000000.0 to 40000000.0 step 0.0 Hz
|  |  |  Connection Type: IQ
|  |  |  Uses LO offset: No
|  |    _____________________________________________________
|  |    /
|  |  |      TX Frontend: 1
|  |  |  Name: E3xx
|  |  |  Antennas: TX/RX
|  |  |  Freq range: 47.000 to 6000.000 MHz
|  |  |  Gain range PGA: 0.0 to 89.8 step 0.2 dB
|  |  |  Bandwidth range: 20000000.0 to 40000000.0 step 0.0 Hz
|  |  |  Connection Type: IQ
|  |  |  Uses LO offset: No
|    _____________________________________________________
|    /
|  |      RX Dboard: 0/Radio#0
|  |    _____________________________________________________
|  |    /
|  |  |      RX Frontend: 0
|  |  |  Name: E3xx
|  |  |  Antennas: RX2, TX/RX
|  |  |  Freq range: 70.000 to 6000.000 MHz
|  |  |  Gain range PGA: 0.0 to 76.0 step 1.0 dB
|  |  |  Bandwidth range: 20000000.0 to 40000000.0 step 0.0 Hz
|  |  |  Connection Type: IQ
|  |  |  Uses LO offset: No
|  |    _____________________________________________________
|  |    /
|  |  |      RX Frontend: 1
|  |  |  Name: E3xx
|  |  |  Antennas: RX2, TX/RX
|  |  |  Freq range: 70.000 to 6000.000 MHz
|  |  |  Gain range PGA: 0.0 to 76.0 step 1.0 dB
|  |  |  Bandwidth range: 20000000.0 to 40000000.0 step 0.0 Hz
|  |  |  Connection Type: IQ
|  |  |  Uses LO offset: No

If I then run the following from uhd/examples (and I have tried different master clock rates):
$ ./test_timed_commands --args "master_clock_rate=61.44e6"

I'm still seeing the following:


$ ./test_timed_commands --args "master_clock_rate=61.44e6"

Creating the usrp device with: master_clock_rate=61.44e6...
[INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_4.1.0.HEAD-0-g8ce6e64f
[INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=11.200.111.66,type=e3xx,product=e320,serial=31B05E5,fpga=1G,claimed=False,addr=11.200.111.66,master_clock_rate=61.44e6
[INFO] [MPM.PeriphManager] init() called with device args `fpga=1G,master_clock_rate=61.44e6,mgmt_addr=11.200.111.66,product=e320'.
[INFO] [0/Radio#0] Performing CODEC loopback test on channel 0 ...
[INFO] [0/Radio#0] CODEC loopback test passed
[INFO] [0/Radio#0] Performing CODEC loopback test on channel 1 ...
[INFO] [0/Radio#0] CODEC loopback test passed
[INFO] [0/DmaFIFO#0] BIST passed (Estimated Minimum Throughput: 1361 MB/s)
[INFO] [0/DmaFIFO#0] BIST passed (Estimated Minimum Throughput: 1361 MB/s)
Using Device: Single USRP:
Device: E300-Series Device
Mboard 0: e320
RX Channel: 0
RX DSP: 0
RX Dboard: A
RX Subdev: E3xx
RX Channel: 1
RX DSP: 1
RX Dboard: A
RX Subdev: E3xx
TX Channel: 0
TX DSP: 0
TX Dboard: A
TX Subdev: E3xx
TX Channel: 1
TX DSP: 1
TX Dboard: A
TX Subdev: E3xx

Testing support for timed commands on this hardware... pass

Perform fast readback of registers:
Difference between paired reads: 1982.600911 us

Testing control timed command:
Span      : 100000.000000 us
Now      : 421985.465495 us
Response 1: 423872.639974 us
Response 2: 425706.005859 us
Difference of response time 1: -98112.825521 us
Difference of response time 2: -196279.459635 us
Difference between actual and expected time delta: -98166.634115 us

About to start streaming using timed command:
Received packet: 100 samples, 0 full secs, 0.535028 frac secs
Stream time was: 0 full secs, 0.535028 frac secs
Difference between stream time and first packet: -0.000000 us

Done!

So, you can see I still have the same issue where it looks like the "timed commands" are getting executed immediately -- not at their expected future times (100ms apart). Please let me know if you have any other ideas. Or maybe someone can confirm that test_timed_commands() is producing expected results for them in UHD 4.1?

Thanks,
Jim


From: Marcus D. Leech patchvonbraun@gmail.com
Sent: Tuesday, February 1, 2022 2:13 PM
To: Jim Palladino jim@gardettoengineering.com; USRP-users@lists.ettus.com usrp-users@lists.ettus.com
Subject: Re: [USRP-users] Re: Timed Commands Not Working

On 2022-02-01 14:10, Jim Palladino wrote:
Hi Marcus,

In the app I'm writing, for now I'm just setting the time to '0.0' after startup, like:
usrp->set_time_now(uhd::time_spec_t(0.0));
That may be part of your problem--that may produce two separate transactions for the radio timestamp registers.

Use set_time_unknown_pps() instead, and see if this changes things.

Also, make sure you're setting master_clock_rate  in the device arguments.

For the "test_timed_commands.cpp" test app, I'm just executing what is here:
https://github.com/EttusResearch/uhd/blob/UHD-4.1/host/examples/test_timed_commands.cpphttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_EttusResearch_uhd_blob_UHD-2D4.1_host_examples_test-5Ftimed-5Fcommands.cpp&d=DwMDaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=XUEEtUEfpaAEGxRI-WGuqHauOvsPdD2NZkfwDnwpYx0&m=2RP1x-Dxx1TwoZef3IUmkTi4mB5REW9yUXnCAYtBmgM&s=socf8y0QRKBM-pQcT5qgsvrxQZkd2hcJuFJ5Ix0rImE&e=

It doesn't appear to matter, but my E320 is setup to use an internal reference, the N320 is external.

Thanks,
Jim


From: Marcus D. Leech patchvonbraun@gmail.commailto:patchvonbraun@gmail.com
Sent: Tuesday, February 1, 2022 1:59 PM
To: usrp-users@lists.ettus.commailto:usrp-users@lists.ettus.com usrp-users@lists.ettus.commailto:usrp-users@lists.ettus.com
Subject: [USRP-users] Re: Timed Commands Not Working

On 2022-02-01 13:55, Jim Palladino wrote:
Hello,

I've been trying to get an app working with timed commands for an E320 or N320 using UHD 4.1. It seems that all commands are processed immediately, not at the time I tell them to. Setting the time to start RX streaming does seem to work fine, but that is a time_spec passed to the streaming function -- not a "timed command".

If, on the other hand, I use timed commands to set a series of RX frequency tunes in the future -- to retune says every 100ms -- that isn't working. All retunes get processed immediately, one after another, with no 100ms gap in between. I would post the code I'm using here, but I went ahead and ran the UHD-included "test_timed_commands" example on both the E320 and N320. The example application does not seem to work right on either device and exhibits the same behaviour I'm seeing with my code. You can see from the results below, that instead of a 100ms gap between get_time_now() calls, as the example app is setup to do, the calls to get_time_now() return immediately.

Here is the output of "test_timed_commands" on the N320. The code is unmodified from the provided example source:

$ ./test_timed_commands

Creating the usrp device with: ...
[INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_4.1.0.4-0-g25d617ca
[INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=192.168.40.2,type=n3xx,product=n320,serial=31EDED4,fpga=XG,claimed=False,addr=192.168.40.2
[INFO] [MPM.PeriphManager] init() called with device args fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'. [INFO] [MPM.Rhodium-0] init() called with args fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'
[INFO] [MPM.Rhodium-1] init() called with args `fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'
Using Device: Single USRP:
Device: N300-Series Device
Mboard 0: n320
RX Channel: 0
RX DSP: 0
RX Dboard: A
RX Subdev: Rhodium
RX Channel: 1
RX DSP: 1
RX Dboard: B
RX Subdev: Rhodium
TX Channel: 0
TX DSP: 0
TX Dboard: A
TX Subdev: Rhodium
TX Channel: 1
TX DSP: 1
TX Dboard: B
TX Subdev: Rhodium

Testing support for timed commands on this hardware... pass

Perform fast readback of registers:
Difference between paired reads: 2016.288086 us

Testing control timed command:
Span      : 100000.000000 us
Now      : 416299.532064 us
Response 1: 418303.910319 us
Response 2: 420352.290853 us
Difference of response time 1: -97995.621745 us
Difference of response time 2: -195947.241211 us
Difference between actual and expected time delta: -97951.619466 us

About to start streaming using timed command:
Received packet: 100 samples, 0 full secs, 0.524535 frac secs
Stream time was: 0 full secs, 0.524535 frac secs
Difference between stream time and first packet: 0.000000 us

Done!

Any thoughts on this would be appreciated, as timed commands are important to the application we are developing.

Thanks,
Jim

How are you setting device time at startup?

Marcus, thanks for the suggestions. I made sure to set the master clock rate on both the E320 and N320. In the app I'm developing, I also tried set_time_unknown_pps() instead of set_time_now() as you suggested. Unfortunately, neither one of those made a difference. On the E320, I reflashed the FPGA to the standard E320_1G image and rebooted. This is the output of USRP probe: ------------------------------ [INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_4.1.0.HEAD-0-g8ce6e64f [INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=11.200.111.66,type=e3xx,product=e320,serial=31B05E5,fpga=1G,claimed=False,addr=11.200.111.66 [INFO] [MPM.main] Launching USRP/MPM, version: 4.1.0.2-g8ce6e64f [INFO] [MPM.main] Spawning RPC process... [INFO] [MPM.PeriphManager] Device serial number: 31B05E5 [INFO] [MPM.PeriphManager] Found 1 daughterboard(s). [INFO] [MPM.RPCServer] RPC server ready! [INFO] [MPM.RPCServer] Spawning watchdog task... [INFO] [MPM.PeriphManager] init() called with device args `fpga=1G,mgmt_addr=11.200.111.66,product=e320'. [INFO] [0/Radio#0] Performing CODEC loopback test on channel 0 ... [INFO] [0/Radio#0] CODEC loopback test passed [INFO] [0/Radio#0] Performing CODEC loopback test on channel 1 ... [INFO] [0/Radio#0] CODEC loopback test passed [INFO] [0/DmaFIFO#0] BIST passed (Estimated Minimum Throughput: 1361 MB/s) [INFO] [0/DmaFIFO#0] BIST passed (Estimated Minimum Throughput: 1361 MB/s) _____________________________________________________ / | Device: E300-Series Device | _____________________________________________________ | / | | Mboard: ni-e320-31B05E5 | | eeprom_version: 2 | | fs_version: 20210910211129 | | mender_artifact: v4.1.0.2_e320 | | mpm_sw_version: 4.1.0.2-g8ce6e64f | | pid: 58144 | | product: e320 | | rev: 2 | | rpc_connection: remote | | serial: 31B05E5 | | type: e3xx | | MPM Version: 4.0 | | FPGA Version: 6.0 | | FPGA git hash: d5c2750.clean | | | | Time sources: internal, external, gpsdo | | Clock sources: external, internal, gpsdo | | Sensors: ref_locked, gps_locked, fan, temp_fpga, temp_internal, temp_rf_channelA, temp_rf_channelB, temp_main_power, gps_gpgga, gps_sky, gps_time, gps_tpv | _____________________________________________________ | / | | RFNoC blocks on this device: | | | | * 0/DDC#0 | | * 0/DUC#0 | | * 0/DmaFIFO#0 | | * 0/Radio#0 | _____________________________________________________ | / | | Static connections on this device: | | | | * 0/SEP#0:0==>0/DUC#0:0 | | * 0/DUC#0:0==>0/Radio#0:0 | | * 0/Radio#0:0==>0/DDC#0:0 | | * 0/DDC#0:0==>0/SEP#0:0 | | * 0/SEP#1:0==>0/DUC#0:1 | | * 0/DUC#0:1==>0/Radio#0:1 | | * 0/Radio#0:1==>0/DDC#0:1 | | * 0/DDC#0:1==>0/SEP#1:0 | | * 0/SEP#2:0==>0/DmaFIFO#0:0 | | * 0/DmaFIFO#0:0==>0/SEP#2:0 | | * 0/SEP#3:0==>0/DmaFIFO#0:1 | | * 0/DmaFIFO#0:1==>0/SEP#3:0 | _____________________________________________________ | / | | TX Dboard: 0/Radio#0 | | _____________________________________________________ | | / | | | TX Frontend: 0 | | | Name: E3xx | | | Antennas: TX/RX | | | Freq range: 47.000 to 6000.000 MHz | | | Gain range PGA: 0.0 to 89.8 step 0.2 dB | | | Bandwidth range: 20000000.0 to 40000000.0 step 0.0 Hz | | | Connection Type: IQ | | | Uses LO offset: No | | _____________________________________________________ | | / | | | TX Frontend: 1 | | | Name: E3xx | | | Antennas: TX/RX | | | Freq range: 47.000 to 6000.000 MHz | | | Gain range PGA: 0.0 to 89.8 step 0.2 dB | | | Bandwidth range: 20000000.0 to 40000000.0 step 0.0 Hz | | | Connection Type: IQ | | | Uses LO offset: No | _____________________________________________________ | / | | RX Dboard: 0/Radio#0 | | _____________________________________________________ | | / | | | RX Frontend: 0 | | | Name: E3xx | | | Antennas: RX2, TX/RX | | | Freq range: 70.000 to 6000.000 MHz | | | Gain range PGA: 0.0 to 76.0 step 1.0 dB | | | Bandwidth range: 20000000.0 to 40000000.0 step 0.0 Hz | | | Connection Type: IQ | | | Uses LO offset: No | | _____________________________________________________ | | / | | | RX Frontend: 1 | | | Name: E3xx | | | Antennas: RX2, TX/RX | | | Freq range: 70.000 to 6000.000 MHz | | | Gain range PGA: 0.0 to 76.0 step 1.0 dB | | | Bandwidth range: 20000000.0 to 40000000.0 step 0.0 Hz | | | Connection Type: IQ | | | Uses LO offset: No ------------------------------------------------------ If I then run the following from uhd/examples (and I have tried different master clock rates): $ ./test_timed_commands --args "master_clock_rate=61.44e6" I'm still seeing the following: ------------------------------------------------------- $ ./test_timed_commands --args "master_clock_rate=61.44e6" Creating the usrp device with: master_clock_rate=61.44e6... [INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_4.1.0.HEAD-0-g8ce6e64f [INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=11.200.111.66,type=e3xx,product=e320,serial=31B05E5,fpga=1G,claimed=False,addr=11.200.111.66,master_clock_rate=61.44e6 [INFO] [MPM.PeriphManager] init() called with device args `fpga=1G,master_clock_rate=61.44e6,mgmt_addr=11.200.111.66,product=e320'. [INFO] [0/Radio#0] Performing CODEC loopback test on channel 0 ... [INFO] [0/Radio#0] CODEC loopback test passed [INFO] [0/Radio#0] Performing CODEC loopback test on channel 1 ... [INFO] [0/Radio#0] CODEC loopback test passed [INFO] [0/DmaFIFO#0] BIST passed (Estimated Minimum Throughput: 1361 MB/s) [INFO] [0/DmaFIFO#0] BIST passed (Estimated Minimum Throughput: 1361 MB/s) Using Device: Single USRP: Device: E300-Series Device Mboard 0: e320 RX Channel: 0 RX DSP: 0 RX Dboard: A RX Subdev: E3xx RX Channel: 1 RX DSP: 1 RX Dboard: A RX Subdev: E3xx TX Channel: 0 TX DSP: 0 TX Dboard: A TX Subdev: E3xx TX Channel: 1 TX DSP: 1 TX Dboard: A TX Subdev: E3xx Testing support for timed commands on this hardware... pass Perform fast readback of registers: Difference between paired reads: 1982.600911 us Testing control timed command: Span : 100000.000000 us Now : 421985.465495 us Response 1: 423872.639974 us Response 2: 425706.005859 us Difference of response time 1: -98112.825521 us Difference of response time 2: -196279.459635 us Difference between actual and expected time delta: -98166.634115 us About to start streaming using timed command: Received packet: 100 samples, 0 full secs, 0.535028 frac secs Stream time was: 0 full secs, 0.535028 frac secs Difference between stream time and first packet: -0.000000 us Done! ---------------------------------------------- So, you can see I still have the same issue where it looks like the "timed commands" are getting executed immediately -- not at their expected future times (100ms apart). Please let me know if you have any other ideas. Or maybe someone can confirm that test_timed_commands() is producing expected results for them in UHD 4.1? Thanks, Jim ________________________________ From: Marcus D. Leech <patchvonbraun@gmail.com> Sent: Tuesday, February 1, 2022 2:13 PM To: Jim Palladino <jim@gardettoengineering.com>; USRP-users@lists.ettus.com <usrp-users@lists.ettus.com> Subject: Re: [USRP-users] Re: Timed Commands Not Working On 2022-02-01 14:10, Jim Palladino wrote: Hi Marcus, In the app I'm writing, for now I'm just setting the time to '0.0' after startup, like: usrp->set_time_now(uhd::time_spec_t(0.0)); That may be part of your problem--that may produce two separate transactions for the radio timestamp registers. Use set_time_unknown_pps() instead, and see if this changes things. Also, make sure you're setting master_clock_rate in the device arguments. For the "test_timed_commands.cpp" test app, I'm just executing what is here: https://github.com/EttusResearch/uhd/blob/UHD-4.1/host/examples/test_timed_commands.cpp<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_EttusResearch_uhd_blob_UHD-2D4.1_host_examples_test-5Ftimed-5Fcommands.cpp&d=DwMDaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=XUEEtUEfpaAEGxRI-WGuqHauOvsPdD2NZkfwDnwpYx0&m=2RP1x-Dxx1TwoZef3IUmkTi4mB5REW9yUXnCAYtBmgM&s=socf8y0QRKBM-pQcT5qgsvrxQZkd2hcJuFJ5Ix0rImE&e=> It doesn't appear to matter, but my E320 is setup to use an internal reference, the N320 is external. Thanks, Jim ________________________________ From: Marcus D. Leech <patchvonbraun@gmail.com><mailto:patchvonbraun@gmail.com> Sent: Tuesday, February 1, 2022 1:59 PM To: usrp-users@lists.ettus.com<mailto:usrp-users@lists.ettus.com> <usrp-users@lists.ettus.com><mailto:usrp-users@lists.ettus.com> Subject: [USRP-users] Re: Timed Commands Not Working On 2022-02-01 13:55, Jim Palladino wrote: Hello, I've been trying to get an app working with timed commands for an E320 or N320 using UHD 4.1. It seems that all commands are processed immediately, not at the time I tell them to. Setting the time to start RX streaming does seem to work fine, but that is a time_spec passed to the streaming function -- not a "timed command". If, on the other hand, I use timed commands to set a series of RX frequency tunes in the future -- to retune says every 100ms -- that isn't working. All retunes get processed immediately, one after another, with no 100ms gap in between. I would post the code I'm using here, but I went ahead and ran the UHD-included "test_timed_commands" example on both the E320 and N320. The example application does not seem to work right on either device and exhibits the same behaviour I'm seeing with my code. You can see from the results below, that instead of a 100ms gap between get_time_now() calls, as the example app is setup to do, the calls to get_time_now() return immediately. Here is the output of "test_timed_commands" on the N320. The code is unmodified from the provided example source: -------------------------------- $ ./test_timed_commands Creating the usrp device with: ... [INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_4.1.0.4-0-g25d617ca [INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=192.168.40.2,type=n3xx,product=n320,serial=31EDED4,fpga=XG,claimed=False,addr=192.168.40.2 [INFO] [MPM.PeriphManager] init() called with device args `fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external'. [INFO] [MPM.Rhodium-0] init() called with args `fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external' [INFO] [MPM.Rhodium-1] init() called with args `fpga=XG,mgmt_addr=192.168.40.2,product=n320,clock_source=external,time_source=external' Using Device: Single USRP: Device: N300-Series Device Mboard 0: n320 RX Channel: 0 RX DSP: 0 RX Dboard: A RX Subdev: Rhodium RX Channel: 1 RX DSP: 1 RX Dboard: B RX Subdev: Rhodium TX Channel: 0 TX DSP: 0 TX Dboard: A TX Subdev: Rhodium TX Channel: 1 TX DSP: 1 TX Dboard: B TX Subdev: Rhodium Testing support for timed commands on this hardware... pass Perform fast readback of registers: Difference between paired reads: 2016.288086 us Testing control timed command: Span : 100000.000000 us Now : 416299.532064 us Response 1: 418303.910319 us Response 2: 420352.290853 us Difference of response time 1: -97995.621745 us Difference of response time 2: -195947.241211 us Difference between actual and expected time delta: -97951.619466 us About to start streaming using timed command: Received packet: 100 samples, 0 full secs, 0.524535 frac secs Stream time was: 0 full secs, 0.524535 frac secs Difference between stream time and first packet: 0.000000 us Done! --------------------------------------------------- Any thoughts on this would be appreciated, as timed commands are important to the application we are developing. Thanks, Jim How are you setting device time at startup?
MD
Marcus D. Leech
Wed, Feb 2, 2022 2:44 PM

On 2022-02-02 07:30, Jim Palladino wrote:

Marcus, thanks for the suggestions. I made sure to set the master
clock rate on both the E320 and N320. In the app I'm developing, I
also tried set_time_unknown_pps() instead of set_time_now() as you
suggested. Unfortunately, neither one of those made a difference.

Thanks, Jim.

I've put in a query to R&D about this.  It is curious that this appears
to be a problem on both N320 and E320.

I shall do a test on N310 (which is the closest MPM-type USRP I have)
and see what happens.

On 2022-02-02 07:30, Jim Palladino wrote: > Marcus, thanks for the suggestions. I made sure to set the master > clock rate on both the E320 and N320. In the app I'm developing, I > also tried set_time_unknown_pps() instead of set_time_now() as you > suggested. Unfortunately, neither one of those made a difference. > > Thanks, Jim. I've put in a query to R&D about this.  It is curious that this appears to be a problem on both N320 and E320. I shall do a test on N310 (which is the closest MPM-type USRP I have) and see what happens.
MD
Marcus D. Leech
Wed, Feb 2, 2022 2:56 PM

On 2022-02-02 07:30, Jim Palladino wrote:

Marcus, thanks for the suggestions. I made sure to set the master
clock rate on both the E320 and N320. In the app I'm developing, I
also tried set_time_unknown_pps() instead of set_time_now() as you
suggested. Unfortunately, neither one of those made a difference.

I ran test_timed_commands on N310, using UHD 3.15.0.0 (on Ubuntu
21.10).  It worked as expected.

On 2022-02-02 07:30, Jim Palladino wrote: > Marcus, thanks for the suggestions. I made sure to set the master > clock rate on both the E320 and N320. In the app I'm developing, I > also tried set_time_unknown_pps() instead of set_time_now() as you > suggested. Unfortunately, neither one of those made a difference. > > I ran test_timed_commands on N310, using UHD 3.15.0.0 (on Ubuntu 21.10).  It worked as expected.
JP
Jim Palladino
Wed, Feb 2, 2022 3:21 PM

Thanks Marcus. Please let me know if R&D comes back with anything. I'm at a bit of a loss . . .

Thanks,
Jim


From: Marcus D. Leech patchvonbraun@gmail.com
Sent: Wednesday, February 2, 2022 9:56 AM
To: Jim Palladino jim@gardettoengineering.com; USRP-users@lists.ettus.com usrp-users@lists.ettus.com
Subject: Re: [USRP-users] Re: Timed Commands Not Working

On 2022-02-02 07:30, Jim Palladino wrote:
Marcus, thanks for the suggestions. I made sure to set the master clock rate on both the E320 and N320. In the app I'm developing, I also tried set_time_unknown_pps() instead of set_time_now() as you suggested. Unfortunately, neither one of those made a difference.

I ran test_timed_commands on N310, using UHD 3.15.0.0 (on Ubuntu 21.10).  It worked as expected.

Thanks Marcus. Please let me know if R&D comes back with anything. I'm at a bit of a loss . . . Thanks, Jim ________________________________ From: Marcus D. Leech <patchvonbraun@gmail.com> Sent: Wednesday, February 2, 2022 9:56 AM To: Jim Palladino <jim@gardettoengineering.com>; USRP-users@lists.ettus.com <usrp-users@lists.ettus.com> Subject: Re: [USRP-users] Re: Timed Commands Not Working On 2022-02-02 07:30, Jim Palladino wrote: Marcus, thanks for the suggestions. I made sure to set the master clock rate on both the E320 and N320. In the app I'm developing, I also tried set_time_unknown_pps() instead of set_time_now() as you suggested. Unfortunately, neither one of those made a difference. I ran test_timed_commands on N310, using UHD 3.15.0.0 (on Ubuntu 21.10). It worked as expected.
MD
Marcus D. Leech
Wed, Feb 2, 2022 3:39 PM

On 2022-02-02 10:21, Jim Palladino wrote:

Thanks Marcus. Please let me know if R&D comes back with anything. I'm
at a bit of a loss . . .

Thanks,
Jim


Just to clarify--this is with the stock FPGA image, correct?

On 2022-02-02 10:21, Jim Palladino wrote: > Thanks Marcus. Please let me know if R&D comes back with anything. I'm > at a bit of a loss . . . > > Thanks, > Jim > > ------------------------------------------------------------------------ > Just to clarify--this is with the stock FPGA image, correct?
JP
Jim Palladino
Wed, Feb 2, 2022 3:44 PM

Correct -- I am using the stock FPGA image for the E320 and the N320.

Thanks,
Jim


From: Marcus D. Leech patchvonbraun@gmail.com
Sent: Wednesday, February 2, 2022 10:39 AM
To: Jim Palladino jim@gardettoengineering.com; usrp-users@lists.ettus.com usrp-users@lists.ettus.com
Subject: Re: [USRP-users] Re: Timed Commands Not Working

On 2022-02-02 10:21, Jim Palladino wrote:
Thanks Marcus. Please let me know if R&D comes back with anything. I'm at a bit of a loss . . .

Thanks,
Jim


Just to clarify--this is with the stock FPGA image, correct?

Correct -- I am using the stock FPGA image for the E320 and the N320. Thanks, Jim ________________________________ From: Marcus D. Leech <patchvonbraun@gmail.com> Sent: Wednesday, February 2, 2022 10:39 AM To: Jim Palladino <jim@gardettoengineering.com>; usrp-users@lists.ettus.com <usrp-users@lists.ettus.com> Subject: Re: [USRP-users] Re: Timed Commands Not Working On 2022-02-02 10:21, Jim Palladino wrote: Thanks Marcus. Please let me know if R&D comes back with anything. I'm at a bit of a loss . . . Thanks, Jim ________________________________ Just to clarify--this is with the stock FPGA image, correct?