Commit Graph

75 Commits

Author SHA1 Message Date
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
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 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
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
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 a7143d3cd0 Bump version: 1.3.1.28-019d-dirty → 1.4.0
Change-Id: Ie675909593b0c383b59b7b4a4edd46cd93283622
2021-11-16 16:27:26 +01:00
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
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
Oliver Smith 0f4d5791df configure.ac: set -std=gnu11
Change-Id: Ie95876d1d2ebf31ff588999d85584f6981522fa8
2021-01-28 10:48:35 +00:00
Eric Wild 1e17c4fb0a osmo-trx-ipc
This adds a IPC backend that uses shared memory interface
to communicate with (proprietary) devices.

Requires config file option
dev-args ipc_msock=/path/to/socket
to specify the master socket the ipc backend should connect to.

If UHD is avaialble the ipc-driver-test tool can be used to test the
backend with a uhd device, this was so far only tested with a b2xx.

Change-Id: Ice63d3499026293ade8aad675ff7a883bcdd5756
2020-08-25 01:00:03 +02:00
Oliver Smith 7bbe19ee9d contrib: integrate RPM spec
Remove OpenSUSE bug report link, set version to @VERSION@, make it build
with CentOS 8 etc.

Disable lms, usrp1 for CentOS 8.

Related: OS#4550
Change-Id: Ie27fcc4f9033f0049507d9dcc295541ac0744c73
2020-05-19 17:05:30 +02:00
Harald Welte 6879bb0db9 PRBS tool sending PRBS sequence to TRX
Change-Id: I2300f909bbfda10a7053320edfd1deaea763759a
2020-05-02 22:32:34 +02:00
Eric Wild c5d5586fbd configure.ac: fix libtool issue with clang and sanitizer
As pointed out at https://github.com/libexpat/libexpat/issues/312
libtool does not play nice with clang sanitizer builds at all.
For those builds LD shoud be set to clang too (and LDFLAGS needs the
sanitizer flags as well), because the clang compiler driver knows how
linking to the sanitizer libs works, but then at a later stage libtool
fails to actually produce the shared libraries and the build fails. This
is fixed by this patch.

Addtionally LD_LIBRARY_PATH has no effect on conftest runs during
configure time, so the rpath needs to be set to the asan library path to
ensure the configure run does not fail due to a missing asan library,
i.e.:

SANS='-fsanitize=memory -fsanitize-recover=all -shared-libsan'
export CC=clang-10
ASANPATH=$(dirname `$CC -print-file-name=libclang_rt.asan-x86_64.so`)
export LDFLAGS="-Wl,-rpath,$ASANPATH $SANS $LDFLAGS"

Change-Id: If3d9465068b2c654b935fc3d9ab41d799d5e02e8
2020-04-11 18:33:42 +00:00
Pau Espin 7a07de1efd debug.h: Avoid printing pthread_t type
Using %lu for pthread_t was wrong on armv7l arch. Even worse, according
to pthread_self() man page, pthread_t cannot be assumed to be of a simple
type and hence printable:
"""
POSIX.1 allows an implementation wide freedom in choosing the type used
to represent a thread ID; for example, representation using either an
arithmetic  type  or a structure is permitted.
"""

Let's use gettid() instead. According to glibc documentation:
"""
The pid_t data type is a signed integer type which is capable of
representing a process ID. In the GNU C Library, this is an int.
"""
It may not be the same on other libc's though, so let's better cast to a
long int just in case.

Accordign to gettid() man, the libc function was only added recently
during glibc 2.30, however the system call has been around for quite
some time (linux 2.4.11). Let's accomodate use udner non-glibc or older
versions of it by having a direct syscall fallback.

Change-Id: I40265fd4c62e550014ba3ff3335ca053c5bc01f2
2020-02-19 18:08:20 +01:00
Pau Espin da7fee8ea8 Bump version: 1.1.1.38-9f2b-dirty → 1.2.0
Change-Id: I9009eb44e7d8100294da139300480fc3a2f6b616
2020-01-03 19:54:00 +01:00
Martin Hauke 066fd04f47 Fix common misspellings and typos
Change-Id: I4ec7accb1912c052b446be7c399bed32a8c62253
2019-10-17 08:06:19 +00:00
Pau Espin e503c988d8 radioInterface: Atomically fetch and change underrun variable
Otherwise, it could happen that underrun events are lost:
TxLower (isUnderrun):	RxLower (pullBuffer):
read(underrun)
			read(underrun)
			write(underrun, |val) [maybe underrun becomes TRUE]
write(underrun, false)

Similary, it could happen the other direction if atomic was only applied
to isUnderrun:
TxLower (isUnderrun):	RxLower (pullBuffer):
			read(underrun) -> true
read(underrun)-> true
write(underrun, false)
			write(underrun, true|val) where val=false

