# Howto select subdev with USRP1

**URL:** <https://www.ruby-forum.com/t/howto-select-subdev-with-usrp1/245418>\
**Category:** GNU Radio\
**Created:** [May 25, 2013, 9:29am UTC](https://www.ruby-forum.com/t/howto-select-subdev-with-usrp1/245418 "2013-05-25T09:29:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [May 25, 2013, 9:29am UTC](https://www.ruby-forum.com/t/howto-select-subdev-with-usrp1/245418/1 "2013-05-25T09:29:41Z")

</div>

Hi

I am having problems selecting the subdev with USRP1:

My USRP1 is populated with 2 LFRX and 2 LFTX.

I am trying the following code:

* * *

#!/usr/bin/python

from gnuradio import gr  
from gnuradio import uhd  
from gnuradio.eng\_option import eng\_option

class build\_block(gr.top\_block):  
def **init** (self):  
gr.top\_block. **init** (self)

```
    self.u_tx = 

```

uhd.usrp\_sink(“serial=47432785”,uhd.stream\_args(‘fc32’))

```
    self.u_tx.set_samp_rate(8.0e6)
    self.tx_src0 = 

```

gr.sig\_source\_c(self.u\_tx.get\_samp\_rate(),gr.GR\_CONST\_WAVE,0, 1.0, 0)  
self.u\_tx.set\_center\_freq(10e6)

# self.u\_tx.set\_subdev\_spec(“A:AB”,0)

```
    self.connect (self.tx_src0, self.u_tx)

```

def main ():  
tb = build\_block ()  
tb.start ()  
raw\_input ('Press Enter to quit: ')

if **name** == ‘ **main** ’:  
main ()

* * *

This way I get I- and Q- Signals out of TXB.  
With the subdev\_spec uncommented I get nothing - neither TXA, not TXB.  
With self.u\_tx.set\_subdev\_spec(“B:AB”,0) I again only get TXB.

What do I Have to configure to get signals only from TXA?

Thanks

Wolfgang

---

<div class="post-metadata">

**Author:** ![Wolfgang\_Buesser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d9b06d/32.png) [@Wolfgang\_Buesser](https://www.ruby-forum.com/u/Wolfgang_Buesser)\
**Post date:** [May 26, 2013, 10:59am UTC](https://www.ruby-forum.com/t/howto-select-subdev-with-usrp1/245418/2 "2013-05-26T10:59:50Z")

</div>

On Sa, 2013-05-25 at 10:56 -0400, Marcus D. Leech wrote:

> > > > ```
> > > > def __init__ (self):
> > > > self.connect (self.tx_src0, self.u_tx)
> > > > 
> > > > ```
> > > > 
> > > > * * *
> > 
> > | Device: USRP1 Device  
> > | | | RX DSP: 0  
> > | | | /  
> > | | | | RX Frontend: BA  
> > | | | | Name: LFRX (A)  
> > | | | | Antennas:  
> > | | \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > | | | | Gain Elements: None  
> > | | | | Connection Type: QI  
> > | | | | Uses LO offset: No  
> > | | | \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > | | | TX DSP: 1  
> > | | | | Sensors:  
> > | | | | Freq range: -32.000 to 32.000 Mhz  
> > | | | | Gain Elements: None  
> > | | | | Connection Type: Q  
> > | | | \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > | | | /  
> > | | | | TX Frontend: A  
> > | | | | Name: LFTX (B)  
> > | | | | Gain range pga: -20.0 to 0.0 step 0.1 dB
> 
> If you swap the TXA/TXB cards, what happens?

It looks I have just found the ‘solution’:

If I put the set\_subdev\_spec above the set\_center-freq I can select  
between TXA(I&Q) and TXB(I&Q).  
I guess I really don’t understand how it all works.

Thanks

Wolfgang

---

<div class="post-metadata">

**Author:** ![Wolfgang\_Buesser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d9b06d/32.png) [@Wolfgang\_Buesser](https://www.ruby-forum.com/u/Wolfgang_Buesser)\
**Post date:** [May 26, 2013, 1:01pm UTC](https://www.ruby-forum.com/t/howto-select-subdev-with-usrp1/245418/3 "2013-05-26T13:01:22Z")

</div>

On 05/25/2013 11:55 AM, Wolfgang Buesser wrote:

> > > > > ```
> > > > > main ()
> > > > > 
> > > > > ```
> > > > > 
> > > > > Wolfgang
> > > 
> > > ```
> > > _____________________________________________________
> > > 
> > > ```
> > > 
> > > | | \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > > | | | ID: LF RX (0x000f)  
> > > | | | \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > > | | | /  
> > > | | | | RX Frontend: B  
> > > | | | | Name: ad9522  
> > > | | | | Sensors:  
> > > | | | | Freq range: -32.000 to 32.000 Mhz  
> > > | | | | Gain Elements: None  
> > > | | | | Connection Type: Q  
> > > | | \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > > | | | | Name: LFTX (AB)  
> > > | | | | Antennas:  
> > > | | | | Sensors:  
> > > | | | | Freq range: -32.000 to 32.000 Mhz  
> > > | | | TX Dboard: B  
> > > | | | | Uses LO offset: No  
> > > | | | \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > > | | | /  
> > > | | | | TX Codec: B

If you use GRC to do these things, it’ll get stuff in the right order,  
which you can “crib” from, even if you don’t end up using the resulting  
GRC-generated  
flow-graph.

–  
Marcus L.  
Principal Investigator  
Shirleys Bay Radio Astronomy Consortium

> **[Live Draw HK Tercepat | Result HK | HK Pools | Live HK | HK Prize Hari Ini](https://www.sbrac.org)**
>
> Temukan live draw hk tercepat melalui halaman hk pools yang resmi dan dapatkan result hk prize melalui live hk secara langsung di situs kami.
