<div dir="ltr"><div><div><div>Hi Ian,<br><br>I understand that time_spec_t is relative to whatever I make it relative to.  I can have it start at my birthday, midnight yesterday, the time at which I had to take my first aspirin (due to dealing with the UHD API), etc.<br><br></div>In terms of implementation with the API, I'm concerned with four function calls (as I outlined in my original e-mail).  For example, when I receive a rx_metadata_t structure back from a recv() call to bring data into my application, what does that time_spec_t represent?  Similarly, I want to set a start time in a stream_cmd_t structure (which has a time_spec_t inside of it), what time reference am I working with there?  Certainly this is not arbitrary or whatever I decide because the USRP has to understand what I'm sending it.<br><br></div>To highlight my frustration, this is what the documentation says about time_spec_t as it relates to issue_stream_cmd():<br><br>"The stream now parameter controls when the stream begins. When true, the
 device will begin streaming ASAP. When false, the device will begin 
streaming at a time specified by time_spec."<br><br></div>No where it is defined how to set time_spec or if this time is absolute or relative.  Let's say I pass in a value of 3.  How does the USRP react?<br><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 10, 2014 at 5:24 PM, Ian Buckley <span dir="ltr"><<a href="mailto:ianb@ionconcepts.com" target="_blank">ianb@ionconcepts.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">time_spec_t is nothing more than a container for a highly accurate count of seconds and fractions there of. It measures from no reference …that entirely down to you to decide what seconds is relative to.<div>The USRP doesn't care about calendars, if you set time from a UTC coordinated source and then an event like a leap second occurs then the USRP will no longer be coordinated with UTC.</div><div><div class="h5"><div><br><div><div>On Dec 10, 2014, at 1:37 PM, Peter Witkowski via USRP-users <<a href="mailto:usrp-users@lists.ettus.com" target="_blank">usrp-users@lists.ettus.com</a>> wrote:</div><br><blockquote type="cite"><div dir="ltr"><div><div>Hi Marcus,<br><br></div>I've looked at the documentation (prior to sending my original mailing list message) and am still lost.  Let me rephrase my question.  Since time_spec_t just holds a seconds count, when did the count start (assuming the USRP is synched to UTC via the GPSDO)?  Restated once more, if I get back 0, what time is it?<br><br></div>I'm assuming that once synched, the USRP is just using seconds after Unix epoch (this would be logical), but would like to confirm this.<br><div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 10, 2014 at 4:11 PM, Marcus D. Leech via USRP-users <span dir="ltr"><<a href="mailto:usrp-users@lists.ettus.com" target="_blank">usrp-users@lists.ettus.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000"><span>
    <div>On 12/10/2014 04:02 PM, Peter Witkowski
      via USRP-users wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div>
          <div>Thanks for the info thus far.  That explains a lot and at
            least I know I don't have to worry about conversions from
            UTC to GPS time.<br>
            <br>
          </div>
          So now that it looks like the USRP is using UTC, when I get a
          time_spec_t structure back from it (or pass it one as a start
          time in issue_stream_cmd()), what does the time_spec_t
          structure hold?  UTC seconds after Unix epoch or something
          else entirely?<br>
          <br>
        </div>
        Note all this assumes that the GPSDO is working properly and
        locked.<br>
        <div>
          <div>
            <div class="gmail_extra"><br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
