On Wed, 10 Jul 2019 at 19:15:41 +0300, Ramazan Çetin wrote:
We made some progress. This short ninput_items size problem results from
"rational_resampler". Rational_resampler is used as interpolator by 2. So,
lets say, there is a tagged packet on input of rational_resampler with
length of 975. We expect that, rational_resampler should put a packet to the
output with size of 1950. But, it outputs partially like length of 1024 or
1536 etc. So, next block cannot produce its output. Because it needs entire
packet with length of 1950.
Can we set min noutput_items for rational_resampler and does this solve the
problem? Or, do you know what the problem is about rational_resampler?
That’s not a problem with rational_resampler, that’s how GNU Radio
works. ninput_items and noutput_items depend on various factors and are
not deterministic. A minimum ninput_items can be forced indirectly by
using set_min_noutput_items() inside the block which requires a minimum
ninput_items. I don’t know whether calling this function in the upstream
block (in rational_resampler, as suggested by you) will work.
You do call set_min_noutput_items() in your code, however, the argument
is too small; increase it to 1950. Note that generally you must take the
implementation of forecast() into account: You use gr::block as base
class and you don’t overwrite forecast(). The default implementation [1]
assumes a 1:1 rate of input to output items. With gr::sync_interpolator
e.g. you must use set_min_noutput_items(minimum ninput_items times
interpolation factor).
[1]
https://github.com/gnuradio/gnuradio/blob/maint-3.7/gnuradio-runtime/lib/block.cc#L115