aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M
AgeCommit message (Collapse)AuthorFilesLines
2018-12-03radioInterface: Fix memleak during close()Pau Espin Pedrol1-0/+8
destructors of pointers created through "new" must be destroyed manually through "delete". Change-Id: I10d37579f16bec89cc762f200a8951218305c708
2018-12-03lms: Destroy streams on device stopPau Espin Pedrol1-0/+4
They are recreated during start(). Actually, if they are not stopped here, during start() after stop(), LMS_SetupStream() will fail because it will detect the streams are already opened. Change-Id: I70d47c287aabdabc5dc1304a942d130aeb10bdc5
2018-12-03lms: Fix start after stop of devicePau Espin Pedrol1-0/+6
Change-Id: I56358a1d1601853bc6dd2e6bb5f80798d0ba84b2
2018-12-02UHDDevice: log exception information on device open failured0gtail1-2/+2
Change-Id: Ia84ddcf50cc83f9326b22bfdfb4f259b4e0bc5f1
2018-11-29lms: Set Rx gain to midpoint, as comment suggests.Harald Welte1-1/+1
So far, the Rx gain was set to 34 dB, wile the comment stated it would be set to half-point, which is 73/2=36dB. Let's adjust the code to match the comment. Change-Id: Idc646def53b83faf4e6c011fb595fa436e223b32
2018-11-29lms: User correct scale factor for transmit samplesHarald Welte1-1/+8
Due to (I believe) a copy+paste mistake from the USRP1 code, we were using only a scale range of up to 9830 when transmitting samples, rather than the full 16 bit signed integer range up to 32767. As a result, we were loosing almost two bits (MSBs) of resolution as well as a lot of transmit power. This changes the scale factor to 0.707 (1/sqrt(2)). Please note that the much higher DAC output level means that the analog gain should be reduced. The theoretic range of up to 73dB should not be used, but Lime Microsystems suggest a value of 61..67 dB. This can be achieved by using a "osmotrx tx-attenuation" value of 6..12 inside the osmo-bts-trx configuration file. Related: OS#3341 Related: OS#3342 Change-Id: I71702feaa11f53e7614a6938a984dd748405474a
2018-11-23lms: Apply LMS->OSMO log level conversionPau Espin Pedrol1-1/+1
Change-Id: I3a8fbcc7cacebc7038c60175a8ae43b21f713cbb
2018-11-23lms: Use LimeSuite.h log level defines instead of hardcoded valuesPau Espin Pedrol1-4/+4
Change-Id: Iee693da1a0fa1db23deafa8d3845c04171e24799
2018-11-19UHDDevice: setRxGain on chan 0 when using multi-arfcnPau Espin Pedrol1-0/+3
When using multi-arfcn feature, several logical channels (arfcn) are multiplxed into one physical transceiver, as can be seen in uhd_device::set_channels. As a result, when multi-arfcn is enabled some properties are actually shared for those logical channels, and internally mapped to the first (only existing) channel, and per-channel internal array variables are allocated accordingly (size() == 1). When setting RxGain, we need to set the correct existing physical channel. Same check is done in getRxGain, and then we apply the RxGain correctly and we avoid outputing an error "Requested non-existent channel" immediatelly after. Change-Id: I5b02bb1ef6450dc48be7b8058d96a5691847d3cc
2018-11-01ChannelizerBase: Fix ASan alloc-dealloc-mismatchPau Espin Pedrol1-1/+1
Fixes following Adress Sanitizer warning: ================================================================= ==27120==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs operator delete) on 0x60c00003d900 #0 0x7f2f216de421 in operator delete(void*, unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cc:151 #1 0x561641ce18b7 in ChannelizerBase::~ChannelizerBase() (/build/new/out/bin/osmo-trx-uhd+0x4a8b7) #2 0x561641ce1cad in Channelizer::~Channelizer() (/build/new/out/bin/osmo-trx-uhd+0x4acad) #3 0x561641cd5160 in RadioInterfaceMulti::close() (/build/new/out/bin/osmo-trx-uhd+0x3e160) #4 0x561641cd5047 in RadioInterfaceMulti::~RadioInterfaceMulti() (/build/new/out/bin/osmo-trx-uhd+0x3e047) #5 0x561641cd5093 in RadioInterfaceMulti::~RadioInterfaceMulti() (/build/new/out/bin/osmo-trx-uhd+0x3e093) #6 0x561641ca3fdd in trx_stop() (/build/new/out/bin/osmo-trx-uhd+0xcfdd) #7 0x561641ca4b32 in main (/build/new/out/bin/osmo-trx-uhd+0xdb32) #8 0x7f2f1f555222 in __libc_start_main (/usr/lib/libc.so.6+0x24222) #9 0x561641ca195d in _start (/build/new/out/bin/osmo-trx-uhd+0xa95d) 0x60c00003d900 is located 0 bytes inside of 128-byte region [0x60c00003d900,0x60c00003d980) allocated by thread T0 here: #0 0x7f2f216dcf19 in operator new[](unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cc:93 #1 0x561641ce142d in ChannelizerBase::init() (/build/new/out/bin/osmo-trx-uhd+0x4a42d) #2 0x561641cd5865 in RadioInterfaceMulti::init(int) (/build/new/out/bin/osmo-trx-uhd+0x3e865) #3 0x561641ca1cb7 in makeRadioInterface(trx_ctx*, RadioDevice*, int) (/build/new/out/bin/osmo-trx-uhd+0xacb7) #4 0x561641ca44c6 in trx_start(trx_ctx*) (/build/new/out/bin/osmo-trx-uhd+0xd4c6) #5 0x561641ca4b05 in main (/build/new/out/bin/osmo-trx-uhd+0xdb05) #6 0x7f2f1f555222 in __libc_start_main (/usr/lib/libc.so.6+0x24222) SUMMARY: AddressSanitizer: alloc-dealloc-mismatch /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cc:151 in operator delete(void*, unsigned long) ==27120==HINT: if you don't care about these errors you may set ASAN_OPTIONS=alloc_dealloc_mismatch=0 ==27120==ABORTING Change-Id: Ib7c98ae478f319573dd86a0d2cb264f676bb3859
2018-10-24sigProcLib: add a CorrType for extended (11-bit) RACHVadim Yanitskiy2-6/+12
This is a preparatory change that enables a possibility to choose the amount of synch. sequences to be used for Access Burst (RACH) detection. The VTY flag will be introduced in further changes. There are two correlation types now: - RACH (default) - TS0 only; - EXT_RACH - all TS0, TS1, and TS2 together. Change-Id: Ia4f20524350bb8c380d7e10360758eddae8b03e9 Related: OS#3054
2018-10-24sigProcLib: introduce both TS1 and TS2 RACH synch. sequencesVadim Yanitskiy2-17/+24
According to 3GPP TS 05.02, section 5.2.7, there are three synch. sequences for Access Bursts: - TS0: GSM, GMSK (default), - TS1: EGPRS, 8-PSK, - TS2: EGPRS, GMSK. Let's prepare everythyng to be able to detect all TS0-3 synch. sequences, but keep detection of both TS1 and TS2 disabled until the corresponding VTY option is introduced. Change-Id: I838c21db29c54f1924dd478c2b34b46b70aab2cd Related: OS#3054
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-10-02Transciever: Log values causing Tx underrunPau Espin Pedrol1-1/+2
Change-Id: I68e18075eade55034567d96fc774d00a794afeeb
2018-09-28Use pthread_setname_np to name threadsPau Espin Pedrol3-0/+18
osmo-trx can start a considerable amount of threads that can make debugging it challenging at least. By using phtread_setname_np, the system sets a meaningful name to the thread which can be seen while debugging with gdb or by printing /proc/$pid/task/$tid/comm. Now we also log system TID when setting the name so we can identify different tasks in /proc even if pthread_setname_np fails. Change-Id: I84711739c3e224cb383fd12b6db933785b28209e
2018-09-20device/lms/LMSDevice.cpp: fix compilation warningVadim Yanitskiy1-1/+1
The following warning was observed with GCC 4.8.5: make[4]: Entering directory `.../osmo-trx/Transceiver52M/device/lms' CXX LMSDevice.lo LMSDevice.cpp: In member function 'LMSDevice::writeSamples()': LMSDevice.cpp:582:22: warning: 'rc' may be used uninitialized in this function [-Wmaybe-uninitialized] samplesWritten += rc; Let's fix this by zero-initializing 'rc'. Change-Id: I4b4a061fc12e5fd1db8d1087d8e0c46ff1e23412
2018-09-13cosmetic: Use proper whitespace in several for loopsPau Espin Pedrol1-1/+1
Change-Id: I82bdeb8a3fa38f3d125e8cbccc3eddbf2b8d8f58
2018-09-10Vector: Copy arrays in a sane way for non-trivially copyable typesPau Espin Pedrol1-3/+15
Avoids this type of compilation warnings: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of non-trivially copyable type ‘class Complex<float>’; use copy-assignment or copy-initialization instead [-Werror=class-memaccess] Change-Id: I9724454dfb7b87f74f39074e4004580ac3b5fe5c
2018-09-10radioInterfaceMulti:pullBuffer: Sanely convert float array to complex arrayPau Espin Pedrol1-3/+16
Fixes this type of compilation warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of non-trivially copyable type ‘class Complex<float>’; use copy-assignment or copy-initialization instead [-Werror=class-memaccess] Change-Id: Ibb2380a0a335ce798fe87221519fbbebade53054
2018-09-10cosmetic: Fix trailing whitespace in several filesPau Espin Pedrol1-9/+9
Change-Id: Ibf5a69f0a3a309e87814635fd903b114fe68890c
2018-09-10SigProcLib: Use available copyTo Vector API instead of memcopyPau Espin Pedrol1-6/+4
This change allows to remove some wrong use of code as per compilation warning: osmo-trx/Transceiver52M/sigProcLib.cpp:1266:40: error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of non-trivially copyable type ‘class Complex<float>’; use copy-assignment or copy-initialization instead [-Werror=class-memaccess] midMidamble->size() * sizeof(complex)); Change-Id: Id446711349bec70fa4e7c8efe0f7f9faf7e4f277
2018-09-10UHHDDevice: Replace deprecated header uhd/utils/thread_priority.hppPau Espin Pedrol1-1/+3
Fixes compilation warning: In file included from osmo-trx/Transceiver52M/device/uhd/UHDDevice.cpp:31: /usr/include/uhd/utils/thread_priority.hpp:10:17: note: #pragma message: This header is deprecated - please use <uhd/utils/thread.hpp> instead. Header was moved in uhd.git c33928d2bbdd27688c3475e77fc461e7d16eba5a. Change-Id: I6299df48a5e14c54eaa07288d166c705eb9ebdbe
2018-09-04radioInterface: Fix variable storing integer return valuePau Espin Pedrol1-2/+3
Change-Id: I0a0a06a6d16a228cfcb7bd746bab2d79f10ce244
2018-09-04osmo-trx: Add osmo_signal to stop whole transceiver chain correctly on errorPau Espin Pedrol3-2/+43
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-09-03lms: Return error on device read timeoutPau Espin Pedrol1-3/+5
If LImeSDR device is unplugged or its fw crashes during operation, reading from the device will fail and will first receive short reads and finally 0 byte reads. Let's quickly notify these events to upper layers instead of trying to process the buffer and checking timestamps for something we know it's already not useful. Related: OS#3340 Change-Id: Ib1af8cdd6cdadf581b039882add4049eea45a0f7
2018-09-03radioInterface: forward errors from RadioDevice to Transceiver in recv pathPau Espin Pedrol4-18/+22
Change-Id: Id7b08b19d6575c79b4d57db656a17ff05bb61ee9
2018-09-03cosmetic: Fix trailing whitespacePau Espin Pedrol3-4/+4
Change-Id: Ia647cfed0acb35adeb9b3b7824170d06c0369ef7
2018-08-17logging: Introduce new "DDEV" category for device-specific codeHarald Welte3-171/+171
The DMAIN category got too overloaded. Let's have the code in Transceive52M/device/* use the new DDEV category. Also, in some cases the log levels have been adjusted to ensure that enabling INFO level should not result in a complete overflow of messages during normal operation. Change-Id: I844fe4a75bf277cd3cc5bd8fa06e06ad97b2ea95
2018-06-20lms: Allow values diff than 34dB to be set by setRxGain()Pau Espin Pedrol1-3/+1
Until now, setRxGain in LMSDevice did not take into account the setter parameter and was always using hardcoded 34dB, which was experimentally found to be a good default value. Let's force that value during initialization, but still allow the upper layers (controlled by BTS) to set different values. osmo-bts only sends a SETRXGAIN command (which calls setRxGain in osmo-trx) if a value is explicitly set in its VTY config, so we are on the safe side if the user doesn't explicitly configure a desired dB. Change-Id: I5684e675281a3f581855dbb56d199a6fe238a712
2018-06-20Add -V param to print versionPau Espin Pedrol1-1/+8
Change-Id: I9f2d6c4b1a508aceb1ccc0559f0902eedf2ec5af
2018-06-14usrp1: Fail in case of unsupported configurationHarald Welte1-0/+12
There might be some configuration that's not supported by osmo-bts-usrp1, and we should reject that properly. Change-Id: Ic7308ce0c57439fe97668bd31801c4bf76b797ad Closes: OS#3348
2018-06-14lms: Fail in case of unsupported configurationHarald Welte1-0/+8
There might be some configuration that's not supported by osmo-bts-lms, and we should reject that properly. Change-Id: I6f82edce589030a4407f6150fb7e8abe6417c1f2 Closes: OS#3347
2018-06-14lms: Fix coding styleHarald Welte1-10/+10
In Change-Id Ib2fca81b76d027b08e2891056fa076d071597783 we introduced some coding style violations. Let's make newly-added code follows standard Osmocom coding style. Change-Id: Ib7ddd275014f03a2eed3cddc02b1356e2b00c0bc
2018-06-14radioDevice: better encapsulation in base classHarald Welte6-34/+38
It's not good style to have the derived classes initialize members inherited from the base class using "this->foo = bar". Rather, let's make the base class have a constructor, and call that constructor to initialize the members of the base class. While doing this * rename 'offset' to 'lo_offset' to avoid confusion with timestamp offset * move 'InterfaceType' into the base class * move 'chans' into the base class * move 'rx_sps' into the base class * mark base class members as 'protected' Change-Id: Ib885675a7612a392aa7f75fca81269ddcff2f6ab
2018-06-13radioDevice: Move tx_sps from derived into base classHarald Welte6-17/+18
All three derived classes use a tx_sps member, let's move this into the base class. Change-Id: I73b4aa2705c5049561e2d7b21301a0d2b3c96ced
2018-06-13lms: Call set_antennas() during open() methodHarald Welte1-0/+5
Without this call, the antenna/path configuration is not applied. Change-Id: I0bca58266b59f1315ec72b6407fe4f4495aff678
2018-06-13lms: Fix support for rx_paths / tx_pathsHarald Welte2-3/+10
Before this patch, any configuration in osmo-trx.cfg regarding the rx and tx "antenna" (path) would have been completely ignored, as the radioDevice::make() function would simply drop those arguments to the floor. Change-Id: Ie50f854abbc9dcf351cddc052d10206382e1d5d3
2018-06-13move set_antennas() from UHD to generic radioDevice base classHarald Welte4-33/+29
Change-Id: I806143e9db21f0be4dcc6a376b3a630be7aeb3ba
2018-06-13lms: Reduce Rx gain from 47 to 34 dBZydrunas Tamosevicius1-1/+1
Initially, Rx gain was hardcoded to be 47. This was too high for our setup and we were constantly getting "clipping detected" messages. Reducing Rx gain to 34 solved the issue. However, it looks like gains should be controlled through configuration files. Change-Id: I30580f18c4ad630c09f725b1d24c125fc3119809
2018-06-13lms: fix LMS_StartStream() handling for multiple channelsZydrunas Tamosevicius1-0/+5
LMS_StartStream() (in LMSDevice::start()) was moved to separate loop. It is because LMS_SetupStream() would fail for second channel if streaming has already been started (LMS_StartStream()) for single channel configuration. Change-Id: I6704bb92864aa81417507c4ae24a22f41dc529c1
2018-06-13lms: Reduce log level of "send buffer of len ..."Zydrunas Tamosevicius1-1/+1
Log level of "send buffer of len ..." messages was changed as it was causing problems on some machines. Change-Id: I605d50e81966c7bd169b27788d62af6fb54c84e1
2018-06-13lms: Use same timestamp offset like when using LimeSDR via UHDZydrunas Tamosevicius1-5/+2
The tx timestamp offset was not set. We set it to the same value as it was in UHD interface for LimeSDR Change-Id: I78bc40cd575097f71a5f82b63467fa81c3f8d837
2018-06-13lms: Check LPBFW to set is within supported rangePau Espin Pedrol1-6/+26
As of LimeSuite 618fbb9c3188b36d75ad5785a97b8887dcc468f6, it seems 5e6 is within the returned range, but LMS_SetLPFBW fails anyway. See for more information: https://github.com/myriadrf/LimeSuite/issues/184 Change-Id: I967e7da7c0e3e8138b76733ee4a0e6311d20b62e
2018-06-13lms: Makefile.am: Reorder params to fix link issuePau Espin Pedrol1-2/+2
It seems the order in which static code and -lfoo is passed to the linker matters. This commit is a lms specific follow-up of commit 2a8183bdf0dfd5c5a59c3933fb932e827ddf811c. Change-Id: I59c20d268ecac4c22689124165c47295bd9176d4
2018-06-13LMSDevice: Fix setup failure with LimeSuite > 18.04.1Pau Espin Pedrol1-1/+1
Fixes: https://github.com/myriadrf/LimeSuite/issues/184 Change-Id: Ia9f37995cd10d19d6820e3e12b8ee8f3efbff5d4
2018-06-13LMSDevice: Set correct values for Max{Tx,Rx}GainPau Espin Pedrol1-2/+2
Change-Id: I3b3a7080a69e15d8d6770186810d922227439099
2018-06-13LMSDevice: Reduce Rx logging verbosity: Only log unexpected timestampsHarald Welte1-1/+2
Change-Id: I06b35efb7368616b9f4d348da574cd524ffe3ea6
2018-06-13LMS_Device: Set ts_offset to 0.Harald Welte1-1/+2
I'm not quite sure what the ts_offset is for, but by using "0" we are now receiving exactly the timestamp that we're expecting: LMSDevice.cpp:486 [tid=140576250332928] chan 0 recv buffer of len 2500 expect 305ed0 got 305ed0 (305ed0) diff=0 Change-Id: I270c94945b1af9662cfc468cfda1ae3af3ac0a27
2018-06-13LMSDevice: Fix initial timestamp offset of 2500Harald Welte1-1/+1
ts_initial must not point to the timestamp of the first sample in the last "flush" sample buffer, but to the first timestamp we expect in the next buffer. Change-Id: I23af62870544d4c6cf5f6e2d6578936603bceb91