Commit Graph

916 Commits

Author SHA1 Message Date
Pau Espin Pedrol 309ad4d901 Bump version: 1.2.0.132-3b8f-dirty → 1.3.0
Change-Id: I92b99ebab1d54e9cbdc8469d76105c55bcb03f36
2021-02-23 14:27:15 +01:00
Vadim Yanitskiy 3b8f7c4d97 Add a (hidden) VTY parameter for Rx/Tx freq. shifting
Change-Id: I360e8ba91471757210c7f096c04928a6fbb91c61
Related: SYS#4454
2021-02-21 12:01:16 +01:00
Pau Espin 48cad832ea tests: Replace deprecated API log_set_print_filename
Change-Id: I3cc0a92da39ab2594b3a7cefb314e2f2ecb628e2
2021-02-19 14:09:01 +01:00
Pau Espin 56237bce95 tests: Explicitly drop category from log
Let's disable category here since we don't care about its formatting here.

In any case, every test relying on logging output validation should
always explicitly state the config to avoid issues in the future if
default values change.

Change-Id: Iaa77f8a7d3f752173507afd988bd76a8aa632082
Related: OS#5034
2021-02-19 14:08:44 +01:00
Pau Espin 5738940535 Replace my_gettid with libosmocore osmo_gettid API
The API was moved to libosmocore, let's use it instead of defining our
own here with all the complexity in build system involved.

Depends: libosmocore.git Change-Id Id7534beeb22fcd50813dab76dd68818e2ff87ec2
Related: OS#5027
Change-Id: I19e32fbc47bd88a668e0c912e89b001b0f8831dd
2021-02-17 18:27:41 +01:00
Pau Espin cec9eda227 Threads.cpp: Use already existing gettid wrapper function
A wrapper function with better support already exists in debug.c and
announced in debug.h. Let's use that one instead.

Related: OS#5027
Change-Id: I2ccf94f95a531d5873da2a4681cf89cbc5b31422
2021-02-17 17:28:06 +01:00
Sylvain Munaut ad202d72e1 sigProcLib: fix C/I computation for 8-PSK modulated bursts
Change-Id: I860af60bc0fbd36dfb38316fad65ddd3a5827a8f
Related: Ib4ceec553f2e5f77bf3f6777724968456a180f5e
Related: OS#4006, OS#4373
2021-02-04 20:44:51 +01:00
Oliver Smith 0f4d5791df configure.ac: set -std=gnu11
Change-Id: Ie95876d1d2ebf31ff588999d85584f6981522fa8
2021-01-28 10:48:35 +00:00
Vadim Yanitskiy 2a637a5c9c Transceiver: use proper factor for amplitude scaling
In Transceiver::addRadioVector() we scale the I/Q samples by scaling
the output voltage of the DAC.   A relative factor/divisor/ration in
the voltage domain cannot be used 1:1 in the power domain.

There exist two similar formulas:

  a) X_dB = 10 * log10(X_lin / X_ref)
  b) Y_db = 20 * log10(Y_lin / Y_ref)

both of them are correct, and according to [1]:

  a) If you convert a quantity X that relates to power or energy,
     => the factor is 10.
  b) If you convert a quantity Y that relates to amplitude,
     => the factor is 20.

Therefore we should be using 20 instead of 10.  This change makes
osmo-trx apply per-lchan attenuation values correctly.  Otherwise
it would double the values indicated in TRXD messages.

[1] https://dspillustrations.com/pages/posts/misc/decibel-conversion-factor-10-or-factor-20.html

Change-Id: I98bc00bd25df4913d45e55eb008d715aca76fc7c
Related: SYS#4918
2021-01-27 01:01:50 +01:00
Vadim Yanitskiy 819cad1776 Transceiver: fix integer division in addRadioVector()
By default, C/C++ compiler does assume integer division.  The
lack of explicit cast to 'double' causes the transceiver to
ignore non-decimal attenuation values (x % 10 > 0):

  txFullScale * 10 ^ ( -3 / 10)
	== txFullScale * 10 ^ 0
	== txFullScale * 1.0

  txFullScale * 10 ^ ( -8 / 10)
	== txFullScale * 10 ^ 0
	== txFullScale * 1.0

  txFullScale * 10 ^ (-10 / 10)
	== txFullScale * 10 ^ -1
	== txFullScale * 0.1

  txFullScale * 10 ^ (-18 / 10)
	== txFullScale * 10 ^ -1
	== txFullScale * 0.1

