discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] set_output_multiple() and forecast() when there a


From: Tom Early
Subject: Re: [Discuss-gnuradio] set_output_multiple() and forecast() when there are multiple sources in a general block
Date: Sat, 17 Dec 2016 18:07:30 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1



On 12/16/2016 11:52 PM, Andrej Rode wrote:
Hey Tom,
On 16/12/16 14:30, Tom Early wrote:
I am designing a general block that will split it's input into two
outputs. 96 input items will become 9 items on one source and 3 items on
another source. I have some questions:

Is it required to set both streams in forecast()?
Forecast just determines how many items the scheduler should provide on
each input port of your block to produce the requested number of output
items by a upstream block. I'd is you take the maximum number of items
you need at each input port to produce items on each output port.
How do I call set_output_multiple() where there are multiple sources,
the larger stream, the first stream, the sum or what?
I would recommend you take the larger number of output items. The thing
is the scheduler will only request chunks of n*output_multiple items and
will give you a buffer with n*output_multiple for each output. (n>=1)
When general_work() is called, is noutput_items for one stream or
something else?
noutput_items is basically the size of each of your output buffers. You
are free to produce 0 items or any number up to noutput_items items on
each of your outputs. For handling with multiple output streams with
different rates I'd recommend you take a look at [0], especially
forecast(), general_work(), consume() and produce() are interesting if
you work with multiple inputs and multiple outputs with different rates.
Maybe even history() if you want to retain a certain number of items for
the next call of general_work().

I hope I could help you with your question :)
Yes, this helps a lot, produce() and WORK_CALLED_PRODUCE is exactly what I was looking for!

It is especially helpful as my next step after this was to make one of the sources produce a variable number of items with each general_work() call... and now I am already there! Thanks Andrej!

Cheers,
Andrej

[0] http://gnuradio.org/doc/doxygen/classgr_1_1block.html





reply via email to

[Prev in Thread] Current Thread [Next in Thread]