# GRC question

**URL:** <https://www.ruby-forum.com/t/grc-question/158577>\
**Category:** GNU Radio\
**Created:** [January 25, 2009, 6:59am UTC](https://www.ruby-forum.com/t/grc-question/158577 "2009-01-25T06:59:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scott\_Bierly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e36b37/32.png) [@Scott\_Bierly](https://www.ruby-forum.com/u/Scott_Bierly)\
**Post date:** [January 25, 2009, 6:59am UTC](https://www.ruby-forum.com/t/grc-question/158577/1 "2009-01-25T06:59:31Z")

</div>

Has anyone successfully used GRC with USRP Dual Source and/or USRP Dual  
Sink blocks? The attached .grc file and .py file are my simple test  
case,  
which bombs like this:

Generating:  
“/home/scott/src/gnuradio/scott-grc/Scott\_Dual\_FFT\_RFX900.py”

Executing: “/home/scott/src/gnuradio/scott-grc/Scott\_Dual\_FFT\_RFX900.py”

Traceback (most recent call last):  
File “/home/scott/src/gnuradio/scott-grc/Scott\_Dual\_FFT\_RFX900.py”,  
line  
72, in   
tb = Scott\_Dual\_FFT\_RFX900()  
File “/home/scott/src/gnuradio/scott-grc/Scott\_Dual\_FFT\_RFX900.py”,  
line  
45, in **init**  
tx\_enb\_b=True,  
File  
“/usr/local/lib/python2.5/site-packages/grc\_gnuradio/usrp/simple\_usrp.py”,  
line 360, in **init**  
gr.io\_signature(2, 2, constructor\_to\_size[self.constructor[0]]),  
TypeError: ‘instancemethod’ object is unsubscriptable

I added the Sink to see what would happen, but originally only had the  
USRP  
Dual Source as a simple diagnostic test, and that bombed this way:

Generating:  
“/home/scott/src/gnuradio/scott-grc/Scott\_Dual\_FFT\_RFX900.py”

Executing: “/home/scott/src/gnuradio/scott-grc/Scott\_Dual\_FFT\_RFX900.py”

Traceback (most recent call last):  
File “/home/scott/src/gnuradio/scott-grc/Scott\_Dual\_FFT\_RFX900.py”,  
line  
56, in   
tb = Scott\_Dual\_FFT\_RFX900()  
File “/home/scott/src/gnuradio/scott-grc/Scott\_Dual\_FFT\_RFX900.py”,  
line  
43, in **init**  
rx\_ant\_b=“RX2”,  
File  
“/usr/local/lib/python2.5/site-packages/grc\_gnuradio/usrp/simple\_usrp.py”,  
line 320, in **init**  
gr.io\_signature(2, 2, constructor\_to\_size[self.constructor[0]]),  
TypeError: ‘instancemethod’ object is unsubscriptable

> > > Done

I’m having a hard time figuring out from this what I might have done  
wrong.  
I will confess I don’t understand how to setup the mux yet, but that  
does  
not appear to be related to this problem.

I’m running off the subversion gnuradio build 10260, which contains GRC  
version 3.1SVN.

Thanks for any help.  
–Scott

---

<div class="post-metadata">

**Author:** ![Scott\_Bierly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e36b37/32.png) [@Scott\_Bierly](https://www.ruby-forum.com/u/Scott_Bierly)\
**Post date:** [January 25, 2009, 7:53am UTC](https://www.ruby-forum.com/t/grc-question/158577/2 "2009-01-25T07:53:53Z")

</div>

Funny, I was working on exactly this. The usrp dual source is  
underutilized, and Im giving the grc/usrp api an overhaul. It will be  
tested and checked in on monday.

The bug you are getting now is due to me forgetting to 100% fix  
something after the daughter board c++ switcheroo. So for now, in  
grc/src/grc\_gnuradio/usrp/simple\_usrp.py… look for

constructor = usrp.source\_c

and replace it with

constructor = (usrp.source\_c, )

sudo make install

---

<div class="post-metadata">

**Author:** ![Scott\_Bierly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e36b37/32.png) [@Scott\_Bierly](https://www.ruby-forum.com/u/Scott_Bierly)\
**Post date:** [January 25, 2009, 9:09pm UTC](https://www.ruby-forum.com/t/grc-question/158577/3 "2009-01-25T21:09:25Z")

</div>

Thanks Josh! That did the trick. I actually had to change a sink too,  
I’ve  
attached the file for reference, and here’s the diff:

## scott@lab-linux-2:~/src/gnuradio/grc/src/grc\_gnuradio/usrp$ diff simple\_usrp.py simple\_usrp.py.save 336,337c336,337 \< class dual\_source\_c(\_dual\_source): constructor = (usrp.source\_c, ) \< class dual\_source\_s(\_dual\_source): constructor = (usrp.source\_s, )

> class dual\_source\_c(\_dual\_source): constructor = usrp.source\_c  
> class dual\_source\_s(\_dual\_source): constructor = usrp.source\_s  
> 377,378c377,378  
> \< class dual\_sink\_c(\_dual\_sink): constructor = (usrp.sink\_c, )  
> \< class dual\_sink\_s(\_dual\_sink): constructor = (usrp.sink\_s, )

* * *

> class dual\_sink\_c(\_dual\_sink): constructor = usrp.sink\_c  
> class dual\_sink\_s(\_dual\_sink): constructor = usrp.sink\_s

I can build dual grc flowgraphs fine now. As soon as I decipher how to  
setup the RX/TX muxes, I’ll be in business! The zero setting for “auto”  
does not seem to choose well for these dual cases. I’ve discovered that  
0x32103210 allows me to build a dual Spectrum analyzer using a pair of  
RFX900’s, although I don’t know why that setting works. I can’t get a  
dual  
Siggen to work yet, but I’ll keep hacking…

–Scott

PS: GRC is really awesome

---

<div class="post-metadata">

**Author:** ![Scott\_Bierly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e36b37/32.png) [@Scott\_Bierly](https://www.ruby-forum.com/u/Scott_Bierly)\
**Post date:** [January 25, 2009, 10:13pm UTC](https://www.ruby-forum.com/t/grc-question/158577/4 "2009-01-25T22:13:28Z")

</div>

This may help you with the muxes: see the comments for the TX and RX mux

[http://www.gnuradio.org/trac/browser/gnuradio/trunk/usrp/host/lib/legacy/usrp\_standard.h](http://www.gnuradio.org/trac/browser/gnuradio/trunk/usrp/host/lib/legacy/usrp_standard.h)

Soon, there will be better configuration options and you will not have  
to deal with muxes!

-Josh
