Commit Graph

986 Commits

Author SHA1 Message Date
Eric Wild c9af0b0ba0 ms: update submodule to currently known working version
Change-Id: I690f508d1f0cee0b623196dd4574c3ee456f07fa
2023-03-02 18:22:37 +01:00
Eric Wild 621a49eb69 ms: adjust float<->integral type conversion
Given integral type A and non integral type B and depending on rounding
mode, optimization, compiler, and phase of the moon A(A)*B != A(A*B) so
split the two cases.

While at it, also make the template automagically work for complex types
instead of requiring manual casts, the general idea here is to allow
inlining and vectorization by treating all args as plain arrays, which is fine.

This works as expected with -tune=native, x64 implies sse2, and we do not
target any neon-less arm versions either.

Clang only array length hints can improve this even more.

Change-Id: I93f077f967daf2ed382d12cc20a54846b3688634
2023-03-02 18:22:37 +01:00
Eric Wild f538397826 .clang-format: adjust template formatting
Change-Id: I9345693982ce33e6bc811be9e98b9d3da2add7a1
2023-03-02 18:22:37 +01:00
Oliver Smith 8c4336dba9 Run struct_endianness.py
Ensure there is no diff to prepare to run this in CI.

Related: OS#5884
Change-Id: I7d571a042009a3d1befb71fdd490fdef39368066
2023-02-20 10:53:48 +01:00
Vadim Yanitskiy fe1b9cef40 configure.ac: check if LIBTRXCON_DIR (submodule) exists
Fail during the configure stage if the submodule is not fetched.

Change-Id: I06456c2087e160032f5bf8b36304477390f117d0
Related: OS#5599
2023-02-10 22:08:35 +07:00
Pau Espin 5e63151f9f Bump version: 1.4.1.29-10b4-dirty → 1.5.0
Change-Id: I84399209ff49769254771e9273bcfc61d47a0226
2023-02-07 17:08:18 +01:00
Eric Wild 10b4e31655 mstrx: do not wait forever if clock locking fails
Change-Id: Ib85f2452b66fb4d9881fe9676e69e4f6a8ba8f74
2023-01-11 18:57:51 +01:00
Eric Wild 0c433350da radio interface: fix init
5561f1129d introduced some changes,
but while RadioInterface lost its call to close() that was previously
used to improperly reset the buffers upon init() that call was
accidentally not removed for RadioInterfaceMulti and
RadioInterfaceResamp, so those reset previously initialized values to 0
during init(), which break osmo-trx for weird setups.

Change-Id: I74fc1586f8ae0832f4093ba8a44a1c70c78ec3d8
2023-01-09 20:17:46 +01:00
Eric Wild d0c1055051 ms: init trash used to escape the usb callbacks
Closes: OS#5847

Change-Id: I1b41350f981bd9f68163509b94d5457218b415d6
2022-12-28 17:01:13 +00:00
Vadim Yanitskiy 0ce64705e0 configure.ac: make use of AC_MSG_CHECKING and AC_MSG_RESULT
Always log whether the MS TRX is going to be built, event if it's not.

Change-Id: I1c5648b8090ba2b6638b71f2d3332dfae87b2772
Related: OS#5599
2022-12-28 05:21:19 +07:00
Vadim Yanitskiy d0b947a0c4 configure.ac: cosmetic: rearrange MS TRX related logic
Make it consistent with the existing AS_IF/AM_CONDITIONAL locations.

Change-Id: I760b93c1b07989b02c4c38cd20ab40e45650f2c1
Related: OS#5599
2022-12-28 05:21:15 +07:00
Vadim Yanitskiy 4a867be165 configure.ac: allow building without cloning submodules
The MS TRX was intentionally added [1] as an optional feature, which
requires a git submodule to be present in order to build libtrxcon.
This feature can be enabled by passing --with-mstrx to the configure.

But autoconf/automake is a mess.  Despite in the root Makefile.am we
are adding full submodule path to the SUBDIRS *conditionally*, the
configure script would still fail if the submodule is not fetched:

  Makefile.am:32: error: required directory
                         ./osmocom-bb/src/host/trxcon
                         does not exist

It would not even enter that directory if it's present, but somehow
it's still required to exist.  For the end user this means that
cloning the submodule becomes a *necessary* step in order to build
osmo-trx from source, even when the MS TRX is not really needed.

The fact that we're unconditionally requiring the submodule, which
is meant to be used by an optional feature feels wrong to me.  It's
also unusual for osmocom projects to require submodules, so it may
(and already did) cause build failures when cloning as usual.

