Commit Graph

1061 Commits

Author SHA1 Message Date
Eric Wild bcaafcaa9d ms: prune common sch acq code
Change-Id: Ife639a78a4463f992247c19e0177f683db2ae0b7
2023-07-07 19:12:39 +02:00
Eric Wild ea7bd5fb91 ms: remove syncthing tool
Only used for testing during the first stages of development.

Change-Id: Ie97069a109324b6e96c66a4b24d03f9745b6a52e
2023-07-07 19:12:39 +02:00
Eric Wild 135d64b1a9 ms: rearrange internal trxcon<->phy if
Change-Id: I20aef3844f7699e164fe089358aa7e2325608c85
2023-07-07 19:12:39 +02:00
Eric Wild e44cf44af4 ms: pretty tx buf class
Change-Id: I96c5dd79426a52e7fff2df27bdaa3fae0c69491a
2023-07-07 19:12:39 +02:00
Eric Wild c0f0a6105a ms: cache frequency
Don't waste time setting the same frequency again.

Change-Id: Ide9f45130955e1cc66610a50d6fc1cd79f30aca9
2023-07-07 19:12:39 +02:00
Eric Wild da5ffd6e01 ms : rename var
Change-Id: Ia90a9f73fdb1f96fa5bd7f27b3c191ce0ba6c65d
2023-07-07 19:12:39 +02:00
Eric Wild 40978041ad ms : rename var
Change-Id: I44e5d1770b248f107abce5683d5f7641655da764
2023-07-07 19:12:39 +02:00
Eric Wild 3e7f4b0da9 ms: use single thread pool
...so we don't spawn threads all the time.
Used for gain avg/setting.

Change-Id: Id675550f55e8ccbbbe6b0d91fbffd01b6ede15f7
2023-07-07 19:12:39 +02:00
Eric Wild 4080cd05ba ms: block burst q to upper layer
The timekeeper should never wait for lazy readers, because that causes
timekeeping and later usb transfers to fail.

Change-Id: Id0aad606a296b2885617013ce6637204357b13d7
2023-07-07 19:10:55 +02:00
Eric Wild b3157b91bb ms: fix startup & shutdown of blade
One of the mystery bugs was that the blade ms needed two starts
after powercycling the bladerf due to transfer timeouts.
This is now fixed.

Change-Id: I1cd8790191790f4861a70bc55c8f4c9993fa10c8
2023-07-06 18:17:06 +02:00
Eric Wild 805e0d9c6b ms: prettify scheduling + add odroid
Change-Id: Icaf42fd5f76dc2d53dc526558aa8ceaa9c190f7b
2023-07-06 18:17:06 +02:00
Eric Wild 4b2b98b067 ms: fix the gain init for blade
Change-Id: Ic5a25d6f5606fba599b8144fbec7285047dca3c9
2023-07-06 18:17:06 +02:00
Eric Wild 2e6c362b9c ms : fix the template formatting
Those lines predate the .clang-format changes.

Change-Id: I891bdf95004accebbbe54916e4472bd381fac545
2023-07-06 16:06:05 +00:00
Oliver Smith 7e47a521ef systemd: depend on networking-online.target
Related: SYS#6400
Change-Id: Idadcbbf55e976ae035cfac4b85ccd870e0f27b82
2023-05-26 14:10:49 +02:00
Oliver Smith f35515c015 debian: set compat level to 10
Related: OS#5958
Change-Id: Ib3d33f323b0c3004911ec026612934c12c1162aa
2023-04-25 16:48:33 +02:00
Vadim Yanitskiy 874542ca7c CommonLibs: clean up and fix Makefile.am
* Do not hard-code '-O3' and '-g', let the user decide on them.
* Move '-lpthread' to LIBADD, it shall not be in CFLAGS.
* Also add '-Wall' to AM_CFLAGS.

Change-Id: Ia971fc4124b405514792e5309d42936aaebdc8c1
2023-03-14 13:16:09 +00:00
Vadim Yanitskiy f476a6755b CommonLibs: remove unused *trx in cfg[_no]_ctr_error_threshold_cmd
Compilation fails when building with -Wall and -Werror:

