Commit Graph

280 Commits

Author SHA1 Message Date
Thomas Tsou fffd987f22 build: Set UHD driver as default configuration
Currently the default configuration is to not build the full
transceiver, which is pointless. Set the UHD driver, which
includes either Ettus or Fairwaves variants, as the default.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-04 10:23:24 -08:00
Thomas Tsou 17bbb9b755 Transceiver52M: Separate architecture specific files
Move x86 specific files into their own directory as this
area is about to get crowded with the addition of ARM
support.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-04 09:15:55 -08:00
Thomas Tsou a1a3ab4bab Transceiver52M: Update RSSI calculation
Use the same measurement method for RSSI as the noise level. Previous
method was to use the peak correlation amplitude relative to the
expected value. This created two very different amplitude approaches
between the noise measurement and RSSI measurement, which would
throw off the upper layer MS power control loop.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18 13:10:18 -04:00
Thomas Tsou fa3a787ccb Transceiver52M: Update noise measurement calculation
Previous removal of the energy detector requirement broke
the noise level calculation loop. The previous adaptive
approach was finicky - noticably at high gain levels. Since
we no longer use the energy threshold for primary burst gating,
we can return to a simpler world.

In the new approach, we compute a running average of energy
levels and track them with a noise vector. A timeslot that
passes the correlator threshold is a valid burst. These are
not used in the noise calculation. Everything else is
considered noise and used to compute the noise level with
respect to full scale input level, which for almost all
supported devices is 2^15.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18 13:10:18 -04:00
Thomas Tsou 010fff783b Transceiver52M: Move reference select from compile time to database
Enabling the external reference on UHD devices through the configure
time switch is awkward. Use a database variable "TRX.Reference" with
'0' or '1' value for internal and external references respectively.
Use internal reference is no entry is defined.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18 13:10:18 -04:00
Thomas Tsou 61b4a6ad9f Transceiver52M: Delay UHD messaging registration until after start
We want to push UHD logs to the OpenBTS logging system, but most
device errors occur at startup, so keep the output on stdout until
after device initialization. That way obvious errors are easily
viewable before seeing the useless TRX timeout message.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18 13:10:18 -04:00
Thomas Tsou de1648ca6b Transceiver52M: Deallocate high level resources on shutdown
This primarily addresses the error case at initialization.
In the event that the transceiver fails to start, we should
be able cleanly shutdown and release while providing a useful
reason for exiting.

After the radio is started and threads launched, there
are no thread state variables or shutdown messaging between
threads, and the transceiver cannot be consistently
shutdown. This issue remains to be solved.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18 13:10:18 -04:00
Thomas Tsou 3952d80d05 Transceiver52M: Reduce and place bounds checking on I/O buffers
Previous send and receive buffers at the radio interface were
arbitrarily set to a sufficient size. For normal (non-resampling)
devices, use a block (chunk) size of 625 samples. For 64 or 100
MHz resampling devices, use 4 times the reduced resampling
numerator or denominator and provide bounds checking where
appropriate.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18 13:10:18 -04:00
Thomas Tsou fe269fe31d Transceiver52M: Add 64 MHz resampling option with B100
Move B100 to the resampling interface with default
clocking. This temporarily resolves undetermined
FPGA clocking issues. This also provides extensible
support for multiple clocking rates and resampling
ratios.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18 13:10:18 -04:00
Thomas Tsou c064124429 Transceiver52M: Remove support for ancient libusrp versions
Current functionality with these old versions is questionable.
There is no reason to use any version of GNU Radio / libusrp older
than 3.3. Version 3.4.2 is the only recommended version for USRP1
users.

Non-USRP1 users must use UHD driver from Ettus Research.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18 13:10:17 -04:00
Thomas Tsou 69d14c9a14 Transceiver52M: Add B210 support
Identical to B200 support, but explicitly check for the device type
name.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18 13:10:17 -04:00
Thomas Tsou c1f7c42a33 Transceiver52M: Setup dual sample rate transceiver
This patch applies oversampling, when selected with 4 sps,
to the downlink only, while running the receiver with
minimal sampling at 1 sps. These split sample rates allow
us to run a highly accurate downlink signal with minimal
distortion, while keeping receive path channel filtering
on the FPGA.

