Bug #4636
closedosmo-trx-uhd crashes with 3 channels multi-ARFCN mode
100%
Description
The user manual [1] (section 13.2 "Multi-ARFCN mode") states:
Up to three ARFCN’s is supported for multi-TRX
[1] http://ftp.osmocom.org/docs/latest/osmotrx-usermanual.pdf
I have a USRP B210, and 2 channels in multi-TRX work fine:
trx ... multi-arfcn enable rx-sps 4 tx-sps 4 chan 0 tx-path TX/RX rx-path RX2 chan 1 tx-path TX/RX rx-path RX2
Trying to start osmo-trx with 3 channels:
trx ... multi-arfcn enable rx-sps 4 tx-sps 4 chan 0 tx-path TX/RX rx-path RX2 chan 1 tx-path TX/RX rx-path RX2 chan 2 tx-path TX/RX rx-path RX2
leads to the following error:
DDEV DEBUG UHDDevice.cpp:207 [tid=140737288886144][chan=0] Configuring Tx antenna TX/RX DDEV DEBUG UHDDevice.cpp:207 [tid=140737288886144][chan=1] Configuring Tx antenna TX/RX DDEV DEBUG UHDDevice.cpp:207 [tid=140737288886144][chan=2] Configuring Tx antenna TX/RX terminate called after throwing an instance of 'uhd::index_error' what(): LookupError: IndexError: multi_usrp: TX channel 2 out of range for configured TX frontends Program received signal SIGABRT pwndbg> bt #0 0x00007ffff6821355 in raise () from /usr/lib/libc.so.6 #1 0x00007ffff680a853 in abort () from /usr/lib/libc.so.6 #2 0x00007ffff6ba186a in __gnu_cxx::__verbose_terminate_handler () at /build/gcc/src/gcc/libstdc++-v3/libsupc++/vterminate.cc:95 #3 0x00007ffff6badd8a in __cxxabiv1::__terminate (handler=<optimized out>) at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48 #4 0x00007ffff6baddf7 in std::terminate () at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:58 #5 0x00007ffff6bae09e in __cxxabiv1::__cxa_throw (obj=<optimized out>, tinfo=0x7ffff7a563a8 <typeinfo for uhd::index_error>, dest=0x7ffff70d5990) at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_throw.cc:95 #6 0x00007ffff71b8315 in ?? () from /usr/lib/libuhd.so.3.15.0 #7 0x00007ffff71b83cb in ?? () from /usr/lib/libuhd.so.3.15.0 #8 0x00007ffff71b9da1 in ?? () from /usr/lib/libuhd.so.3.15.0 #9 0x000055555556ecaf in uhd_device::setTxAntenna (this=0x5555555e4ae0, ant="TX/RX", chan=2) at /usr/include/boost/smart_ptr/shared_ptr.hpp:732 #10 0x00005555555747f6 in RadioDevice::set_antennas (this=this@entry=0x5555555e4ae0) at /usr/include/c++/10.1.0/bits/stl_vector.h:1043 #11 0x000055555557298b in uhd_device::open (this=0x5555555e4ae0, args=..., ref=0, swap_channels=<optimized out>) at UHDDevice.cpp:564 #12 0x0000555555563826 in trx_start (trx=0x5555555e4150) at osmo-trx.cpp:516 #13 main (argc=<optimized out>, argv=<optimized out>) at osmo-trx.cpp:645 #14 0x00007ffff680c002 in __libc_start_main () from /usr/lib/libc.so.6 #15 0x0000555555565a2e in _start () at osmo-trx.cpp:657
Either our documentation is wrong and 2 channels is the maximum in multi-ARFCN mode, or it's a bug somewhere in osmo-trx / UHD driver.
P.S. I just tested setting 3 channels for a "UHD Source" block in GNU Radio (see attachment) - same error.
Files
Updated by fixeria almost 4 years ago
No matter if N > 2 channels is supported by USRP B210 or not, we should terminate gracefully and not crash:
https://gerrit.osmocom.org/c/osmo-trx/+/19040 UHDDevice: catch LookupError/IndexError in set{Rx,Tx}Antenna()
Updated by fixeria almost 4 years ago
Here is an extract from the log output during a successful run with 2 channels:
DDEV INFO UHDDevice.cpp:639 [tid=140375369013120] Device configuration: Single USRP: Device: B-Series Device Mboard 0: B210 RX Channel: 0 RX DSP: 0 RX Dboard: A RX Subdev: FE-RX2 RX Channel: 1 RX DSP: 1 RX Dboard: A RX Subdev: FE-RX1 TX Channel: 0 TX DSP: 0 TX Dboard: A TX Subdev: FE-TX2 TX Channel: 1 TX DSP: 1 TX Dboard: A TX Subdev: FE-TX1
Updated by Hoernchen almost 4 years ago
I don't know where the number 3 comes from, unless you use the mcbts mode the b210 has only 2 channels to offer, which still are not independent due to the shared LO.
Updated by Hoernchen almost 4 years ago
Err, duh, the mctbs mode is what you're trying to use.. it should support 5 arfcns, and it's actually just one channel that contains the whole bw. Still no idea where that 3 comes from.
Updated by laforge over 3 years ago
- Assignee set to fixeria
Updated by laforge over 3 years ago
From the backtrace it seems that osmo-trx is trying to setTxAntenna() for chan=2. I would assume chan=0/chan=1 are the actaul physical radio frontend channels, and there is no chan=2?
So somehow a part of code doens't "get" that the three ARFCNs are just in software and thre's no TxAntenna specifically for each of those ARFCN?
Updated by laforge over 3 years ago
looking at the code, it should magically work if you don't set tx-path or rx-path on chan 1 + chan 2.
Updated by fixeria over 3 years ago
- % Done changed from 0 to 100
Kudos to laforge for his analysis that helped to fix the problem.
https://gerrit.osmocom.org/c/osmo-trx/+/20076 radioDevice: fix set_antennas(): consider MULTI_ARFCN mode
https://gerrit.osmocom.org/c/osmo-trx/+/20077 vty: add multi-ARFCN specific warning for chan N > 0
Updated by Hoernchen 2 months ago:
... it should support 5 arfcns ...
See https://lists.osmocom.org/pipermail/openbsc/2020-September/013233.html.
Updated by fixeria over 3 years ago
- Status changed from Feedback to Resolved
The fix has been merged.