Change-Id: I85b1063f57f630d90c6da32827bec4a05afc6514
Related: SYS#4918
2021-01-21 00:24:16 +01:00
Pau Espin 54a98b5b52 ChannelizerBase: Fix memory leak
The memory leak was reported by ASan:

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x7f23b488e459 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x558e83e39e3c in ChannelizerBase::initFilters() /osmo-trx/Transceiver52M/ChannelizerBase.cpp:84
    #2 0x558e83e3a8a0 in ChannelizerBase::init() /osmo-trx/Transceiver52M/ChannelizerBase.cpp:188
    #3 0x558e83e2d263 in RadioInterfaceMulti::init(int) /osmo-trx/Transceiver52M/radioInterfaceMulti.cpp:197
    #4 0x558e83de76d2 in makeRadioInterface(trx_ctx*, RadioDevice*, int) /osmo-trx/Transceiver52M/osmo-trx.cpp:115
    #5 0x558e83dea663 in trx_start /osmo-trx/Transceiver52M/osmo-trx.cpp:600
    #6 0x558e83dead6f in main /osmo-trx/Transceiver52M/osmo-trx.cpp:695
    #7 0x7f23b2576151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)

Change-Id: Ibc4c7edeb9bba517db08fce152d863e6cc0c7bbb
2021-01-18 11:39:24 +00:00
Pau Espin fca503d0b4 radioInterfaceMulti: Fix memory leak upon close()
The leak was reported by ASan.

Direct leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7fd9c9c29f41 in operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cpp:99
    #1 0x55bd63ae2364 in RadioInterfaceMulti::init(int) /git/osmo-trx/Transceiver52M/radioInterfaceMulti.cpp:209
    #2 0x55bd63a9c6d2 in makeRadioInterface(trx_ctx*, RadioDevice*, int) /git/osmo-trx/Transceiver52M/osmo-trx.cpp:115
    #3 0x55bd63a9f663 in trx_start /git/osmo-trx/Transceiver52M/osmo-trx.cpp:600
    #4 0x55bd63a9fd6f in main /git/osmo-trx/Transceiver52M/osmo-trx.cpp:695
    #5 0x7fd9c7910151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)

Change-Id: Ia4f9d4e47caa86ada98054763573e652d281992c
2021-01-17 17:18:49 +00:00
Oliver Smith e8edd1fcae contrib/jenkins: don't build osmo-gsm-manuals
Related: OS#4912
Change-Id: Ibacb11da37acfd324cee37068099627136717781
2021-01-13 13:16:48 +01:00
Alexander Couzens 7e27deb8cb osmo-trx.spec: move ipc-driver-test into package ipc-test
Allow to drop the uhd runtime dependency of osmo-trx-ipc.
uhd is only required for the driver-test utility.

Related: SYS#5266
Change-Id: Iff91e09684167247c9c7de0141451a5b9344aa0d
2021-01-08 09:32:03 +01:00
Harald Welte a9512d963a manual: Fix typo OsmTRX -> OsmoTRX
Change-Id: I4b3a76e41d4abbb08046a241ae9b7c079ce990ae
2021-01-07 14:07:14 +01:00
Harald Welte c6220741b1 README update
* use https for hyperlinks
* explicitly mention the primary use case with OsmoBTS
* fix spelling in title

Change-Id: I4f20ad8666dcc6bbc23d78b40b7c73ddd7e6eacc
2021-01-06 13:27:56 +01:00
Pau Espin Pedrol 4a4e607a19 ipc-driver-test: Allow setting dir prefix for UD socket
Change-Id: I35282b38a1d560fb3440fe0aa9a27808d9d116cc
2020-12-10 15:26:32 +00:00
Vadim Yanitskiy 1587307a99 vty: fix swapped documentation for 'filler type' command
vty_cmd_string_from_valstr() expands the given 'struct value_string'
sequentionally, so the order of entries in both filler_{types,docs}
shall match (regardless of the value assigned).

