Commit Graph

720 Commits

Author SHA1 Message Date
Eric Wild f57a86131e ms: drop the tx burst padding
useless.

Change-Id: Ied5c3ab5dde975e11b0ef6d9cbc86be19173c4e8
2023-07-28 12:19:41 +00:00
Eric Wild 7d5c16590c ms: fix blocking logging
Change-Id: I0f5dcb13d1bd9e626e1eeab6ca767ca1b5ae43b8
2023-07-25 18:25:49 +02:00
Eric Wild f8c7a52521 devices: add freq/gain override for uhd
This allows using arbitrary gain and frequencies.

Change-Id: I3c1b9a067cafc6d696b9aa2da8ee0480ec1e094f
2023-07-25 18:25:49 +02:00
Eric Wild c0f78a37ed devices: unify band handling
This is basically common, but optional code.

Change-Id: I64f5a462451e967d4750d8e4f1d5832cbab41cff
2023-07-25 18:25:49 +02:00
Eric Wild 19e134a626 transceiver: pass cfg struct instead of args
Passing 7 args is a bit much, just pass the config struct instead.

Change-Id: I48386900d15ff4d770c70a4efc246d32f921904b
2023-07-25 18:25:49 +02:00
Oliver Smith a98521ac05 USRPDevice:updateAlignment: remove byteswap code
After upgrading our CI environment to use Debian 12 with GCC 12, the
byteswap code fails the build with the following. I've talked to Eric
about this and he recommended to just remove the code as practically
nobody will use osmo-trx with a big endian system.

USRPDevice.cpp:591:30: error: 'data' is used uninitialized [-Werror=uninitialized]
  591 |   *wordPtr = host_to_usrp_u32(*wordPtr);
      |              ~~~~~~~~~~~~~~~~^~~~~~~~~~

Related: OS#6057
Change-Id: I806d8c1432cb20efca1830a2752a4cbc70384b54
2023-07-13 14:34:59 +02:00
Eric Wild df4520df77 ms: make init call less confusing
Change-Id: I122b0c8cf97e5efcbc60cd95e8bd06a50d57eb57
2023-07-07 19:16:40 +02:00
Eric Wild 2f40abd8f5 ms: sch: drop intermediate softvector
Change-Id: Iadc8f224f9e43282339197b11f388fc574656299
2023-07-07 19:16:40 +02:00
Eric Wild 6a3e4b32f0 ms: flexible template for value_type buffer sum
Manual attempts to get the number of complex and single samples right
turned out to be a bit error prone at times...

Change-Id: I3c9953073555e3a7f70b78b0946dfdf949175a82
2023-07-07 19:16:40 +02:00
Eric Wild c3e515a28b ms: rearrange code to allow clean exits
This allows gracefully terminating the application by introducing queue
timeouts.

Change-Id: I0b8deebc63cf4d936666fd68e1666d1917e89a5d
2023-07-07 19:12:39 +02:00
Eric Wild bcaafcaa9d ms: prune common sch acq code
Change-Id: Ife639a78a4463f992247c19e0177f683db2ae0b7
2023-07-07 19:12:39 +02:00
Eric Wild ea7bd5fb91 ms: remove syncthing tool
Only used for testing during the first stages of development.

Change-Id: Ie97069a109324b6e96c66a4b24d03f9745b6a52e
2023-07-07 19:12:39 +02:00
Eric Wild 135d64b1a9 ms: rearrange internal trxcon<->phy if
Change-Id: I20aef3844f7699e164fe089358aa7e2325608c85
2023-07-07 19:12:39 +02:00
Eric Wild e44cf44af4 ms: pretty tx buf class
Change-Id: I96c5dd79426a52e7fff2df27bdaa3fae0c69491a
2023-07-07 19:12:39 +02:00
Eric Wild c0f0a6105a ms: cache frequency
Don't waste time setting the same frequency again.

Change-Id: Ide9f45130955e1cc66610a50d6fc1cd79f30aca9
2023-07-07 19:12:39 +02:00
Eric Wild da5ffd6e01 ms : rename var
Change-Id: Ia90a9f73fdb1f96fa5bd7f27b3c191ce0ba6c65d
2023-07-07 19:12:39 +02:00
Eric Wild 40978041ad ms : rename var
Change-Id: I44e5d1770b248f107abce5683d5f7641655da764
2023-07-07 19:12:39 +02:00
Eric Wild 3e7f4b0da9 ms: use single thread pool
...so we don't spawn threads all the time.
Used for gain avg/setting.

Change-Id: Id675550f55e8ccbbbe6b0d91fbffd01b6ede15f7
2023-07-07 19:12:39 +02:00
Eric Wild 4080cd05ba ms: block burst q to upper layer
The timekeeper should never wait for lazy readers, because that causes
timekeeping and later usb transfers to fail.

Change-Id: Id0aad606a296b2885617013ce6637204357b13d7
2023-07-07 19:10:55 +02:00
Eric Wild b3157b91bb ms: fix startup & shutdown of blade
One of the mystery bugs was that the blade ms needed two starts
after powercycling the bladerf due to transfer timeouts.
This is now fixed.