Without this patch, we oversample the receive path and
require a steep receive filter to get similar adjacent
channel suppression as the FPGA halfband / CIC filter
combination, which comes with a high computational cost.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18 13:10:17 -04:00
Thomas Tsou 2c282f5e12 Transceiver52M: Generate delay filter with SSE memory alignment
This requires an additional memcpy() on the signal vector
constructor, but allows the interpolation filter to use
SSE optimzationed convolution.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18 13:10:17 -04:00
Thomas Tsou 92c16df875 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>
2013-10-18 13:10:17 -04:00
Thomas Tsou d5a80c3dc6 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>
2013-10-18 13:10:17 -04:00
Thomas Tsou dafb33700e 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>
2013-10-18 13:10:17 -04:00
Thomas Tsou 0e44ab360e 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>
2013-10-18 13:10:17 -04:00
Thomas Tsou 092f757ec2 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>
2013-10-18 13:10:17 -04:00
Thomas Tsou a57bc8a3b9 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>
2013-10-18 13:10:17 -04:00
Thomas Tsou 84c60f6679 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>
2013-10-18 13:10:17 -04:00
Thomas Tsou 865bca42d6 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>
2013-10-18 13:10:17 -04:00
Thomas Tsou c88d8d53f8 Transceiver52M: Add UmTRX support
Requires Fairwaves UHD driver.

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

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18 13:10:17 -04:00
Thomas Tsou 9ccd9f2c3c 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>
2013-10-18 13:10:17 -04:00
Thomas Tsou 8181b0104a 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>
2013-10-18 13:10:17 -04:00
Thomas Tsou 9471d7635a 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>
2013-10-18 13:10:17 -04:00
Thomas Tsou 03e6ecf977 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>
2013-10-18 13:10:17 -04:00
Thomas Tsou 3eaae80c90 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>
2013-10-18 13:10:17 -04:00
Thomas Tsou e57004d0c3 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>
2013-10-18 13:10:17 -04:00
Thomas Tsou 6aa1f18f41 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>
2013-10-18 13:10:17 -04:00
Thomas Tsou e5dcfc4f80 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>
2013-10-18 13:10:17 -04:00
Thomas Tsou 83e0689e76 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>
2013-10-18 13:10:04 -04:00
Thomas Tsou d24cc2cd96 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>
2013-10-18 13:04:15 -04:00
Thomas Tsou ddd6defb43 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>
2013-10-18 13:04:13 -04:00
Thomas Tsou 96794cb746 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>
2013-10-18 13:03:41 -04:00
Thomas Tsou 7e06806ff0 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>
2013-10-18 13:03:41 -04:00
Thomas Tsou cb69f08410 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>
2013-10-18 13:03:41 -04:00
Thomas Tsou 312e387630 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>
2013-10-18 13:03:41 -04:00
Thomas Tsou f2293b8cfa 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>
2013-10-18 13:03:41 -04:00
Thomas Tsou e3e8814948 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>
2013-10-18 13:03:41 -04:00
Thomas Tsou 02d88d1380 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>
2013-10-18 13:03:41 -04:00
Thomas Tsou b4cb4e23c0 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>
2013-10-18 13:03:41 -04:00
Alexander Chemeris d734e2d634 Fix build of the Transceiver. 2013-06-16 14:30:58 +04:00
ttsou fc40a84d9b Transceiver52M: Add more complete specification of GPRS types
Submitted by: Ivan Kluchnikov <kluchnikovi@gmail.com>
Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@5690 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-06-15 22:29:20 +04:00
ttsou 258855c758 Transceiver52M: Add GPRS combinations to correlation types
Submitted-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@5677 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-06-15 22:29:20 +04:00
ttsou bec41039bf Transceiver52M: Fix calculation of TS correlation for 2 sps and higher
The correlation starting point for normal burst training sequence
calculation should be a scaled value of the same symbol regardless
of the samples-per-symbol used. Use of 2 samples-per-symbols double
the index values, but yields the following outputs, which results
in a late time-of-arrival value at the output of the correlation.

This patch modifies the parameter calculation accordingly.

1 sps parameters

maxTOA = 3
spanTOA = 5;
startIx = 61;
endIx = 87;
windowLen = 26;
corrLen = 7;

2 sps parameters (errant case)

maxTOA = 6;
spanTOA = 10;
startIx = 112;
endIx = 184;
windowLen = 72;
corrLen =13;

2 sps parameters (corrected)

