[USRP-users] managing variable processing load on stream
josh at ettus.com
Sat Feb 25 15:09:48 EST 2012
> I'm assuming that behind the scenes is some sort of interrupt routine
> filling a FIFO buffer on the pc side and that rx_stream->recv() pulls
> from that buffer when it's called. I guess I really want to watch that
> buffer capacity and set the promiscuity of the analysis tasks
> appropriately. Any ideas or examples?
For the network devices, all the recv packet buffering is happening
inside the kernel, so UHD doesn't know much about how many packets have
arrived into the host.
You could implement a circular buffer on top of stream->recv(), with one
thread filling and another emptying. You app would keep track of the
FIFO's capacity as a metric.
A simpler metric may be to call stream->recv() with a zero timeout. If
your application is keeping up, you should expect to see the call timeout.
More information about the USRP-users