Transmitting on 2 different USRP B210

16 views (last 30 days)
Andrew
Andrew on 25 Jan 2026 at 10:36
Commented: Walter Roberson on 26 Jan 2026 at 5:06
I want to have a MIMO setup using 4 USRP B210s (2 transmit 2 receive). I am able to connect 2 USRPs to one computer and detect via MATLAB, and can also initalize two sdru objects, but when I try to transmit I get the following error: libusb_session_impl_event_handler_task: LIBUSB_ERROR_CODE -1
this is a code snippet
txRadio1 = comm.SDRuTransmitter(...
'Platform', usrp(1).Platform, ...
'SerialNum', usrp(1).SerialNum,...
'ChannelMapping', 1, ...
'CenterFrequency', 2.4e9, ...
'Gain', 60, ...
'MasterClockRate', 30.72e6, ...
'InterpolationFactor', 30.72e6 / sampleRate);
txRadio2 = comm.SDRuTransmitter(...
'Platform', usrp(2).Platform, ...
'SerialNum', usrp(2).SerialNum,...
'ChannelMapping', 1, ...
'CenterFrequency', 5e9, ...
'Gain', 60, ...
'MasterClockRate', 30.72e6, ...
'InterpolationFactor', 30.72e6 / sampleRate);
txWaveform = txWaveform / max(abs(txWaveform));
for i = 1:10
txRadio1(txWaveform);
pause(0.5);
txRadio2(txWaveform);
pause(0.5);
disp(1/i);
end

Answers (1)

Umar
Umar on 26 Jan 2026 at 0:05
Edited: Walter Roberson on 26 Jan 2026 at 5:04
Hi @Andrew,
I saw your post about the LIBUSB_ERROR_CODE -1 you're getting with the two USRP B210s. I've spent some time digging through documentation and forums to figure this out for you.
The problem you're hitting is actually pretty common with multiple B210s - it's a USB bandwidth contention issue. The B210 is quite demanding on USB 3.0, and when you try to run two of them simultaneously, they're fighting over the same bandwidth. Even though USB 3.0 is supposed to be fast, it's actually half-duplex, meaning the transmit and receive share the same data path rather than having separate lanes.
Here's what I'd recommend trying first. Check if both your USRPs are plugged into the same USB 3.0 controller. This is the most common culprit. A lot of people think plugging into different USB ports means different controllers, but that's often not the case - many motherboards share a single controller across multiple ports. On Windows, you can open Device Manager and look under "Universal Serial Bus controllers" to see the actual controller assignments. On Linux, run "lspci | grep USB" to see how many separate xHCI controllers you have. You want each USRP on its own dedicated controller.
If you don't have separate controllers available on your motherboard, you might need to get a PCIe USB 3.0 expansion card that has multiple independent controllers. Intel chipsets (Series 7, 8, or 9) tend to work best with USRPs based on what I've seen in the community.
The second thing I'd try is reducing your master clock rate. You're running at 30.72 MHz which is really pushing it for dual devices. Try dropping down to 16 MHz or even 10 MHz to start with and see if the error goes away. You can always increase it gradually once you get things working. Here's what that would look like in your code:
MasterClockRate = 16e6 InterpolationFactor = 16e6 / sampleRate
Also, make sure you're using external 6V power supplies for both B210s. USB bus power isn't really sufficient for reliable dual-transmit operations, especially when you're pushing the bandwidth limits.
Another thing worth trying - instead of transmitting sequentially with short pauses, try either transmitting them truly simultaneously or increase your pause duration significantly (like 2 seconds instead of 0.5). The current timing might not be giving the USB subsystem enough time to properly handle the handoff between devices.
You might also want to add 'UnderrunOutputPort' set to true in your transmitter objects so you can monitor if you're getting underruns, which would confirm it's a bandwidth issue.
If none of this works, I hate to say it, but Ettus actually recommends using the N200/N210 series for multi-device setups instead of the B210. The N-series uses Gigabit Ethernet instead of USB, which gives each device its own dedicated bandwidth and is way more reliable for what you're trying to do. I know that's not what you want to hear if you already have the B210s, but it's worth knowing for future reference.
There's also the option of using just one B210 with both of its channels (it's 2x2 MIMO capable on a single unit) if that would work for your application. You'd set 'ChannelMapping' to [1 2] instead of just 1, and that would give you dual transmit without the USB controller conflicts.
Here are some resources that might help:
Ettus Knowledge Base on multiple USRPs and USB bandwidth: https://kb.ettus.com/About_USRP_Bandwidths_and_Sampling_Rates
USRP B200/B210 USB 3.0 performance discussion: https://files.ettus.com/manual/page_usrp_b200.html
UHD and USRP Manual on USB transport: https://files.ettus.com/manual/page_transport.html
Let me know if any of this helps or if you're still stuck. Happy to brainstorm.
  1 Comment
Walter Roberson
Walter Roberson on 26 Jan 2026 at 5:06
@Umar is right that it is common for USB ports to share a controller.
On my older iMac, there are four USB ports, two of which share one controller and the other two of which share a different controller.
On my even older MacBook Pro, all of the USB ports on one side shared a single controller, and the USB ports on the other side were on a different controller.

Sign in to comment.

Categories

Find more on Communications Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!