maxTOA = 6;
spanTOA = 10;
startIx = 122;
endIx = 174;
windowLen = 52;
corrLen =13;

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

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@5183 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-04-04 23:35:08 +00:00
ttsou 2064297aa8 Transceiver52: allow for handling of TCH/H slots
Although currently unsupported in GSM core, enable TCH/H
support in Transceiver52M for testing and future availability.

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

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@5169 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2013-03-27 22:00:25 +00:00
kurtis.heimerl 1a2d244c70 Correction of trivial warnings.
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4670 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-12-22 04:30:56 +00:00
ttsou d3564ff846 Transceiver52M: Read IP address and port to bind to from a configuration instead of hardcoding them.
Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4634 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-12-16 20:48:47 +00:00
ttsou 5298de12ee Transceiver52M: Properly pass samplerate to RadioDevice::make()
Without this patch, if SAMPSPERSYM is set bigger than 1, then
erratic behaviour will occur.

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

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4633 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-12-16 20:35:01 +00:00
ttsou e8dde02a66 transceiver52m: reset energy threshold on receive gain changes
The adaptive energy detection threshold does not scale relative
to signal level. In other words, the adjustment factor will be
the same whether the at 40% of signal level or 4%. If the receive
gain is reduced by a large amount, suppose 20 dB, the receiver
may take minutes to adjust to the new level.

When the receive gain is changed, reset the threshold back to
the initial level. This reduces issues of runtime gain adjustment
and prevents blocking bursts while the threhold level slowly
adjusts.

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

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4595 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-12-06 15:43:55 +00:00
kurtis.heimerl ec842de741 Alexander's patches:
1)I did an experiment and compiled OpenBTS with clang yesterday, which
immediately highlighted two potential bugs in the Transceiver52 code.
I'm not sure they are indeed bugs and not the intended behavior, but
they look very much like that. The first one is below and the second
one is in the following mail.

GSM::Time() arguments are defined like #define USB_LATENCY_INTRVL
(10,0), which means that they are expanded into GSM::Time((10,0)).
This expression is a GSM::Time() with a single parameter where (10,0)
return value of the last argument, 0 in this case. I.e.
GSM::Time((10,0)) is equivalent to  GSM::Time(0). I think this was not
the intention.

2) Printing \n after every complex number breaks output when you want to
print it in a single line, e.g. in many debug output.

I do not claim any copyright over this change, as it's very basic.
Looking forward to see it merged into mainline.

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4515 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-11-23 08:37:32 +00:00
ttsou f60dafa4ff Transceiver52M: UHD: Setup option to pass arguments from command line
UHD accepts optional 'args' that can be used for device descriptions
such as IP address, device type, etc. Allow these to be passed in on
the transceiver command line as the third argument (number of supported
carriers is the second argument). This option benefits those who may
have multiple UHD devices attached to a single system.

This option is not yet supported by GSM core and requires starting the
transceiver independently on the command line. This option has no
effect when USRP1 is used.

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

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4315 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-10-22 00:07:14 +00:00
ttsou 60dc4c9da4 transceiver: uhd: prevent output of underrun message at ERROR level
The appearance of underruns on B100 due to the latency transmit
window scares people. These should not be logged at ERROR level
because the events are generally not real errors. So use the same
behaviour of USRP1 of not logging these events. The presence of
underrun events can be determined by changes in the latency window
that is shown with log level set at INFO.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@3988 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-08-08 23:30:23 +00:00
ttsou 221f23ee44 transceiver: uhd: allow underrun flag to reset during timing alignment
Allowing the underrun flag to reset will prevent a single event from
causing large jumps in the transmit latency threshold. This should
keep unreasonable timing latencies from occurring (e.g. latencies of
20+ frames).

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@3981 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-08-08 00:51:34 +00:00
ttsou 2173abfe56 transceiver: b100: raise minimum transmit latency value
Put a floor on the transmit latency of the B100 in order to suppress
underruns in typical conditions. Empirical data from a handful of
relatively recent machines shows that the B100 will underrun when
the transmit threshold is reduced to a time of 6 and a half frames,
so we set a minimum 7 frame threshold.

The overall benefit should be marginal and may increase the
possibility of bursts arriving stale (after the trasmit deadline),
but will reduce the number of alarming UHD related messages that
appear in the log file.

