Commit Graph

844 Commits

Author SHA1 Message Date
Oliver Smith 7cc7e3de99 contrib/osmo-trx.spec.in: add osmo-trx-ipc
Change-Id: Ib57980e8e102d6f77d0bffa47faafd929c82a288
2020-05-27 14:10:04 +02:00
Oliver Smith 0f00e676f2 contrib/systemd/osmo-trx-ipc.service: new file
Change-Id: Ic2ba7616c6909bd0a7e642554ecffa4939935b01
2020-05-27 14:00:05 +02:00
Oliver Smith 8b9ec56e5d IPCDevice.h: remove limesuite include
Change-Id: I3808dcc69dd3ccc8372852c622660b7056c1be8a
2020-05-27 14:00:05 +02:00
Oliver Smith 106347dc31 configure.ac: add --with-ipc
Change-Id: Ie7b1b07479b81366cebaa081d80917ae868992b4
2020-05-27 14:00:05 +02:00
Oliver Smith 14ee5eacb5 gitignore: add new binaries
Change-Id: I9fd0b6cdb0b9d66b37e813cc8d35a28b9c9dc539
2020-05-27 14:00:05 +02:00
Eric Wild 803a90028c ipc: add master socket number/path parameters
osmo-trx-ipc needs to know which master socket it should talk to, so
pass this path in the config device args like this:
dev-args ipc_msock=/path/to/socket

Additionally, add a master socket suffix number parameter to the ipc
backend,
ipc-driver-test -n 0 to start serving /tmp/ipc_sock0

Change-Id: I24857fbb74e5fc808b2a218957c723291de2ba04
2020-05-27 14:00:05 +02:00
Eric Wild bd8ca9f95e shm: fix alignment
Change-Id: I8b593d792a992973e76dd19f7b678c9caa9c5e16
2020-05-27 14:00:05 +02:00
Eric Wild aec2c35861 ipc: gain setting
Change-Id: I674d51fdcab2691853681f661b441364ed75207a
2020-05-27 14:00:05 +02:00
Eric Wild c53a7fb4f4 ipc: make ipc server uhd output more verbose
Change-Id: I9f2c15adff96e71a806ef09f17152c11d7c043aa
2020-05-27 14:00:05 +02:00
Eric Wild 420e5f6112 ipc: print received path delay value
Change-Id: Ib072b01451084e055882d2867b558a5f8ede95ea
2020-05-27 14:00:05 +02:00
Eric Wild 453c32c091 ipc: adjust over/underflow reporting
Change-Id: Iec2ca94ed8b6cf96d8797540cff43af6542e6437
2020-05-27 14:00:05 +02:00
Eric Wild c3299d945a ipc: remove intermediate class used for debugging
Change-Id: I2e8a93389cf2f6fc0b9a591f800c019427cf37e6
2020-05-27 14:00:05 +02:00
Eric Wild ac037980d7 ipc: update the licenses
Change-Id: If523884e76166c11e88944bb7633ff3b54a3a88b
2020-05-27 14:00:05 +02:00
Eric Wild ebc9e07476 v1
Change-Id: I057e272623b41421f442206f550bcc8c60f4a747
2020-05-27 14:00:05 +02:00
Eric Wild 58425b9653 scaling val
Change-Id: I6ddfd792ea42655e12fae0b195e362c98792b96f
2020-05-27 14:00:05 +02:00
Eric Wild b36c69d102 add kernel style .clang-format with 120 chars per line limit
Change-Id: I1dc6610d7adfa1a52f3d41ad04544806c2be2c39
2020-05-27 14:00:05 +02:00
Eric Wild 4d2e2a9e83 spawn the client as a thread
Change-Id: I86cd659e74ebdbf43c4352e83e5adb78f8fe6de5
2020-05-27 14:00:05 +02:00
Eric Wild 3eede6b455 silence warnings
Change-Id: I01b2dce8e04cdc21872e5bbc3eec7e0a5e3d1b0b
2020-05-27 14:00:05 +02:00
Eric Wild 3b35c447e1 no undefined behavior by adding/substracting values != 0 from null ptr
Change-Id: Id2dc21e884991b3cca9f617aece12ac35959c1b2
2020-05-27 14:00:05 +02:00
Eric Wild 162ea392c3 shm: fix warnings
Change-Id: I0e56539f699c39ab6e3546c96973184552da4d5f
2020-05-27 14:00:05 +02:00
Eric Wild 036b85e85a ipc: fix shm size calculation
Total size was previously only as large as sizeof(struct
ipc_shm_raw_stream) + sizeof(uint32_t)*num_buffers....

