Commit Graph

397 Commits

Author SHA1 Message Date
Thomas Tsou
efdcd66a2f Transceiver52M: Separate main transmit and receive drive threads
This patch primarily addresses observed repeated overrun
conditions in embedded environments - namely ARM.

The heartbeat of the transceiver is derived from the receive
sample stream, which drives the main GSM clock. Detach the
transmit thread from the receive loop to avoid interfering with
the receive I/O, which is sensitive to overrun conditions if
pull process is interrupted.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6745 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:18:56 +00:00
Thomas Tsou
97d44b5d60 Transceiver52M: Disable equalization
Unsupported at 4 sps, and performance benefits remain
to be proven at 1 sps. Disable until further testing.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6744 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:18:53 +00:00
Thomas Tsou
914fe4e164 Transceiver52M: Reduce RACH and TSC correlation windows
Start the correlation search window at 4 symbols before
the expected correlation peak. End the search at 10
symbols and 4 + maximum expected delay for RACH and TSC
bursts respectively.

This change lowers receive side cpu utilization while
maintaining reasonable timing jitter and accuracy tolerance.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6743 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:18:49 +00:00
Thomas Tsou
4bd5f6e64a Transceiver52M: Narrow resampling filter bandwidth
This patch only applies to resampling use at 4 samples-per-symbol.
By extention that means only USRP2 / N2xx devices are affected.
At 4 samples-per-symbol we restrict output bandwidth to roughly
roughly 700 MHz, which combined with the 2 pulse Laurent
approximation yields < 0.5 degrees of RMS phase error at the
resampler output.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6742 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:18:46 +00:00
Thomas Tsou
b8ad607382 Transceiver52M: Add B200 support
Set master clock rate to 52 MHz for B200. Also, we want to avoid
floating point comparison errors on clock rate settings, but we
expect to be able really set the rates we specify. Set the
offset limit to 1 Hz. If we can't set our rates with that level
of precision, then something is wrong.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6741 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:18:43 +00:00
Thomas Tsou
43d3fcfa76 Transceiver52M: Setup dual Laurent pulse shaping filter
Provides substantially improved transmit phase error
performance when enabled. Requires use of 4 samples
per symbol, and is enabled by default when set.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6740 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:18:39 +00:00
Thomas Tsou
58d1896ae8 Transceiver52M: Check that sample rates are sane before using
If there is an error in the sample rate determination, noted
by a negative return sample rate value, error directly and
don't try to set the device rate.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6739 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:18:36 +00:00
Thomas Tsou
abc5f65b0e Transceiver52M: Refactor RACH and normal burst detection
Both RACH and normal bursts are detected with the same approach of
midamble correlation combined with peak-to-average ratio. The
difference is the midamble placements and lengths. Thus, there is
no reason to have independent implementations.

This patch creates a common call burstDetect(), while leaving the
correlation window indexing in the original calls.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6738 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:18:32 +00:00
Thomas Tsou
e6d3c22c56 Transceiver52M: Add UmTRX support
Requires Fairwaves UHD driver.

  https://github.com/chemeris/UHD-Fairwaves.git

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6737 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:18:29 +00:00
Thomas Tsou
d2193d4c18 Transceiver52M: Add 4 samples-per-symbol Laurent pulse shape
When 4 samples-per-symbol operation is selected, replace the
existing pulse approximation, which becomes inaccurate with
non-unit oversampling, with the primary pulse, C0, from the
Laurent linear pulse approximation.

Pierre Laurent, "Exact and Approximate Construction of Digital Phase
  Modulations by Superposition of Amplitude Modulated Pulses", IEEE
  Transactions of Communications, Vol. 34, No. 2, Feb 1986.

Octave pulse generation code for the first three pulses of the
linear approximation are included.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6736 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:18:26 +00:00
Thomas Tsou
1d7e468b06 Transceiver52M: Disable energy detector
The adaptive energy threshold gating suffers a near-far problem
at certain gain levels. This is due to exponential threshold
raising, but linear decreases. A large signal level followed by
a period low signal level causes (comparatively) weak signals to
go undetected. Additionally, the algorithm performs differently
at multiple RF gain levels.

This patch switches solely to correlation based gating for burst
detection. The main computational load with this approach is
sub-sample width peak interpolation, which we disable for intial
detection and run after threshold passing.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6735 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:18:22 +00:00
Thomas Tsou
7251140a21 Transceiver52M: Add SSE floating point / integer conversion
Convertions are performed in multiples of 4 or 8. All loads are
considered unaligned.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6734 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:18:18 +00:00
Thomas Tsou
9dbadffcc5 Transceiver52M: Replace resampler with SSE enabled implementation
Replace the polyphase filter and resampler with a separate
implementation using SSE enabled convolution. The USRP2 (including
derived devices N200, N210) are the only supported devices that
require sample rate conversion, so set the default resampling
parameters for the 100 MHz FPGA clock. This changes the previous
resampling ratios.

  270.833 kHz -> 400 kHz      (65 / 96)
  270.833 kHz -> 390.625 kHz  (52 / 75)

