On 08/06/2023 07:16, Leon Wabeke wrote:
Hi Eesa
I am not sure if this will help, but in some of our code where we
reuse the USRP in another thread, I only create the handle once and
pass that to both threads (instead of calling multi_usrp::make in each
thread), something like:
|uhd::usrp::multi_usrp::sptr pUSRP =
uhd::usrp::multi_usrp::|make|(strUSRPArgs);|
|cTXClass tx(pUSRP);|
|cRXClass rx(pUSRP);|
Regards
Leon
*From: *eesa.nik...@gmail.com <eesa.nik...@gmail.com>
*Date: *Thursday, 08 June 2023 at 07:56
*To: *usrp-users@lists.ettus.com <usrp-users@lists.ettus.com>
*Subject: *[USRP-users] Creating TX usrp and RX usrp objects using Two
different threads using X310
You don't often get email from eesa.nik...@gmail.com. Learn why this
is important <https://aka.ms/LearnAboutSenderIdentification>
[The e-mail server of the sender could not be verified (SPF Record)]
Hi dears,
I created a TX usrp an RX usrp object (using
uhd::usrp::multiusrp::make()) using two different threads.
When I try to set subdevice for them the first thread can set
subdevice successfully but hte later fails to set it and throw an
excption with this error message: "Error: map::at".
(Example setting=> TX subdev=A:0, antenna=TX/RX; RX subdev=A:0 (or
B:0), antenna= RX2)
If I comment the methods to set subdevice for the later thread (e.g.
for RX: rx_usrp->set_rx_subdev_spec("B:0")) my code works correctly.
I wonder why this problem is for! As UHD examples such as
txrx_loopback_tofile, set subdevice for both TX and RX separately and
it works fine. The only difference between this example and mine is
that I am using two different threads.
It is worth noting that my code works correctly for N200 usrp.
My UHD version is "UHD 4.3.0.0.-0g1f8fd345"
Can anyone help me to resolve this issue?
Thank you.
Eesa
Indeed, there should only be on multi_usrp object, and you create
*streamers* off of that object to handle TX and RX.
That it "works" on the N200 is probably just a historical accident.
There can be only one multi_usrp object to "own"
a given USRP device. So, you create the multi_usrp once and share it
across threads. You may well create and RX
streamer in one thread and a TX in another.
_______________________________________________
USRP-users mailing list -- usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-le...@lists.ettus.com