# Gr\_buffer::allocate\_buffer: warning and USRP tx underflow

**URL:** <https://www.ruby-forum.com/t/gr-buffer-warning-and-usrp-tx-underflow/239598>\
**Category:** GNU Radio\
**Created:** [March 6, 2014, 10:03am UTC](https://www.ruby-forum.com/t/gr-buffer-warning-and-usrp-tx-underflow/239598 "2014-03-06T10:03:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [March 6, 2014, 10:03am UTC](https://www.ruby-forum.com/t/gr-buffer-warning-and-usrp-tx-underflow/239598/1 "2014-03-06T10:03:25Z")

</div>

Hi,  
My gnuradio flow graph has a custom block taking input from multiple  
USRP’s and the output of the block is connected to a USRP transmitter.  
My  
applications demands a sample rate of at least 5Msps and up to 10Msps.  
Inside the block around 500 (depends on the sample rate) complex samples  
from each of the USRP is stored in a buffer and processed.Without the  
transmitter connected, the flow graph runs smoothly and there is no  
overflow message in the grc. But with the transmitter USRP, I see a lot  
of  
underruns in the grc and the spectrum in signal analyzer shows  
discontinuity.Is there a way to overcome the underrun issue within the  
GRC  
platform?

1. Also, GRC produces the following warning,  
gr\_buffer::allocate\_buffer: warning: tried to allocate  
16 items of size 4000. Due to alignment requirements  
128 were allocated. If this isn’t OK, consider padding  
your structure to a power-of-two bytes.  
On this platform, our allocation granularity is 4096 bytes.

Is this warning something of a concern?

Regards,  
Saran  
National University of Singapore

---

<div class="post-metadata">

**Author:** ![sarankumar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e36b37/32.png) [@sarankumar](https://www.ruby-forum.com/u/sarankumar)\
**Post date:** [March 6, 2014, 4:53pm UTC](https://www.ruby-forum.com/t/gr-buffer-warning-and-usrp-tx-underflow/239598/2 "2014-03-06T16:53:01Z")

</div>

On Thu, Mar 6, 2014 at 4:01 AM, sarankumar [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Saran  
> National University of Singapore

Two things to keep in mind as you are connecting multiple USRPs  
together:

1. Make sure that the sample rates from your sources to sinks are exact.

2. If the sample rate matching is good, then the problem is probably  
due to processing speed. You’re computer is just not able to keep up  
with the flowgraph. You’ll have to work on optimizing your code and  
any blocks in the path for this problem.

The warning itself is not necessarily a problem; it’s just telling you  
that more memory is allocated. That could be indicative of  
inefficiencies and/or errors in your block’s behavior dealing with the  
input/output streams.

Tom