Change-Id: Ieb3bbc4fb30f303c47555ca77d03a9e965bc72b5
2020-12-08 15:38:00 +01:00
Pau Espin Pedrol 7e83f18bba ipc: Fix wrong reference to BTS in log line
Change-Id: Idd272959e335c46ca88e348dd792e15ddb317d61
2020-12-07 19:28:44 +01:00
Pau Espin 57db77f185 main: generate coredump and exit upon SIGABRT received
Previous code relied on abort() switching sigaction to SIG_FDL +
retriggering SIGABRT in case the signal handler returns, which would
then generate the coredump + terminate the process.
However, if a SIGABRT is received from somewhere else (kill -SIGABRT),
then the process would print the talloc report and continue running,
which is not desired.

Change-Id: I3a3ff56cb2d740a33731ecfdf76aa32606872883
Fixes: OS#4865
2020-11-25 17:50:21 +01:00
Harald Welte 94def47fdf Use osmo_fd_*_{disable,enable}
Change-Id: Ic8c8c418e123fbdff625556a900b19650deefe0b
Depends: libosmocore.git Idb89ba7bc7c129a6304a76900d17f47daf54d17d
2020-11-11 20:15:59 +00:00
Vadim Yanitskiy 3fb4d31ecb doc/manuals: generate XML VTY reference at build-time
Unfortunately, we cannot re-use the existing Makefile rules from:

  $(OSMO_GSM_MANUALS_DIR)/build/Makefile.vty-reference.inc

because they do not allow to generate the list of $(DOCBOOKS) from
a template, and require the project to store everything in separate
folders with specific names.  Also, those rules expect that the
target PDFs contain only a single word in their names (for example,
'osmoapp-vty-reference', not 'osmo-app-vty-reference'), while in a
project with multiple similarly named targets this would reduce
readability (imagine 'osmotrxuhd-vty-reference').

Change-Id: I798ea3b7417b8ca3e9c7d50911158c5413526237
Depends: I6aac73d998c5937894233631e654a160d5623198
Related: SYS#4937, SYS#4910
2020-11-04 19:33:05 +00:00
Vadim Yanitskiy 744e44eaa1 main: use logging API to print SIMD info instead of printf()
Otherwise these logging lines end up in the automatically generated
XML VTY reference (stdout), so this breaks further XML processing.

Change-Id: I8e0fd728d406e2452c9c0ddad5bce5f6b17fab42
Related: SYS#4937, SYS#4910
2020-11-04 19:33:05 +00:00
Vadim Yanitskiy faacb1987e vty: fix documentation for 'ext-rach (disable|enable)'
Do not use 'extended' because it's not the same 11-bit Access Burst,
as it was assumed before.  Add missing docs for 'enable'/'disable'.

Change-Id: I80b5a584e554eb7cc2416017b10fee032202b372
2020-11-04 19:29:45 +00:00
Vadim Yanitskiy c0e7ce922a vty: auto-generate cmd and doc strings for cfg_filler_type_cmd
Change-Id: I7fb228c63f3246f443ece67106abba0432b1659e
2020-11-02 09:28:19 +00:00
Vadim Yanitskiy ab6e7f35ab vty: remove groundless statement about filler type 'dummy'
Dummy bursts have nothing to do with A5/x encryption, and I see
no reason why (and how?!?) would using that filler type break
encryption in osmo-bts-trx.  I asked the author of this code
back in August 2020 [1], and so far didn't get any response.

[1] https://lists.osmocom.org/pipermail/openbsc/2020-August/013208.html