The new resampling factor uses a USRP resampling factor of 256
instead of 250. On the device, this allows two halfband filters to
be used rather than one. The end result is reduced distortial and
aliasing effecits from CIC filter rolloff.

B100 and USRP1 will no be supported at 400 ksps with these changes.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6733 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:18:14 +00:00
Thomas Tsou
00d6835d72 Transceiver52M: Replace convolve and related calls with SSE implementation
This large patch replaced the convolve() call with an SSE vector
enabled version. The lower C and SSE intrinsic based code operates
on fixed and aligned vectors for the filter taps. The storage format
of interleaved I/Q for both complex and real vectors is maintained.

SSE filter tap values must:

  1. Start 16-byte aligned
  2. Number with a multiple of 4 between 4 and 20 for real taps
  3. Number with a multiple of 4 for complex taps

Non-compliant values will fall back to non-SSE usage. Fixed length
iterators mean that head and tail cases may require reallocation of
the input vector, which is automatically handled by the upper C++
interface.

Other calls are affected by these changes and adjusted or rewritten
accordingly. The underlying algorithms, however, are unchanged.

  generateGSMPulse()
  analyzeTrafficBurst()
  detectRACHBurst()

Intel SSE configuration is automatically detected and configured at
build time with Autoconf macros.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6732 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:18:09 +00:00
Thomas Tsou
9887f4a179 Transceiver52M: Generate RACH correlation sequence at initialization
There is no temporal dependency on when the RACH sequence is generated,
so there is no need for transceiver to create it in response to a
command from GSM core. If we power on the transceiver, we will need
the RACH sequence, so just allocate it during initialization.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6731 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:18:04 +00:00
Thomas Tsou
969ed83431 Transceiver52M: Remove logging from signal processing core
The only logging outputs in the the signal processing library
are debug lines that generate copious amounts of output while
providing little useful information to the user. The relevant
information (time-of-arrival, channel gains, etc.) can and
should be logged from transceiver instance itself.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6730 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:18:00 +00:00
Thomas Tsou
c48eb33e78 Transceiver52M: Add destructors to correlation seqeunce objects
Add destructor calls so we can avoid the nested vector deallocations.
Also remove the unnecessary pointer NULL checks prior to destruction.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6729 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:17:57 +00:00
Thomas Tsou
20e44cb379 Transceiver52M: Make GSM pulse filter internal to implementation
There is no reason expose the pulse shaping filter outside of the
signal processing calls. The main transceiver object makes no use
of the filter and there's no reason to pass it around.

Initialize the pulse shape with the signal processing library, and
maintain an internal static member like many of the other library
variables. Similarly destroy the object when the library is closed.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6728 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:17:53 +00:00
Thomas Tsou
ecc81ab384 Transceiver52M: Rename samples-per-symbol variable names
Because repeatedly typing mSamplesPerSymbol is giving me
carpal tunnel syndrome. Replace with the much shorter,
easier to type, and just as clear name of 'sps'.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6727 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:17:50 +00:00
Thomas Tsou
98ebd4963d Transceiver52M: Verify global config sanity before using
The configuration table is instantiated as a global variable with
no means to check constructor status. This means various types
of database failure conditions (e.g. file existence, permissions,
etc.) are not reported. This patch performs a small number of
checks to make sure that the configuration is sane.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6726 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:17:45 +00:00
Thomas Tsou
b6168292a2 Transceiver52M: Remove unused test code from main
The commented out test code is not maintained and behaviour is
unknown. Remove for clarity.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6725 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:17:42 +00:00
Thomas Tsou
83d8630c1b Transceiver52M: Use exception blocks for rate changes
UHD will throw if something goes awry in these sensitive sections,
so we should catch and shutdown gracefully. There is no recovery
if we can't set rates.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6724 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:17:39 +00:00
Thomas Tsou
0e0c81de63 Transceiver52M: Set resampling option automatically based on device
Remove the built time resampling selection and link both options.
Move the normal push/pullBuffer() calls back to the base class and
overload them in the inherited resampling class.

USRP2/N2xx devices are the only devices that require resampling so
return that resampling is necessary on the device open(), which is
the point at which the device type will be known.

The GSM transceiver only operates at a whole number multiple of
the GSM rate and doesn't care about the actual device rate and
if resampling is used. Therefore GSM specific portion of the
transceiver should only need to submit the samples-per-symbol
value to the device interface.

Then, the device should be able to determine the appropriate
sample rate (400 ksps or 270.833 ksps) and if resampling is
appropriate.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6723 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:17:35 +00:00
Thomas Tsou
c9668c3d66 Transceiver52M: Remove and rename oversampling variables
The transceiver only uses a single integer oversampling value,
which is more simply referred to as samples-per-symbol.

mRadioOversampling --> mSPS
mTransceiverOversampling (removed)

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6722 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:17:30 +00:00
Thomas Tsou
d6515f2613 Transceiver52M: Remove periodic alignment update from UHD build
Periodic timing alignment should never be required for UHD devices,
though the mechanism was used as a fallback mechanism should UHD
not properly recover after an underrun - as may occur in old
003.003.000 based revisions. This issue is not a concern in more
recent UHD releases and deprecates this code for legacy USRP1
use only.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6721 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:17:27 +00:00
Thomas Tsou
2ac6abd3b6 Transceiver52M: Add device offset correction table
Previously, two timing correction values were used for UHD devices
depending on the sample rate of 270.833e3 or 400e3 for native GSM or
resampled device rate respectively. The correction values compensate
for residual timing effects due to analog component delays, filters
lag times, and general fudge factors. These values are device
specific and over-generalized by the two value configuration.