So in here isUnderrun would return true twice while it should only
return one.

Change-Id: I684e0a5d2a9583a161d5a6593559b3a9e7cd57e3
2019-09-20 19:17:22 +02:00
Pau Espin 72a75f3e43 Require newer version of libosmocore to avoid build failure
Older commit started using osmo_timerd_* APIs which are only available
starting libosmocore 0.12.0, but configure.ac still states 0.11.0 is
accepted, which is incorrect.

Fixes: 4456b6f132
Change-Id: I71743b8a10edb10af51ad8e9289c53e432199b97
2019-08-07 21:11:47 +02:00
Pau Espin c27d9f88df Remove AUTHORS file
License of this file doesn't match the license stated in COPYING and in
most source code files (GPLv3 vs AGPLv3). Furthermore, we don't really
maintain this file, so let's drop it to avoid non-up-to-date content
which may introduce confusion.

Related: OS#3515
Change-Id: I536a145cb7696af8e9dbd3065ee5e5f493217ac6
2019-06-25 12:40:17 +02:00
Pau Espin b5def414b8 smpl_buf: Move it to device/common and create libdevice_common.la
Since in next commit osmo-trx-lms starts using smpl_buf.cpp, it seems
some automake step doesn't like including a cpp file twice from a
different directory, since race conditions can occur building it.
Instead we define the dependency by first building a static lib and then
using it on each libdevice.la (one per device type).

We already do the similar under arch/ subdir, where we have a common/
subdir and then one subdir and lib per architecture.

Change-Id: I465ad0f6d5569bb3006d711c8fd0df14391fcf35
2019-05-06 11:23:18 +02:00
Joachim Steiger 2875290d95 lms: add device type detection and device specific gains
add device dependant max gain setup - limesdr mini and limenet micro need slightly reduced maximum gains to get a PASS on phase error measurements
rework clock reference setup - external clock needs to be selected before calling LMS_Init(), internal can only be set after.
remove now unused compat_LMS_VCTCXO* functions - we do not set the VCTXCO directly anymore

Change-Id: I3cf905b0a84bc1ec200891762a6646141ee37181
2019-04-17 18:24:11 +00:00
Pau Espin affd351787 configure.ac: check boost only if USRP1 support is enabled
boost is only used in USRPDevice class.

It looks like it can be removed entirely quite easily, since only
boost::shared_ptr is used for 2 variables. That's left for somebody with
the device and willingness to test the changes.

Change-Id: I4c3fa3ff58fd552d0cb4c4cf2033615d84c07c96
2018-12-14 20:05:36 +00:00
Pau Espin 03b11620d9 lms: Fix build against LimeSuite > 18.10
LimeSuite dc124e4e2ed9b549b142410af172f0592f9f0c23 > 18.10 broke API
compatibility.

OS#3729
Change-Id: Idf500a5b39a857233f728c6a4316c00a99374556
2018-12-14 13:30:07 +01:00
Oliver Smith be8a83f681 build manuals moved here from osmo-gsm-manuals.git
Moved to doc/manuals/, with full commit history, in preceding merge commit.
Now incorporate in the build system.

Build with:

$ autoreconf -fi
$ ./configure --enable-manuals
$ make

Shared files from osmo-gsm-manuals.git are found automatically if
- the repository is checked out in ../osmo-gsm-manuals; or
- if it osmo-gsm-manuals was installed with "make install"; or
- OSMO_GSM_MANUALS_DIR is set.

Related: OS#3385
Change-Id: I2762171af0bf719a34ba12a0c2e4dcc206098beb
2018-11-27 18:36:41 +01:00
Pau Espin 5ac2cb3662 Install systemd services with autotools
Change-Id: Ia1a4fb62dee35737ece1f3501f352501eba2449e
2018-09-12 14:17:26 +02:00
Pau Espin b148d05542 configure.ac: Specify default language as C++
This is useful if we add more AC_CHECK_HEADER or similar configure tests including
C++ header files or required C++ features, since otherwise gcc is used
by default and test fail.

Change-Id: Iee757c78b72290c5d2a4c31339800a4e72b6be23
2018-09-04 18:00:57 +00:00
Pau Espin 288d8af070 configure.ac: Add --enable-werror option
Change-Id: Ib2782aecd400398bf36427f255c2a427ef781e06
2018-08-30 17:30:15 +02:00
Pau Espin 70d0344b31 configure.ac: Fix typo in with-lms help string
Change-Id: I7777d027fffa50dddf3f0a3c0bf2173aa8497be3
2018-08-17 17:17:05 +02:00
Pau Espin c7756e73b7 debian: Add cfg file examples for osmo-trx-{lms,uhd}
Sort cfg files according to their osmo-trx binary.
Install them during make install.
Add the installed cfg files to related debian packages.