Change-Id: Iae513d7acbb8ef682e1744ac8726cbd6ece8bd87
2020-11-02 09:27:59 +00:00
Vadim Yanitskiy 5d6504c45a vty: fix documentation for 'multi-arfcn (disable|enable)'
Change-Id: Id653ee058b208ddc105947319adad8da667be11f
2020-11-02 09:27:14 +00:00
Vadim Yanitskiy c620ced36d vty: cosmetic: use VTY_IPV4_CMD in 'bind-ip' / 'remote-ip'
Change-Id: I8e44f771cbd03629c066bc24c3186997761f93f1
2020-11-02 09:27:08 +00:00
Vadim Yanitskiy ef79fd9b95 vty: fix documentation for 'rx-sps (1|4)' and 'tx-sps (1|4)'
Change-Id: I70d9b16fd2b1c2cbaafc978724369cd2c9679cbd
2020-11-02 09:27:02 +00:00
Vadim Yanitskiy e0bdb6b47b vty: fix documentation for 'egprs (disable|enable)'
Change-Id: I7a28bede8fd7d68b3afe9deec381fc93e46d65a9
2020-10-30 04:17:39 +07:00
Vadim Yanitskiy 948b4e4096 vty: fix documentation for 'swap-channels (disable|enable)'
Change-Id: Idca1a2beab07ef4df9ae5c55658cab80f7cc7565
2020-10-30 04:17:39 +07:00
Vadim Yanitskiy c7a750d428 Transceiver: explicitly init m{Rx,Tx}LowerLoopThread
Coverity warns us that a non-static class members:

  - mRxLowerLoopThread, and
  - mTxLowerLoopThread,

are not initialized in this constructor nor in any functions that
it calls.  I don't think it's critical, because we do initialize
them in Transceiver::start(), but let's make them nullptr.

Change-Id: If9e06aa7965f17383ab6599c15945e8ce2703bbf
Fixes: CID#214952
2020-10-25 15:24:21 +07:00
Vadim Yanitskiy 0ff9c9fca3 Transceiver: use size_t and ARRAY_SIZE() in constructor
Change-Id: I164d66aad04d77957300b07e83b085f43a3ee8c1
2020-10-24 23:41:57 +00:00
Vadim Yanitskiy 24cb0c9948 device: drop unreasonable LIBOSMO{CTRL,VTY}_{CFLAGS,LIBS}
Neither VTY nor CTRL API is used in device specific code, excluding
the 'uhd' where osmo_cpu_sched_vty_apply_localthread() is called.

Change-Id: I568b443da4b96c005734d749faa22b9c7440f951
2020-10-24 23:41:57 +00:00
Vadim Yanitskiy 6be2d15541 main: add --vty-ref-mode, use vty_dump_xml_ref_mode()
Change-Id: Ie54c45fdcc8660f37f8db2367b53404b189b3ffc
Depends: Ie2022a7f9e167e5ceacf15350c037dd43768ff40
Related: SYS#4910
2020-10-24 21:16:17 +00:00
Vadim Yanitskiy bc5263cee1 device/common/Makefile.am: remove $(LMS_CFLAGS) from AM_CXXFLAGS
This is device-independent code, so it should not be here.

Change-Id: I1ffc3431a9a1a46c74c354b3f8a256684bfcbe73
2020-10-24 19:44:21 +00:00
Vadim Yanitskiy 6b4acc12f7 device/lms: get rid of 'using namespace std'
Change-Id: I4329801c502db73efa946f15c103b2c081cee5a7
2020-10-24 19:25:32 +07:00
Vadim Yanitskiy d1ca287d83 device/lms: fix missing semicolon in LMSDevice::assign_band_desc()
Change-Id: I6aedb72306461ebb944fc13a795b0bf3121ea275
2020-10-24 19:25:32 +07:00
Vadim Yanitskiy a0d862ba1d device/lms: fix: 'trx_vty.h' header requires C linkage
Otherwise, the linker fails to produce osmo-trx-lms binary:

  LMSDevice.cpp:493: undefined reference to
    `get_value_string(value_string const*, unsigned int)'

  LMSDevice.cpp:237: undefined reference to
    `osmo_panic(char const*, ...)'

Change-Id: I2fef166c13136af7b7aaa744d39427d76ad11769
Fixes: OS#4828
2020-10-24 19:25:32 +07:00
Harald Welte c5989fe180 Use osmo_fd_setup() wherever applicable
Change-Id: Ie093dea96ec8990368695c0c5824e0fe44fb8540
2020-10-19 12:27:36 +02:00
Harald Welte 08970c562f ipc: Use OSMO_FD_* instead of deprecated BSC_FD_*
Change-Id: I98b3f9525954d6882f7488d650038a8e28f7b769
2020-10-18 22:41:40 +02:00
Pau Espin e91544d740 Calculate RSSI offset based on RxGain configuration
Prior to this patch, osmo-trx relied totally on proper VTY configuration
being set in "rssi-offset" together with the RxGain set through TRXC in
order to provide correct Uplink RSSI measurements to bts-trx.

With this patch, RSSI is now by default calculated (in LMS and UHD
backends) based on the currently set RxGain, by providing empirically
discovered values. Still, for backward compatibility, the old
"rssi-offset" command will overwrite completely the per-default
calculated rssi offset.
A new optional parameter "relative" is added at the end of the
"rssi-offset" VTY command to flag the value as relative to the newly
per-default calculated value. This way specific setups (like adding a
LNA / RF fronted) can still be expressed while still keeping the
automatic per-default offset.

Related: OS#4468
Change-Id: I8ef78fd20c22c60d61bfb18d80a4a36df4fd6c20
2020-10-14 12:53:04 +02:00
Pau Espin 93fee1f163 Transceiver: Pass config struct instead of large list of params
Change-Id: Ifb43cb11f3e7a69b0a88f632f0a0c90ada7f939e
2020-10-14 12:52:04 +02:00
Pau Espin e69a56cec5 contrib/jenkins: Enable parallel make in make distcheck
Change-Id: I32925b35126bcd4ef7b5e1315dde28869c2b4b86
Related: OS#4421
2020-10-12 19:48:47 +02:00
Philipp Maier 76795401fb osmo-trx: add commandline option --vty-ref-xml
The commandline option --vty-ref-xml is needed to enable automatic
generation of the VTY reference manual.

Change-Id: I34dd36183e013ab005f39b235c4ab561590befb7
Related: SYS#4937, OS#1601
2020-10-09 20:48:00 +02:00
Philipp Maier 30863e8720 vty: add attributes to VTY commands indicating when they apply
Change-Id: I6dfdedc081eb8c3d53913f6fa38591920c8b3b43
Related: SYS#4937, OS#1601
2020-10-08 19:36:35 +02:00
Pau Espin 0fbdfefebc arch: x86: Fix convolve optimizations breaking signal
This patch fixes MS failing to even see the network, and only RACHs of 1
zeroed byte being seen in GSMTAP.

The issue seems to only appear on some specific machines; others have
been running fine for weeks without this memset being an issue.

Fixes: 7a52e42ee0
Change-Id: I98ad885a5d71e7775973a4d881c0f1cd665ea711
2020-09-18 20:19:56 +02:00
Vadim Yanitskiy b7c6f1e83f radioDevice: fix set_antennas(): consider MULTI_ARFCN mode
In the multi-ARFCN mode, if the Tx/Rx antenna names are explicitly
set in 'chan N' sections of the configuration file:

  trx
   ...
   multi-arfcn disable
   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

osmo-trx would crash, because radioDevice::set_antennas() would
attempt to configure antenna names for all N physical channels,
while USRP devices usually have 2 or even 1 available.

The easiest approach is to remove both 'tx-path'/'rx-path' from
all 'chan N' sections excluding 'chan 0', so it would work fine.
This makes sense, because in the multi-ARFCN mode we actually
use only one physical channel.

However, let's still make sure that explicit configuration of the
Tx/Rx antenna names would not crash osmo-trx and skip N > 0 in
radioDevice::set_antennas().

Change-Id: I09f316f181cbbc2214e8913b73f7c1fcea4e8c05
Related: OS#4636
2020-09-12 14:47:21 +07:00
Vadim Yanitskiy 4d43684194 vty: add multi-ARFCN specific warning for chan N > 0
Change-Id: I12d7c466a9a428a384233c4377627e262f165401
Related: OS#4636
2020-09-12 14:39:20 +07:00
Vadim Yanitskiy 54bde5a8ba proto_trxd: cosmetic: 'if' is not a function, add space
Change-Id: I99cf10662232b1f6845d4019dd3b9be45a82d85b
2020-09-11 21:03:08 +07:00