This patch is UHD and B100 specific - USRP1 is unaffected.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@3980 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-08-08 00:51:31 +00:00
ttsou 711fdf6f81 transceiver, usrp1: fix transmit gain setting bug
Transmit gain setting would deceptively set the receive
gain instead. Since transmit attenuation is a combination
of RF gain and digital scaling, this major copy/paste bug
may have gone unnoticed by many users.

Reported-by: Robin Coxe <coxe@close-haul.com>
Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@3309 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-03-13 04:05:30 +00:00
ttsou 724eb36105 transceiver, uhd: output timestamps on monontonic error
The "Loss of monotonic time" error occurs when a timestamp
arrives from the device that is earlier in time than the
previous timestamp. The output is an ALERT level message
generally accompanied by a transmit side timeout from the
device.

UHD: Loss of monotonic time
UHD: Loss of monotonic time
UHD: Device send timed out

Add to the error description the timestamp values that
generated the error and output with ALERT rather than
ERR log.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@3307 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-03-13 02:20:01 +00:00
ttsou 3b5c0c1e91 transceiver, uhd: fix build error due to log level
Previous commit r3181 used a 2.6 logging level.

  ALARM->ALERT

Fix for 2.8 levels.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@3187 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-02-14 17:58:11 +00:00
ttsou 37720bebbc transceiver, uhd: display device information on make failure
The failure "UHD make failed" implies that a suitable device
was found, but construction failed. Output the the found
target device information along with message.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@3181 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-02-14 01:52:10 +00:00
ttsou b371ed54c7 transceiver, uhd: alert user on unrecoverable errors
Unrecoverable device errors include send and receive
timeouts and mangled packets. Other device errors, such
as non-monotonic timestamps are sometimes recoverable
through a soft restart.

These fatal are generally limited to development
versions of UHD driver or device firmware, but can occur
in release versions.

Alert user on such device errors along with current UHD
version.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@3012 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2012-01-09 18:11:34 +00:00
kurtis.heimerl 856bbbee2a Matching UHD changes in gnuradio
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2817 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-12-15 00:50:16 +00:00
kurtis.heimerl e33203208b transceiver52M: bump critial errors to ALERT level
Device errors regarding properties such as sample
rate or frequency tuning are almost always fatal and
lead to the common error "assuming TRX is dead".
Make sure that these errors are clearly presented to
the user.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2700 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-28 06:26:08 +00:00
kurtis.heimerl 4403d4ff7c transceiver, uhd: exit informatively if no devices are found
Perform a UHD device search before constructing the object,
and inform the user if no device is found.

No device found is the most common reason for the transceiver
to fail with the dreaded error "assuming TRX is dead".

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2699 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-28 06:26:04 +00:00
kurtis.heimerl 523ae5a69e transceiver, uhd: reject usrp1 if compiled with uhd support
This configuration is invalid because of FPGA based timestamp
support for the USRP1 in the UHD driver.

Kindly inform the user to recompile with libusrp support from
GNU Radio.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2698 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-28 06:26:01 +00:00
kurtis.heimerl ac0ee1289a transceiver, uhd: runtime check for setting master clock rate
Before setting the master clock rate, make sure that the
device is capable of being set. For now, assume that devices
that operate with default clock rates above 64 MHz,
specifically USRP2/N200/N210, cannot be set at 52 MHz.

Inform the user that these devices can be used with the
compile time option of host based resampling.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2697 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-28 06:25:58 +00:00
kurtis.heimerl 4ba47189f8 changing config scripts to explitly target UHD/USRP1
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2692 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:19:36 +00:00
kurtis.heimerl b99cbf384b transceiver, resamp: enlarge transmit resampler output buffer
It was possible to reach a state where a resampled burst would
overrun the transmit output buffer and corrupt the global
allocated signal vectors. The result was a segmentation fault
when attempting to access heap allocated signal vectors since
the pointers were garbage.

Whether the segfault occured or not appears to depend on the
memory location of the signal vector pointers, since it does
not occur on all systems.

Double buffer size to accomodate an incoming burst plus up to
a full chunk that may be remaining from the previous resampling
operation.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2691 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:19:33 +00:00
kurtis.heimerl 66ad2db373 transceiver: enable USRP1 firmware binary install
Not sure why this functionality is commented out.

