# Timestamp tags and set\_min\_output\_buffer

**URL:** <https://www.ruby-forum.com/t/timestamp-tags-and-set-min-output-buffer/236895>\
**Category:** GNU Radio\
**Created:** [October 9, 2013, 9:00pm UTC](https://www.ruby-forum.com/t/timestamp-tags-and-set-min-output-buffer/236895 "2013-10-09T21:00:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alcina](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@alcina](https://www.ruby-forum.com/u/alcina)\
**Post date:** [October 9, 2013, 9:00pm UTC](https://www.ruby-forum.com/t/timestamp-tags-and-set-min-output-buffer/236895/1 "2013-10-09T21:00:40Z")

</div>

Hi,

I’m writing a block that always outputs the same number of items as it  
gets  
in.

The block is doing FFT on a fixed length vector, so I always need nfft  
samples in and nfft samples out. I’ve achieved this (I think) by using:  
set\_min\_noutput\_items(nfft) and set\_max\_noutput\_items(nfft). However,  
when  
I increase nfft to 8192, I get a message about not enough buffer space.  
I  
tested various things and ended up calling  
set\_min\_output\_buffer(2\*nfft) as just nfft wasn’t enough. It all seems  
to  
work nicely, except that the rx\_time tags are screwed up – I get a  
nearly  
random offset in the beginning, even though there are no dropped packets  
on  
the USRP.

Is this a bug or a feature? What is the correct way to increase the  
value  
of noutput\_items without breaking rx\_time tags?

juha

---

<div class="post-metadata">

**Author:** ![Juha\_V](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@Juha\_V](https://www.ruby-forum.com/u/Juha_V)\
**Post date:** [October 9, 2013, 9:10pm UTC](https://www.ruby-forum.com/t/timestamp-tags-and-set-min-output-buffer/236895/2 "2013-10-09T21:10:36Z")

</div>

On 10/09/2013 02:59 PM, Juha V. wrote:

> set\_min\_output\_buffer(2\*nfft) as just nfft wasn’t enough. It all
> 
> * * *
> 
> Discuss-gnuradio mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)  
> Juha,

An easier way to achieve this is, is calling set\_output\_multiple(nfft)  
in the block constructor - which assures noutput\_items = n\*nfft where n

> = 1  
> then if its a sync block without the relative rate or forecast being  
> change, it will also assume it also needs nfft items each work call  
> set\_min\_noutput\_nitems and set\_min\_output\_buffer are bigger hammers that  
> probably shouldn’t be used in this case unless you have really big  
> vectors - I think by default there should be no problems with an output  
> multiple \<= 8k  
> are you consuming nfft each time in your current block? If it is  
> providing you nfft+extra samples each time through work you would get  
> strange offsets if you simply consumed noutput\_items each time.

-Tim

---

<div class="post-metadata">

**Author:** ![Juha\_V](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@Juha\_V](https://www.ruby-forum.com/u/Juha_V)\
**Post date:** [October 9, 2013, 9:44pm UTC](https://www.ruby-forum.com/t/timestamp-tags-and-set-min-output-buffer/236895/3 "2013-10-09T21:44:30Z")

</div>

Thanks.

I’ve modified the code. I now call set\_output\_multiple(nfft) in the  
constructor. This is probably for the better, as I can now use  
sync\_block  
again. I also got rid of the buffer size error message on larger fft  
sizes.

However, I still have the problem with random rx\_time tags triggered in  
the  
beginning of the acquisition. I’ll keep investigating this. It could be  
that this is a feature of the n200 + gpsdo combination.

juha
