Project

General

Profile

Actions

Bug #4636

closed

osmo-trx-uhd crashes with 3 channels multi-ARFCN mode

Added by fixeria over 3 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
UHD
Target version:
-
Start date:
06/29/2020
Due date:
% Done:

100%

Spec Reference:

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

multi_usrp.png View multi_usrp.png 49.8 KB fixeria, 06/29/2020 09:48 AM
multi_usrp.grc multi_usrp.grc 10.1 KB fixeria, 06/29/2020 09:48 AM
Actions #1

Updated by fixeria over 3 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()

Actions #2

Updated by fixeria over 3 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
Actions #3

Updated by Hoernchen over 3 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.

Actions #4

Updated by Hoernchen over 3 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.

Actions #5

Updated by laforge over 3 years ago

  • Assignee set to fixeria

As nobody every provided any feedback here, I assumed it is something specific to the setup of fixeria and not a generic bug.

pespin: Do we have osmo-gsm-tester tests with multi-arfcn mode of osmo-trx on B2xx?

Did anyone else see this problem during the last 2 months?

Actions #6

Updated by fixeria over 3 years ago

  • Status changed from New to Feedback
Actions #7

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?

Actions #8

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.

Actions #9

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.

Actions #10

Updated by fixeria over 3 years ago

  • Status changed from Feedback to Resolved

The fix has been merged.

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)