# UHD USRP2 full duplex mystery solved

**URL:** <https://www.ruby-forum.com/t/uhd-usrp2-full-duplex-mystery-solved/194988>\
**Category:** GNU Radio\
**Created:** [September 14, 2010, 10:59pm UTC](https://www.ruby-forum.com/t/uhd-usrp2-full-duplex-mystery-solved/194988 "2010-09-14T22:59:10Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![meckart](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@meckart](https://www.ruby-forum.com/u/meckart)\
**Post date:** [September 14, 2010, 10:59pm UTC](https://www.ruby-forum.com/t/uhd-usrp2-full-duplex-mystery-solved/194988/1 "2010-09-14T22:59:10Z")

</div>

I’ve been attempting to do a full duplex send/recv using UHD on a USRP2  
with an XCVR2450.

The major problem I had was that issue\_stream\_cmd nearly always resulted  
in a runtime error of “usrp2 no control response”. It worked fine if I  
transmitted w/o receiving or received w/o transmitting. The same code  
also worked when using a 2nd USRP2 for receiving.

After a session with Wireshark and the UHD host source, I had my “Well,  
duh” moment. When you call send, the data starts streaming to the USRP2  
right away – even if you specify a timestamp in the future. The USRP2  
starts sending back PAUSE frames almost immediately, which throttles not  
only additional send data, but also any commands to the control port.

The solution is to call issue\_stream\_cmd first (and start the recv  
thread), then start the send thread. This was simple enough in my app  
because I was specifying start times in the future anyway. It does  
prevent a method I was going to use on a WBX where I start the send  
thread once and scan through several receive frequencies before stoping  
the send thread.

Perhaps most of you knew about this gotcha already, but I hope this will  
help someone else who encounters the problem. Anyway, it was fun  
investigating and I learned a lot more about the UHD host code and  
protocols

-Marc

---

<div class="post-metadata">

**Author:** ![meckart](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@meckart](https://www.ruby-forum.com/u/meckart)\
**Post date:** [September 14, 2010, 11:30pm UTC](https://www.ruby-forum.com/t/uhd-usrp2-full-duplex-mystery-solved/194988/2 "2010-09-14T23:30:46Z")

</div>

FYI - in the future this will go away in the future when tx flow control  
becomes host-based (and away from ethernet pause frames). -Josh

---

<div class="post-metadata">

**Author:** ![meckart](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@meckart](https://www.ruby-forum.com/u/meckart)\
**Post date:** [September 23, 2010, 8:48am UTC](https://www.ruby-forum.com/t/uhd-usrp2-full-duplex-mystery-solved/194988/3 "2010-09-23T08:48:17Z")

</div>

Just saw this thread now… I’m seeing this problem with my USRP2s and  
the  
WBX board. However, I’m not using UHD. Do you know a fix for this  
outside  
of UHD?

---

<div class="post-metadata">

**Author:** ![meckart](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@meckart](https://www.ruby-forum.com/u/meckart)\
**Post date:** [September 23, 2010, 9:19am UTC](https://www.ruby-forum.com/t/uhd-usrp2-full-duplex-mystery-solved/194988/4 "2010-09-23T09:19:19Z")

</div>

To elaborate more on my issue… I see the USRP2 send mac pause frames,  
and  
then no new data is sent over the interface for 5-10 seconds.

---

<div class="post-metadata">

**Author:** ![meckart](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@meckart](https://www.ruby-forum.com/u/meckart)\
**Post date:** [March 14, 2011, 2:57pm UTC](https://www.ruby-forum.com/t/uhd-usrp2-full-duplex-mystery-solved/194988/5 "2011-03-14T14:57:38Z")

</div>

On 14/03/2011 9:42 AM, Scott Johnston wrote:

> > resulted in a runtime error of “usrp2 no control response”. It worked  
> > The solution is to call issue\_stream\_cmd first (and start the recv
> > 
> > -Marc

Marc:

The XCVR2450 _hardware_ doesn’t support full-duplex at all, so no amount  
of cleverness on the software side can change that.

---

<div class="post-metadata">

**Author:** ![meckart](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@meckart](https://www.ruby-forum.com/u/meckart)\
**Post date:** [March 14, 2011, 5:14pm UTC](https://www.ruby-forum.com/t/uhd-usrp2-full-duplex-mystery-solved/194988/6 "2011-03-14T17:14:35Z")

</div>

On Mar 14, 2011, at 8:53 AM, Marcus D. Leech wrote:

> On 14/03/2011 9:42 AM, Scott Johnston wrote:
> 
> > Does anybody have an example of how to setup a full duplex app?
> > 
> > I am using the uhd with the USRP n210.
> > 
> > Marc E. wrote:
> > 
> > > I’ve been attempting to do a full duplex send/recv using UHD on a USRP2 with  
> > > an XCVR2450.
> 
> The XCVR2450 _hardware_ doesn’t support full-duplex at all, so no amount of  
> cleverness on the software side can change that.

Although the XCVR2450 doesn’t do full duplex, the WBX does, and current  
UHD avoids the problem I described in my previous message. However, the  
WBX has enough internal leakage between tx and rx that we gave up on  
single-daughterboard full duplex. We now use a USRP2 with a WBX for tx  
and a USRP N210 with a DBSRX2 for rx.

As for examples, I’ll try to clean up my C++ app and post it later this  
week. GRC works fine full-duplex, too, I believe.

-Marc

---

<div class="post-metadata">

**Author:** ![meckart](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@meckart](https://www.ruby-forum.com/u/meckart)\
**Post date:** [March 14, 2011, 2:43pm UTC](https://www.ruby-forum.com/t/uhd-usrp2-full-duplex-mystery-solved/194988/7 "2011-03-14T14:43:50Z")

</div>

Hello Mark,

Is there anyway you could post your code or a link to it on the forum? I  
am interested in full duplex communications.

Rest of the gnuradio world,

Does anybody have an example of how to setup a full duplex app?

I am using the uhd with the USRP n210.

TIA

Scott

Marc E. wrote:

> -Marc
> 
> * * *
> 
> Discuss-gnuradio mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [Discuss-gnuradio Info Page](http://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

–  
Scott Johnston  
MIT Lincoln Laboratory  
244 Wood Street, Lexington, MA 02420-9108  
(781) 981-8196  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![meckart](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@meckart](https://www.ruby-forum.com/u/meckart)\
**Post date:** [March 14, 2011, 5:53pm UTC](https://www.ruby-forum.com/t/uhd-usrp2-full-duplex-mystery-solved/194988/8 "2011-03-14T17:53:36Z")

</div>

> However, the WBX has enough internal leakage between tx and rx that we gave up  
> on single-daughterboard full duplex.

Just a heads up, you had not tried WBX without C1 installed on the  
grand-daughterboard, or even without the grand-daughterboard at all,  
just using J202 and J201 on the main WBX board, you might see if one  
of those scenarios could meet your tx-rx isolation requirements.

Jason

---

<div class="post-metadata">

**Author:** ![meckart](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@meckart](https://www.ruby-forum.com/u/meckart)\
**Post date:** [March 14, 2011, 5:39pm UTC](https://www.ruby-forum.com/t/uhd-usrp2-full-duplex-mystery-solved/194988/9 "2011-03-14T17:39:10Z")

</div>

Hi Marc,

How much leakage are you seeing between TX and RX on a WBX board?

Yeah, GRC works fine for full duplex and it is very easy to set it up.

Best regards,  
-Vijay

— On Mon, 3/14/11, Marc E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

From: Marc E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Discuss-gnuradio] UHD USRP2 full duplex mystery solved  
To: “Scott Johnston” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Cc: “discuss-gnuradio Discussion Group” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Date: Monday, March 14, 2011, 12:12 PM

On Mar 14, 2011, at 8:53 AM, Marcus D. Leech wrote:

> On 14/03/2011 9:42 AM, Scott Johnston wrote:
> 
> > Does anybody have an example of how to setup a full duplex app?
> > 
> > I am using the uhd with the USRP n210.
> > 
> > Marc E. wrote:
> > 
> > > I’ve been attempting to do a full duplex send/recv using UHD on a USRP2 with  
> > > an XCVR2450.
> 
> The XCVR2450 _hardware_ doesn’t support full-duplex at all, so no amount of  
> cleverness on the software side can change that.

Although the XCVR2450 doesn’t do full duplex, the WBX does, and current  
UHD avoids the problem I described in my previous message. However, the  
WBX has enough internal leakage between tx and rx that we gave up on  
single-daughterboard full duplex. We now use a USRP2 with a WBX for tx  
and a USRP N210 with a DBSRX2 for rx.

As for examples, I’ll try to clean up my C++ app and post it later this  
week. GRC works fine full-duplex, too, I believe.

-Marc

---

<div class="post-metadata">

**Author:** ![meckart](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@meckart](https://www.ruby-forum.com/u/meckart)\
**Post date:** [March 14, 2011, 6:31pm UTC](https://www.ruby-forum.com/t/uhd-usrp2-full-duplex-mystery-solved/194988/10 "2011-03-14T18:31:52Z")

</div>

> > > However, the WBX has enough internal leakage between tx and rx that we  
> > > gave up on single-daughterboard full duplex.
> > 
> > Just a heads up, you had not tried WBX without C1 installed on the  
> > grand-daughterboard, or even without the grand-daughterboard at all,  
> > just using J202 and J201 on the main WBX board, you might see if one  
> > of those scenarios could meet your tx-rx isolation requirements.

Sorry, missing and _if_ in there ( … Just a heads up, if you have not  
… )

Basically, C1 allows for reception on the TX/RX antenna port, it  
connects the two T/R switches.

However, if you are looking to do full-duplex, you will not be  
receiving on the TX/RX port anyhow, just RX2. So rather than having  
an implicit leakage path through the T/R switches (RF switches rarely  
give more than 20-30dB isolation, depending on frequency), you can  
remove C1 on the grand-daughterboard and improve isolation at the  
expense of not being able to receive on the TX/RX port.

If you want to go even further, you can remove the grand-daughterboard  
entirely and install SMA connectors in J201 and J202. You will also  
need to move a capacitor to AC couple J201 and J202 to the circuit.

Jason

---

<div class="post-metadata">

**Author:** ![meckart](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@meckart](https://www.ruby-forum.com/u/meckart)\
**Post date:** [March 14, 2011, 6:38pm UTC](https://www.ruby-forum.com/t/uhd-usrp2-full-duplex-mystery-solved/194988/11 "2011-03-14T18:38:45Z")

</div>

On 14/03/2011 12:12 PM, Marc E. wrote:

> Although the XCVR2450 doesn’t do full duplex, the WBX does, and current UHD  
> avoids the problem I described in my previous message. However, the WBX has enough  
> internal leakage between tx and rx that we gave up on single-daughterboard full  
> duplex. We now use a USRP2 with a WBX for tx and a USRP N210 with a DBSRX2 for rx.
> 
> As for examples, I’ll try to clean up my C++ app and post it later this week.  
> GRC works fine full-duplex, too, I believe.
> 
> -Marc

Saw XCVR2450, and assumed you were using it.

How much isolation does your application need? The HMC174-series  
switches in the WBX are roughly 26dB isolation each, and there should be  
two such paths  
between transmit and receive when using RX2 and TX/RX, giving roughly  
52dB isolation (at least from the switches–circuit paths may make this  
number worse).

---

<div class="post-metadata">

**Author:** ![meckart](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@meckart](https://www.ruby-forum.com/u/meckart)\
**Post date:** [March 14, 2011, 6:58pm UTC](https://www.ruby-forum.com/t/uhd-usrp2-full-duplex-mystery-solved/194988/12 "2011-03-14T18:58:14Z")

</div>

Thanks, Jason. I should have posted our observations back when we made  
them. We’re doing okay with the two-USRP setup, but it’s good to have  
options.

-Marc

---

<div class="post-metadata">

**Author:** ![meckart](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@meckart](https://www.ruby-forum.com/u/meckart)\
**Post date:** [March 14, 2011, 11:15pm UTC](https://www.ruby-forum.com/t/uhd-usrp2-full-duplex-mystery-solved/194988/13 "2011-03-14T23:15:21Z")

</div>

Hi Scott,

You’ll find uhd\_streamer.cpp at [https://public.me.com/mepard](https://public.me.com/mepard).

Some things you should know:

- It doesn’t use gnu-radio, but uses UHD directly. (We should move to  
the usrp-users list if you want to continue the discussion.)
- It can do two UHD transmits and one receive at the same time.
- It transmits and receives from RAM. It loads the transmit files into  
RAM first, then does simultaneous tx and rx, storing the received data  
in RAM, and finally stores the received data in a file. This makes it  
immune to disk performance issues, but limits the amount of data you can  
send and receive.
- It can be invoked multiple times simultaneously and uses a lock file  
to arbitrate access to the radios. You’ll need to pre-create the lock  
file as described in a comment in the code.
- It can run in standalone, client, or server modes. The client-server  
scheme saves time when doing a bunch of operations in a row by not  
having to reconfigure everything about the radios every time. One  
instance of the server and multiple clients can run at the same time.  
Access to the server’s fifos is controlled by the lock file.

All of this is because we do our signal processing offline in normal,  
single-threaaded MATLAB. To keep our hefty Ubuntu box and the USRPs  
busy, we create multiple instance of MATAB each with a list of tx/rx  
tasks to perform. They each use MATLAB’s unix() function to invoke  
uhd\_streamer, which serializes access to the radios. We tune the number  
of instances to keep the radios busy, but not overflow main memory.

HTH.

-Marc

---

<div class="post-metadata">

**Author:** ![meckart](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@meckart](https://www.ruby-forum.com/u/meckart)\
**Post date:** [October 14, 2011, 4:19pm UTC](https://www.ruby-forum.com/t/uhd-usrp2-full-duplex-mystery-solved/194988/14 "2011-10-14T16:19:32Z")

</div>

Vijay,

Can you post a GRC file with full-duplex configuration? I have the  
XCVR2450  
board so I know I can only get half-duplex. Does the GRC full-duplex  
flow  
graph for the WBX board achieve half-duplex for the XCVR2450 board?

Thanks,  
Johnny

---

<div class="post-metadata">

**Author:** ![meckart](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@meckart](https://www.ruby-forum.com/u/meckart)\
**Post date:** [March 14, 2011, 6:19pm UTC](https://www.ruby-forum.com/t/uhd-usrp2-full-duplex-mystery-solved/194988/15 "2011-03-14T18:19:57Z")

</div>

Jason,

Could you elaborate on this? I don’t follow what you are talking about.

Thanks

Scott

Jason A. wrote:

> * * *
> 
> Discuss-gnuradio mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [Discuss-gnuradio Info Page](http://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

–  
Scott Johnston  
MIT Lincoln Laboratory  
244 Wood Street, Lexington, MA 02420-9108  
(781) 981-8196  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![meckart](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/65b543/32.png) [@meckart](https://www.ruby-forum.com/u/meckart)\
**Post date:** [July 6, 2016, 2:18pm UTC](https://www.ruby-forum.com/t/uhd-usrp2-full-duplex-mystery-solved/194988/16 "2016-07-06T14:18:39Z")

</div>

Dear All,  
I would like to request you you that now a days, I am doing a  
assignment for transferring and receiving a sine wave of 10KHz through  
USRP N210 by using WBX daughter board.  
The sine wave is transferring through GRC of GNUradio block. and same i  
wave a receiving as per WI GUI SCOPE SINK SHOWING. but when we removed  
both Antenna.  
Still sine wave is appearing in WX GUI SCOPE SINK. in transmitting and  
receiving wave.

It’s means that SINE wave is neither transferring nor receiving.

I am using TX/RX for transmuting. and for RX2 for receiving.

I am not getting where I am wrong.  
Also I am getting following waring…

Generating: “/home/dsplab/Desktop/BRIJENDRA/top\_block.py”  
Generating: “/home/dsplab/Desktop/BRIJENDRA/top\_block.py”  
Generating: “/home/dsplab/Desktop/BRIJENDRA/top\_block.py”  
Executing: “/home/dsplab/Desktop/BRIJENDRA/top\_block.py”  
linux; GNU C++ version 4.8.2; Boost\_105400; UHD\_003.005.005-0-unknown  
fft\_impl\_fftw: /home/dsplab/.gr\_fftw\_wisdom: Permission denied  
Using Volk machine: sse4\_2\_32\_orc  
– Opening a USRP2/N-Series device…  
– Current recv frame size: 1472 bytes  
– Current send frame size: 1472 bytes  
UHD Warning:  
The recv buffer could not be resized sufficiently.  
Target sock buff size: 50000000 bytes.  
Actual sock buff size: 163840 bytes.  
See the transport application notes on buffer resizing.  
Please run: sudo sysctl -w net.core.rmem\_max=50000000  
UHD Warning:  
The recv buffer could not be resized sufficiently.  
Target sock buff size: 50000000 bytes.  
Actual sock buff size: 163840 bytes.  
See the transport application notes on buffer resizing.  
Please run: sudo sysctl -w net.core.rmem\_max=50000000

UHD Warning:  
The send buffer could not be resized sufficiently.  
Target sock buff size: 1048576 bytes.  
Actual sock buff size: 163840 bytes.  
See the transport application notes on buffer resizing.  
Please run: sudo sysctl -w net.core.wmem\_max=1048576

UHD Warning:  
Unable to set the thread priority. Performance may be negatively  
affected.  
Please see the general application notes in the manual for  
instructions.  
EnvironmentError: OSError: error in pthread\_setschedparam  
len(audio\_taps) = 1267

I am also attaching .grc file whatever i am using for this application.  
Please help me.  
I am looking forwards.

with best regards.

Brijendra Sharma  
Project Scientist@IIT Kanpur.  
removed\_email\_address@domain.invalid
