aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/osmo-trx.cpp
AgeCommit message (Collapse)AuthorFilesLines
2019-12-03trx: exit() on unsupported positional arguments on command lineHarald Welte1-0/+5
Change-Id: Ifeea65a359e9ca307efb2c721fd0fb6f0959e976
2019-10-21vty: Simplify filler burst settings and improve help and readability.Alexander Chemeris1-3/+3
In the command line options time, filler table/filer burts settings were a bit difficult to undertand because the number of one-letter settings was limited. Now, with VTY configuration, there is no reason to keep it so difficult. Also, after the previous commit it was no longer posible to enable random 8-PSK filler bursts. With this patch you can configure all supported filler bursts in a simple and logical way. Change-Id: I752eb2c1162d084e8769181f2fcd6c0877663448
2019-10-09Use new libosmocore logging lock APIPau Espin Pedrol1-4/+1
Since libosmocore Id7711893b34263baacac6caf4d489467053131bb, a new API log_enable_multithread() is available which takes care of protecting logging infrastructure from us (and actually does it correctly since we cannot protect internal libosmocore structures from osmo-trx). Let's drop all mutex related code from osmo-trx logging infra and simply rely on libosmocore's. Related: OS#4088 Change-Id: I519d0f30bce871005ca26b90177ea4aa4839360a
2019-09-20radioInterface: Atomically fetch and change underrun variablePau Espin Pedrol1-0/+5
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-08-14osmo-trx: log to stderr on signal receivedPau Espin Pedrol1-2/+2
Since osmo-trx it's a big multithreaded process and shutdown sequence can be complex, better use stderr to log signal received events to make sure log is outputted straigh away and not buffered. In general stdout is usually line-buffered, but buffering strategy can be more conservative if output is for instance redirected to a file. Change-Id: I70ba86919d1f7df41ef3db4916317d27697a025c
2019-07-22Bind CTRL port to IP addr specified in VTY configPau Espin Pedrol1-1/+1
Before this commit, osmo-trx was always setting its CTRL socket to listen on 127.0.0.1. Change-Id: I61a06c1b9c20a906e7030f824a93370d041be7b9
2019-07-22Add SPDX annotationPau Espin Pedrol1-0/+2
Related: OS#3515 Change-Id: I3719bd8dc015569ecd81928fc079e27593cdca09
2019-07-19Logger: global Log mutex is now available from C codePau Espin Pedrol1-0/+4
This way the C++ logging API can still be used while allowing for C files to use the same mutex. Change-Id: I473e57479f8ae98a84ad00b76ff338f79f732236
2019-07-17Fix spelling discovered by lintianRuben Undheim1-1/+1
Change-Id: I5ab9b9c7c47d0d6e674c1f5242e2b3a05006293e
2019-06-17Add option to set stack size in config file, default == 0 == OS defaultEric Wild1-1/+1
Change-Id: Id752f6b5ce9a96a67cd1ff835687ce0e03d3a50d
2019-06-05Rename and move STOP signal from Transceiver to mainPau Espin Pedrol1-3/+3
The callback actually belongs there, since it's the code/thread in main the one actually in charge of stopping everything. It simplifies current code, and more important, allows for new clients of this signal to use it. This callback will also be used in forthcoming commits by code controlling rate_ctr thresholds to stop the process if the VTY configured threshold is used. Change-Id: Id4159e64225c6606fef34a74b24f37c3a071aceb
2019-06-05Add rate_ctr support to store/retrieve SDR errors through VTYPau Espin Pedrol1-0/+3
Introduce a unified implementation-agnostic interface for radioDevice to signal SDR error counters to upper layers and manage them. This patch only implements counters for osmo-trx-lms (other devices will show all counters unchanged during time). Sample use through VTY: """ OsmoTRX> show rate-counters osmo-trx statistics 0: device:rx_underruns: 0 (0/s 0/m 0/h 0/d) Number of Rx underruns device:rx_overruns: 0 (0/s 0/m 0/h 0/d) Number of Rx overruns device:tx_underruns: 0 (0/s 0/m 0/h 0/d) Number of Tx underruns device:rx_drop_events: 4 (0/s 2/m 3/h 0/d) Number of times Rx samples were dropped by HW device:rx_drop_samples: 513 (0/s 196/m 425/h 0/d) Number of Rx samples dropped by HW """ Change-Id: I78b158141697e5714d04db8b9ccc96f31f34f439
2019-04-16use BSC_FD_READ and not OSMO_FD_READHarald Welte1-1/+1
We haven't even released any tagged version of libosmocore yet which includes support for the renamed OSMO_FD_READ constant. Let's avoid any breakage and use the new constants only with considerable delay, at the very least only when released libosmocore versions provide it. Change-Id: Idb57077b2a4b2a71dd5d75a24ded8bb5887da188
2019-04-11multi-ARFCN: fix maximum number of carriers limitationTom Tsou1-1/+1
Maximum number of carriers is fixed to 3 channels on a single physical RF channel in multi-ARFCN mode. For some reason, it was limited to 5. Let's fix this, and also follow this limitation in the following VTY command handlers: - cfg_multi_arfcn_cmd, - cfg_chan_cmd. Change-Id: I66a1462f368458afd313ee6f0bc0abc496dde817
2019-04-02osmo-trx: Check return code of osmo_fd_registerPau Espin Pedrol1-1/+4
Fixes Coverity CID 197513. Change-Id: I93fbcb062439a547379aaecba283d107fdc9cb59
2019-03-29osmo-trx: Use signalfd to serialize signals in main thread ctxPau Espin Pedrol1-5/+46
This should avoid prolematic scenarios where different signal handlers are running on different thread in parallel. Furthermore, we make sure those signals are always run by main loop thread. Change-Id: I9b9d9793be9af11dbe433e0ce09b7ac57a3bdfb5
2019-03-29osmo-trx: Avoid handling signals after shutdown triggeredPau Espin Pedrol1-0/+6
Recently a blocked osmo-trx process was found after ending SIGTERM to it. Apparently one thread was handling SIGTERM and calling fprintf() (grabbing libc lock) while another thread was handling another signal and also grabbing similar lock. Both thread looked deadlocked there. Probably this change doesn't fix the block on its own, but at least simplifies scenarios inside signal ctx which can go wrong. Change-Id: If91621913b8b03d8a0f4c863be0b0d479f97e8a1
2019-01-24VTY: add extended (11-bit) RACH detection toggleVadim Yanitskiy1-1/+2
Since I838c21db29c54f1924dd478c2b34b46b70aab2cd we have both TS1 and TS2 synch. sequences, in addition to "default" TS0. Let's finally introduce the VTY configuration parameter, that can be used to toggle optional detection of both TS1 and TS2. Note: we keep this optional because of potentially bad impact on performance. There's no point in paying the performance penalty unless upper levels (BTS, PCU) actually make use of it. Change-Id: I1aee998d83b06692d76a83f79748f9129a2547e8 Related: OS#3054
2018-12-12osmo-trx.cpp: move comma_delimited_to_vector() to Utils.cppOliver Smith1-15/+1
Make the "opt" argument const. This function will also be used by LMSDevice.cpp in a follow-up commit. Related: OS#3654 Change-Id: If3f0f682ca453c2b0a06175ec9626567932cfce6
2018-12-04osmo-trx: Change some lines to use libosmocore logging instead of coutPau Espin Pedrol1-5/+5
Change-Id: I66e3c37014ba12cd002e5b678bc0a6026f5dfc7e
2018-10-23Add long parameters (--help, --version, ...)Oliver Smith1-5/+13
Makes osmo-trx-* more consistent with other Osmocom programs, and allows an unified test for not having "UNKNOWN" in --version. Related: OS#3578 Change-Id: I90cf01d972aa10b48c59b67a1e7f82a4255ef526
2018-10-21trx_validate_config(): Fix validation of rx_spsHarald Welte1-1/+1
Change-Id: I7e932cff59335add09c76caba6f9ac1e7cf69022 Fixes: Coverity CID#188871
2018-09-04osmo-trx: Add osmo_signal to stop whole transceiver chain correctly on errorPau Espin Pedrol1-0/+17
Transceiver::stop() can only be called from either CTRL iface thread or from main thread (running osmocom loop). That's because stop attempts to cancel and then join all the other threads, which would then lock if attempting to stop from some of them. As a result, the best option is to indicate to the user of the transceiver option (osmo-trx.cpp) to stop it in a correct fashion by destroying the object from the main thread. Change-Id: Iac1d2dbe2328e735db2d4b933cb67b1af1babca1
2018-06-20Add -V param to print versionPau Espin Pedrol1-1/+8
Change-Id: I9f2d6c4b1a508aceb1ccc0559f0902eedf2ec5af
2018-04-28osmo-trx: s/GSM Core Address/GSM BTS Address/Harald Welte1-1/+1
The TRX connects to the BTS, not to the "Core". The Core network is miles away... Change-Id: I6de2f708fc7a7df7dea16314b7dfa4ab82f15b2c
2018-04-16use osmo_init_logging2()Pau Espin Pedrol1-1/+1
Change-Id: I2c28e6e6e3eb9f587680b34330e03408e32c2b94
2018-03-06osmo-trx: Re-introduce -l cmd line parameterPau Espin Pedrol1-1/+6
Parameter -l to set the terminal logging levle was removed in 3da1f8352e337fb032bf7a58c2909d3ba918e237, but afterwards it was decided to keep the cmd line options for a bit more to easy migration to VTY cfg. The command line no longer accepts keywords ("DEBUG", "INFO", etc.) but log level numbers, due to libosmocore APIs log_parse_level and log_level_str being marked as deprecated and for internal use only. Keep in mind the log level is overridden by VTY cfg if any line sets log levels for log stderr in there. Explicit cast to unsigned int for loglvel is issued to avoid iostream printing it as a char. Change-Id: I91c35ecded177b7976045d9b693855adb9e18f8a
2018-03-05osmo-trx: Use VTY cfg structures while still allowing cmd line optionsPau Espin Pedrol1-269/+187
Existing cmd line options are kept for a while to give people some time to move to use VTY cfg. All new cfg options should be set only through VTY. VTY options take preference (override) over cmd line options. Deprecated options are removed from help message to dissuade users from keep using them. Steps to drop cmd line options in the future: - Drop comma_delimited_to_vector, print_deprecated - Drop all options in handle_options marked with print_deprecated. - Set "-c" param to do the same as "-C", to keep compatibility with old param and still use same naming as all other osmocom projects. - Remove the hack in main() to set 1 channel implicitly by default. Change-Id: Ib8de1a5da4b3c0b6a49e00033f616e1d66656adf
2018-03-05vty: Implement VTY cfg parsing for current parametersPau Espin Pedrol1-1/+1
At this stage, osmo-trx still uses the cmdline parameters top run the device, but it is already able to parse all the same parameters from a cfg file through the VTY and filling a trx_ctx structure which will be later used to drive the device. Device config can be printed in the VTY with "show trx". Change-Id: Ie084c1b30b63f91c6e7640832ec1797d9e813832
2018-03-05Move enums required by VTY to a separate headerPau Espin Pedrol1-15/+15
This patch is a preparation for next patches, which add full VTY cfg support. Change-Id: I3d5b0576aa96869756f1629a40306c0043b6304b
2018-03-05osmo-trx.cpp: Move trx start and stop to helper functionsPau Espin Pedrol1-52/+66
Make main() smaller, and make it easier to replace cmdline parameters in following commits. Change-Id: I10eaaafe38ace2b7bb095a0ad1db70d6c06ee03b
2018-02-27Logger: Use libosmocore logging systemPau Espin Pedrol1-12/+3
We still need an intermediate class Logger due to osmo-trx being multi-threaded and requiring to have a lock to use libosmocore, which is not thread safe. Change-Id: I30baac89f53e927f8699d0586b43cccf88ecd493
2018-02-27Add initial support for logging, vty, ctrlPau Espin Pedrol1-2/+54
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-22osmo-trx: Set up talloc ctxPau Espin Pedrol1-0/+14
Change-Id: I67f1980fc615ab74371cbe1c4f83e987381299bc
2018-02-22osmo-trx: set up signals using libosmocore helpersPau Espin Pedrol1-12/+20
Change-Id: I86e78cd6054d0deff1b1aa061299d9f307e2a352
2018-02-20Logger: Drop syslog supportPau Espin Pedrol1-1/+1
This feature is currently not being used, so let's drop it to make it easier to integrate into libosmocore logging system in the future. Change-Id: I8282745ef0282d41599eaf94fe460a1d29b18e2a
2018-02-07Add support to set Rx/TxAntennaPau Espin Pedrol1-4/+60
Some devices have different Rx or Tx ports with different RF characteristics. For instance LimeSDR has H (High), L (Low) and W (Wide) band Rx ports, each of one being more suitable to a specific range of frequencies. In case one wants to support several GSM bands, the best option is to use the WideBand port and connect the antenna physically to that port in the board. Then the firmware must be instructed ro read from that port. Support for Rx/Tx port configuration is already in there for all the layers (Limesuite, SoapySDR, SoapyUHD, UHD), but we are missing the required bits in osmo-trx to make use of the available UHD API. This commit addresses it. Before this patch, the Rx/Tx paths configured could be changed by means of the LimeSuiteGUI app, but after running osmo-trx, the values were changed to the default ones. One can now start using osmo-trx with 1 channel and specific Rx/Tx ports by using for instance: osmo-trx -c 1 -y BAND1 -z LNAW Default behaviour if no specific path or an empry path is passed ("") is to do the same as preiously, ie. nothing by not calling the set{T,R}xAntenna APIs. One can also configure only specific channels, for instance to configure only the first Tx channel and the second Rx channel: osmo-trx -c 2 -y BAND1, -z ,LNAW Change-Id: I1735e6ab05a05b0312d6d679b16ebd4a2260fa23
2018-01-09Drop use of ConfigurationTable gConfigPau Espin Pedrol1-3/+0
After latest changes, it is not being used anymore. Change-Id: I43a49aee94e3239194ad9742fb6374324acac0de
2017-08-16Add -j option to bind to specific addressPau Espin Pedrol1-8/+16
Before this patch, the binding of the listening sockets was hardcoded to a local IP. Change-Id: I9ba184a1251c823e413a9230943ed263e52142ec
2017-07-20Add '-t' command line option to enable SCHED_RRHarald Welte1-2/+29
SCHED_RR allows us to operate osmo-trx reliable even under exceptionally high system load, as the realtime scheduler priority will have higher priority than the other "regular" tasks on the system. Change-Id: Ia2452b9763960b2be37fbeee9d832554da68a53f Closes: OS#2344
2017-06-08ssedetect: call __builtin_cpu_supports() only if supportedVadim Yanitskiy1-0/+8
Some compilers don't support the __builtin_cpu_supports built-in, so let's make them able to compile the project anyway. Change-Id: I0c90402d8e4c9f196c54b066ff30891c8de3ad2b
2017-05-19radioInterface: Remove UmTRX 'diversity' optionTom Tsou1-32/+0
The 'diversity' option was an experimental 2 antenna receiver implementation for UmTRX. The implementation has not been maintained and current working status is unknown. In addition to code rot, Coverity is triggering errors in the associated code sections. Removal of code cleans up many cases of special handling that were necessary to accommodate the implementation. Change-Id: I46752ccf5dbcffbec806081dec03e69a0fbdcdb7
2017-05-19cosmetic: Add info about SSE supportPhilipp Maier1-0/+16
The osmo-trx binary outputs no info about its SSE support status. This commits adds some putput that informs about the SSE of the binary and also tells which of the SSE levels the CPU supports. Change-Id: Iacc83fd668c31644e0efb3e18962cf2870ed1daf
2017-05-19ssedetect: Add runtime CPU detectionPhilipp Maier1-0/+8
The current implementation can select the SSE support level during compiletime only. This commit adds functionality to automatically detect and switch the SSE support level and automatically switch the Implementation if the CPU does not support the required SSE level. Change-Id: Iba74f8a6e4e921ff31e4bd9f0c7c881fe547423a
2017-04-10config: Remove OpenBTS style sqlite configurationTom Tsou1-80/+4
OpenBTS relies on reading in configuration values from the OpenBTS.config sqlite3 database. This configuration method is not maintained and not recommended for Osmocom or OpenBTS use. Command line setup is the recommended approach. Note that when the osmo-trx logging mechanism is replaced, the sqlite dependency will be removed. Change-Id: I95d7b771fde976818bee76f89163e72c3a44ecdd
2017-04-03Transceiver: Remove unsigned negative comparesTom Tsou1-1/+1
Change-Id: I49f30699786c52736ef334dae61f7bbd65d878d5 Fixes: Coverity CID 149353, 149356
2016-07-20uhd: Update USRP2/N200/N210 for 4 SPS RxTom Tsou1-23/+35
Requires changing the radioInterface API to pass in Rx side SPS value. Update the (deprecated) diversity configuration to match as well. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-07-17uhd: Add command line option for GPS referenceTom Tsou1-6/+31
Unlike earlier versions of UHD, the current release (3.9.2) does not automatically select on-board GPSDO as the reference source. Modify the command line settings to allow explicit selection of GPS in addition to the external setting. Simultaneous GPS and external reference settingis disallowed. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-07-01egprs: Enable 8-PSK burst detection when EDGE is enabledTom Tsou1-2/+2
The command line EDGE option will enable 8-PSK burst detection on any slot where a normal burst is expected. The burst search order is 8-PSK first followed by GMSK. EDGE will force 4 SPS sampling on Tx and Rx. Along with twice the search correlation from 8-PSK and GMSK, EDGE will increase CPU utilization. Whether the increase is notable or not is dependent on the particular machine. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-07-01mcbts: Add multi-ARFCN radio supportTom Tsou1-7/+38
Add new radio interface "radioInterfaceMulti" for multi-carrier support. Only USRP B200/B210 devices are supported because of sample rate requirements (3.2 Msps). Only 4 SPS operation Tx/RX is supported. 8-PSK is supported. Other options may be added at a later time Signed-off-by: Tom Tsou <tom.tsou@ettus.com>