Commit Graph

571 Commits

Author SHA1 Message Date
Philipp Maier e51a8f029e cosmetic: Add info about SSE support
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-19 17:23:20 +00:00
Philipp Maier e8ae9fcf38 buildenv: Split up SSE3 and SSE4.1 code
Currently we find SSE3 and SSE4.1 code mixed togehter along with
generic code in one file. This introduces the risk that the
compiler exidantly mixes SSE4.1 instructions into an SSE3, or
even worse into a generic code path.

This commit splits the SSE3 and SSE4.1 code into separate files
and compiles them with the matching target options.

Change-Id: I846e190e92f1258cd412d1b2d79b539e204e04b3
2017-05-19 17:21:45 +00:00
Philipp Maier f5bf33b287 buildenv: Make build CPU invariant
Currently the build environment checks which extension the current
CPU supports and picks the compiler flags accordingly.

If the build is happening on a machine that does not support the
extensions we need (SSE3, SSE4.1), the binary will lack those
extensions, even if its intended to be used on a more powerful
machine that would support the extensions.

This commit removes the CPU tests from the build process.

Change-Id: Ic913aa13c23c348ae62e78c9dfd6ed8b0a62798c
2017-05-19 17:19:39 +00:00
Philipp Maier fe9769833f cosmetic: remove code duplication
The ARM and the X86 implementation of the conversion functions share
the same, non cpu specific implementation in separate files.

This commit removes the code duplication by putting the generic
implementation into a convert_base.c, similar to to convolve_base.c

Change-Id: Ic8d8534a343e27cde79ddc85be4998ebd0cb6e5c
2017-05-19 17:16:37 +00:00
Philipp Maier 7e07cf2346 ssedetect: Add runtime CPU detection
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-05-19 17:12:45 +00:00
Philipp Maier dfe0aef184 Add test program to verify convolution implementation
Convolution is a complex process and we should be able to verify
if computing results change when the implementation is touched.

This commit adds a test program that executes some testcases.
The testcases are crafted in a way that every implmentation
(several different ones for SSE) is executed once. The output
can be compared against the included .ok file.

Change-Id: Ic702ecb356c652fbcd76bee689717fb5d3526fe9
2017-05-19 16:57:25 +00:00
Philipp Maier 131f82bfac cosmetic: Make parameter lists uniform
The non-sse implementation and the sse implementation of the convert
and convolve functions have different parameter lists. This makes it
difficult to use function pointers in order to select the right
function depending on the SSE-Level and CPU.

This commit uniformizes the parameter lists in preparation for
planned runtime cpu detection support

Change-Id: Ice063b89791537c4b591751f12f5ef5c413a2d27
2017-05-02 17:17:57 +00:00
Philipp Maier 78b5627fa1 buildenv: Turn off native architecture builds
The compiler option -march=native instructs the compiler to auto-optimize
the code for the current build architecture. This is fine for building
and using locally, but contraproductive when generating binary packages.

This commit replaces -march=native with $(SIMD_FLAGS), which contains a
collection of supported SIMD options, so we won't loose the SSE support.

Change-Id: I3df4b8db9692016115edbe2247beeec090715687
2017-05-02 10:21:25 +00:00
Tom Tsou de116e90c0 config: Remove OpenBTS style sqlite configuration
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-10 06:54:40 +00:00
Tom Tsou 15da7e1f7e Configuration: Fix const and signedness compile warnings
Change-Id: I701559814b2aee6f84f10e612f128da40f6a51c1
2017-04-03 18:55:02 -07:00
Tom Tsou 6031734f44 Transceiver: Remove unsigned negative compares
Change-Id: I49f30699786c52736ef334dae61f7bbd65d878d5
Fixes: Coverity CID 149353, 149356
2017-04-03 18:06:48 +00:00
Tom Tsou 5d2a36a113 Resampler: Fix non-array delete for filter taps
Change-Id: I59cdb01809da5940c74aaae9d17f413aefbf04b2
Fixes: Coverity CID 149349
2017-04-03 18:06:48 +00:00
Tom Tsou 2af14407a8 sigProcLib: Fix negative value check on unsigned value
Convert negative value check on unsigned value to zero check
to avoid potential divide-by-zero error condition.

