# USRP timing offset

**URL:** <https://www.ruby-forum.com/t/usrp-timing-offset/243224>\
**Category:** GNU Radio\
**Created:** [September 2, 2015, 4:44pm UTC](https://www.ruby-forum.com/t/usrp-timing-offset/243224 "2015-09-02T16:44:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [September 2, 2015, 4:44pm UTC](https://www.ruby-forum.com/t/usrp-timing-offset/243224/1 "2015-09-02T16:44:06Z")

</div>

Hi everyone!

I’m new to Gnuradio e USRP. I use a USRP N210 with WBX daughterboards  
and  
loop back cable to connect TX e RX. I have tested USRP with a simple  
flowgraph (sine , usrp\_sink , usrp\_source) and I have observed that the  
output signal from usrp\_source block is time shifted. I mean, the  
usefull  
output signal starts after 0.0105 seconds. How can avoid this? I have  
tried  
to use “issued\_stream\_cmd”, setting time\_spec=0.0105 s but nothing has  
changed.

I want to use this USRP in a more complex project and I need to remove  
this  
initial time-shift.

I attach a plot of input and output signal and my flowgraph.

Thanks in advance for help,

Leo

---

<div class="post-metadata">

**Author:** ![Leonard\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/bb73d2/32.png) [@Leonard\_F](https://www.ruby-forum.com/u/Leonard_F)\
**Post date:** [September 2, 2015, 5:05pm UTC](https://www.ruby-forum.com/t/usrp-timing-offset/243224/2 "2015-09-02T17:05:09Z")

</div>

Hi Leonard,

you should try to use set\_start\_time(time\_spec\_t(x)) on both the USRP  
sink and source, but only after setting a device time using  
set\_time\_now() before, that should be sufficiently (\>0.1s) earlier than  
x, before you start the flow graph.

Best regards,  
Marcus

---

<div class="post-metadata">

**Author:** ![Leonard\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/bb73d2/32.png) [@Leonard\_F](https://www.ruby-forum.com/u/Leonard_F)\
**Post date:** [September 4, 2015, 7:31pm UTC](https://www.ruby-forum.com/t/usrp-timing-offset/243224/3 "2015-09-04T19:31:48Z")

</div>

Thank you Marcus for help!

Now I’ m using Usrp with SCFDMA chain. I set\_time\_now and start\_time\_now  
:

uhd\_usrp\_source.set\_time\_now (uhd.time\_spec\_t(time.time()))  
uhd\_usrp\_source.set\_start\_time(uhd.time\_spec\_t(time.time()+0.6))  
uhd\_usrp\_sink.set\_start\_time(uhd.time\_spec\_t(time.time()+0.6))

and I haven’t time shift.

But I see a lot of “L” (late packet) printed and some “U” (underflow).  
How  
can solve the problem? I have tried to use low sample rate but after few  
seconds L and U appear.

Thanks

Leo

2015-09-02 16:41 GMT+02:00 Leonard F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