Change-Id: I905cdac30b441e4df0a3f5c0924d1637b9f67b90
2018-06-19 11:31:45 +02:00
Pau Espin 1f50fedb5f build: Add support for LimeSuite device backend
Change-Id: I239e1b37263a62b374d84974c9347e3654072e87
2018-06-13 21:45:32 +00:00
Pau Espin d0ac926b56 Bump version: 0.3.0-dirty → 0.4.0
Change-Id: Ifc469bce89d52012e1f876c847b4535360a602ad
2018-05-03 16:23:30 +02:00
Pau Espin f3d7f443a0 Build one osmo-trx binary for each device support enabled
Same way as we do in osmo-bts. After this commit, osmo-trx no longer
exists. Instead, osmo-trx-uhd and osmo-trx-usrp1 are generated based on
configure flags enabled.

A new flag --with(out)-uhd has been added to enable/disable build of
osmo-trx with UHD backend. It is left enabled by default to keep
compatibility with older build scripts. Binary with USRP1 backend must
still be manually enabled with --with-usrp1 flag.

Change-Id: Iea8c0d7434762713a53440d29bf3ebd84accb262
2018-04-24 19:17:22 +02:00
Pau Espin a4316ee4c5 Change configure define USRP1 to DEVICE_USRP1
Similar as we do for ARCH_*, it's easier to find those are related to
device support features.

Change-Id: Iba238bff689b8f944af76120402c0fa2e29a70de
2018-04-24 18:46:48 +02:00
Pau Espin 2128a308eb Move device specific files to device subdir
Change-Id: Ib42fef14bf4c7b779f44d99711a35c18b32a4c21
2018-04-24 18:46:48 +02:00
Pau Espin 43fedb656b Move arch specific fiels to arch subdir
Take the chance to update some includes using files available in that
subdir to have them ina more uniform way.

Change-Id: Ibda3c54fd4dc3f6b845cc373f1a1e6b758c1ea82
2018-04-24 15:22:59 +02:00
Pau Espin 53bdb7f82a configure.ac: Add --enable-sanitize option
Change-Id: I1b5154a47bb2f66103ac254a0f422e8a80b2d3e0
2018-04-16 15:17:48 +00:00
Martin Hauke 20259cb307 configure.ac: Fix typo
Unbreak git-version-gen when used with .tarball-version

Change-Id: Id836c6822daf1f6835a8c869624b4b40dde47f3a
2018-04-08 19:53:37 +02:00
Pau Espin 8fbbd656c7 Build Transceiver52M/common as an .la lib
Stop picking files from that directory on different places as it causes
dependency issues during make distclean/maintainer-clean.

Fixes: OS#3029

Change-Id: I81bb4251d18fce978d27849b621b20f541caab0b
2018-03-08 14:53:13 +01:00
Pau Espin 5ea1817dc2 Add initial support for logging, vty, ctrl
Up to this point, the logging system, vty and ctrl are initialized and
can be used fine, though they don't have a lot of use yet.

Depends on libosmocore Change-Id Ib79cdb62d45d8c78445c7b064e58eb7e9faeccf9

Related: OS#2184

Change-Id: I08982c37b4f873966304b3cfb38a10ee86eb3dad
2018-02-27 07:10:50 +00:00
Pau Espin 8b843e5bed Depend on libosmocore
Change-Id: If345c89293fcd7d1ad4f17214eea339951f25a5d
2018-02-22 20:04:47 +01:00
Pau Espin c92dad32dd configure.ac: Check for pkg-config
Change-Id: I1a851181a99f2f35ea4ff1b38c7afe27a04e5f18
2018-02-20 20:32:27 +01:00
Alexander Huemer 6fafd33b13 Unbreak `./configure --with-usrp1` build
Change-Id: I49b385594271ae64a48d4d39ee9fe26d7c95bd30
2018-01-20 23:24:20 +01:00
Pau Espin c2ba427b52 tests: Migrate convtest util to autotest infrastructure
Change-Id: Ie682abf7e83de436d0f37f9f6e0664cb2f4d0c9e
2018-01-11 18:45:12 +01:00
Pau Espin 2ac788b2c3 Set up GNU Autotest infrastructure
Test files are moved from CommonLibs/ to tests/CommonLibs/.
Some tests are disabled in autotest because they generate timedate
related output which cannot exactly match against expected output.

Change-Id: I3d6ba625968be09297642d18090c496490e9b8fc
2018-01-10 11:17:32 +01:00
Pau Espin caf2abc58f Remove Configuration module and libsqlite dependency
Change-Id: I823aea91367d586507bbf352f1b6f25bdd635baa
2018-01-09 15:26:50 +01:00
Pau Espin 82f83ced73 cosmetic: Remove trailing whitespace
Change-Id: I64c8dbad3fc42bcb8dd4ac9b16bbd9c59a0cf5d5
2018-01-09 15:26:49 +01:00