Change-Id: Ib0d7d1bceb5fe66e69345db93a74e3e0773a2257
Fixes: Coverity CID 165059
2017-03-31 21:43:31 +00:00
Tom Tsou 92bdfb86ac sigProcLib: Check return status on downsampling
Improper length values will cause the polyphase resampler
rotation to fail. Check return and return NULL on error.

Change-Id: I3ad22f9fd7a20754f589c04258dcca3770474a9b
Fixes: Coverity CID 165235
2017-03-31 21:41:04 +00:00
Tom Tsou ae91f13ecb sigProcLib: Remove unreachable code and no-effect checks
Unreachable path and negative value inspection on unsigned
types.

Change-Id: If53b4b03550b0a7656c808cfe96806252153eb2f
Fixes: Coverity CID 165239, 165238, 165236
2017-03-31 21:41:03 +00:00
Tom Tsou 9d53ecf666 Resampler: Fix initialization return checking
Greater-than comparison was used on boolean type.

Change-Id: Ia3b71b3a06b34a6fd781bf197ecf9d5cc1711d13
2017-03-31 21:40:23 +00:00
Alexander Chemeris e0c12189d4 sigProcLib: Constify demodulation functions burst argument.
demodCommon() used to scale input vector in place which changed original data.
That's a bad practice and is not really necessary, so I've changed the code to
scale burst after it's copied to a new vector during a delay operation.

Change-Id: Ic45f71b634e48808356d68925bb9f5783e0bf0d3
2017-03-28 14:24:22 +00:00
Alexander Chemeris 1470fcdb5a sigProcLib: constify signalVector arguments for detectBurst() functions.
Change-Id: Ic033371a387353eb12b1827a0eb16c00c07da88a
2017-03-28 14:24:07 +00:00
Alexander Chemeris 6e1dffd486 Move Transceiver::demodulate() to sigProcLib to make it reusable.
Change-Id: I2cad47160e53f65612bd1da8998c83a0a22bce9b
2017-03-28 14:23:56 +00:00
Alexander Chemeris 0229d22d2e sigProcLib.h: Fix whitespaces. No non-whitespace changes.
The file seem to be using "2 spaces" indent, bt some lines are using
tabs which breaks formatting.

Change-Id: I7718cca45c245c9e91250ab2877f5436d4029698
2017-03-28 14:23:44 +00:00
Alexander Chemeris f7717acd0c sigProcLib: Add operator<< to print CorrType to a string.
Change-Id: I3d68cbdab8fb504d7f155029654a576d318a201e
2017-03-28 14:23:35 +00:00
Alexander Chemeris b34e60c105 Move BURST_THRESH from Transceiver.cpp to sigProcLib.h to make it reusable.
Change-Id: I5a888890e26858c0fbb2ddb7ef23cb0fd66a64b4
2017-03-28 14:22:01 +00:00
Alexander Chemeris 4e6c938024 Move Transceiver::detectBurst() to sigProcLib to make it reusable.
Change-Id: I3cbe8e6e4f39dde02c945e6c9086c040e276845c
2017-03-24 14:59:24 -07:00
Alexander Chemeris 4aa548f0c2 sigProcLib: rename signalError type to SignalError.
Change-Id: I1a5ae6e87d4c69945053fdefec185d0fb1a26399
2017-03-24 19:54:04 +00:00
Alexander Chemeris f9e78beea5 Move CorrType type from Transceiver to sigProcLib.
Required to move Transceiver::detectBurst to sigProcLib.

Change-Id: I3e0e74a98bbca4d19657f50a5fb447f078663c9b
2017-03-24 19:54:04 +00:00
Alexander Chemeris f0189c47be vector: Introduce shrink() function to shrink vector size without loosing data.
Change-Id: I9c0ac2715aea1a90c9e6ebcd982522b80a547099
2017-03-24 01:25:06 +00:00
Alexander Chemeris c708816be1 vector: Introduce segmentMove() method to move data inside of a vector.
Change-Id: I2f3f4267b4137a0bc031f27e0f896fba9b9f3433
2017-03-24 01:24:23 +00:00
Alexander Chemeris e56bf3a0e5 signalVector: Implement segment().
Change-Id: I6fe3aae53fb2fa5bb7637e976de6059eabe08202
2017-03-24 01:22:40 +00:00
Alexander Chemeris 38b69871ae BitVector: Convert SoftVector from 0..1 to -1..+1 soft bits.
This makes code simpler and will allow us send -127..127 soft bits towards
osmo-bts instead of 0..255 bits.

