# FPE with FM Rcvr

**URL:** <https://www.ruby-forum.com/t/fpe-with-fm-rcvr/205176>\
**Category:** GNU Radio\
**Created:** [March 31, 2011, 6:33am UTC](https://www.ruby-forum.com/t/fpe-with-fm-rcvr/205176 "2011-03-31T06:33:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [March 31, 2011, 6:33am UTC](https://www.ruby-forum.com/t/fpe-with-fm-rcvr/205176/1 "2011-03-31T06:33:06Z")

</div>

Working the following issue…any ideas?

System: Ubuntu 10.10, Gnuradio 3.3.0, uhd (Mar 2011), USRP2, TVRX

Using the attached grc model results in a floating point exception:

gnuradio\_core\_runtime.py (1476)

top\_block.py (96)

```
 top_block_gui.py (72)

   USRP2_WX.py (326)

```

General output in GRC:

Generating: “/home/jim/radiostuff/refs/gen/USRP2\_WX.py”

Executing: “/home/jim/radiostuff/refs/gen/USRP2\_WX.py”

linux; GNU C++ version 4.4.5; Boost\_104200; UHD\_003.000.000-3235792

Current recv frame size: 1476 bytes  
Current send frame size: 1472 bytes  
Making transport for DSP0…  
Current recv sock buff size: 50000000 bytes  
Making transport for DSP1…  
Current recv sock buff size: 50000000 bytes  
Making transport for ERR0…  
mboard0 MIMO master

Warning:  
The hardware does not support the requested RX sample rate:  
Target sample rate: 3.200000 MSps  
Actual sample rate: 3.225806 MSps #Betting this is the culprit but  
haven’t completed a trace

> > > gr\_fir\_ccc: using SSE

> > > Done

I’m looking through the UHD spec to see if there is a function that  
easily resolves this but nothing has jumped out, yet.

It might be a memory issue. An attempt to sample at the 6Mz limit with  
the TVRX (board responds with ~5.88…) results in  
gr\_buffer:allocate\_buffer: failed to allocate buffer of size 18760,  
which points to an installation issue that make check should have  
handled…a reinstall and closer scrutiny of the output should highlight  
any neglected warnings/errors.

---

<div class="post-metadata">

**Author:** ![ronh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bcef8e/32.png) [@ronh](https://www.ruby-forum.com/u/ronh)\
**Post date:** [March 31, 2011, 7:26am UTC](https://www.ruby-forum.com/t/fpe-with-fm-rcvr/205176/2 "2011-03-31T07:26:44Z")

</div>

On 03/30/2011 09:31 PM, Ron H. wrote:

> Working the following issue…any ideas?
> 
> System: Ubuntu 10.10, Gnuradio 3.3.0, uhd (Mar 2011), USRP2, TVRX
> 
> Using the attached grc model results in a floating point exception:

(process of elimination)

it looks like its coming from the xlating filter

> It might be a memory issue. An attempt to sample at the 6Mz limit  
> with the TVRX (board responds with ~5.88…) results in  
> gr\_buffer:allocate\_buffer: failed to allocate buffer of size 18760,  
> which points to an installation issue that make check should have  
> handled…a reinstall and closer scrutiny of the output should  
> highlight any neglected warnings/errors.

failed to allocate is an issue introduced by a block that changed that  
is used in the fft sink (tom?)

-Josh

---

<div class="post-metadata">

**Author:** ![ronh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bcef8e/32.png) [@ronh](https://www.ruby-forum.com/u/ronh)\
**Post date:** [April 1, 2011, 3:40pm UTC](https://www.ruby-forum.com/t/fpe-with-fm-rcvr/205176/3 "2011-04-01T15:40:17Z")

</div>

On Fri, Apr 1, 2011 at 1:49 AM, Ron H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Adding to the following, a backtrace that points to the throw  
> std::bad\_alloc (), gr\_buffer.cc (88)
> 
> May have some association with another error addressed earlier this year by  
> T. Rondeau: [Discuss-gnuradio] gr\_vmcircbuf\_sysv\_shm: shmget (1): Invalid  
> argument, Dated: Fri, 11 Feb 2011 09:52:04-0500

Ron, I took a look at your graph, and I see a few discrepancies. Where  
are  
you getting your numbers for adc\_rate, usrp\_dec, and usrp\_inter? Using a  
sample rate for the USRP as 3.2 Msps doesn’t work because it runs at 100  
Msps with integer decimation, so you are really asking for a decimation  
of  
31.25. Instead, it is giving you a decimation of 31 for a rate of 3.225,  
as  
the warning in your original email said.

I then don’t quite get what you are doing with the rational resampler  
and  
how you are building the taps for the frequency translating filter, but  
maybe I just haven’t gone through the math properly.

Importantly, though, you have set the decimation of the filter to 0  
(probably because you are doing integer division with  
audio\_inter/audio\_dec,  
which is less than 1; I suspect you meant audio\_rate/audio\_dec or  
something), which, while I haven’t tested it, is probably where you’re  
problem is.

gr\_vmcircbuf\_sysv\_shm: shmget (1): Invalid argument

> 

gr\_buffer::allocate\_buffer: failed to allocate buffer of size 18760 KB

> #3 0x008a3055 in \_\_gnu\_cxx::\_\_verbose\_terminate\_handler() () from  
> /usr/lib/libstdc++.so.6  
> #4 0x008a0f35 in ?? () from /usr/lib/libstdc++.so.6  
> #5 0x008a0f72 in std::terminate() () from /usr/lib/libstdc++.so.6  
> #6 0x008a10e1 in \_\_cxa\_throw () from /usr/lib/libstdc++.so.6  
> _#7 0x00ae4861 in gr\_buffer::gr\_buffer (this=0xb4ef478, nitems=2345,  
> sizeof\_item=8192, link=…) at gr\_buffer.cc:88_

You are asking for a huge buffer here. It’s throwing because it can’t  
properly allocate you the size buffer you are requesting. It’s seeking a  
buffer of 2345 items with a size of 8192 for each item. I’m not sure  
which  
block is doing this, but it strikes me it could be due to the decimation  
of  
0 in the filter.

Tom

---

<div class="post-metadata">

**Author:** ![ronh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bcef8e/32.png) [@ronh](https://www.ruby-forum.com/u/ronh)\
**Post date:** [April 1, 2011, 8:14am UTC](https://www.ruby-forum.com/t/fpe-with-fm-rcvr/205176/4 "2011-04-01T08:14:43Z")

</div>

Adding to the following, a backtrace that points to the throw  
std::bad\_alloc (), gr\_buffer.cc (88)

May have some association with another error addressed earlier this year  
by T. Rondeau: [Discuss-gnuradio] gr\_vmcircbuf\_sysv\_shm: shmget (1):  
Invalid argument, Dated: Fri, 11 Feb 2011 09:52:04-0500

gr\_vmcircbuf\_sysv\_shm: shmget (1): Invalid argument  
gr\_buffer::allocate\_buffer: failed to allocate buffer of size 18760 KB  
terminate called after throwing an instance of ‘std::bad\_alloc’  
what(): std::bad\_alloc

Program received signal SIGABRT, Aborted.  
0x00436416 in \_\_kernel\_vsyscall ()  
(gdb) bt  
#0 0x00436416 in \_\_kernel\_vsyscall ()  
#1 0x006c2941 in raise () from /lib/libc.so.6  
#2 0x006c5e42 in abort () from /lib/libc.so.6  
#3 0x008a3055 in \_\_gnu\_cxx::\_\_verbose\_terminate\_handler() () from  
/usr/lib/libstdc++.so.6  
#4 0x008a0f35 in ?? () from /usr/lib/libstdc++.so.6  
#5 0x008a0f72 in std::terminate() () from /usr/lib/libstdc++.so.6  
#6 0x008a10e1 in \_\_cxa\_throw () from /usr/lib/libstdc++.so.6  
#7 0x00ae4861 in gr\_buffer::gr\_buffer (this=0xb4ef478, nitems=2345,  
sizeof\_item=8192, link=…) at gr\_buffer.cc:88  
#8 0x00ae4908 in gr\_make\_buffer (nitems=2345, sizeof\_item=8192,  
link=…) at gr\_buffer.cc:96  
#9 0x00acec5f in gr\_flat\_flowgraph::allocate\_buffer (this=0xb4ef458,  
block=…, port=0) at gr\_flat\_flowgraph.cc:121  
#10 0x00acf1af in gr\_flat\_flowgraph::allocate\_block\_detail  
(this=0xb4ef458, block=…) at gr\_flat\_flowgraph.cc:80  
#11 0x00ad1538 in gr\_flat\_flowgraph::setup\_connections (this=0xb4ef458)  
at gr\_flat\_flowgraph.cc:62  
#12 0x00af7880 in gr\_top\_block\_impl::start (this=0xab2dcd0) at  
gr\_top\_block\_impl.cc:106  
#13 0x00af61b0 in gr\_top\_block::start (this=0xaa91c78) at  
gr\_top\_block.cc:59  
#14 0x00179128 in \_wrap\_gr\_top\_block\_sptr\_start (args=0xa7bdeec) at  
python/gnuradio\_core\_runtime.cc:15301  
#15 0x080ddd23 in PyEval\_EvalFrameEx ()  
#16 0x080df04c in PyEval\_EvalFrameEx ()  
#17 0x080df04c in PyEval\_EvalFrameEx ()  
#18 0x080dfbb2 in PyEval\_EvalCodeEx ()  
#19 0x080de145 in PyEval\_EvalFrameEx ()  
#20 0x080dfbb2 in PyEval\_EvalCodeEx ()  
#21 0x080dfca7 in PyEval\_EvalCode ()  
#22 0x080fd956 in PyRun\_FileExFlags ()  
#23 0x080d7d09 in ?? ()  
#24 0x080ddd23 in PyEval\_EvalFrameEx ()  
#25 0x080dfbb2 in PyEval\_EvalCodeEx ()  
#26 0x080dfca7 in PyEval\_EvalCode ()  
#27 0x080fe460 in PyRun\_StringFlags ()  
#28 0x080dee04 in PyEval\_EvalFrameEx ()  
#29 0x080dfbb2 in PyEval\_EvalCodeEx ()  
#30 0x080de145 in PyEval\_EvalFrameEx ()  
#31 0x080df04c in PyEval\_EvalFrameEx ()  
#32 0x080df04c in PyEval\_EvalFrameEx ()  
#33 0x080dfbb2 in PyEval\_EvalCodeEx ()  
#34 0x080dfca7 in PyEval\_EvalCode ()  
#35 0x080df0d8 in PyEval\_EvalFrameEx ()  
#36 0x080dfbb2 in PyEval\_EvalCodeEx ()  
#37 0x080de145 in PyEval\_EvalFrameEx ()  
#38 0x080dfbb2 in PyEval\_EvalCodeEx ()  
#39 0x08168e3c in ?? ()  
#40 0x0805fd6a in PyObject\_Call ()  
#41 0x0805aa53 in ?? ()  
#42 0x0805b295 in Py\_Main ()  
#43 0x0805a8ab in main ()  
(gdb)
