aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2020-08-25devices: reset internal smart sample buffers upon stopEric4-2/+22
They are too smart, they keep the timestamps. Change-Id: Idb4b8f03eb5ffdfd6d3fdbc137b20e3ddc4cfa65
2020-08-25osmo-trx-ipcEric Wild30-10/+3765
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-14add kernel style .clang-format with 120 chars per line limitEric1-0/+521
Change-Id: I1dc6610d7adfa1a52f3d41ad04544806c2be2c39
2020-08-13debian/control: change maintainer to the Osmocom team / mailing listVadim Yanitskiy1-1/+1
Change-Id: Ida1a3583749a004e2a6c92cfed0b6806a5b83c78
2020-07-31Use new libosmovty cpu sched config featuresPau Espin Pedrol11-7/+32
Using the new libosmovty features allow for: * Setting different cpu-affinity masks for each thread in the process, both at startup through .cfg file as well as changing it at runtime. * Unified VTY interface to change the scheduling policy of the process inherited by all osmocom processes enabling the feature. Depends: libosmocore.git Change-Id If76a4bd2cc7b3c7adf5d84790a944d78be70e10a Depends: osmo-gsm-masnuals.git Change-Id Icd75769ef630c3fa985fc5e2154d5521689cdd3c Related: SYS#4986 Change-Id: I3798603779b88ea37da03033cf7737a6e4751d6e
2020-07-27Transceiver: Add several rate_ctr for rx error conditionsPau Espin Pedrol4-5/+33
Since there's now a rate counter, we can drop log level for those events which can be bursty and hence print lots of output in short periods of time, which may affect performance. This way setting them to INFO it's enough to avoid getting them in stderr unless explicitly configured by the user (for instance to debug stuff), while still allowing a good enough level to be enabled for other targets such as gsmtap. Related: OS#4679 Change-Id: I000f7112e35ac68d3d922444f78468b1ea74cbba
2020-07-27Transceiver: Check log level before generating burst str representationPau Espin Pedrol1-1/+1
Avoid entering the logRxBurst() function and running a long loop even if not used. Change-Id: I67408bc8643d5d97355f277c4a2007064a83ae90
2020-07-17Transceiver: Lower some log levels which have an associated counterPau Espin Pedrol1-5/+5
They are left as INFO instead of DEBUG since they show possible timing/performance issues in the setup. Change-Id: I8aab10054ac89c29b871259fdbe59636723ddfb6
2020-07-17Introduce CTR log categoryPau Espin Pedrol3-19/+26
This way i most usual rate_ctr related internal logging is disabled by default (notice), and it can b eeasily enabled by switching the category to info or debug. Change-Id: Id6c36432da7e7ce673c585bcae6772a695028ec5
2020-07-17trx_rate_ctr: Lower some log levelsPau Espin Pedrol1-6/+6
Change-Id: I1b5a63e6cc09ac02305c31ea7e94aff53ac0e5c2
2020-07-17Transceiver: Restrict conditions where FN gaps are detectedPau Espin Pedrol1-1/+1
In pushRadioVector, like we did for driveTxPriorityQueue already, gaps are possible in any channel for TRX!=0, since TRX0 is the only one expected to be always transmitting. Since we always need to transmit there, it makes no sense to check for channel being not NONE. Change-Id: I3b4b85b9100f69dfa113c54a4357120bd11ec86f
2020-07-15Transceiver: Use already obtained value from Rx msg structurePau Espin Pedrol1-1/+1
Change-Id: I3854f284e6d6a561b3816b467985f59e690a282b
2020-07-15Transceiver: Provide initial value for TransceiverState::mFiller in constructorPau Espin Pedrol1-1/+1
Fixes: Coverity CID#211258 Change-Id: Ic00cc5939ca46407cb5bf8b6fcbcf3dc677041a2
2020-07-10Add rate counter for missing Txbursts when scheduled towards the radioInterfacePau Espin Pedrol5-6/+20
Related: OS#4487 Change-Id: Ibb2c492b3c67cbab11fbb936ae3a090fb5756aa8
2020-07-10Transceiver: Fix race condition obtaining Dl burst from Upper layerPau Espin Pedrol3-23/+17
The queue was being accessed sequentially obtaining and releasing the mutual exclusion zone twice. First in getStaleBurst() dropping all FN<currTime, then in getCurrentBurst() trying to obtain FN=currTime. However, since in between the mutex is released, it could happen that for instance upper layer would introduce currTime-1 in the queue, which would make then getCurrentBurst() detect that one instead of potential currTime in the queue and return NULL. By holding the mutex during the call to both functions we make sure the state is kept during the whole transaction. Related: OS#4487 (comment #7) Change-Id: If1fd8d7fc5f21ee2894192ef1ac2a3cdda6bbb98
2020-07-10Introduce rate counters to detect issues in received Dl bursts from TRXDPau Espin Pedrol6-10/+80
This ones together with rate counters already available in lower layers allows to understand better the source of the problem with stalled tx bursts. Change-Id: Ia34f7e7d780ad1e12f24638a07f05fe91f2afea5
2020-07-10trx_rate_ctr: Fix locking wrong mutexPau Espin Pedrol1-1/+1
It was notcied due to sometimes causing deadlock at shutdown time. Fixes: 92ba59dacffe79f4c987154bc63c6eacd8c3605f Change-Id: I49bea4b0ae469794b5c80ee8fa4f275914a5194c
2020-07-01doc/manuals: Update thread documentation after dropping CTRL sock threadsPau Espin Pedrol1-10/+5
Per-ARFCN CTRL threads managing CTRL socket loops were dropped a while ago, but it was forgotten to udpate the documentation. Change-Id: I34d117325e60b04b075c205d21bb0b827a5e8c52
2020-07-01TransceiverState: Initialize ctrs field in constructorPau Espin Pedrol1-0/+1
Coverity dixit: "Non-static class member field "ctrs.tx_stale_bursts" is not initialized in this constructor nor in any functions that it calls." Fixes: CID#211258 Change-Id: I4643a0500e9cad09938c05fab2f358167f72ffa9
2020-06-29Introduce rate counter tx_stale_burstsPau Espin Pedrol6-7/+73
This allows checking if there's timing issues on the downlink side between osmo-bts-trx and osmo-trx. This counter is useful to find information about osmo-bts-trx 'fn-advance' setting, since this counter basically counts if burstrs from it arrived too late to osmo-trx. Change-Id: Id6df00da81f6d6884f4dddc5a2c4b354dca3af97
2020-06-29Rename device specific rate counter multi-thread helpersPau Espin Pedrol2-49/+49
RadioInterface ones will be added in next commit, so let's differentiate the structs required for each one. Change-Id: Ib0e142a1dd4bedefdb4c5f15c34132da872c0975
2020-06-29trx_rate_ctr: Fix immediate rescheduling on per-sec thresholdsPau Espin Pedrol1-2/+2
For instance, use in VTY: "ctr-error-threshold tx_underruns 5 per-second" If the condition becomes true (eg 5 underruns happened in one sec), the statement inside OSMO_MAX would become -1, but it was being handled as an unsigned when doing the OSMO_MAX internal comparison. As a result, OSMO_MAX((unsigned)-1, 1) was returning -1 (unsigned) stored in threshold_timer_sched_secs which then became and int -1, which was handled by osmo_timer_schedule as a 0, hence having an immediate trigerring all the time. While at it, make threshold_timer_sched_secs unsigned since it doesn't make sense to have it as signed anyway. Change-Id: I6ea3d64dff189a5bc924e72d846e02d50536a8ea
2020-06-29cosmetic: trx_rate_ctr: Fix whitespacePau Espin Pedrol1-1/+1
Change-Id: I4dc8220a6813d6ff30f1b241cc46b801adec4057
2020-06-29UHDDevice: catch LookupError/IndexError in set{Rx,Tx}Antenna()Vadim Yanitskiy1-2/+16
Currently configuring 3 channels in multi-ARFCN mode makes the process crash during the Rx/Tx antenna configuration due to uncaught UHD specific LookupError/IndexError exceptions: terminate called after throwing an instance of 'uhd::index_error' what(): LookupError: IndexError: multi_usrp: TX channel 2 out of range for configured TX frontends Let's catch them and terminate gracefully. Change-Id: If66305f2787c6292375e4bfbd60c1d3d764cffd4 Related: OS#4636
2020-06-25{UHD,LMS}Dervice: Log expected resulting TxPower when setting device ↵Pau Espin Pedrol2-7/+11
specific TxGain Change-Id: I3c54c61cd6dd7e40bb2831fd4962ff72130b390d
2020-06-25Drop old TxGain APIs from parent radioDevice abstract classPau Espin Pedrol5-50/+20
All radioDevice subclasses except USRPDevice have already been reworked to use the new SetPowerAttenuation() methods, hence we can drop the compatibility layer that was added to transition from the old API to the new one, and move those functions to USRPDevice. This way we simplify the parent abstract class with methods not needed by most devices and not used anymore by external users of those classes. Change-Id: Ice005cd0a07c49b6e212c06f1228ef93c24db727
2020-06-25LMSDevice: Compute TxGain on LimeSuite API based on expected Tx output powerPau Espin Pedrol2-51/+144
Right now, according to a few measurements taken on LimeMicro devices, we expect the Tx Gain at UHD level to relate 1:1 with the slope in Tx output power given a specific band. If more fine-grained results are wanted or some device doesn't follow a 1:1 slope relationship, functions TxGain2TxPower and TxPower2TxGain need to be adapted/improved. This patch is basically doing the same thing as was done previously for UHDDevice in 992c9bd1cea410e2dd42ce7566299104b5648aff. Related: OS#4583 Change-Id: If154fe4d4cd118aa30ea43c22ee7119117b77da6
2020-06-24osmo-trx.spec.in: Use %config(noreplace) to retain current config fileHarald Welte1-2/+2
Change-Id: Ia6a279e4e19eee8368219e3bc1b011802b1fcadc
2020-06-22Transceiver: Allow sending negative nominal tx power in RSP NOMTXPOWERPau Espin Pedrol1-4/+1
Some SDR devices under some bands may provide only under 0 dBm Tx Power. Change-Id: I8cecb7a37eb80db341a624eb7b826180eac4a1d4
2020-06-19proto_trxd: Fix UndefinedBehaviorSanitizer from ubsanPau Espin Pedrol1-1/+1
From UBSan: proto_trxd.c:65:18: runtime error: 128 is outside the range of representable values of type 'char'. Fixes: OS#4507 Change-Id: I71f815fe794a00934ee0e876848af56f30a21bfe
2020-06-17RPM spec file: Require uhd-firmware for osmo-trx-uhdHarald Welte1-0/+1
The automatic dependency will only depend on the UHD library package. The user will then fail to start osmo-trx-uhd due to missing firmware. So let's include an explicit 'Requires' to the uhd-firmware package to solve this. Change-Id: I0ebfe669c21d3957a48d57bd7248244e3e924236
2020-06-15UHDDevice: Compute TxGain on UHD API based on expected Tx output powerPau Espin Pedrol2-44/+55
Right now, according to a few measurements taken on B210, we expect the Tx Gain at UHD level to relate 1:1 with the slope in Tx output power given a specific band. If more fine-grained results are wanted or some device doesn't follow a 1:1 slope relationship, functions TxGain2TxPower and TxPower2TxGain need to be adapted/improved. Change-Id: I6f432465dce5c6ec1f1bc4653f6149efb18c3f43
2020-06-09radioInterface: Operate on real Tx power attenuation rather than on device ↵Pau Espin Pedrol7-61/+59
specific gains All the Tx gain related APIs are left out of reach from radioInterface, and in there we simply interact with radioDevice passing the attenuation received from TRXC. Prior gain logic is moved in base radiodevice class, with the idea that the setTxGain() and related functions will be dropped over time in each sublcass in favour of an specific implementation of the SetPowerAttenuation API. Change-Id: I4f8a1bcbed74aa9310306b97b0b1bfb02f7855e6
2020-06-09UHDDevice: Implement getNominalTxPower() based on TxFrequencyPau Espin Pedrol2-6/+90
The table with nominal UHD Tx Gains and real transmit power is filled with values measured experimentally. More information can be found in OS#4583. Related: OS#4583 Change-Id: If7ef5bf95ffe4afe5864c0f051853aa38b9639eb
2020-06-08Transceiver: Implement TRXC cmd NOMTXPOWERPau Espin Pedrol10-0/+50
It allows the BTS to retrieve the nominal transmit output power value of each TRX in order to compute attenuation later on and apply it through SETPOWER or ADJPOWER TRXC commands. Change-Id: I1d7efe56e008d8d60e23f9a85aa40809f7f84d9c
2020-05-29Transceiver: Fix extra space in RSP NOISELEV errorPau Espin Pedrol1-1/+1
Change-Id: I35c2f3b3b9358ddb64a53f36969621d45bb243f8
2020-05-26Transceiver: Log when sending of CLK indications beginsPhilipp Maier1-0/+2
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-23doc: switch log levels to noticePhilipp Maier4-4/+4
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-22Makefile.am: EXTRA_DIST: debian, contrib/*.spec.inOliver Smith1-1/+4
Change-Id: Ie192c9b516ff98f2b1ab8e7927da55a0c1e9eb56
2020-05-19contrib: integrate RPM specOliver Smith3-9/+32
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-19contrib: import RPM specOliver Smith1-0/+189
Copy the RPM spec file from: https://build.opensuse.org/project/show/home:mnhauke:osmocom:nightly Related: OS#4550 Change-Id: I694fcd888778ab68d13165f4d0bf65e5d6870fb4
2020-05-09Use OSMO_FD_READ instead of deprecated BSC_FD_READPau Espin Pedrol1-1/+1
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-07prbs-tool: Don't require C99Harald Welte1-2/+5
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-02utils: Ensure content of this directory is included in 'make dist'Harald Welte1-0/+2
The python + matlab should be part of every source release Change-Id: I9814a9a352dbee03177ef9e8dfd19bc2baf0ca07
2020-05-02prbs-tool: Add error simulation capabilitiesHarald Welte1-12/+79
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-02PRBS tool sending PRBS sequence to TRXHarald Welte4-1/+327
Change-Id: I2300f909bbfda10a7053320edfd1deaea763759a
2020-04-14transceiver: get rid of the ctrl threadsEric3-75/+124
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-14doc: apply an rssi-offset of 28 by default.Philipp Maier1-0/+3
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-14transceiver: check the right vectorEric1-2/+2
Change-Id: I03800ae094c35c306fa4ca29f84e71d958ffdbdc
2020-04-11configure.ac: fix libtool issue with clang and sanitizerEric1-0/+5
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