Change-Id: I16ecc3d4c829dcf0f619ad995bc9d4a4ed8af0a4
2017-03-22 18:31:22 +00:00
Alexander Chemeris 7db522b6d9 BitVector: Remove convolutional codec - we don't use it in osmo-trx.
Now we have more fexibility in how we represent SoftVector, since we
no longer depend on the particular convolutional codec implementation.

Change-Id: I3006b6a26c5eff59dbe9c034f689961802f1d0d0
2017-03-22 18:31:17 +00:00
Alexander Chemeris ae09b04e26 CommonLibs: Print soft bits with less confidence to console when printing a soft vector.
We use other symbols to show that these bits has less confidence:
o and . for 0 with less confidence
| and ' for 1 with less confidence

Change-Id: I747a17568ee48f1f3163e8dfab2e450af85e6435
2017-03-22 18:31:12 +00:00
Alexander Chemeris b61c610cd9 Call vectorSlicer() right before packing bits for transmission to osmo-bts.
vectorSlicer() converts soft-bits from -1..+1 to 0..1 while we want
to keep SoftVector in -1..+1 mode until the last minute, because at some
point we'll want to transmit -1..+1 to osmo-bts instead of converting it
from 0..1 back to -1..+1 on the osmo-bts side.

Plus it removes code duplication - we call it once instead of twice.

Change-Id: Idd6ddd7ac219afb0df055a692632678b66373764
2017-03-22 18:31:07 +00:00
Alexander Chemeris 132fb247b1 sigProcLib: Slice SoftVector instead of signalVector for GMSK demod.
This makes it similar to 8-PSK demod and also saves a bit of lines ofcode and
should give us a tiny improvement in performance.