Let's work this problem around by defining LIBTRXCON_DIR variable
in configure.ac and using it in the root Makefile.am.  If the MS
TRX is not enabled explicitly, make autoconf/automake happy by
assigning LIBTRXCON_DIR the submodule's root directory, which is
always present but empty if the submodule is not fetched.

Change-Id: I02ae2b37c82ae2f55e7d9bd92e226f2b8b023968
Related: [1] b7253c6fdc
Related: OS#5599, OS#5846
2022-12-28 04:38:07 +07:00
Vadim Yanitskiy fdcce1fc6e configure.ac: fix: properly check whether to enable ms-trx
Condition 'test ENABLE_MS_TRX' is always true because 'ENABLE_MS_TRX'
is a string literal, not a variable...  Because of this, automeke will
unconditionally try to configure the submodule.

Change-Id: Icbb9278c688bfe506d5ad726f16a6c200572de1b
Fixes: b7253c6fdc
Related: OS#5599
2022-12-23 22:29:42 +07:00
Eric Wild 2ca77d7ff2 ipc: remove old autotools workaround
Closes: OS#5845
Change-Id: I3f8a0204b1fda52d1228add8afde620274b164a5
2022-12-23 15:37:27 +01:00
Eric Wild b6fd0709f4 clang-format: proper c++ standard
Change-Id: I9828093a08ed8b4c2a11f482f674368ac137d4dc
2022-12-23 13:41:53 +00:00
Eric Wild d3e3bba2cd ipc: add missing override
Change-Id: Ib1493ac10b40d24372075d4cebd67015192675e0
2022-12-23 13:41:36 +00:00
Eric Wild 5561f1129d clean up mutex, scopedlock, and signal classes
This also uncovers very interesting design decisions like the copying of
mutexes and condition vars depending on recursive locks that were
previously hidden by shady c function calls..
We have perfectly good c++11 versions for all of that.

While we're at it, also use the initialization list for the other (still
copy constructable) vectors, which cleans up the radio interfaces.

Change-Id: Idc9e3b1144c5b93f5dad2f8e0e30f1058477aa52
2022-12-23 13:41:30 +00:00
Eric Wild b7253c6fdc ms-trx support
This is basically a trxcon that includes a transceiver, and can just
be used with existing and future apps supporting the trxcon interface,
i.e. mobile or ccch_scan.

Supports bladerf and uhd.
Currently using hardcoded sched/prios aimed at a setup with working,
reliable usb and reserved cores, for example a raspi 4 (ONLY 4, not 3,
not 2, not any other version)

Additionally builds test tools used for development: osmo-trx-syncthing*

see https://osmocom.org/projects/baseband/wiki/MS-side_GPRS for the
project description and details

Change-Id: I36c65a8c725c4da76dc70006cd96b0a2b6878e84
2022-12-23 13:41:13 +00:00
Vadim Yanitskiy 5a23a24bb1 contrib/jenkins.sh: dump submodule status before building
Change-Id: I0f9d8f9213fd59605172fac011306c96c39bd5eb
2022-12-22 21:34:55 +00:00
Eric Wild b60fb8e1e3 properly update osmocom-bb submodule, for real this time..
Change-Id: Icb3ba575cf5235db7e6c03df3d7d45133d535c50
2022-12-22 16:15:42 +00:00
Max 934e1016ff ctrl: take both address and port from vty config
Change-Id: Id7d1425e603cc62a62a63d1057291861f02782ba
2022-12-17 21:26:49 +03:00
Eric Wild ac726b1147 vita demod by piotr krysik, modified
Grabbed from gr-gsm 2de47e28ce1fb9a518337bfc0add36c8e3cff5eb
Had a few rounds of extensive cleanup (not the va itself). Uses gcc
multiversioning for x86 targets.

Change-Id: I5466c522cf4de984a4810ec46df43a10b52ed78f
2022-12-13 11:06:33 +01:00
Eric Wild 508270d83d update osmocom-bb submodule to fix make distcheck
see https://gerrit.osmocom.org/c/osmocom-bb/+/30563

Change-Id: Ie7b10891b69c3dc863c76284f422f9e9509ac244
2022-12-13 11:06:33 +01:00
Eric Wild 7d897cb5b0 bladerf xa4 support
This is not really finished, there are multiple reasons to not use this:
1) main clock is not a gsm multiple, so it will continously drift
2) small buffer sizes lead to tx gaps that are hard to detect and break
everything.

