[Top][All Lists]

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

Re: [Discuss-gnuradio] change number of input bytes in block

From: Matt Ettus
Subject: Re: [Discuss-gnuradio] change number of input bytes in block
Date: Fri, 09 Mar 2007 10:09:45 -0800
User-agent: Thunderbird (X11/20070302)

steve wrote:

i've a _bb block that i wrote. On the first call to work() i
get 2047 bytes, 2nd call 127, then 7 and then 1 byte ..then the
whole thing starts again.

The scheduler will basically give you every input sample it has available.

I would like to get the same amount of data for each call to
work() (e.g. always 512 bytes on input). Is that possible?

You can ensure that you always get AT LEAST AS MANY input items as you need by making your own forecast() method. If more data is available, you will get more, but you don't need to consume all of it. Look at some of the blocks that inherit from gr_block instead of gr_sync_block.

Where does 2047, 127, 7 and 1 come from anyway?
(2^11 - 1, 2^7 -1, 2^3 - 1, 2^1 - 1)

Buffer sizes tend to be in multiples of a page.


reply via email to

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