Ideally we need to remove vector slicing at all, because in osmo-bts-trx
we convert back to +-1.0 again (actually to +-127, but it doesn't mater).
So we should rather transmit +-1.0 values to avoid double conversion.

Change-Id: If9ed6f0f80fbe88c994b2f9c3cae91d0d57f4442
2017-03-22 18:31:03 +00:00
Alexander Chemeris 1c0b8b355c sigProcLib: Rename demodulateBurst() to demodGmskBurst() for clarity.
Change-Id: Ibcef8d7d4a2c06865bed7e4091ccc8dbbd494d77
2017-03-22 18:30:53 +00:00
Alexander Chemeris 1dd05cf35a sigProcLib: make energyDetect() simpler by returning actual energy.
Change-Id: I9bf97f2dc03fea9bebcf43198dfb05f6e4694e9c
2017-03-22 18:09:00 +00:00
Alexander Chemeris 14d13b67dc sigProcLib: Fix documentation, sync argument names in .cpp and .h files.
Documentation in sigProcLib.h was noticeably out of sync with the actual
implementation - e.g. not all arguments were documented and arguments
which are already removed are still in the documentation. Also argument
names were different between declaration in .h and implementation in .cpp
which was confusing.

I've fixed this for detect*Burst() functions.

Change-Id: I4dfd07125d9a1e9a42a78b79faff539f003deb16
2017-03-20 18:42:32 +00:00
Alexander Chemeris 89bca9b2de radioBuffer: Remove extra ; at the end of inline function definitions.
Change-Id: I8911adf0a0bb1ae828ac9cdf1a76c904639f6c06
2017-03-20 18:41:02 +00:00
Alexander Chemeris 9270a5aa2e sigProcLib: Typo sybols -> symbols
Change-Id: I8cbef852374d0458c4f4ad4be0df0aa998e3796a
2017-03-20 17:36:06 +00:00
Alexander Chemeris 4793f4679b CommonLibs: Remove unused files.
Change-Id: I2bfb45a1c7d01785bdb30204dba38c683a4288a9
2017-03-20 17:32:04 +00:00
Max 802b86502d Add autoconf-archive to dependencies
We use AX_EXT in ./configure for checking CPU features anyway, so it's
better to add it as explicit dependency.

Related: OS#1923
Change-Id: I7ba48e1df4ede8b477574da3faa15fd02e15c69b
2017-03-14 18:49:55 +01:00
Tom Tsou a93f789e50 uhd: Increase MC-BTS FPGA clock rate to 51.2 MHz
Addresses following issues where UHD 3.9 and likely other UHD versions
would report a master clock (FPGA) rate error. Update MC-BTS FPGA clock
for B200 and B210 to 51.2 MHz, which is supported by all UHD versions.
Only B200/B210 is supported for MC-BTS operation.

https://osmocom.org/issues/1963
https://osmocom.org/issues/1648

ALERT UHDDevice.cpp:548:set_master_clk: Failed to set master clock rate
ALERT UHDDevice.cpp:549:set_master_clk: Requested clock rate 3.2e+06
ALERT UHDDevice.cpp:550:set_master_clk: Actual clock rate 5e+06

Change-Id: I78fb2c0959abd0e666628ba39f433162aafb067e
2017-03-07 17:54:06 -08:00
Tom Tsou 72bf762b42 uhd: Add support for UHD-3.11 logging control
The logging API changes in UHD-3.11, which causes build failure if
not properly handled.

Change-Id: I223ebb9fae3f4061e0cb37c05263c1b569e8f628
2017-03-07 14:25:05 -08:00
Max 2dee3e996e Fix building against sqlite3
* Explicitly check for sqlite3 at configure stage, remove old include
  dir, fix header inclusion.
* Use configure results for linking instead of hardcoded linker option
  for sqlite.
* Add dependency on -dev package for .deb

Change-Id: I6d7f697d67651f02ceb77fc4da4317b64fa47f9e
Fixes: OS#1928
2017-01-26 17:06:06 +01:00
Max 1f1cebb2e5 Remove embedded sqlite3
Previous patch switches to using system-wide sqlite3 so it's safe to
remove local copy now.

Change-Id: Ie8e751cc62132fe1f7748ccd78c5d48469027329
2017-01-24 15:15:30 +01:00
Ruben Undheim d1b28bd766 Do not embed sqlite3 when building
Change-Id: If5edadc04c3ff953b451676e55ad3d00d4e43c82
2017-01-24 15:15:24 +01:00
Max 833e97e9ba Integrate Debian packaging changes
debian/control:
    * restructure to make it easier to incorporate further changes
    * update package descriptions
    * update project URL

debian/rules:
    * use proper hardening syntax

debian/copyright: update to match Debian format

Change-Id: I9a89e7311c8632ae26ac2e6c02d1e427d94b1608
Related: OS#1694
2017-01-24 15:14:32 +01:00
Max e6d059f0c9 Add gerrit settings
Make it simple to setup and use this repo with 'git review' command.

Change-Id: I6bbe65cc09e086685995f084a07a646a7d60b93c
2017-01-24 15:03:48 +01:00
Holger Hans Peter Freyther 012a1b345b debian: Require fftw3 header files for osmo-trx
Install missing development package to get osmo-trx to build.

Change-Id: Id80937724d5e4da4ed555cbabfcd3e2457cb2a19
2017-01-24 14:47:10 +01:00
Tom Tsou 80cb08071b Revert "uhd: Set minimum supported version to 3.9.0"
This reverts commit 93ca09ea61.

Ettus Research recommends the use of 3.9 series of UHD releases,
but requiring this version has lead to issues with broken OBS and
packaged binaries by Debian, Ubuntu, and other distributions.

Change-Id: Ie6b175ac6d46d091937380c79fdd0125b16ec75f
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2017-01-19 13:48:15 -08:00
Tom Tsou 44c7f41d75 uhd: Add X300 sample timing for 4 SPS
Previously only 4/1 and 1/1 configurations Tx/Tx samples-per-symbol
were supported.

Change-Id: I9153171fe3af95e1cb0d9d35a9287dfde155d184
2017-01-11 13:30:42 -08:00