Have you tried set_output_multiple(x)? That would ensure that you'd
always get n*x output space, with n in 1,2,3...

Greetings,
Marcus

On 04/01/2015 07:49 PM, Zhe Feng wrote:
> Dear Martin, 
>
> I tried to call it in the constructor, and it's the same as call it in
> the work function. It didn't work as I expected. 
>
> I was actually trying to update and adding more features to
> peak_detector2. There is a conditional statement below in my work
> function. 
>
> if( noutput_items >= d_look_ahead) 
>
> I tried to use set_min_noutput_items (d_look_ahead) in the constructor
> and in the work function. Neither of these two ways helped me satisfy
> the above condition. 
>
>
> Best regards,
> Zhe
>
>
> On Wed, Apr 1, 2015 at 1:22 PM, Martin Braun <martin.br...@ettus.com
> <mailto:martin.br...@ettus.com>> wrote:
>
>     I don't know the details off the top of my head, but this might be
>     one of those functions that you can't call during work(). Have you
>     tried calling it in the ctor?
>
>     M
>
>     On 01.04.2015 08:34, Zhe Feng wrote:
>
>         Dear Marcus,
>
>         Thanks for your comment!
>         I made a typo my previous post that I was going to say
>         "set_min_noutput_items" but I wrote "set_noutput_items". I
>         actually used
>         it in the work function, but it didn't seem to function as I
>         expected.
>         After reading your comment, I put it in the constructor and
>         nothing
>         changed.
>
>         Best regards,
>         Zhe
>
>         On Wed, Apr 1, 2015 at 11:18 AM, Marcus Müller
>         <marcus.muel...@ettus.com <mailto:marcus.muel...@ettus.com>
>         <mailto:marcus.muel...@ettus.com
>         <mailto:marcus.muel...@ettus.com>>> wrote:
>
>             Hi,
>             noutput_items is what GNU Radio can maximally allow your
>         block to
>             produce, which is the free size in the output buffer,
>         which is the input
>             buffer of the next block.
>             So if your block is faster than the downstream block, you
>         will see
>             exactly the behaviour you are observing. This is normal,
>         and good.
>
>             There's nothing the scheduler can do about this -- something
>             "downstream" of your block just "backs up" the item flow,
>         and your block
>             will have to wait until whatever is downstream of it is
>         done consuming
>             input, so that there is space for output from your block
>         again.
>
>             You could try using set_min_noutput_items [1] in your block's
>             constructor, so that GNU Radio won't even ask you to
>         work() if there's
>             not enough space available.
>
>             Greetings,
>             Marcus
>
>
>             [1]
>            
>         
> http://gnuradio.org/doc/doxygen/classgr_1_1block.html#a65cfc579150dc4d10c6180d3365aa9a8
>
>             On 04/01/2015 04:47 PM, Zhe Feng wrote:
>              > Dear all,
>              >
>              > I'm experiencing a problem with the noutput_items.
>              >
>              > I have written a sync block which did "return" several
>         times. I
>             found the
>              > noutput_items dropped exactly by the amount that I
>         returned. For
>             example, if
>              > I wrote "return 10", after that, I printed
>         noutput_items and found it
>              > decreased to noutput_items -10.
>              >
>              > Due to this fashion, the noutput_items could decrease
>         to a value
>             that one of
>              > my "if statement" isn't satisfied. In that case,
>         several items
>             wouldn't be
>              > outputed so the actual size of output items is smaller
>         than the
>             size of
>              > input items. Is it still a sync block?
>              >
>              > I tried to wait for the noutput_items to increase but
>         it didn't
>             happen. I
>              > tried to use "set_noutput_items( )" or
>         "set_output_buffer()" to
>             some values
>              > I wanted, but they also failed.
>              >
>              > So I'm asking that how to tell the scheduler
>         effectively that I
>             want to
>              > increase the noutput_items?
>              >
>              > Thanks!
>              > Best regards,
>              > Zhe
>              >
>              >
>              >
>              > --
>              > View this message in context:
>            
>         
> http://gnuradio.4.n7.nabble.com/How-to-increase-the-noutput-items-tp53075.html
>              > Sent from the GnuRadio mailing list archive at Nabble.com.
>              >
>              > _______________________________________________
>              > Discuss-gnuradio mailing list
>              > Discuss-gnuradio@gnu.org
>         <mailto:Discuss-gnuradio@gnu.org>
>         <mailto:Discuss-gnuradio@gnu.org
>         <mailto:Discuss-gnuradio@gnu.org>>
>              > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
>             _______________________________________________
>             Discuss-gnuradio mailing list
>             Discuss-gnuradio@gnu.org <mailto:Discuss-gnuradio@gnu.org>
>         <mailto:Discuss-gnuradio@gnu.org
>         <mailto:Discuss-gnuradio@gnu.org>>
>             https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
>
>
>         --
>         Zhe Feng
>         Electrical Engineering: System
>         University of Michigan Ann Arbor
>         Tel: 734-834-3188 <tel:734-834-3188>
>
>
>
>
>         _______________________________________________
>         Discuss-gnuradio mailing list
>         Discuss-gnuradio@gnu.org <mailto:Discuss-gnuradio@gnu.org>
>         https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
>
>     _______________________________________________
>     Discuss-gnuradio mailing list
>     Discuss-gnuradio@gnu.org <mailto:Discuss-gnuradio@gnu.org>
>     https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
>
>
> -- 
> Zhe Feng 
> Electrical Engineering: System 
> University of Michigan Ann Arbor 
> Tel: 734-834-3188
>
>
>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to