# Using set\_min\_output\_buffer() in Python block

**URL:** <https://www.ruby-forum.com/t/using-set-min-output-buffer-in-python-block/230367>\
**Category:** GNU Radio\
**Created:** [June 13, 2014, 3:50pm UTC](https://www.ruby-forum.com/t/using-set-min-output-buffer-in-python-block/230367 "2014-06-13T15:50:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason\_sam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7993a0/32.png) [@jason\_sam](https://www.ruby-forum.com/u/jason_sam)\
**Post date:** [June 13, 2014, 3:50pm UTC](https://www.ruby-forum.com/t/using-set-min-output-buffer-in-python-block/230367/1 "2014-06-13T15:50:38Z")

</div>

Dear All,

Is it possible to use set\_min\_output\_buffer() in Python? I want to be  
able to output more than 4096 items from a Python block during one call  
to the work function. Is there a way to do this?

Regards,

David

* * *

NOTE: The information in this email and any attachments may be  
confidential and/or legally privileged. This message may be read, copied  
and used only by the intended recipient. If you are not the intended  
recipient, please destroy this message, delete any copies held on your  
system and notify the sender immediately.

Toshiba Research Europe Limited, registered in England and Wales  
(2519556). Registered Office 208 Cambridge Science Park, Milton Road,  
Cambridge CB4 0GZ, England. Web: www.toshiba.eu/research/trl

---

<div class="post-metadata">

**Author:** ![divotdave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Post date:** [June 13, 2014, 8:47pm UTC](https://www.ruby-forum.com/t/using-set-min-output-buffer-in-python-block/230367/2 "2014-06-13T20:47:16Z")

</div>

On 13.06.2014 15:49, David Halls wrote:

> Dear All,
> 
> Is it possible to use set\_min\_output\_buffer() in Python? I want to be  
> able to output more than 4096 items from a Python block during one call  
> to the work function. Is there a way to do this?

Hey David,

sure, this function is available in Python. It’s even in GRC, if you  
want to create code to see how it’s used.

M

---

<div class="post-metadata">

**Author:** ![divotdave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Post date:** [June 16, 2014, 7:03pm UTC](https://www.ruby-forum.com/t/using-set-min-output-buffer-in-python-block/230367/3 "2014-06-16T19:03:56Z")

</div>

Hey Martin,

My calls using

self.set\_min\_output\_buffer(4096\*2)

and

self.set\_min\_noutput\_items(4096)

fail at runtime. Perhaps I am missing some import statements?

“AttributeError: ‘bsld\_dec\_butterfly\_cfb’ object has no attribute  
‘set\_min\_output\_buffer’”

Regards,

David

* * *

From: [discuss-gnuradio-bounces+david.halls=removed\_email\_address@domain.invalid](mailto:discuss-gnuradio-bounces+david.halls=removed_email_address@domain.invalid)  
[discuss-gnuradio-bounces+david.halls=removed\_email\_address@domain.invalid] on  
behalf of Martin B. [removed\_email\_address@domain.invalid]  
Sent: 13 June 2014 19:45  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Discuss-gnuradio] Using set\_min\_output\_buffer() in Python  
block

On 13.06.2014 15:49, David Halls wrote:

> Dear All,
> 
> Is it possible to use set\_min\_output\_buffer() in Python? I want to be  
> able to output more than 4096 items from a Python block during one call  
> to the work function. Is there a way to do this?

Hey David,

sure, this function is available in Python. It’s even in GRC, if you  
want to create code to see how it’s used.

M

> ## recipient, please destroy this message, delete any copies held on your safely by Mimecast. For more information please visit [http://www.mimecast.com](http://www.mimecast.com)
> 
> * * *
> 
> 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)

* * *

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)**

* * *

NOTE: The information in this email and any attachments may be  
confidential and/or legally privileged. This message may be read, copied  
and used only by the intended recipient. If you are not the intended  
recipient, please destroy this message, delete any copies held on your  
system and notify the sender immediately.

Toshiba Research Europe Limited, registered in England and Wales  
(2519556). Registered Office 208 Cambridge Science Park, Milton Road,  
Cambridge CB4 0GZ, England. Web: www.toshiba.eu/research/trl

---

<div class="post-metadata">

**Author:** ![divotdave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Post date:** [June 17, 2014, 9:41am UTC](https://www.ruby-forum.com/t/using-set-min-output-buffer-in-python-block/230367/4 "2014-06-17T09:41:04Z")

</div>

On Tue, Jun 17, 2014 at 1:02 AM, David Halls  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> fail at runtime. Perhaps I am missing some import statements?
> 
> “AttributeError: ‘bsld\_dec\_butterfly\_cfb’ object has no attribute  
> ‘set\_min\_output\_buffer’”
> 
> Regards,
> 
> David

The “set\_min\_noutput\_items()” is not yet a supported python statement  
[1]  
as per March 06, 2014.  
Also, I believe this statement should be placed in the member functions  
(constructor, work function, callback function etc) of your custom  
block,  
don’t put it at the wrong place.  
In alternative, you may want to replace it with “set\_output\_multiple()”  
if  
this is more appropriate.

1. 

[http://gnuradio.4.n7.nabble.com/self-set-min-noutput-items-is-not-a-valid-python-command-in-gnuradio-td46731.html](http://gnuradio.4.n7.nabble.com/self-set-min-noutput-items-is-not-a-valid-python-command-in-gnuradio-td46731.html)

---

<div class="post-metadata">

**Author:** ![divotdave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Post date:** [June 17, 2014, 11:44am UTC](https://www.ruby-forum.com/t/using-set-min-output-buffer-in-python-block/230367/5 "2014-06-17T11:44:37Z")

</div>

On 16.06.2014 19:02, David Halls wrote:

> fail at runtime. Perhaps I am missing some import statements?
> 
> “AttributeError: ‘bsld\_dec\_butterfly\_cfb’ object has no attribute  
> ‘set\_min\_output\_buffer’”

Ah, I misunderstood. You want to use this on Python blocks, I thought  
you just wanted to call it from Python (on C++ blocks). It it’s not in  
the gateway blocks, then it won’t work in Python.

Cheers,  
Martin

---

<div class="post-metadata">

**Author:** ![divotdave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Post date:** [June 17, 2014, 12:17pm UTC](https://www.ruby-forum.com/t/using-set-min-output-buffer-in-python-block/230367/6 "2014-06-17T12:17:18Z")

</div>

* * *

> From: Activecat [removed\_email\_address@domain.invalid]  
> Sent: 17 June 2014 08:39  
> To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> Cc: David Halls  
> Subject: Re: [Discuss-gnuradio] Using set\_min\_output\_buffer() in Python block

> On Tue, Jun 17, 2014 at 1:02 AM, David Halls  
> \<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
> Hey Martin,

> My calls using

> self.set\_min\_output\_buffer(4096\*2)

> and

> self.set\_min\_noutput\_items(4096)

> fail at runtime. Perhaps I am missing some import statements?

> “AttributeError: ‘bsld\_dec\_butterfly\_cfb’ object has no attribute  
> ‘set\_min\_output\_buffer’”

> Regards,

> David

> The “set\_min\_noutput\_items()” is not yet a supported python statement [1] as per  
> March 06, 2014.  
> Also, I believe this statement should be placed in the member functions  
> (constructor, work function, callback function etc) of your custom block, don’t  
> put it at the wrong place.  
> In alternative, you may want to replace it with “set\_output\_multiple()” if this  
> is more appropriate.

> 1.

[http://gnuradio.4.n7.nabble.com/self-set-min-noutput-items-is-not-a-valid-python-command-in-gnuradio-td46731.html](http://gnuradio.4.n7.nabble.com/self-set-min-noutput-items-is-not-a-valid-python-command-in-gnuradio-td46731.html)

Thanks Activecat!!! I had the problem that

“out\_rc[0:len(rcABm)] = rcABm  
ValueError: operands could not be broadcast together with shapes (4096)  
(5376)”

where “out\_rc = output\_items[3]”

using set\_output\_multiple(4096_2) has resolved my problem by increasing  
the length of the output buffer vector to 4096_2. I wonder if there is a  
fixed limit as to how far I can stretch this? In the future I may want  
my decoder to output even more than blocks in one go.

Regards,

David

* * *

NOTE: The information in this email and any attachments may be  
confidential and/or legally privileged. This message may be read, copied  
and used only by the intended recipient. If you are not the intended  
recipient, please destroy this message, delete any copies held on your  
system and notify the sender immediately.

Toshiba Research Europe Limited, registered in England and Wales  
(2519556). Registered Office 208 Cambridge Science Park, Milton Road,  
Cambridge CB4 0GZ, England. Web: www.toshiba.eu/research/trl

---

<div class="post-metadata">

**Author:** ![divotdave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Post date:** [June 18, 2014, 6:55am UTC](https://www.ruby-forum.com/t/using-set-min-output-buffer-in-python-block/230367/7 "2014-06-18T06:55:51Z")

</div>

On Tue, Jun 17, 2014 at 6:16 PM, David Halls  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> fixed limit as to how far I can stretch this? In the future I may want my  
> decoder to output even more than blocks in one go.

In GRC graphical flowgraph there is a “Max Number of Output” setting  
under  
the “Options” block.  
Documentation: The Max Number of Output is the maximum number of output  
items allowed for any block in the flowgraph; to disable this set the  
max\_nouts equal to 0. Use this to adjust the maximum latency a flowgraph  
can exhibit.

Besides this I guess there is no other limiting factor.
