I was exited to see the vrt progress. I have compiled Josh’s usrp2_vrt-
branch, installed the required firmware/fpga- image in the sd- card, and
can find the usrp2. Everything working so far.
But now comes the question, is there a way to read the current usrp2-
time, so that I can do something like “start_rx_streaming(0,
I basically try to figure out what the time in the usrp2 is, and then
add a number of seconds/ticks/whatever to that, in order to start
receiving at some future instant.
To do this, I have tried two ways
First I tried to use two instances of a 16sc handler, one which just
read one sample (writing it to /dev/null), from which I extracted the
time, and then stopped the streaming.
Then I add a number of seconds/ticks to the time I got from the usrp2,
and start streaming again with that incremented time as the second
parameter to “start_rx_streaming(…,…)”, and try to receive samples
using the second handler (which was actually writing to a file).
This results in two things,
- During reception with the first handler, a message about bad VRT-
header is displayed, which I tracked back to usrp2_impl.cc, but not
further than that, since I can’t really figure out under which
conditions the message is displayed.
- During reception with the second handler, no samples are received.
I thought that it might have something to do with seconds being to long,
or a tick being to short, so I tried adding different values but that
didn’t seem to change much, since the out- file was still 0 bytes.
In the second approach:
I noticed that there is a #define OP_READ_TIME 3, but after some
grepping I only found it in usrp2_eth_packet.h (where it was defined)
and in “usrp2_impl.cc, std::string opcode_to_string(int opcode)”. What
are the plans of this op- code, a “what time is it on my usrp2 right
If that is the case, and it has not been written yet, I did some
rewriting of usrp2.cc, usrp2_impl.cc, usrp2.h and usrp2_impl.h for that
functionality (give me current time on the usrp2), using the already
existing struct op_read_time_reply_t. But this raises another question,
namely: What is “op_read_time_reply_t.time” actually describing? It is a
uint32_t, but the vrt_header seems to use a uint32_t for integer
seconds, and a uint64_t for fractional seconds, while the time_spec_t
structure seems to use two uint32_t for ticks and seconds, and another
structure for something I’m not sure about… I guess the question is,
do I parse the 32 bit integer to a time_spec_t? And if so how?
I think I lost my self somewhere. However would I be very happy if
someone could straighten my questions out.