Sunday, September 1, 2019

Re: [Discuss-gnuradio] Maximum input items consumed on each input stream

Hi,

I found this thread very useful, and I have another question regarding the scheduler internals.
It is my understanding from reading documentation that each block's *work* or *general_work* function
will be called at the highest sample rate that the block will see, whether that is on the input or output of the block.
I'd like to know what happens if the block's work function does not finish within the time allotted to it.
Is part of the input/output buffer dropped, or does it interfere with the sample rate of the next blocks?

For example, I have a block which filters incoming samples with a variable tap length matched filter to output the maximum correlation:
If the filter size is too large, the block will consume too much CPU time doing the filtering and output some wrong values.
Is this because some output is dropped/truncated, or because it changes the sample rate of the next blocks?

Thanks,
Adrian

On Sat, Aug 31, 2019 at 4:56 AM Ron Economos <w6rz@comcast.net> wrote:

If you use set_output_multiple(), you don't have to check the input buffer. The block will only execute if there are a multiple of the value used in set_output_multiple() items available. For example, if set_output_multiple() is set to 256, the block will only execute if noutput_items is at least 256, but it could also be 512, 768, 1024, 1280, 1536, etc.

Since forecast() sets ninput_items_required to noutput_items, the same number of items appears on the input buffer.

Here's a dummy block that just copies input to output to show the structure. The loop in general_work() allows for any value of CHUNK_SIZE to work properly. With a size of 8900, the loop will typically only execute once.

#ifdef HAVE_CONFIG_H
#include "config.h"

No comments:

Post a Comment