Change-Id: I1205b56a4b11bdf32fbdbfb82b67da36965a7981
2020-05-27 14:00:05 +02:00
Pau Espin 9eff30845b WIP: comments
Change-Id: Ia2631a869e23af520b9eade192dfdb032174c689
2020-05-27 14:00:05 +02:00
Pau Espin cf66e6a45e WIP: osmo-trx-ipc
Change-Id: Ice63d3499026293ade8aad675ff7a883bcdd5756
2020-05-27 14:00:05 +02:00
Philipp Maier fdefbfac39 Transceiver: Log when sending of CLK indications begins
When the logging category TRXCLK is set to info osmo-trx prints a
logline that informs about the sending of clock indications. In practice
this those log lines are often used to identify that osmo-trx and
osmo-bts are running properly, so it would be helpful, even in
productive use, if there would be an information in the log that the
sending of clock indications has begun. However, the regular printing of
the clock indication log line would soon flood the log. So, lets have an
addional log line that logs only once when the transceiver starts and
quickly informs at loglevel NOTICE that clock indications are now sent.

Change-Id: I6aa88943b76c9a2bf7aed60d6a3d325c1f27820a
Related: OS#2577
2020-05-26 22:49:02 +02:00
Philipp Maier 5e16f79f0f doc: switch log levels to notice
Some of the example configs have loglevels set to info. This is too
verbose, lets make sure all loglevels are set to notice