Change-Id: I455c34bb9520d5f09eeb1ac76fceb4bdea94d1ac
2022-12-06 09:45:06 +01:00
Eric Wild 94dcf6d29c add checkpatch config
- do not lint the submodule
- do not lint the grgsm code
- do not lint headers, checkpatch does not understand that this is a c++
project and any change to existing headers will cause issues.
- also do not do arcane C varargs checks that do not apply to C++

Change-Id: Ie7a9fbd021e12a88db30212240af2332c6cdcb37
2022-12-02 14:45:17 +01:00
Eric Wild 040497e0a4 osmocom-bb for ms-trx side trxcon integration
Change-Id: I784a3d66b68f6458056d92db2ec596755b704e61
2022-12-01 12:00:04 +01:00
Eric Wild 8984d7f2ca rename noisevector class -> avgvector
The vectors feature is averaging, and not adding noise.

Change-Id: I05def8ab9ea7a2cece8db09c36c303e13ef40927
2022-11-30 16:40:42 +01:00
Eric Wild aa7a40ee84 ignore vscode dirs
Change-Id: Iad9fd20924b7cfc6dbbfb708aa9c692a3cab574c
2022-11-28 19:19:38 +01:00
Max f2f35fc592 Add realtime scheduling and set priority in service file
This sets highest realtime priority among all Osmocom services.

Related: OS#5687
Change-Id: Id74acf201d4388493f0eeb38909641c662551164
2022-11-11 17:33:25 +03:00
Vadim Yanitskiy 00ddcfaf50 Transceiver::expectedCorrType(): RACH is always 8-bit on PTCCH/U
It does not make sense for the MS to use 11-bit Access Bursts on
PTCCH/U because the payload does not matter, only the ToA does.

Change-Id: I5fb9f1c6810cdcd26a885b183e414d01d422eb28
2022-10-26 04:13:43 +07:00
Max 2f20c564bf Set working directory in systemd service file
By default systemd will execute service with root directory
(or home directory for user instance) which might result in
attempts to create files in unexpected place. Let's set it
to 'osmocom' subdir of state directory
(/var/lib for system instance) instead.

Related: OS#4821
Change-Id: I041bb9e0b4250826d2d15d0ea2cdb93d7a0cd04b
2022-09-09 18:54:42 +07:00
Vadim Yanitskiy 19faae85c6 threshold_timer_update_intv(): call osmo_timer_del() unconditionally
osmo_timer_del() does check if a timer is active internally.

Change-Id: Icaf6f31a3235a3fb6993fa2bb35190150e35c2c2
2022-08-06 05:03:00 +07:00
Oliver Smith 1c6a3459cd contrib/jenkins: don't run "make distcheck" on arm
Avoid building osmo-trx a second time on arm during "make distcheck". If
the build of osmo-trx already passed on arm, running "make distcheck"
should give the exact same result as on x86_64.

This should shorten the build time significantly for osmo-trx jobs
running on raspberry pis, currently they take half an hour.

Change-Id: Ib4fbf7d54d479bbdda3c1415493bfc57b37d3971
2022-07-11 13:57:49 +02:00
Oliver Smith 32311d8635 gitignore: add uhddev_ipc.cpp
This file gets generated during the build.

Change-Id: I70bfb456e309daa4436767b2e55bce0c038a4975
2022-07-08 14:35:49 +02:00
Oliver Smith 71c46e91df configure.ac: add -lboost_thread for uhd < 4.2.0
Fix for the following error we see since building master-osmo-trx on
debian 10 instead of 9:
  /usr/bin/ld: ipc_driver_test-uhdwrap.o: undefined reference to symbol '_ZTIN5boost6detail16thread_data_baseE'
  /usr/bin/ld: //usr/lib/x86_64-linux-gnu/libboost_thread.so.1.67.0: error adding symbols: DSO missing from command line

After spending a lot of time on researching this, my understanding is
now that uhd.pc should have had "-lboost_thread" in versions up to the
latest release 4.2.0 because before that it would include boost thread
headers in its logging code:
04a83b6e76

ld is able to figure out which library provides the missing symbol, and
apparently depending on the binutils version and linker flags, it may
just ignore this and not show an error. This is why apparently it worked
with debian 9 and still does work in OBS (different flags), and why it
was not fixed upstream in uhd.pc. By now fixing it is not needed in the
latest version anymore, and there are already versions of uhd.pc in
various linux distributions without -lboost_thread, so I think it's
appropriate to add the workaround here in configure.ac.