This patch adds the following struct to store these correction
values by device type and sample rate - through samples-per-symbol.

struct uhd_dev_offset {
        enum uhd_dev_type type;
        int sps;
        double offset;
};

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6720 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:17:23 +00:00
Thomas Tsou
c9c9000d07 Transceiver52M: Add UHD device type checking
UHD device type was previously detected, but only categorized in
terms of bus type, USB or Ethernet, and sample rate capability.
With the number of supported device increasing, we can no longer
easily group devices since we need to handle more and more
device-specific peculiarities. Some of these factors are managed
internally by the UHD driver, but other factors (e.g. timing
offsets) are specific to a single device.

Start by maintaining an enumerated list of relevant device types
that we can use for applying device specific operations. Also
rename the USB/Ethernet grouping to transmit window type because
that's what it is.

enum uhd_dev_type {
        USRP1,
        USRP2,
        B100,
        NUM_USRP_TYPES,
};

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6719 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:17:19 +00:00
Thomas Tsou
360ba2f1f8 Transceiver52M: Update to UHD streamer interface
This patch is long overdue and can now be merged after better understanding
of timestamp stability issues. UHD tick / timespec conversions were
generally used with the streamer interface, though these calls are actually
independent change sets. The combination would lead to internal rounding
errors and a timing drift most notably on B100 running at GSM symbol
rate multiples. There are no known issues, however, with the streamer code
itself.

The aforementioned issue was discovered in test code only, which was never
merged to mainline.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6718 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-17 06:17:14 +00:00
Kurtis Heimerl
b0ea928994 r6605 in private:
Dont POWERON the radio before it is inited.
Suppress some irrelevant gcc warnings.



git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6715 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-16 02:07:39 +00:00
Kurtis Heimerl
ff99b37721 Missed this path change
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6712 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-15 06:23:48 +00:00
Kurtis Heimerl
d4d880d4b0 Reverting libortp requirement until I can figure out how it maps to debian land
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6711 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-15 04:00:58 +00:00
Kurtis Heimerl
a09fa74532 should not install to a set home directory
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6710 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-15 02:48:38 +00:00
Kurtis Heimerl
e6ce2cfa55 Martin Hauke's build/typo bug fixes
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6698 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-11 19:47:27 +00:00
Kurtis Heimerl
ea6659c604 increasing watchdog timer range as a workaround
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6628 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-03 17:38:54 +00:00
Kurtis Heimerl
8006dd55ff Default to non-RAD1 setups.
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6617 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-10-02 01:54:16 +00:00
Michael Iedema
7a5d549aa5 - reinstate runloop as quite a few installs might be depending on it
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6508 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-09-19 05:24:50 +00:00
Michael Iedema
ef1d68e0bb - add missing CLI script so debian packages build properly again
- ignore some stuff


git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6496 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-09-18 09:01:55 +00:00
Kurtis Heimerl
9757b7bc1e Missed some stuff. Suggested by Chris Newman
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6402 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-09-05 05:49:56 +00:00
Kurtis Heimerl
f610e7a270 removed /var/run/OpenBTS stuff
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6303 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-08-24 06:20:45 +00:00
Kurtis Heimerl
b288d5c7ff stepping down from alert to warning to reduce tension from users of UHD devices
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6192 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-08-15 23:32:59 +00:00
Kurtis Heimerl
6dfce1265c ortp 0.20 compat
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6191 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-08-15 23:23:42 +00:00
Kurtis Heimerl
cbd9157c38 missed the removal of old transceivers
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6169 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-08-14 00:54:30 +00:00
Kurtis Heimerl
5289a229d9 sync of openbts
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6168 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-08-14 00:52:14 +00:00
Kurtis Heimerl
1baba59e14 added conflicts to control, do not install public/private concurrently!
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@5905 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-07-09 07:29:50 +00:00
Kurtis Heimerl
2ada18a775 cleaned up makefiles, and now can is confflags="--with-uhd" dpkg-buildpackage -B to build the uhd version. There's still an issue with linking uhd though, I have to test on a real install.
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@5904 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-07-09 07:22:26 +00:00
Kurtis Heimerl
7466de849a OpenBTS working now
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@5903 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-07-09 05:14:42 +00:00
Kurtis Heimerl
a737b586d3 fixed some compatibility issues
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@5900 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-07-09 05:14:09 +00:00
Kurtis Heimerl
01b412379e smq debian packaging files
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@5896 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-07-07 07:37:02 +00:00
Kurtis Heimerl
8f5c064961 First pass at adding debian package building scripts
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@5895 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-07-07 07:36:54 +00:00
Kurtis Heimerl
826c4f655f removing extraneous sqlite3 calls
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@5840 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-07-01 05:30:23 +00:00