Change-Id: Ief82b85d9ff0e0e94eaabd255ebea961396fff32
2020-05-23 11:50:47 +00:00
Oliver Smith f3155e33b9 Makefile.am: EXTRA_DIST: debian, contrib/*.spec.in
Change-Id: Ie192c9b516ff98f2b1ab8e7927da55a0c1e9eb56
2020-05-22 13:48:11 +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
Oliver Smith f669bf43e7 contrib: import RPM spec
Copy the RPM spec file from:
https://build.opensuse.org/project/show/home:mnhauke:osmocom:nightly

Related: OS#4550
Change-Id: I694fcd888778ab68d13165f4d0bf65e5d6870fb4
2020-05-19 17:04:19 +02:00
Pau Espin 4a575b02b5 Use OSMO_FD_READ instead of deprecated BSC_FD_READ
New define is available since libosmocore 1.1.0, and we already require
1.3.0, so no need to update dependenices.
Let's change it to avoid people re-using old BSC_FD_READ symbol when
copy-pasting somewhere else.

Change-Id: I868baf575b77c448b3115701e70d439de89b0fb3
2020-05-09 18:54:20 +02:00
Harald Welte cf35c37c94 prbs-tool: Don't require C99
from a Debian8 build:

[  256s] prbs-tool.c: In function 'apply_errors_prbs':
[  256s] prbs-tool.c:190:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
[  256s]   for (int i = 0; i < sizeof(pchan->prbs_u)-4; i++) {
[  256s]   ^

Change-Id: I8541fce50405525efffb12210a269e0ab8a687ab
2020-05-07 23:55:56 +02:00
Harald Welte 6e369348b0 utils: Ensure content of this directory is included in 'make dist'
The python + matlab should be part of every source release

Change-Id: I9814a9a352dbee03177ef9e8dfd19bc2baf0ca07
2020-05-02 22:34:27 +02:00
Harald Welte 546516d79c prbs-tool: Add error simulation capabilities
The tool can now simulate:
* lost bursts on the TRX->BTS interface
* zeroed/overwritten bursts on the TRX->BTS interface
* errors in the TCH codec frames before passing them to the encoder

Change-Id: I0b52c2af6d973669ac233bf9868400e497496460
TODO: Ability to introduce errors in certain classes of the bits only.
2020-05-02 22:32:51 +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 a7143bf7a1 transceiver: get rid of the ctrl threads
There is no need to have n threads handle n ctrl sockets, since they all
will immediately respond to commands, so handle them from the existing
main osmo select loop.

Care must be taken to ensure that calls from within the command handler
do not block, or at least don't block too long, which currently is the
case.

Change-Id: I642a34451e1825eafecf71a902df916ccee7944c
2020-04-14 19:10:51 +00:00
Philipp Maier 4ffdca10d4 doc: apply an rssi-offset of 28 by default.
Set an rssi offset of 28 in the example configs to make sure that the
power control loop gets RSSI values that match at least half way the
reality when the 1800 Mhz band is used. For other bands the value will
be different (See also related osmocom ticket)

Change-Id: I62725fe454f54e2c7cb7550dadb1e6fc94337d78
Related: OS#4468
2020-04-14 17:16:23 +00:00
Eric Wild 1a26b4f085 transceiver: check the right vector
Change-Id: I03800ae094c35c306fa4ca29f84e71d958ffdbdc
2020-04-14 13:17:25 +00: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
Philipp Maier cc971aa1a6 doc: do not set the base-port of the trx
In current config files a base port for osmo-trx is set. Lets remove
this setting so that compiled-in default (which is the same value)
is used.

Change-Id: I105d1c51424836daa6893e83a81c83cc7ac6afd4
2020-04-01 10:21:50 +00:00
Philipp Maier 748d8edbf8 debug: use LOGL_NOTICE for log category DDEV
The log category DDEV ueses LOGL_INFO as debug level. This is too
verbose, lets use LOGL_NOTICE instead

Change-Id: I56d45ce5c3f55574491ffa6e4d902d6ba7499d46
Related: OS#2577
2020-03-25 12:36:15 +01:00
Pau Espin dfc6e5ffc7 radioDevice: Drop unused isControl param from WriteSamples API
The out "isControl" parameter is only used by internal callers of
USRPDevice, and not used at all by any user of the generic API
(radioInterface*.cpp). Hence, we can get rid of it and keep it as a flag
for an internal API of USRPDevice.

Change-Id: I843384e24b76cdd28a95f9ee4e95e6157098e4a3
2020-03-12 19:35:47 +01:00
Pau Espin f8c0c464b8 radioDevice: Drop unused RSSI param from readSamples API
The out "RSSI" parameter is only filled by USRPDevice, and not used at
all by any user of the API (radioInterface*.cpp).

RSSI seems to be computed nowadays in the common path in
Transceiver::pullRadioVector().

Change-Id: I06c2ea5a9891d170bc468f952bbf2a7e64d95784
2020-03-12 19:34:28 +01:00
Pau Espin 93707d0227 cosmetic: fix several typos found by codespell
Change-Id: Id1f6766572fd313463201e6d03964965f227db25
2020-02-25 17:03:00 +01:00
Pau Espin 5291e8a654 debug.h: Fix print format of chan in CLOGCHAN
Under armv7l arch, size_t is actually an unsigned int and not a long
unsigned int, and compiler errors:

CommonLibs/debug.h:28:24: error: format ‘%lu’ expects argument of type
‘long unsigned int’, but argument 8 has type ‘size_t {aka unsigned int}’ [-Werror=format=]

Change-Id: I7f6ded5a984570b5267916d6c84eb7d019db73a8
2020-02-19 18:08:20 +01: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 fd67262df8 contrib/jenkins.sh: Reorder sanity checks
Change-Id: Idfe12148aa7a8030bdaf56d11c1547ebc3f56d14
2020-02-19 11:53:30 +01:00
Pau Espin 0569845a08 lms: Initial multi-arfcn support
With current state multi-arfcn can be used (eg. I can place a call
between 2 phones using TRX1 and sustain for as long as wanted), but from
time to time (around every 20seconds), a burst of Tx packed dropped
events from LimeSuite appears.

LimeNet-micro coefficients have yet not been tested.

Related: OS#4362
Change-Id: I7e67d90a8126546eeeeba376f816ec5d158d4712
2020-01-15 15:46:14 +01:00
Pau Espin c69b87f9bd lms: Make ts_offset and smpl rate coefs device-specific
Right now the values are the same for all devices, but they will differ
in forthcoming commits once multi-arfcn support is added.

Change-Id: I262d3a71848fc3070473e29e42820848e7591d02
2020-01-15 15:46:14 +01:00
Pau Espin a7bf6cd8a4 lms: Store device type specific parameters in one place
Add an enum containing each supported device type (LimeSDR-USB,
LimeSDR-Mini and LimeNet-Micro) plus "unknown", to leave some room for
yet-to-come devices to run with some generic parameters without
rebuilding osmo-trx.

Each device type is assigned a dev_desc structure, and all of them are
put in HashMap, similar to what's already done in UHDDevice.cpp.

Device type is infered from string provided by LMS_GetDeviceInfo(), as
it was already done before in several places. From now on, we only need
to parse the string once since we store the device type after first
during open time.

Later on, more fields will be moved to device-type specific structure,
such as Tx timing offset, clock rate, etc.

Change-Id: I7658615787c5bc41c365bab9c11733b701ac2ae5
2020-01-15 15:45:29 +01:00
Pau Espin e7f6a27ab6 lms: Move rx_buffers allocation to constructor
Release is done in destructor, so let's move allocation to constructor
since there's really no need to have them in open() which is already
quite complex and large.

Change-Id: I8a4fd973590c4c165abd8f2837b2da8fc14a2066
2020-01-15 15:35:01 +01:00
Pau Espin a979f5f32b lms: Make reference to std::vector unambiguous
Change-Id: Ieebdbd3d5082a02aea2441e6737783370511cbc1
2020-01-15 15:34:49 +01:00