Make install places the FPGA firmware image in:

  /usr/local/share/usrp/rev2/
  /usr/local/share/usrp/rev4/

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2690 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:19:31 +00:00
kurtis.heimerl a198d45539 transceiver, resamp: insert missing filter values
With transceiver integration, the resampling filter files were
dropped. This created a working resampling implementation for
the USRP2 / N200, but with spectrum irregulaties that likely
caused issues at longer range operation. Simply reinsert the
filter files and modify the filter initialization to use them.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2689 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:19:28 +00:00
kurtis.heimerl e417c5a28e transceiver: uhd: increase log level on constructor errors
Exceptions on make are major no-start conditions. Make these
errors more apparent.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2688 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:19:25 +00:00
kurtis.heimerl 3758b16aa4 transceiver: usrp1: select single dboard use at compile time
The following option selects single daughterboard use on
side A only. Otherwise, the default setting is TX on A and
Rx on B.

  ./configure --with-singledb

Other options are possible, as per the following enum, but
for simplicity with configure options, there are only two
choices.

  enum dboardConfigType {
    TXA_RXB,
    TXB_RXA,
    TXA_RXA,
    TXB_RXB
  };

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2687 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:19:22 +00:00
kurtis.heimerl c6b9b7014f transceiver: uhd: make external reference a compile time option
External reference selection was already compile-time
determined by a hard coded value. Make it selectable
as a configure option.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2686 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:19:19 +00:00
kurtis.heimerl d3d4af3b4d uhd: increase initial transmit transport latency
For network based devices (USRP2, N200, etc.), increase the
latency from 2 to 3 frames, which effectively buffers more
samples on the host in front of the Ethernet interface.

USB devices (USRP1 and B100) utilize an adaptive mechanism
so they are less effected by this value.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2685 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:19:16 +00:00
kurtis.heimerl 67e3d5ad87 transceiver: update main to non-device specific interface
The low-level RadioDevice interface is agnostic to libusrp
or uhd based devices. 'make' allocates and returns a
pointer to a generic RadioDevice implemented for whatever
class of device determined at compile time.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2684 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:19:13 +00:00
kurtis.heimerl 4e59d6630b transceiver: update to log messages to work with P2.8
Log level changes in P2.8:

    ERROR     -> ERR
    WARN      -> WARNING
    DEEPDEBUG -> DEBUG

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2683 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:19:11 +00:00
kurtis.heimerl 75336d9dee build: insert autofoo for usrp transceiver and options
Usage:

  ./configure --with-usrp1

  Enable non-UHD USRP1 support through the gnuradio-based
  driver. Requires gnuradio (libusrp) to be installed.

 ./configure --with-resample

  Enable host-based 400ksps to 270.833ksps resampling.
  Only supported for UHD devices. If not enabled, the GSM
  sample rate is requested directly from the device.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2681 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:19:05 +00:00
kurtis.heimerl 3998da7577 transceiver: add a newline for uhd information outputs
Minor change to clarify the logging output.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2679 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:19:00 +00:00
kurtis.heimerl b7358ce438 transceiver: reject usrp1 if detected using uhd
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2678 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:18:57 +00:00
kurtis.heimerl e380af3ecc transceiver: make the transmit drive loop bus dependent
With the introduction of the B100, there is USB support
using UHD devices. The characteristics of the trasmit
side burst submissions are more reflective of the bus
type than the device or driver.

Use a fixed latency interval for network devices and the
adaptive underrun approach for USB devices - regardless
of driver or device type.

The GPMC based transport on the E100 appears unaffected
by either latency scheme, which defaults to network.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2677 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:18:55 +00:00
kurtis.heimerl 0803ad9ad9 transceiver: reroute uhd messages to logging facility
Pipe the following uhd message types to standard warning
levels (INFO, WARN, ERROR) respectively. Ignore fastpath
logging messages and, instead, catch them from the
asynchronous device interface.

    enum type_t{
        status  = 's',
        warning = 'w',
        error   = 'e',
        fastpath= 'f'
    };

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2676 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:18:51 +00:00
kurtis.heimerl 543540406c transceiver: clean variable init of radio interface constructor
Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2675 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:18:49 +00:00
kurtis.heimerl e724d6d53d transceiver: move various radio interface definitions
Move them out of the interface file - primarily for
readability.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2674 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:18:46 +00:00
kurtis.heimerl 0628613f4f transceiver: rename getting radio vector time to getTime()
Small name change to match setTime for a get/set pair.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2673 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:18:43 +00:00
kurtis.heimerl ce31733860 transceiver: add option for host based resampling
The resampling transceiver is unified with the 52MHz
version. The option to resample 400ksps from the device
to a GSM appropriate 270.833ksps is enabled at compile
time with the following option.

   ./configure --with-resamp

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2672 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:18:39 +00:00
kurtis.heimerl 513a629183 uhd: keep reading on overrun or other non-fatal errors
The readSamples call does not return less than the
number of samples requested. Doing otherwise is a
fatal error. So on overruns, which are not fatal,
continue reading until the requested number of
samples is received.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2671 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:18:36 +00:00
kurtis.heimerl 9b557835d5 transceiver: separate I/O portion of radio interface implementation
Move push and pull of buffers into a dedicated file. This will
allow us to swap out resampling, non-resampling, and possibly
floating point device interfaces while presenting a single
floating point abstration in the interface itself.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2670 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:18:34 +00:00
kurtis.heimerl 8aea56e15f transceiver: separate radio clock and vector interfaces
Remove radio clock and vector interfaces into their own
files. This clears up and simplifies the radio interface
and, additionaly, prepares for a further split of the I/O
portion for optional resampler use.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2669 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:18:30 +00:00
kurtis.heimerl 119ca9ca07 transceiver: uhd: update copyright header
Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2668 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:18:26 +00:00
kurtis.heimerl 1979c6f155 transceiver: minor cleanup of sample type sizing in uhd
A small simplification of buffer indexing and sizing.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2667 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:18:24 +00:00
kurtis.heimerl be1decc0d2 transceiver: remove extraneous comments
These lines are virtually never enabled.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2666 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:18:21 +00:00
kurtis.heimerl 3b8ad24efd transceiver: remove extra typedefs to remove warnings
These typedefs serve no purpose and the compiler complains.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2665 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:18:19 +00:00
kurtis.heimerl 26ca5bc2d2 uhd: remove external clock polarity setting
Unused and causes the follwing errors on certain UHD versions.

"ValueError: unhandled clock configuration reference source: _external_"

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2664 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:18:16 +00:00
kurtis.heimerl d3e2590e9b uhd: verify setting of master clock rate
If the master clock rate fails to set - this basically only happens
when the wrong transceiver is choosen for the particular device -
the error is fatal and the transceiver should exit. The clock rate
setting was previously never verified.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2663 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:18:13 +00:00
kurtis.heimerl 16c654043c transceiver: fix bug in setting low-level attenuation
This patch fixes some confusion in gain vs. attenuation
setting. The UHD device is controlled through gain
settings but OpenBTS represents gain in terms of
attenuation relative to maximum - 0 dB attenuation.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2662 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:18:11 +00:00
kurtis.heimerl 2b28c696f8 uhd: remove uhd type argument
UHD recently modified the E100 type name from 'usrp-e' to
'e100' causing the device make to fail. Remove device type
checking to keep things working with the older and newer
names.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2661 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:18:08 +00:00
kurtis.heimerl ee5347af40 transceiver: reinsert digital gain scaling
Commit e161523c (transceiver: simplify transmit power control)
changed transmit gain control to RF setting only. This was
appropriate for a WBX board with 25 dB of gain control, but
inappropriate for an RFX with fixed transmit gain.

RFX boards will regain the ability to set transmit
attenuation. Since gain is set on the RF side first,
reintroducing digital gain settings should have limited
overall effect on non-RFX daughterboards.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2660 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:18:05 +00:00
kurtis.heimerl 495d3c8b0c uhd: flush receive buffer should return true on timeout
Receive buffer flush should continue to read until
either the desired number of packets has been read or
timeout, which means that the buffer has been emptied.
These are expected behaviours and should return true.

Ignore errors at this stage as the data and associated
metadata can be considered garbage and not worth
reporting. Actual error conditions will be caught
further downstream when useful data comes in.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2659 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:18:02 +00:00
kurtis.heimerl b9e237e83e usrp1: fix transmit side tuning bug
Transmit tuning was primarily setup for side A only. Some boards
- WBX - would still tune with improper channel arguments, though
receiver performance was disrupted.

Previous testing was primarily with single board on side A only
or dual configuration with side A transmit, so this bug largely
went undetected. Patch tested with RFX and WBX daughterboards
in single and dual configurations sides A and B.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2658 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:59 +00:00
kurtis.heimerl c3c7c3e23d usrp1: fix typo in rx gain setting log message
Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2657 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:57 +00:00
kurtis.heimerl 6cb348b9a1 uhd: log asynchronous errors as errors
Bump abnormal asynchronous events - basically send errors -
up to ERROR level. These errors are dominated almost
entirely by underflow events, which should not be regularly
occuring.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2656 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:54 +00:00
kurtis.heimerl 3ed6fb7755 transceiver: fix energy threshold bug
If no bursts were received over a long enough duration
then the threshold would roll into negative territory.
The energy detection is based on a comparison with the
squared threshold, so all handsets would become
effectively barred after a certain period of
inactivity.

In theory, this bug also exists in the mainline tree,
but there the daughterboard receive gain is fixed at
max, which always allows the ADC to generate sufficient
noise to trigger the energy dectector and keep the
system in a valid steady state.

To fix, simply add a negative value check like those
already in place for other locations.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2655 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:52 +00:00
kurtis.heimerl 7ac54b10d3 transceiver: simplify transmit power control
UHD will internally accept floats with a range of +/-1.0,
which corresponds to a 16-bit signed integer range of
apporximately +/- 32000. Set the default amplitude to .3,
which is a safe value agaist saturation elsewhere in the
transmit chain.

The non-UHD maximum amplitude is unchanged at 13500.

Remove digital gain control because it's unnecessary and
causes extra load on enbedded systems.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2654 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:49 +00:00
kurtis.heimerl d4be074ea6 uhd: reorganize error handling, exit when non-recoverable
This is primarily a minor refactor with the exception
of non-recoverable errors - notably if the receive times
out - which almost always requires a reload of the FPGA.
In these cases, quit without trying as resistance is
futile.

ERROR_TIMING:          Soft restart of streaming
ERROR_UNHANDLED:       Benign errors
ERROR_UNRECOVERABLE:   Abandon ship

Non-recoverable behaviour has not been observed in recent
builds, but may exist in older (or future) configurations.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2653 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:46 +00:00
kurtis.heimerl 13074c9d42 uhd: enable automatic alignment updates
Overnight testing shows that this shouldn't be required
in the majority of cases, but shit happens. Enabling
this forces transmit timing realignment at one minute
intervals. As a fallback method, timing slips not
caught by normal checks will be reset at the update.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2652 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:43 +00:00
kurtis.heimerl 187b03d847 uhd: cleanup startup timestamp alignment
At startup, instead of flushing initial packets blindly,
send a stop streaming command, flush, and start. The same
procedure is used in the event of a runtime timestamp
validity error.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2651 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:40 +00:00
kurtis.heimerl 58d6a01b50 transceiver: rework digital gain settings
The output of the modulator or resampler is scaled and
converted from floating point to fixed point. The scaling
factor is the leftover dB in RF attention (relative to max
transmit power), which is handled prior to the integer
conversion. This should work across all daughterboards and
non-UHD installations.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2650 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:38 +00:00
kurtis.heimerl d1ae0cd2b9 uhd: set attenuation relative to max RF gain
Previously this was referenced off the the ad9862
PGA with a range from 0 to -20 dB. Instead base
the attenuation factor on the maximum total RF
gain returned by the device.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2649 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:35 +00:00
kurtis.heimerl 41f708b9a0 uhd: disable adaptive buffering in 52 MHz transceiver
Similar to the non-52 Mhz case,

589dd9091ef594ef6ef5804fbf6bfa70f3f02858

This drastically reduces underruns on the E100.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2648 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:32 +00:00
kurtis.heimerl 68292106af uhd: rework handling of timestamp errors
On a lapses of time monotonicity (and possibly other errors),
stop and restart the receive streaming with a buffer flush
in between. This is a cleaner replacement to the previous
clock reset with that didn't attempt to stop steaming.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2647 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:28 +00:00
kurtis.heimerl c7cb817cb1 uhd: fix timestamp conversion bug on 32-bit architectures
Type size_t was used in the UHD time_spec_t to integer
conversion, which would overflow at roughly 4 and a half
hours causing the sample buffer to error on timestamp
validity. Builds where size_t takes on 64-bits were not
affected by this bug.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2646 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:26 +00:00
kurtis.heimerl a14d4beb1a uhd: reset sample clock when time goes non-monotonic
With UHD b4fc0d61bb6cbd1a5614745bab9aeb0abc22cb6f

