USRP2 rx handler chunk size

Hi all,
I’m observing that rx handlers are called when 371 samples are ready,
I thought (I don’t remember why
I have 370 hard coded in my code) the chunks where 370 samples. Has
this changed lately or it has been
always like this?
Is there a way to know in advance with how many samples the
rx_handlers are called each time?

Also, I have a question about the rx handlers implemented usage
pattern. I have understood how to use it,
and I find it a bit dangerous. In the documentation I read, about
usrp2::rx_nop_handler::operator()

“Function operator invoked by USRP2 RX API. Derived classes must
override this method but then invoke
it at the start of their processing. This operator will always be
called at least once.”

Why rely on the fact that user has to implement the operator() calling
the base class one first? Wouldn’t have
been the same with this structure:

class rx_nop_handler : public rx_sample_handler
{

virtual bool operator()(const uint32_t *items, size_t nitems, const
rx_metadata *metadata) {

method_user_has_to_specify(items, nitems, metadata);
}

virtual bool method_user_has_to_specify(const uint32_t *items,
size_t nitems, const rx_metadata *metadata) = 0;
}

In this way USRP2 class calls operator()(…) on the handler that
doesn’t do dynamic binding on user defined handler, but then
rx_nop_handler::operator() after have done his stuff calls the
method_user_has_to_specify. Same effect of actual structure but
without relying on the user to behave nicely.

Regards
Gaetano M.


On Fri, Sep 17, 2010 at 9:14 PM, Gaetano M. [email protected]
wrote:

Hi all,
I’m observing that rx handlers are called when 371 samples are ready,
I thought (I don’t remember why
I have 370 hard coded in my code) the chunks where 370 samples. Has
this changed lately or it has been
always like this?

So I have dig in it, and it seems that in the past:

usrp2/firmware/include/usrp2_eth_packet.h:#define U2_MAX_SAMPLES
370

but at same time:

gr-usrp2/src/usrp2_base.h:#define USRP2_MIN_RX_SAMPLES 371
usrp2/host/apps/tx_samples.cc:#define MAX_SAMPLES (371)
usrp2/host/apps/test_mimo_tx.cc:#define MAX_SAMPLES (371)

and now on last version:

usrp2/firmware/include/usrp2_eth_packet.h:#define U2_MAX_SAMPLES
371
gr-usrp2/src/usrp2_base.h:#define USRP2_MIN_RX_SAMPLES 371
usrp2/host/apps/test_mimo_tx.cc:#define MAX_SAMPLES (371)
usrp2/host/apps/tx_samples.cc:#define MAX_SAMPLES (371)

so I guess it was an old bug in the firmware code ?

Regards
Gaetano M.


cpp-today.blogspot.com

On Sat, Sep 18, 2010 at 12:25 AM, Gaetano M. [email protected]
wrote:

usrp2/firmware/include/usrp2_eth_packet.h:#define U2_MAX_SAMPLES 370
gr-usrp2/src/usrp2_base.h:#define USRP2_MIN_RX_SAMPLES 371
usrp2/host/apps/test_mimo_tx.cc:#define MAX_SAMPLES (371)
usrp2/host/apps/tx_samples.cc:#define MAX_SAMPLES (371)

I meant the opposite, on last version (3.3.0) is equal to 370, on
previous versions (3.2.2) it was 371. Given the fact is now defined
as 370 has the USRP2_MIN_RX_SAMPLES put equal to 370 as well ?

Regards
Gaetano M.


cpp-today.blogspot.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs