Discussion:
[USRP-users] buffer reset or clear issue on USRP N200
Chenfei Gao
2013-02-04 18:38:49 UTC
Permalink
Hi all,

I got a question on how to reset or clear the data stored in the buffer of USRP N200. Is it possible to do it by rebooting the USRP ? I set up a USRP receiver using uhd.usrp_source but I received a lot of messages unexpected. I ran the receiver standalone. It can still got the messages passing in without transmitter. Thus, I guess something still stays in the buffer. Does anybody have the similar situation?

Any suggestions would be appreciated.

Chenfei
Fernando Quivira
2013-02-04 18:43:50 UTC
Permalink
Hi

If you use C++, this might be helpful. I found this online:

uhd::rx_metadata_t md;
std::vector<std::complex<float> > buff(BUFFER_SIZE);

while(rx_stream->recv(&buff.front(), buff.size(), md,
uhd::io_type_t::COMPLEX_FLOAT32,uhd::device::RECV_MODE_ONE_PACKET))
{
// NOP
}

It's supposed to clear the buffer. It looks hacky to me, but it works most
of the time.

Does anyone know of a better way?
Post by Chenfei Gao
Hi all,
I got a question on how to reset or clear the data stored in the buffer of
USRP N200. Is it possible to do it by rebooting the USRP ? I set up a USRP
receiver using uhd.usrp_source but I received a lot of messages unexpected.
I ran the receiver standalone. It can still got the messages passing in
without transmitter. Thus, I guess something still stays in the buffer.
Does anybody have the similar situation?
Any suggestions would be appreciated.
Chenfei
_______________________________________________
USRP-users mailing list
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
Josh Blum
2013-02-04 18:46:24 UTC
Permalink
Post by Chenfei Gao
Hi all,
I got a question on how to reset or clear the data stored in the
buffer of USRP N200. Is it possible to do it by rebooting the USRP ?
I set up a USRP receiver using uhd.usrp_source but I received a lot
of messages unexpected. I ran the receiver standalone. It can still
got the messages passing in without transmitter. Thus, I guess
something still stays in the buffer. Does anybody have the similar
situation?
The big hammer would be to power cycle the USRP, but...

The buffers should clear whenever the device object is constructed, also
when the transmit or receive streamer is constructed.

If you dont want to tear-down and re-construct the rx streamer, you can
simply issue a stop stream command (if this is continuous streaming),
and call recv() until timeout. This will also flush out rx buffers.

Now the filters in the DSP chains do have history to them. So if you are
having some issue with that, tx streams should be padded out at their
end so the upconversion filters have zeros in their history; likewise,
you an throw out the first several rx samples, which could be rx history
from the last run.

-josh
Post by Chenfei Gao
Any suggestions would be appreciated.
Chenfei
_______________________________________________ USRP-users mailing
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
Luis Trigo
2013-09-24 18:27:35 UTC
Permalink
Post by Josh Blum
Post by Chenfei Gao
Hi all,
I got a question on how to reset or clear the data stored in the
buffer of USRP N200. Is it possible to do it by rebooting the USRP ?
I set up a USRP receiver using uhd.usrp_source but I received a lot
of messages unexpected. I ran the receiver standalone. It can still
got the messages passing in without transmitter. Thus, I guess
something still stays in the buffer. Does anybody have the similar
situation?
The big hammer would be to power cycle the USRP, but...
The buffers should clear whenever the device object is constructed, also
when the transmit or receive streamer is constructed.
If you dont want to tear-down and re-construct the rx streamer, you can
simply issue a stop stream command (if this is continuous streaming),
and call recv() until timeout. This will also flush out rx buffers.
Now the filters in the DSP chains do have history to them. So if you are
having some issue with that, tx streams should be padded out at their
end so the upconversion filters have zeros in their history; likewise,
you an throw out the first several rx samples, which could be rx history
from the last run.
-josh
Post by Chenfei Gao
Any suggestions would be appreciated.
Chenfei
_______________________________________________ USRP-users mailing
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
Hi all,

I have a similar problem. I am working with the N210+XCVR2450 in a TDD
application and, when I restart the RX streaming (with time spec) after the
TX of a burst, the first RX samples are older than expected.

I suppose it is a buffer problem. I've tried different ways of cleaning the
RX buffer, but I couldn't manage to do it in a propper way. Josh, what do
you mean with "issue a stop stream command (if this is continuous
streaming), and call recv() until timeout" ?

Thank you,

Luis

Loading...