Fixes: OS#5608
Related: https://stackoverflow.com/q/19901934
Change-Id: I0367f1c2981bf56252e7514d5993cbbec960b21b
2022-07-08 14:35:36 +02:00
Pau Espin a39fa875a3 Bump version: 1.4.0.3-9a3e → 1.4.1
Change-Id: I9a930264b7c40b3e205c9818634597cc21364a50
2022-06-29 09:32:57 +02:00
Harald Welte 9a3e3fceb8 update git URLs (git -> https; gitea)
Change-Id: I1ac62853250a6717f502959bd96fdc3e9ead7a91
2022-06-18 13:52:06 +02:00
Vadim Yanitskiy 1a19caf002 tests: use 'check_PROGRAMS' instead of 'noinst_PROGRAMS'
When using 'check_PROGRAMS', autoconf/automake generates smarter
Makefiles, so that the test programs are not being compiled during
the normal 'make all', but only during 'make check'.

Change-Id: I816689e2aeac9decbc44ba210956a929cc7a3169
2022-04-13 19:55:36 +03:00
Oliver Smith 424c74d006 treewide: remove FSF address
Remove the paragraph about writing to the Free Software Foundation's
mailing address. The FSF has changed addresses in the past, and may do
so again. In 2021 this is not useful, let's rather have a bit less
boilerplate at the start of source files.

Change-Id: I8ba71ab9ccde4ba25151ecbeb2a323f706b57d43
2021-12-14 12:23:00 +01:00
Pau Espin a7143d3cd0 Bump version: 1.3.1.28-019d-dirty → 1.4.0
Change-Id: Ie675909593b0c383b59b7b4a4edd46cd93283622
2021-11-16 16:27:26 +01:00
Vadim Yanitskiy 019d698126 LMSDevice: LMS_GetDeviceList() may return a negative number
Change-Id: I855bd8ea6d9cb0f285f4dbbf3bcd09bff4e71044
Fixes: CID#240718
2021-10-25 13:12:51 +03:00
Vadim Yanitskiy a686277c72 IPCDevice: check value returned from select()
Change-Id: I1c823317659547bb2391c57ac4d7931de1a383e3
Fxies: CID#240744
2021-10-25 13:10:18 +03:00
Vadim Yanitskiy 683f140739 IPCDevice: use thread safe strerror_r() instead of strerror()
Change-Id: Ia51ffa51ec7729572faca0282ae41c1e4968049f
2021-10-25 12:56:44 +03:00
Vadim Yanitskiy 5e40d92400 trx_rate_ctr: use thread safe strerror() in device_sig_cb()
Change-Id: Ibd52af22bbe99652f402ada87410de167a124b73
2021-10-25 12:56:44 +03:00
Pau Espin bb2cb9d54b lms,uhd: Allow changing band between poweroff & poweron
Before this patch, reconnecting to osmo-trx and attempting to configure it for
another band is not going to work without restarting the process.
The new variable is added in order to still allow POWEROFF followed by a
POWERON without need to reconfigure the device. In that case, previous
configuration is kept.

Change-Id: I43e5e1e4dcb36be605c6bd25dd6a5f3649e244e7
2021-09-21 17:24:18 +02:00
Pau Espin b9423b25b6 lms,uhd: Skip re-assigning same band
There's no need to spend time looking up again the same band
description.

Change-Id: I6f5631c9e64b9c261d52a856d757d08d2f336947
2021-09-21 17:24:18 +02:00
Pau Espin 069f5cd857 lms,uhd: Validate band of RxFreq too
So far the validation is only done on TxFreq for all TRX. Let's also do
it for RxFreq.

Change-Id: I30eef2727ee96b1344aa1416edd66e2302b88964
2021-09-21 17:24:11 +02:00
Pau Espin c90b207803 lms: Drop duplicated check
Same check is already done by set_band().

Change-Id: I48d14f35e83fa17d1a8f4154479f0a5cee0f816d
2021-09-21 13:48:20 +02:00
Pau Espin 985694175d computeCI: Document hardcoded multiplier
Logarithm change of base rule is used. Document it so it's clear where
it comes from.

Change-Id: Ia588e8dafda4e1abe0721f12491661949339a1ba
2021-09-03 13:52:02 +02:00
Oliver Smith ac8a4e7297 d/patches/build-for-debian8.patch: remove
Remove this workaround, as we are not building for debian 8 anymore.

Related: OS#5223
Depends: osmo-ci Ibe7ba124557969df62798ba49c4489e9606c2341
Change-Id: I5519075a7f95fa61b0b5f1825e4e9324b9eede76
2021-09-03 08:26:59 +00:00