Change-Id: I1cd8790191790f4861a70bc55c8f4c9993fa10c8
2023-07-06 18:17:06 +02:00
Eric Wild 805e0d9c6b ms: prettify scheduling + add odroid
Change-Id: Icaf42fd5f76dc2d53dc526558aa8ceaa9c190f7b
2023-07-06 18:17:06 +02:00
Eric Wild 4b2b98b067 ms: fix the gain init for blade
Change-Id: Ic5a25d6f5606fba599b8144fbec7285047dca3c9
2023-07-06 18:17:06 +02:00
Eric Wild 2e6c362b9c ms : fix the template formatting
Those lines predate the .clang-format changes.

Change-Id: I891bdf95004accebbbe54916e4472bd381fac545
2023-07-06 16:06:05 +00:00
Vadim Yanitskiy 1ddd727bb4 ipc-driver-test: clean up variables in Makefile.am
* AM_CPPFLAGS is for preprocessor flags like '-I' or '-D',
* AM_CFLAGS/AM_CXXFLAGS is for C/C++ compiler flags like '-Wall',
* AM_LDFLAGS is for linker flags like '-no-undefined', not libraries!
* Link ipc-driver-test against libdevice.la,
* Do not put $(UHD_CFLAGS) everywhere.

Change-Id: Iafd68974c9c613fb4e65a01d076b2c687b716c83
2023-03-14 13:16:09 +00:00
Pau Espin 8a4362459d Call osmo_fd_unregister() before closing and changing bfd->fd
Change-Id: Iffc7d89166be1cf3cd1f8c3effe90f04d5c5a9c1
2023-03-14 12:54:20 +00:00
arehbein 20ecc4f531 Transition to use of 'telnet_init_default'
Related: OS#5809
Change-Id: Icc57c68337d55c6594c1c36e9bf41624d11dab0a
2023-03-09 12:48:32 +00:00
Eric Wild 097a16e384 ms: adjust tx scaling for tx samples
The "safe" scaling factor introduced in
7ac54b10d3 is too low and dates back to
the beginning and the move from usrp1->uhd, but the modulator will
exceed +-1 so "proper" scaling leads to overflows. Let's just do what
osmotrx has been doing for many years...

Change-Id: I75a2eba1f7f7b81249c06ce3fc9dfeee08878cb9
2023-03-02 18:22:37 +01:00
Eric Wild 621a49eb69 ms: adjust float<->integral type conversion
Given integral type A and non integral type B and depending on rounding
mode, optimization, compiler, and phase of the moon A(A)*B != A(A*B) so
split the two cases.

While at it, also make the template automagically work for complex types
instead of requiring manual casts, the general idea here is to allow
inlining and vectorization by treating all args as plain arrays, which is fine.

This works as expected with -tune=native, x64 implies sse2, and we do not
target any neon-less arm versions either.

Clang only array length hints can improve this even more.

Change-Id: I93f077f967daf2ed382d12cc20a54846b3688634
2023-03-02 18:22:37 +01:00
Oliver Smith 8c4336dba9 Run struct_endianness.py
Ensure there is no diff to prepare to run this in CI.

Related: OS#5884
Change-Id: I7d571a042009a3d1befb71fdd490fdef39368066
2023-02-20 10:53:48 +01:00
Eric Wild 10b4e31655 mstrx: do not wait forever if clock locking fails
Change-Id: Ib85f2452b66fb4d9881fe9676e69e4f6a8ba8f74
2023-01-11 18:57:51 +01:00
Eric Wild 0c433350da radio interface: fix init
5561f1129d introduced some changes,
but while RadioInterface lost its call to close() that was previously
used to improperly reset the buffers upon init() that call was
accidentally not removed for RadioInterfaceMulti and
RadioInterfaceResamp, so those reset previously initialized values to 0
during init(), which break osmo-trx for weird setups.

Change-Id: I74fc1586f8ae0832f4093ba8a44a1c70c78ec3d8
2023-01-09 20:17:46 +01:00
Eric Wild d0c1055051 ms: init trash used to escape the usb callbacks
Closes: OS#5847

Change-Id: I1b41350f981bd9f68163509b94d5457218b415d6
2022-12-28 17:01:13 +00:00
Eric Wild 2ca77d7ff2 ipc: remove old autotools workaround
Closes: OS#5845
Change-Id: I3f8a0204b1fda52d1228add8afde620274b164a5
2022-12-23 15:37:27 +01:00
Eric Wild d3e3bba2cd ipc: add missing override
Change-Id: Ib1493ac10b40d24372075d4cebd67015192675e0
2022-12-23 13:41:36 +00:00
Eric Wild 5561f1129d clean up mutex, scopedlock, and signal classes
This also uncovers very interesting design decisions like the copying of
mutexes and condition vars depending on recursive locks that were
previously hidden by shady c function calls..
We have perfectly good c++11 versions for all of that.

While we're at it, also use the initialization list for the other (still
copy constructable) vectors, which cleans up the radio interfaces.