trx_vty.c: In function ‘cfg_ctr_error_threshold’:
trx_vty.c:469:18: error: unused variable ‘trx’ [-Werror=unused-variable]
  struct trx_ctx *trx = trx_from_vty(vty);
                  ^~~
trx_vty.c: In function ‘cfg_no_ctr_error_threshold’:
trx_vty.c:501:18: error: unused variable ‘trx’ [-Werror=unused-variable]
  struct trx_ctx *trx = trx_from_vty(vty);
                  ^~~

Change-Id: I3d74c3f38aa03608a32b9dee472e49236543c87f
2023-03-14 13:16:09 +00:00
Vadim Yanitskiy 1ddd727bb4 ipc-driver-test: clean up variables in Makefile.am
* AM_CPPFLAGS is for preprocessor flags like '-I' or '-D',
* AM_CFLAGS/AM_CXXFLAGS is for C/C++ compiler flags like '-Wall',
* AM_LDFLAGS is for linker flags like '-no-undefined', not libraries!
* Link ipc-driver-test against libdevice.la,
* Do not put $(UHD_CFLAGS) everywhere.

Change-Id: Iafd68974c9c613fb4e65a01d076b2c687b716c83
2023-03-14 13:16:09 +00:00
Pau Espin 8a4362459d Call osmo_fd_unregister() before closing and changing bfd->fd
Change-Id: Iffc7d89166be1cf3cd1f8c3effe90f04d5c5a9c1
2023-03-14 12:54:20 +00:00
Vadim Yanitskiy 5ba130c381 tests: LMSDeviceTest: fix CPPFLAGS vs CXXFLAGS
* AM_CPPFLAGS is for preprocessor flags like '-I' or '-D',
* AM_CXXFLAGS is for C++ compiler flags like '-Wall'.

Change-Id: I82fc1eb6796f5289f0feff7bee5264bfacd6e733
2023-03-11 05:33:37 +07:00
Vadim Yanitskiy fed58d97b8 tests: use -no-install libtool flag to avoid ./lt-* scripts
This option should be used for any executables which are used only
for testing, or for generating other files and are consequently never
installed.  By specifying this option, we are telling Libtool that
the executable it links will only ever be executed from where it is
built in the build tree.  Libtool is usually able to considerably
speed up the link process for such executables.

Change-Id: Ieb4ddc5799819c24ed357218c7b0197bcb6b5c91
2023-03-11 05:33:36 +07:00
Vadim Yanitskiy 0e13bfd18c tests: there shall be no libraries in LDFLAGS
Change-Id: I95b07b5a7735fb2753281555a4544f1ba967579e
2023-03-11 05:33:10 +07:00
Vadim Yanitskiy cf1ca2e92e tests: Makefile.am: move -I flags from AM_CFLAGS to AM_CPPFLAGS
* AM_CPPFLAGS is for preprocessor flags like '-I' or '-D',
* AM_CFLAGS is for C (not C++!) compiler flags like '-Wall'.
* AM_CXXFLAGS is for C++ specific compiler flags like '-Wall'.

By having the preprocessor flags in the proper variable we make
sure that they apply to both *.c and *.cpp files.

Change-Id: I7b3504a01e3350834b35c42d8d76d5d88d84a4b9
2023-03-11 05:31:57 +07:00
arehbein 20ecc4f531 Transition to use of 'telnet_init_default'
Related: OS#5809
Change-Id: Icc57c68337d55c6594c1c36e9bf41624d11dab0a
2023-03-09 12:48:32 +00:00
Eric Wild 097a16e384 ms: adjust tx scaling for tx samples
The "safe" scaling factor introduced in
7ac54b10d3 is too low and dates back to
the beginning and the move from usrp1->uhd, but the modulator will
exceed +-1 so "proper" scaling leads to overflows. Let's just do what
osmotrx has been doing for many years...

Change-Id: I75a2eba1f7f7b81249c06ce3fc9dfeee08878cb9
2023-03-02 18:22:37 +01:00
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