Sample clock will reset to zero after an overrun. Earlier
versions may hang the FPGA, which is non-recoverable,
requiring a manual image reload or reboot.

If reset to zero, attempt to kick the sample clock to the
last properly received timestamp value. At this point,
there will be a timing continuity jump, which will drop
connections, but transmit and receive chains should be
aligned allowing for re-establishment.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2645 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:23 +00:00
kurtis.heimerl 6b495a5218 uhd: inline thread priority setting
Push the ability to set thread priority out to the 52M
Transceiver interface, because that's where the thread
control exists.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2644 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:21 +00:00
kurtis.heimerl 24481decc2 uhd: move static functions into the uhd_device class
Simplifies things slightly, and this is supposed to be
C++ after all.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2643 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:18 +00:00
kurtis.heimerl d936400b8c uhd: allow the non-uhd to still compile unchanged
The missing methods are not implemented and simply return. They
didn't exist in the first place.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2642 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:15 +00:00
kurtis.heimerl db2aae579c uhd: move non-52MHz transceiver to common radio device interface
Use the same header files for the device and start moving
toward a commmon transceiver without so much redundant code.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2641 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:13 +00:00
kurtis.heimerl 02d04055a3 uhd: set and shadow settings through interface
Shadow all gains and frequencies, which minimizes device access.
This allows the transceiver to variably control the device
settings.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2640 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:10 +00:00
kurtis.heimerl 993364485b uhd: set receive gain during initialization
This shouldn't matter much, but the gain settings through the
interface are short circuited right now, which makes this a
problem.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2639 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:07 +00:00
kurtis.heimerl be6abe18cc uhd: set hardware side delay offset for e100
The value is used to align transmit and receive time slots within
a sample. This oscilloscope measured value is close, but may
need minor tweaking.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2638 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:05 +00:00
kurtis.heimerl 3cc1da9d8b uhd: log useful information on monotonic errors
Track the current errant and previous timestamp values.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2637 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:02 +00:00
kurtis.heimerl c491997c1e uhd: only the E100 supports FPGA timestamps and adjustable clock rate
Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2636 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:17:00 +00:00
kurtis.heimerl 33f748f265 uhd: flush initial receive samples
Occasionally, the E100 will have errant timestamps at start
related to previous sessions. Early packets will be thrown
out anyways, so do this explicitly so the timestamps don't
royally fuck up the sample timing.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2635 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:16:57 +00:00
kurtis.heimerl 965e757c53 uhd: add 52 MHz transceiver support
These are mostly identical changes as added to the non-52MHz
implementation with the exception of sample rate.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2634 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:16:54 +00:00
kurtis.heimerl d302868b13 uhd: remove extra type conversion
Type conversion, if necessary, should happen inside the device.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2633 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:16:51 +00:00
kurtis.heimerl 79e71c925e Transceiver52M: add WBX, DBSRX, and single board support
Remove all RFX specific parts and control daughterboard
functionality using the base API. The tuning is now set
to a non-inverted image so remove the I/Q swap as well.

Daughterboard configuration is set through an enum
variable. Currently, there is no auto-configuration and
the default is Tx/RX on sides A/B respectively. For
transceiver boards the receive antenna is set to RX2.

enum dboardConfigType {
  TXA_RXB,
  TXB_RXA,
  TXA_RXA,
  TXB_RXB
};

const dboardConfigType dboardConfig = TXA_RXB;

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2632 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:16:48 +00:00
kurtis.heimerl f5eef205a7 transceiver: fix initialization segfault in radio interface
'loadTest' variable was never initialized sometimes causing
segmentation fault on transceiver startup.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2631 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26 03:16:45 +00:00
kurtis.heimerl c8739b8b71 Reverting r2342
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2424 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-02 00:06:34 +00:00
hsamra 3ebf98c721 Updates to working with a single RFX...builds but not working yet.
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2342 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-10-14 02:32:19 +00:00
dburgess 0fd55ea482 Removed a Makefile that should not have benn checked in.
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2313 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-10-12 08:15:48 +00:00
dburgess 00de66004b Changes to auto-foo files that should probably be removed anyway.
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2312 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-10-12 08:14:47 +00:00
dburgess b3a0ca42db Adding in the missing Transceiver52M directory
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2307 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-10-12 07:44:40 +00:00