Change-Id: Idc9e3b1144c5b93f5dad2f8e0e30f1058477aa52
2022-12-23 13:41:30 +00:00
Eric Wild b7253c6fdc ms-trx support
This is basically a trxcon that includes a transceiver, and can just
be used with existing and future apps supporting the trxcon interface,
i.e. mobile or ccch_scan.

Supports bladerf and uhd.
Currently using hardcoded sched/prios aimed at a setup with working,
reliable usb and reserved cores, for example a raspi 4 (ONLY 4, not 3,
not 2, not any other version)

Additionally builds test tools used for development: osmo-trx-syncthing*

see https://osmocom.org/projects/baseband/wiki/MS-side_GPRS for the
project description and details

Change-Id: I36c65a8c725c4da76dc70006cd96b0a2b6878e84
2022-12-23 13:41:13 +00:00
Max 934e1016ff ctrl: take both address and port from vty config
Change-Id: Id7d1425e603cc62a62a63d1057291861f02782ba
2022-12-17 21:26:49 +03:00
Eric Wild ac726b1147 vita demod by piotr krysik, modified
Grabbed from gr-gsm 2de47e28ce1fb9a518337bfc0add36c8e3cff5eb
Had a few rounds of extensive cleanup (not the va itself). Uses gcc
multiversioning for x86 targets.

Change-Id: I5466c522cf4de984a4810ec46df43a10b52ed78f
2022-12-13 11:06:33 +01:00
Eric Wild 7d897cb5b0 bladerf xa4 support
This is not really finished, there are multiple reasons to not use this:
1) main clock is not a gsm multiple, so it will continously drift
2) small buffer sizes lead to tx gaps that are hard to detect and break
everything.

Change-Id: I455c34bb9520d5f09eeb1ac76fceb4bdea94d1ac
2022-12-06 09:45:06 +01:00
Eric Wild 8984d7f2ca rename noisevector class -> avgvector
The vectors feature is averaging, and not adding noise.

Change-Id: I05def8ab9ea7a2cece8db09c36c303e13ef40927
2022-11-30 16:40:42 +01:00
Vadim Yanitskiy 00ddcfaf50 Transceiver::expectedCorrType(): RACH is always 8-bit on PTCCH/U
It does not make sense for the MS to use 11-bit Access Bursts on
PTCCH/U because the payload does not matter, only the ToA does.

Change-Id: I5fb9f1c6810cdcd26a885b183e414d01d422eb28
2022-10-26 04:13:43 +07:00
Oliver Smith 424c74d006 treewide: remove FSF address
Remove the paragraph about writing to the Free Software Foundation's
mailing address. The FSF has changed addresses in the past, and may do
so again. In 2021 this is not useful, let's rather have a bit less
boilerplate at the start of source files.

Change-Id: I8ba71ab9ccde4ba25151ecbeb2a323f706b57d43
2021-12-14 12:23:00 +01:00
Vadim Yanitskiy 019d698126 LMSDevice: LMS_GetDeviceList() may return a negative number
Change-Id: I855bd8ea6d9cb0f285f4dbbf3bcd09bff4e71044
Fixes: CID#240718
2021-10-25 13:12:51 +03:00
Vadim Yanitskiy a686277c72 IPCDevice: check value returned from select()
Change-Id: I1c823317659547bb2391c57ac4d7931de1a383e3
Fxies: CID#240744
2021-10-25 13:10:18 +03:00
Vadim Yanitskiy 683f140739 IPCDevice: use thread safe strerror_r() instead of strerror()
Change-Id: Ia51ffa51ec7729572faca0282ae41c1e4968049f
2021-10-25 12:56:44 +03:00
Pau Espin bb2cb9d54b lms,uhd: Allow changing band between poweroff & poweron
Before this patch, reconnecting to osmo-trx and attempting to configure it for
another band is not going to work without restarting the process.
The new variable is added in order to still allow POWEROFF followed by a
POWERON without need to reconfigure the device. In that case, previous
configuration is kept.

Change-Id: I43e5e1e4dcb36be605c6bd25dd6a5f3649e244e7
2021-09-21 17:24:18 +02:00
Pau Espin b9423b25b6 lms,uhd: Skip re-assigning same band
There's no need to spend time looking up again the same band
description.

Change-Id: I6f5631c9e64b9c261d52a856d757d08d2f336947
2021-09-21 17:24:18 +02:00
Pau Espin 069f5cd857 lms,uhd: Validate band of RxFreq too
So far the validation is only done on TxFreq for all TRX. Let's also do
it for RxFreq.

Change-Id: I30eef2727ee96b1344aa1416edd66e2302b88964
2021-09-21 17:24:11 +02:00
Pau Espin c90b207803 lms: Drop duplicated check
Same check is already done by set_band().

Change-Id: I48d14f35e83fa17d1a8f4154479f0a5cee0f816d
2021-09-21 13:48:20 +02:00
Pau Espin 985694175d computeCI: Document hardcoded multiplier
Logarithm change of base rule is used. Document it so it's clear where
it comes from.

Change-Id: Ia588e8dafda4e1abe0721f12491661949339a1ba
2021-09-03 13:52:02 +02:00