Dear Sir,
Let me explain the reason of why to use the function: set_min_noutput_items().
I am creating a custom interpolator block.
Says, the interpolation factor is 1000. Hence it is important to call set_output_multiple(1000).
Meanwhile, for this block the interpolation factor depends on Sample Rate (samp_rate). In this flow-graph the samp_rate could be changed by the user during runtime. This means the interpolation factor may change during runtime, and hence we need to call set_output_multile() with different values during runtime !
The problem arisen when there is no guarantee that set_output_multiple() will work if you change it on the fly.
The workaround is to use set_min_noutput_items() if it work on the fly.
Says, after changing samp_rate, the new interpolation factor is recalculated as 800.
If the set_output_multiple(800) doesn't work, the general_work() can still consume 1 input and produce 800 output if the noutput_items is at least 800. This enables the flow graph continue to work.
If the noutput_items is less than 800, the only correct thing the general_work() can do is to consume_each(0) and return 0. This may be problematic and can cause unforeseen behavior. So it is important to make sure the noutput_items is at least 800. Hence I call: set_min_noutput_items(800)
This means we can make use of set_min_noutput_items() as a workaround, if set_output_multiple() doesn't change on the fly.
The questions are:
1). Can we use this to change setting on the fly: set_min_noutput_items()
2). Is there any better workaround for this?
Regards,
Activecat