</span><a href="http://files.ettus.com/manual/classuhd_1_1time__spec__t.html#a2bd6c4c8ad7209d219c3ca5ae238fb6e" target="_blank">http://files.ettus.com/manual/classuhd_1_1time__spec__t.html#a2bd6c4c8ad7209d219c3ca5ae238fb6e</a><div><div><br>
    <br>
    <br>
    <blockquote type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div class="gmail_extra">
              <div class="gmail_quote">On Wed, Dec 10, 2014 at 3:32 PM,
                Perelman, Nathan via USRP-users <span dir="ltr"><<a href="mailto:usrp-users@lists.ettus.com" target="_blank">usrp-users@lists.ettus.com</a>></span>
                wrote:<br>
                <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                  <div bgcolor="white" link="blue" vlink="purple" lang="EN-US">
                    <div><p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)">The
                          time returned via
                          get_mboard_sensor(“gps_time”) will be UTC
                          already (assuming the GPSDO is locked). The
                          GPSDO corrects for leap seconds. If you look
                          up the GPRMC string, you can see that the
                          time/date given are UTC.</span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)">-Nathan</span></p><p class="MsoNormal"><a name="14a364dfd304d0db_14a360b06b44bec8_14a35f4435933d7c_14a35e7fb9b6b53b__MailEndCompose"><span style="font-size:11pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)"> </span></a></p>
                      <div>
                        <div style="border-width:1pt medium medium;border-style:solid none none;border-color:rgb(181,196,223) -moz-use-text-color -moz-use-text-color;padding:3pt 0in 0in"><p class="MsoNormal"><b><span style="font-size:10pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span style="font-size:10pt;font-family:"Tahoma","sans-serif";color:windowtext">
                              USRP-users [mailto:<a href="mailto:usrp-users-bounces@lists.ettus.com" target="_blank">usrp-users-bounces@lists.ettus.com</a>]
                              <b>On Behalf Of </b>Marcus D. Leech via
                              USRP-users<br>
                              <b>Sent:</b> Wednesday, December 10, 2014
                              3:18 PM<br>
                              <b>To:</b> <a href="mailto:usrp-users@lists.ettus.com" target="_blank">usrp-users@lists.ettus.com</a><br>
                              <b>Subject:</b> Re: [USRP-users]
                              time_spec_t GPS Time or UTC?</span></p>
                        </div>
                      </div>
                      <div>
                        <div><div> <br></div><p class="MsoNormal">On 12/10/2014 03:10 PM,
                            Peter Witkowski via USRP-users wrote: </p>
                          <div>
                            <div>
                              <div>
                                <div>
                                  <div>
                                    <div>
                                      <div>
                                        <div>
                                          <div><p class="MsoNormal" style="margin-bottom:12pt">Hello,</p>
                                          </div><p class="MsoNormal" style="margin-bottom:12pt">I
                                            have a question regarding
                                            the time reference used by
                                            the USRP (namely the x300).</p>
                                        </div><p class="MsoNormal" style="margin-bottom:12pt">If
                                          I call the following UHD API
                                          functions (see list below),
                                          what time reference is used
                                          (GPS or UTC)?  Does the USRP
                                          itself handle leap seconds and
                                          the delta between Unix time
                                          and the time it's getting from
                                          it's GPS receiver (assuming a
                                          GPSDO is installed and
                                          locked)?</p>
                                      </div><p class="MsoNormal">1.  When I
                                        specify the time_spec_t value in
                                        issue_stream_cmd(), what time
                                        reference is the USRP
                                        expecting?  For example, do I
                                        pass it seconds after epoch
                                        (Unix time) or something else?</p>
                                    </div><p class="MsoNormal">2. When I get
                                      time via get_time_last_pps(), what
                                      is the time reference?</p>
                                  </div><p class="MsoNormal">3. Same question
                                    as above except for retrieving time
                                    via get_mboard_sensor("gps_time").</p>
                                </div><p class="MsoNormal" style="margin-bottom:12pt">4.  When
                                  I get samples from the sensor using
                                  recv(), what time reference is used
                                  for the time_spec_t timestamp in the
                                  rx_metadata_t structure?  I understand
                                  that is the timestamp of the first
                                  sample, but is the timestamp seconds
                                  after epoch (i.e. Unix time) or based
                                  on something else?</p>
                              </div><p class="MsoNormal" style="margin-bottom:12pt">Just
                                wondering if I need to worry about
                                translating between GPS seconds and Unix
                                seconds or something similar.</p>
                            </div><p class="MsoNormal">Thanks in advance for
                              the help.<br clear="all">
                            </p>
                            <div>
                              <div>
                                <div>
                                  <div>
                                    <div>
                                      <div>
                                        <div>
                                          <div>
                                            <div><p class="MsoNormal"><br>
                                                -- </p>
                                              <div><p class="MsoNormal">Peter
                                                  Witkowski<br>
                                                  <a href="mailto:pwitkowski@gmail.com" target="_blank">pwitkowski@gmail.com</a></p>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                          <pre> </pre>
                          <pre> </pre>
                          <pre>_______________________________________________</pre>
                          <pre>USRP-users mailing list</pre>
                          <pre><a href="mailto:USRP-users@lists.ettus.com" target="_blank">USRP-users@lists.ettus.com</a></pre>
                          <pre><a href="http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com" target="_blank">http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com</a></pre><p class="MsoNormal">The USRP doesn't actually
                            care, or know, about epoch-based time
                            systems.   The TOD clock in USRPs is just a
                            wide counter that increments at<br>
                              the master clock rate.<br>
                            <br>
                            The only requirement in most cases is that
                            everybody in a collection of USRPs agrees on
                            the interpretation of time.  The gps_time
                            returned in the<br>
                              sensor is just parsed from the NMEA data,
                            as far as I know, without any further
                            manipulation to make it consistent with (for
                            example) Unix epoch<br>
                              time or any other time system.<br>
                            <br>
                            In many cases, applications that don't care
                            about
                            time-as-it-relates-to-the-rest-of-the-world,
                            they load the TOD registers in a cluster of
                            USRPs<br>
                              with 0, so that the TOD clock becomes kind
                            of a "mission elapsed timer".<br>
                            <br>
                            <br>
                            <br>
                            <br>
                          </p>
                          <pre>-- </pre>
                          <pre>Marcus Leech</pre>
                          <pre>Principal Investigator</pre>
                          <pre>Shirleys Bay Radio Astronomy Consortium</pre>
                          <pre><a href="http://www.sbrac.org/" target="_blank">http://www.sbrac.org</a></pre>
                        </div>
                      </div>
                    </div>
                  </div>
                  <br>
                  _______________________________________________<br>
                  USRP-users mailing list<br>
                  <a href="mailto:USRP-users@lists.ettus.com" target="_blank">USRP-users@lists.ettus.com</a><br>
                  <a href="http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com" target="_blank">http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com</a><br>
                  <br>
                </blockquote>
              </div>
              <br>
              <br clear="all">
              <br>
              -- <br>
              <div>Peter Witkowski<br>
                <a href="mailto:pwitkowski@gmail.com" target="_blank">pwitkowski@gmail.com</a></div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
USRP-users mailing list
<a href="mailto:USRP-users@lists.ettus.com" target="_blank">USRP-users@lists.ettus.com</a>
<a href="http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com" target="_blank">http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com</a>
</pre>
    </blockquote>
    <br>
  </div></div></div>

<br>_______________________________________________<br>
USRP-users mailing list<br>
<a href="mailto:USRP-users@lists.ettus.com" target="_blank">USRP-users@lists.ettus.com</a><br>
<a href="http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com" target="_blank">http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div>Peter Witkowski<br><a href="mailto:pwitkowski@gmail.com" target="_blank">pwitkowski@gmail.com</a></div>
</div></div></div>
_______________________________________________<br>USRP-users mailing list<br><a href="mailto:USRP-users@lists.ettus.com" target="_blank">USRP-users@lists.ettus.com</a><br><a href="http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com" target="_blank">http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com</a><br></blockquote></div><br></div></div></div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Peter Witkowski<br><a href="mailto:pwitkowski@gmail.com">pwitkowski@gmail.com</a></div>
</div></div></div></div>