Saturday, December 3, 2011

[Discuss-gnuradio] set_start_time problem in jblum uhd_work branch

_______________________________________________
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
I accidentally posted this in usrp-users instead of discuss-gnuradio, so I'm reposting here.

Sean


From: usrp-users-bounces@lists.ettus.com [usrp-users-bounces@lists.ettus.com] on behalf of Nowlan, Sean [Sean.Nowlan@gtri.gatech.edu]
Sent: Friday, December 02, 2011 11:32 PM
To: usrp-users@lists.ettus.com
Subject: Re: [USRP-users] set_start_time problem

Josh,

I think I've got it working. I haven't checked with a spectrum analyzer or an oscilloscope; I just watched for the transmit LED to come on. I've included the fix below; I'm not sure if you need to make a similar change on the RX side of things, i.e., in gr_uhd_usrp_source.cc.

--- jblum/gr-uhd/lib/gr_uhd_usrp_sink.cc        2011-12-02 10:29:50.801978304 -0500
+++ gnuradio/gr-uhd/lib/gr_uhd_usrp_sink.cc     2011-12-02 23:24:54.203518213 -0500
@@ -389,7 +389,7 @@
 
         _metadata.start_of_burst = true;
         _metadata.end_of_burst = false;
-        _metadata.has_time_spec = _stream_now;
+        _metadata.has_time_spec = !(_stream_now);
         if (_start_time_set){
             _start_time_set = false; //cleared for next run
             _metadata.time_spec = _start_time;

Sean


From: usrp-users-bounces@lists.ettus.com [usrp-users-bounces@lists.ettus.com] on behalf of Nowlan, Sean [Sean.Nowlan@gtri.gatech.edu]
Sent: Friday, December 02, 2011 7:54 PM
To: usrp-users@lists.ettus.com
Subject: [USRP-users] set_start_time problem

Hi everyone, especially Josh :)

I'm having a problem using the set_start_time function in gr-uhd. My flowgraph begins transmitting immediately even though I've specified a time in the future. Any ideas? Example flowgraph:

class test(gr.top_block):
    def __init__(self):
        gr.top_block.__init__(self, "test")
        ...
        self.usrp = uhd.usrp_sink(
            device_addr="addr=192.168.10.2",
            io_type=uhd.io_type.COMPLEX_FLOAT32,
            num_channels=1)
        ...
        self.usrp.set_time_source("external",0)
        self.usrp.set_clock_source("external",0)
        ...
        t = self.usrp.get_time_now(0).get_real_secs() + 20.0
        self.usrp.set_start_time(uhd.time_spec_t(t))
        ...

if __name__ = '__main__':
        ...
        tb = test()
        ...
        tb.start()
        raw_input('press enter to quit: ')
        tb.stop()

No comments:

Post a Comment