aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/device/lms
AgeCommit message (Collapse)AuthorFilesLines
2020-06-25{UHD,LMS}Dervice: Log expected resulting TxPower when setting device ↵Pau Espin Pedrol1-4/+5
specific TxGain Change-Id: I3c54c61cd6dd7e40bb2831fd4962ff72130b390d
2020-06-25Drop old TxGain APIs from parent radioDevice abstract classPau Espin Pedrol1-4/+0
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-09radioInterface: Operate on real Tx power attenuation rather than on device ↵Pau Espin Pedrol1-14/+13
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-08Transceiver: Implement TRXC cmd NOMTXPOWERPau Espin Pedrol2-0/+10
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-03-12radioDevice: Drop unused isControl param from WriteSamples APIPau Espin Pedrol2-10/+2
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-12radioDevice: Drop unused RSSI param from readSamples APIPau Espin Pedrol2-3/+2
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-01-15lms: Initial multi-arfcn supportPau Espin Pedrol1-7/+17
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-15lms: Make ts_offset and smpl rate coefs device-specificPau Espin Pedrol1-8/+12
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-15lms: Store device type specific parameters in one placePau Espin Pedrol2-25/+117
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-15lms: Move rx_buffers allocation to constructorPau Espin Pedrol1-4/+5
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-15lms: Make reference to std::vector unambiguousPau Espin Pedrol1-1/+1
Change-Id: Ieebdbd3d5082a02aea2441e6737783370511cbc1
2020-01-13lms: Change radioDevice constructor arg name to avoid masking instance attrPau Espin Pedrol2-3/+3
channel number mangling based on multi-arfcn feature being enabled was moved to generic radioDevice() to reuse code. Hence, the generic parent constructor sets this->chans to 1 if multi-arfcn feature is requested. However, LMSDevice constructor argument had same name as the class instance attribute, taking preference. As a result, if multi-arfcn is enabled in LMSDevice, the generic constructor first sets this->chans=1 but afterwards LMSDEvice constructor keeps calling .resize() with the argument value "chans" instead of using this->chans. Let's rename the argument in all radioDevice child class constructors to avoid potential future bugs in all of them. Change-Id: Id6c837e9133f22783dd92a81dfcc493e51bf2d21
2020-01-13lms: Improve smpl_buf error loggingPau Espin Pedrol1-2/+3
Change-Id: I511abe2c333443b978a3767bd7b7e320e07c4930
2020-01-07lms: Drop unused definePau Espin Pedrol1-1/+0
Change-Id: Iaf3361ed29dd552e5e52b62bc738fa20c6b583fe
2020-01-07lms: Move initialization of field started to constructorPau Espin Pedrol1-3/+1
Change-Id: I135a2ff4a419775169452be1128c7b30f7d638ad
2020-01-07Make logging category DLMS generic and reusable for other backendsPau Espin Pedrol1-1/+1
Make sure old configs using "logging level lms <level>" are still accepted. Initialization order of VTY componenets need to be resorted since newly introduced command requires logging VTY node to be already setup beforehand. Change-Id: Ia195a74a62a8a3dd6267fb1359acaa5628208d8e
2019-10-17Fix common misspellings and typosMartin Hauke2-2/+2
Change-Id: I4ec7accb1912c052b446be7c399bed32a8c62253
2019-09-13radioDevice: Introduce getTxGain() APIPau Espin Pedrol1-0/+5
It will be used in later commits by radioInterfaceMulti. Change-Id: Ie3caca8971ed1e5370dfed6fb60716a24e7d82a5
2019-09-13LMSDevice: Return previous txGain/rxGain if setting value failedPau Espin Pedrol2-6/+10
Change-Id: I11e853e11bec99fc88e81642f9b2cd87d5815398
2019-08-26lms: Log available antennas if requested antenna failsPau Espin Pedrol2-2/+23
Related: OS#3343 Change-Id: Icd328e85b0a75ef67f371a7ed72638053b1854f9
2019-08-21Drop old setPriority related codePau Espin Pedrol1-4/+0
This code is not needed anymore since we are setting SCHED_RR scheduler with a real time priority in main thread during startup, so all threads will inherit same rt priority, which should be enough to keep the process working reliably even on high system loads (from non rt processes). osmo-trx was tested to be reliable during test with stress-ng as explained in related ticket below. Related: OS#2344 Change-Id: I3a88946dd71e9aeeaac9d19d396e2236c302b608
2019-08-01lms: Drop rx_underruns rate ctr, add tx_drop_* rate ctrPau Espin Pedrol2-28/+61
After discussion in [1] and further look at the code, it became obvios rx_underrun events are not happening in general for any SDR (don't exist), so let's drop that counter. Instead, add Tx Dropped Packet counters, which were not accounted prior to this commit. [1] https://github.com/osmocom/osmo-trx/commit/bde55afd29fc9aae10eb11f6515821afa39b772d Change-Id: Iff1535c219a4695a511d383d7c4b06ef6eff959d
2019-07-22Add SPDX annotationPau Espin Pedrol2-1/+6
Related: OS#3515 Change-Id: I3719bd8dc015569ecd81928fc079e27593cdca09
2019-06-09lms: Fix stream_stats checks with overrun/underrunPau Espin Pedrol1-4/+4
It was initially thought that underruns/overrun fields were increasing-over-time values. However, after reading LimeSuite code, it seems overrun and underrun fields are actually reset upon every call to LMS_GetStreamStatus(). Related: osmo-trx.git 928177125654c1e596ec3450a68882c031ebb929 Related: https://github.com/myriadrf/LimeSuite/issues/265 Change-Id: I677232a7b12ee83d26aa34d92f76a91d4b5a63a6
2019-06-06lms: Drop unusued variable masterClockRatePau Espin Pedrol2-5/+0
Change-Id: I19192925d008046f474615a0476b52ddee9a9d78
2019-06-05Add rate_ctr support to store/retrieve SDR errors through VTYPau Espin Pedrol2-36/+45
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-05-24lms: Fix stream_stats checks with droppedPacketsPau Espin Pedrol1-3/+5
Existing code had a typo (value was assigned from wrong variable). Furthermore, it was experimentally found that: while underrun/overrun are documented as "FIFO overrun count" in LimeSuite.h, it seems droppedPackets ("Number of dropped packets by HW") is not actually an incrementing counter like the others, but simply a value set every time LMS_RecvStream() is called. Since we are actually interested in keeping the count over time, adjust code to achieve that. Change-Id: Id93d33400e11360b9536f56a31904328549cfbbf
2019-05-06lms: Use smpl_buf to recover from timestamp jumpsPau Espin Pedrol3-13/+67
Also take the chance to make sure we handle properly short reads (keep reading again). Both scenarios can be tested by running osmo-trx-lms and then using on a terminal: sudo kill -STOP `pidof osmo-trx-lms`; sleep 0.5; sudo kill -CONT `pidof osmo-trx-lms` Fixes: OS#3339 Change-Id: Idfc4e69acc30afb11440b6b9cbdcfa09ff920265
2019-05-06smpl_buf: Move it to device/common and create libdevice_common.laPau Espin Pedrol1-1/+1
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-06Introduce LOGCHAN macro to standarize logging channel infoPau Espin Pedrol1-33/+33
Change-Id: I67d869499aa16af58c863ca7b74c356bcd979936
2019-05-03device: Drop unused numberRead/numberWritten APIsPau Espin Pedrol2-15/+0
It's really not used, so let's drop unused code and simplify work for new to come device drivers implementation. Change-Id: I0d18f9c2584771e2f7b3d5c6b016e764e02855ff
2019-04-25lms: Catch and log dropped packets by HW during recvPau Espin Pedrol2-0/+9
Change-Id: I23554d95b0aff585024610fc12920c9da4f3ba9e
2019-04-25lms: Remove unused var m_last_tx_overrunsPau Espin Pedrol2-2/+0
Change-Id: I2104205b2af7cd6c86075d5cc4f0f36bde5e5311
2019-04-25lms: Remove references to ALERT loglevelPau Espin Pedrol1-21/+21
ALERT log level is not Osmocom standard level, it's just a define in osmo-trx to keep compatibility with old code. Same goes for one reference to "ERR" intead of "ERROR". Change-Id: I0e171a8ac8a8bfa804ac97fba3d73efcfa6424b4
2019-04-25lms: Log underrun/overrun eventsPau Espin Pedrol1-2/+10
Change-Id: I8c6b1d3e8515153e5d4079cc6620901ef8ce2449
2019-04-25Move duplicated thread_enable_cancel to CommonLibsPau Espin Pedrol1-6/+0
Change-Id: I1a479b59bdda01233273dfa919bd678edbe34708
2019-04-25lms: Improve log during flush recv errorPau Espin Pedrol1-1/+1
Change-Id: Id45d42599738efd6a5d89787c75779838a979330
2019-04-25lms: flush_recv: alloc buf on stack instead of heapPau Espin Pedrol1-3/+1
No need to use the heap here since buffer is only used as a temporary trash. Using the stack is quicker. Change-Id: Iede8dc0903ee3865a52c8e2fd811bcde444fee33
2019-04-17lms: properly call close if set_antennas() fails, add some commentsJoachim Steiger1-1/+4
Change-Id: I9ebe986ee3a15842a15853424ee98e9a2fa6a5df
2019-04-17lms: add device type detection and device specific gainsJoachim Steiger2-44/+40
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-17lms: move LMS_GetLPFBWRange and LMS_Calibrate calls from open to startJoachim Steiger2-27/+50
bandwidth, freqency, gain stages need to be set before calibration can be successful Change-Id: I1090effdf0f43e5183a402e4c1a1ffe5abdefd37
2019-04-17lms: move LMS_EnableChannel from Start/Stop to Open/Close deviceJoachim Steiger1-8/+14
move enable: it is important that channels are actually enabled before applying any configuration (besides external clock) move disable: move to close, so channels are not disabled and not enabled again while osmotrx is active. Change-Id: I82878913254ce15a85db8d006e13d5eb639793e9
2019-04-17lms: Remove wrong unused code copied from -uhdJoachim Steiger1-5/+2
Change-Id: I2bc7fcfa429d1f82c2d8e95d31dfed367f2b3f9d
2018-12-14lms: Fix build against LimeSuite > 18.10Pau Espin Pedrol1-2/+20
LimeSuite dc124e4e2ed9b549b142410af172f0592f9f0c23 > 18.10 broke API compatibility. OS#3729 Change-Id: Idf500a5b39a857233f728c6a4316c00a99374556
2018-12-13LMSDevice: make use of dev-args in osmo-trx.cfgOliver Smith1-2/+40
Allow selecting a specific LimeSDR device by setting dev-args in the config file. Split up the given dev-args address by comma and select the device where all substrings can be found. I could not test this with real hardware, but I have added a test case to make sure this works as expected. Related: OS#3654 Change-Id: Ib9aaa066a01bf9de3f78234d7ada884d6f28c852
2018-12-07lms: Do {under,over}run checks even if LMS_RecvStream failsPau Espin Pedrol1-1/+1
Under failure, it could still be that stream status is updated, so let's father that in all cases. Change-Id: I4e2b8be06d2993db1bab233948a8ee774b8ac4ee
2018-12-07lms: Move {under,over}run checks into separate methodPau Espin Pedrol2-11/+16
Change-Id: I7f450aa79f6285d14826c40ecfdd9490d00509ef
2018-12-05lms: Improve Set{Rx,Tx}{Gain,Freq} loggingPau Espin Pedrol1-6/+10
Change-Id: I6713a27c5f74beb7fcfdd712fcf695afccbc3d76
2018-12-05lms: Allow setting Tx/RxFreq for lchan!=0Pau Espin Pedrol1-11/+0
Related: OS#3346 Change-Id: I9dd0bb41d1863111d28947fc0d7c7e7ecfaf5fa8