|
From: | Nowlan, Sean |
Subject: | Re: [Discuss-gnuradio] Timeout problem using usrp_source.set_start_time() |
Date: | Tue, 19 Jun 2012 15:36:24 +0000 |
I thought the “set_start_time” method simply keeps UHD from instantly streaming, and then does this “tx_sob” and “tx_time” tagging for you on the first sample.
Sure, it can be done somewhere in the flowgraph using GNU Radio tags, but doesn’t this achieve the same end goal with less complexity for the user? I.e., if the user simply wants to start continuous streaming sometime in the future, “set_start_time” should
do the trick. Sean From: discuss-gnuradio-bounces+address@hidden [mailto:discuss-gnuradio-bounces+address@hidden
On Behalf Of Nick Foster Andrew, There is a better way. If you look in gr_uhd_usrp_sink.cc, it's expecting to see tags indicating start of burst ("tx_sob") and end of burst ("tx_eob") as well as a transmit time ("tx_time"). To issue a start of burst, for instance, use: add_item_tag(0, //stream ID
nitems_written(0)+i, //absolute sample number to tag
pmt::pmt_string_to_symbol("tx_eob"), //tag name
pmt::pmt_from_bool(1), //set this true to indicate start of burst
d_me //block src id
); Similar syntax applies for marking the end of burst (use tx_eob instead). To use the tx_time tag, use a pmt::pmt_from_tuple where the bool is above. The tuple is (uint64_t, double) where the integer value is seconds and the double value
is fractional seconds. The block source ID d_me above is really just a convenience identifier and one way to put it together is: std::stringstream id; id << name() << unique_id(); d_me = pmt::pmt_string_to_symbol(id.str()); It does sound a little complicated but it works well in practice. Feel free to keep asking questions. The best reference is gr_uhd_usrp_sink.cc, and you'll probably want to look at gruel/src/include/gruel/pmt.h. --n On Tue, Jun 19, 2012 at 6:08 AM, Andrew Senior <address@hidden> wrote: Hello all, |
[Prev in Thread] | Current Thread | [Next in Thread] |