I have been trying to implement a custom block based on
gr_message_source that will be connected to the UHD USRP sink block.
It inserts tx_sob and tx_eob tags together with the message contents
into the output stream. I have a few questions with regards to the
proper use of the tx streaming tags after looking at the source code
for both the C++ tags demo as well as the USRP sink:
I see that in the tags demo code (specifically tag_source_demo.h)
that a tx_eob tag is first sent when the block starts running (as
_samps_left_in_burst is set to 1 initially). Is there any reason
behind this?
Looking at the USRP sink code, it seems that I can just insert
tx_sob and tx_eob tags without having to insert a tx_time tag together
with a tx_sob tag?
Am I right in my understanding that the USRP2 will only start
transmitting after receiving an tx_eob tag? If so, I presume that
there’s a limit as to how much data the USRP2 can buffer before
transmitting?
I have been trying to implement a custom block based on
gr_message_source that will be connected to the UHD USRP sink block.
It inserts tx_sob and tx_eob tags together with the message contents
into the output stream. I have a few questions with regards to the
proper use of the tx streaming tags after looking at the source code
for both the C++ tags demo as well as the USRP sink:
FYI, You may also be interested in:
I see that in the tags demo code (specifically tag_source_demo.h)
that a tx_eob tag is first sent when the block starts running (as
_samps_left_in_burst is set to 1 initially). Is there any reason
behind this?
Its not necessary from the hardware’s perspective. I think it was just a
convenient way to get a new burst started from the perspective of this
code in example (no edge case).
//Handle the end of burst condition.
//Tag an end of burst and return early.
//the next work call will be a start of burst.
if (_samps_left_in_burst < size_t(noutput_items)){
this->make_eob_tag(this->nitems_written(0) +
Looking at the USRP sink code, it seems that I can just insert
tx_sob and tx_eob tags without having to insert a tx_time tag together
with a tx_sob tag?
The time tag is optional. If you dont specify a time, then the samples
are transmitted ASAP.
Am I right in my understanding that the USRP2 will only start
transmitting after receiving an tx_eob tag? If so, I presume that
Actually, the usrp will transmit as soon as it seems an incoming packet
of samples (assuming there is not a transmit time set).
EOB is only necessary to tell the USRP, “I will not be sending any more
samples for an indeterminate amount of time”. Therefore the device can
go into idle.
there’s a limit as to how much data the USRP2 can buffer before
transmitting?
There is a limit of about 1MB, after that samples back up into the host.
So you dont have to worry about sample loss.
Hi Josh,
I have done the same work as Alex. I modified the code in
gr_message_source. I added a tx_sob tag and a tx_time tag to the first
byte of the message, and a tx_eob tag to the last byte of the message.
Assuming:
there are 100 bytes in a message(or we call it a packet)
bpsk modulation is employed
set samples_per_symbol to 2
So there are 800 symbols or 1600 samples in the packet.
In the output of the gr_message_source block, the 0 byte is tagged with
the tx_sob and the tx_time, and the 99 byte is tagged with the tx_eob.
Then in the output of the symbol map block, the 0 symbol is tagged with
the tx_sob and the tx_time, and the 792 symbol is tagged with the
tx_eob.
After pulse shaping filter, the 0 sample is tagged with the tx_sob and
the tx_time, and the 1584 sample is tagged with the tx_eob.
My questions are as follow:
The 1599 sample is the last sample in the packet, but the tx_eob tag
are added to the 1584 sample. So, what will happen to the 1585-1599
samples in the usrp? Are they transmitted by the usrp immediately after
the 1584 sample?
Is it necessary to adding the tx_eob tag exactly to the last (1599)
sample? How can I do this?
the tx_sob and the tx_time, and the 99 byte is tagged with the tx_eob.
Then in the output of the symbol map block, the 0 symbol is tagged with
the tx_sob and the tx_time, and the 792 symbol is tagged with the
tx_eob.
After pulse shaping filter, the 0 sample is tagged with the tx_sob and
the tx_time, and the 1584 sample is tagged with the tx_eob.
I think its important to note that certain gnuradio blocks do not pass
tags because it is undecided how to interpolate the sample index. Tom
would have more to say about this.
My questions are as follow:
The 1599 sample is the last sample in the packet, but the tx_eob tag
are added to the 1584 sample. So, what will happen to the 1585-1599
samples in the usrp? Are they transmitted by the usrp immediately after
the 1584 sample?
Yes, these samples will be send ASAP, and they will not have an EOB, so
the device will regard this as underflow
Is it necessary to adding the tx_eob tag exactly to the last (1599)
sample? How can I do this?
The sample index is one of the parameters of the tag
Hi Josh,
It is really a pleasure to have received your reply.
The purpose adding tx_sob and tx_eob tags is to send packets in bursts.
What can I do to make all samples of a packets in a burst? Is there any
example to demonstrate how to send packets in bursts?
Best regards,
King Qiu