On 20/07/2023 10:41, frie...@free.fr wrote:
I don't see a streaming time specified in the generated code that you
supplied.
I used
         self.blocks_head_0 = blocks.head(gr.sizeof_gr_complex*1, 
(int(6*samp_rate)))
and
         self.connect((self.blocks_head_0, 0), (self.blocks_file_sink_0, 0))
         self.connect((self.blocks_interleave_0, 0), (self.blocks_head_0, 0))
and since I interleave 2 complex streams I expect 6*samp_rate to last 3 seconds

Try setting a "Start Time" in your UHD source block of perhaps "2.0" --
this will arrange for streaming to commence 2 seconds
after it resets the timestamp clock.  Otherwise, streaming is started
at some random time.
OK will try that. The setting in the Python script is the one provided by GRC.
Indeed adding at the end of the __init__(self) generated by GRC
         curr_hw_time = self.uhd_usrp_source_1.get_time_last_pps()
         self.uhd_usrp_source_1.set_time_next_pps((curr_hw_time+1.0))
         self.uhd_usrp_source_1.set_start_time((curr_hw_time+1.1))
seems to do the trick with the 1st PPS edge always aligned to the same sample 
index.
Too bad GRC does not generate the appropriate code: I cannot see any impact when
changing the Start Time (seconds) of the UHD: USRP Source block.

Hmmm, using GR 3.10.1.1, setting a "start time" of 1.4 ends up generating this code in the .py:

      self.uhd_usrp_source_0.set_center_freq(0, 0)
        self.uhd_usrp_source_0.set_antenna("RX2", 0)
        self.uhd_usrp_source_0.set_gain(0, 0)

        self.uhd_usrp_source_0.set_start_time(uhd.time_spec(1.4))
        self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_gr_complex*1)

Also, rather than looking for the PPS edge in the data, the "File Meta
Sink" includes meta-data, like timestamps-as-seen-by-the-radio.
The PPS edge was just to check the consistency of the date last access date
(which seems consistent with my expectation) and the position of the actual
data (which I cannot figure out by analyzing the IQ stream). I did check that 
the
meta data are consistent (with my above example the data start streaming at 1.1 
s
of the internal timer of the SDR source) but my objective is the comparison with
the system time, which I am now on better tracks to achieve with these inputs.

Thanks.

_______________________________________________
USRP-users mailing list -- usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-le...@lists.ettus.com
_______________________________________________
USRP-users mailing list -- usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-le...@lists.ettus.com

Reply via email to