Commit Graph

325 Commits

Author SHA1 Message Date
Alexander Chemeris e171425b99 uhd: Set RF frontend bandwidth for UmTRX to improve signal quality.
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-05-18 16:49:05 -07:00
Alexander Chemeris 4d029d8965 UmTRX: Manually set Tx gain stages for the best signal quality.
New UHD versions support split configuration of Tx gain stages.
We utilize this to set the gain configuration, optimal for
the Tx signal quality. From our measurements, VGA1 must be
18dB plus-minus one and VGA2 is the best when 23dB or lower.

Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-05-18 16:48:17 -07:00
Tom Tsou 6613331459 build: Provide option for disabling SSE autodetection
Setup '--with-sse' option to check system capabilities by default, but
allow disabling by the user. Selective SSE build options can be
controlled by the user by defining specific HAVE_SSE options.

Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-05-18 16:35:44 -07:00
Tom Tsou 577cd020c1 sigproc: Add clipping detection on RACH and TSC input
Alert user of overdriven burst input indicated by a positive
threshold detector result. This indication serves as notification
that the receive RF gain level is too high for the configured
transceiver setup.

Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-05-18 16:35:35 -07:00
Alexander Chemeris 88bbf1aafd uhd: Use full DAC scale with UmTRX to improve signal quality.
Signed-off-by: Tom Tsou <tom@tsou.cc>
2015-05-18 16:35:25 -07:00
Tom Tsou 2cc2ddda41 build: Add 'subdir-objects' to AM_INIT_AUTOMAKE
This will shutup automake and make it stop complaining about the
following subdirectory warnings.

"warning: source file 'common/fft.c' is in a
subdirectory, but option 'subdir-objects' is disabled"

Signed-off-by: Tom Tsou <tom@tsou.cc>
2015-05-18 16:35:13 -07:00
Tom Tsou d7610cf0b8 radioInterface: Reset sample buffer cursors on each start
Non-zero buffer indices may lead to uplink/downlink timing offset
during repeated start/stop cycles. Mainly affects USRP2 and other
resampled devices that rely on the buffer to absorb sample block
sizes that are not multiples of the burst size.

Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-05-07 17:47:17 -07:00
Tom Tsou 722d4f70a4 usrp1: Update device API for frequency offset tuning
Commit 8e17df7374 "Add option for baseband frequency offset",
modified the base device API to allow for RF tuning, which was never
updated for the USRP1.

Update the implementation to match the API, however, note actual offset
in the USRP1 remains unsupported.

Signed-off-by: Tom Tsou <tom@tsou.cc>
2015-01-19 09:59:41 -08:00
Tom Tsou 93b7f37309 b210: Lock dual-channel tuning access
Frequency tuning is a multi-step process with RF and DDC/DUC protoimns
that can be corrupted if both channels attempt to tune at the same time.

Signed-off-by: Tom Tsou <tom@tsou.cc>
2014-12-15 20:25:27 -08:00
Tom Tsou 4ad9ea69ab Transceiver52M: Add X300/X310 and E310 USRP support
Treat X300 similar to N200 and resample with 100 MHz base clocking,
which provides some amount of oversampling for reduced phase error
compared to the 1 sample per symbol receiver. Treat E310 similar to 13
MHz rate devices for the lowest computational use.

Signed-off-by: Tom Tsou <tom@tsou.cc>
2014-12-15 18:59:45 -08:00
Tom Tsou eb54bddf47 Transceiver52M: Implement POWEROFF command
Add stop and restart capability through the POWEROFF and POWERON
commands. Calling stop causes receive streaming to cease, and I/O
threads to shutdown leaving only the control handling thread running.
Upon receiving a POWERON command, I/O threads and device streaming are
restarted.

Proper shutdown of the transceiver is now initiated by the destructor,
which calls the stop command internally to wind down and deallocate
threads.

Signed-off-by: Tom Tsou <tom@tsou.cc>
2014-12-15 16:20:15 -07:00
Tom Tsou a4d1a41244 Transceiver52M: Allow setting gain before POWERON
There is no reason gain settings should not be modifiable when the radio
is running or not.

Signed-off-by: Tom Tsou <tom@tsou.cc>
2014-12-15 16:20:15 -07:00
Tom Tsou b999759175 CommonLibs: Add thread cancellation capability
For clean shutdown in the transceiver we need to cancel and join
running threads for orderly unwinding. Thread cancellation points
already exist, so we just need to be able to call on the threads to
exit out when stopping or shutting down.

Don't error when joining a NULL thread, which would be the case if a
thread was stopped before ever being started to begin with.

Signed-off-by: Tom Tsou <tom@tsou.cc>
2014-12-15 16:20:15 -07:00
Tom Tsou 1ae25561fa uhd: Display current timestamp with buffer status errors
Existing implementation outputs sample buffer parameters, but it is
helpful to know the submitted timestamp that led to the errant
condition.

Signed-off-by: Tom Tsou <tom@tsou.cc>
2014-12-15 16:19:38 -07:00
Thomas Tsou 187225cf33 Transceiver52M: Fix SSE convolution shuffle register
An errant shuffle register value used in complex-complex convolution
causes distorted correlation peak-to-average values for certain TSC
values. The error effect varies for different TSC sequences with the
most noticeable effect of degraded detection on TSC 1 and no effect on
TSC 7.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2014-05-08 13:57:36 -04:00
Thomas Tsou ccb73e15f3 Transceiver52M: Fix retransmissions when filler table is enabled
Commit 15d743efaf "Disable filler table
retransmissions by default" made OpenBTS style filler table behavior
optional. When enabled, dummy bursts were automatically loaded into the
filler table, but the table was not updated and only filler busts were
retransmitted.

Enable the restransmit state flag when the filler table option is
specified. Only preload filler table and enable retransmissions on
channel zero.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2014-04-15 17:47:48 -04:00
Thomas Tsou a5c83aeb56 Transceiver52M: Add E1XX USRP device id and timings
Device specific timing settings for the E100 and E110 were missing from
the Tx/Rx offset table. Add E1XX identifier and offsets to the device
list and offset table respectively.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2014-04-09 23:14:31 -04:00
Thomas Tsou c283916e41 Transceiver52M: Allow startup delay for stream alignment
UHD requires a small amount of time to align multiple streams at
startup. Delay the startup by 100 ms relative to the queried device time
(actual delay inclusive of control latencies will be less).

The following error is only relevant to dual-channel UHD devices (e.g.
Fairwaves UmTRX and Ettus B210).

UHD Error:
    The receive packet handler failed to time-align packets.
    1002 received packets were processed by the handler.
    However, a timestamp match could not be determined.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2014-03-27 13:57:18 -04:00
Thomas Tsou cecfb2e8f9 Transceiver52M: Set UHD rates before creating streamers
Recent versions of UHD require setting the sample rate before creating
streamers otherwise the following exception occurs.

Boost_105300; UHD_003.007.000-0-g7fef199d

terminate called after throwing an instance of
'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::math::rounding_error> >'
  what():  Error in function boost::math::round<d>(d): Value -nan can not be represented in the target integer type.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2014-03-27 13:49:51 -04:00
Thomas Tsou 8e17df7374 Transceivert52M: Add option for baseband frequency offset
Allow command line setting of the DSP frequency in UHD. All channels
will be tuned with the same offset. Dual-channel tuning with the B210,
which uses a single LO, will override the command line offset value
and set the DSP frequency automatically.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2014-03-06 15:52:49 -05:00
Thomas Tsou 3ebc772dc2 Transceiver52M: Enable B210 dual channel support
The main difference between existing UmTRX dual channel is the
single LO on B210 transmit and receive front-ends vs. independent
tuning paths. In order to support dual-ARFCN frequencies, baseband
offset conversion must be applied by tuning the FPGA CORDIC for
each channel. For B210, the following tuning order is applied.

1. If the new frequency of channel A is within the baseband range
   of channel B, then retune both channels with the RF centered
   and equal valued positive and negative baseband shifts.

2. If the new frequency of channel A is not with the baseband range
   of channel B, then retune channel A directly (without manual
   applied offset). Channel B will no longer be tuned to the
   previous frequency.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2014-03-03 23:17:57 -05:00
Thomas Tsou 18d3b833bc Transceiver52M: Disable initial device time reset
With dual-channels on B210, we lose the ability to reset both
channels to a synchronized state. Instead, let the timestamp
clock start with an arbitary value, which is the first
timestamp received from the device, instead of a near-zero
value. This approach also makes integration for device, in
general, with free-running timestamp clocks.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2014-03-03 23:16:59 -05:00
Thomas Tsou e788239fba Transceiver52M: Split B200 and B210 identifiers
Differentiate between the two in order to provide enumeration
for dual-channel support.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2014-03-03 18:47:36 -05:00
Thomas Tsou 635f1bf2af Transceiver52M: Set B2XX clock frequency to 26 MHz
Change from the original USRP1 rate of 52 MHz. On B2XX we can use
26 MHz, which is closer to the default 32 MHz of the device.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2014-02-13 14:35:45 -05:00
Thomas Tsou 15d743efaf Transceiver52M: Disable filler table retransmissions by default
Burst selection at a particular time works in the following order
of priority.

1. Slot is disabled with channel combination set to NONE (default)
1. Burst exists in priority queue for the current time.
2. Filler table entry is used

This patch sets default behaviour to force all filler table entries
to zero and disallows filler table changes. This effectively means
that only bursts received from upper layers will be transmitted and
nothing will be automatically transmitted in the absence or delay
of incoming burts at a particular time.

New Command line option "Enable C0 filler table" allows reverting
to previous idle burst generation and retransmission behaviour on
TRX0. Retransmission cannot be enabled on non-C0 channels.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2014-01-26 21:52:46 -05:00
Thomas Tsou af506441b3 Transceiver52M: Add missing scaling vector resize
Downlink scaling factors, which are stored in a vector for multiple
channels, was not being sized correctly.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-18 01:36:58 -05:00
Thomas Tsou 4de70be9a6 Transceiver52M: Remove database configuration file requirement
We don't require any parameters stored in the configuration table,
so don't bother with the existence of the persistent database file.
This also removes an unnecessary step during initial setup since
relevant parameters can be configured from the command line.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-17 18:57:45 -05:00
Thomas Tsou fb827d04ba Transceiver52M: Ignore channel estimation if we are not equalizing
Equalization is currently disabled by default. As such, we don't need to
run channel estimates or even track the update state, which would
otherwise be allocating/decallocating the channel state vector at
regular intervals.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-16 16:16:36 -05:00
Thomas Tsou 2c79110969 Transceiver52M: UHD: Check running status before stopping stream
On startup errors we get a segfault if we stop and shutdown. This
is because we try to send a stop stream command to the device before
it has been created. Setup a check for running status before
attempting to stop the physical device.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-16 01:44:07 -05:00
Thomas Tsou 85b179d125 Transceiver52M: Create new osmo-trx executable
Create new main executable with full command line option parsing
of relevant parameters. Database configuration table still exists
(and must exist because of the global gConfig object), but can
be bypassed with command line options.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-16 01:44:07 -05:00
Thomas Tsou 2e622ff131 Transceiver52M: Output device and operating mode to stdout
Very useful user information at startup.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-16 01:43:46 -05:00
Thomas Tsou 3f32ab5afa Transceiver52M: Enable all warnings and resolve
Mainly basic signed vs unsigned comparisons and intializer ordering.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15 23:35:07 -05:00
Thomas Tsou 8c33679fa5 Transceiver52M: Add virtual destructor for radio device
Empty destructor removes compile warning.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15 23:35:07 -05:00
Thomas Tsou 477b77c558 Transceiver52M: Remove unused code
This includes unknown and unused variables, functions, and
non-relevant documentation.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15 23:35:07 -05:00
Thomas Tsou d3fccea05f Transceiver52M: Allow only channel zero to set TSC value
We support one TSC value per each transceiver object. Only channel
zero can set this value. Other channels can attempt to set the TSC
value, but will error if the TSC does not match the existing value.
In either case, non-zero channels do not manipulate the gloabl TSC
setting.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15 23:35:07 -05:00
Thomas Tsou cb269a32dd Transceiver52M: Use independent power scaling varables for each channel
Simply vectorize the existing power state variable.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15 23:35:07 -05:00
Thomas Tsou 1882099d15 Transceiver52M: Set const qualifier on appropriate radio vector methods
Pointer accessor and noise average methods for radio and noise vectors
respectively.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15 23:35:07 -05:00
Thomas Tsou a0179e37f8 Transceiver52M: Use independent noise vectors for each channel
Each ARFCN channel may be independently configureted and possibly on
separate hardware, so don't share a single vector for noise estimate
calculations. Allow a non-pointer based iterator so we can get away
with using the default copy constructor.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15 23:35:07 -05:00
Thomas Tsou ef25dba4e7 Transceiver52M: Ignore detected bursts at the noise floor
The transceiver has the ability to detect bursts below the noise floor,
but little hope in successful decoding, so don't even try. We still use
the detected burst to differentiate against noise vs actual data.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15 23:35:07 -05:00
Thomas Tsou 2d0c00bd3d Transceiver52M: Check time slot validity of incoming bursts
In errant cases, GSM core may send bursts with invalid slot values,
which is allowed by the GSM::Time object. If we find a burst like this
coming into the transceiver, then drop it immediately.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15 23:35:07 -05:00
Thomas Tsou e90a42becc Transceiver52M: Add dual channel diversity receiver option
This patch add support for dual channel diversity on the receive
path. This allows two antennas two shared antennas to be used for
each ARFCN handling channel in the receiver. This configuration
may improvde performance in multi-path fading environments,
however, noise andpotential interference levels are increased due
to the higher bandwidth used.

The receive path is oversampled by a factor of four for a rate
of 1.083333 Msps. If the receive paths are tuned within a
maximum channel spacing (currently set at 600 kHz), then both
ARFCN frequencies are processed by each channel of the receiver.
Otherwise, the frequency shifted diversity path is disabled and
standard non-diversity operation takes place.

Diversity processing is handled by selecting the path with the
higheset energy level and discarding the burst on the second
path. Selection occurs on a burst-by-burst basis.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15 23:35:07 -05:00
Thomas Tsou 30421a7e25 Transceiver52M: Refactor receive path outer burst handling
Separate the large pullRadioVector() call, which forms the central
portion of the receive path burst processing. Break out RACH, normal
burst, and demodulation into separate methods. This makes the burst
handling from the FIFO read to soft bit output somewhat more
manageable.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15 23:35:07 -05:00
Thomas Tsou 34bbef754f Transceiver52M: sigproc: Wrap internal phase on frequency shift
The call into table lookup will loop on values outside of the
table range. With continuously increasing phase, this leads
to an eventual permanent hard spin. Wrap the phase value to
prevent that from happening.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15 23:35:07 -05:00
Thomas Tsou 2c1f85a10c Transceiver52M: UHD: Add string descriptors to device-offset pairs
As we add more channel combintions including but not limited to
new devices, signal processing schemes, and diversity, we'll
need to handle more special cases. Add string descriptions for
just a bit more sanity.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15 23:35:07 -05:00
Thomas Tsou a2fe91a688 Transceiver52M: Add vectorized radio burst capability
This patch allows multiple signalVectors to be stored within
a single radioVector object. The motivation is to provide
a facility for diversity and/or MIMO burst handling. When
no channel value is specified, single channel bevhaviour
is maintained.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15 23:35:07 -05:00
Thomas Tsou e1ce92599a Transceiver52M: Rearrange socket port assignemnts
Style change for clarity only.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15 23:35:07 -05:00
Thomas Tsou b075dd2f73 Transceiver52M: Dynamically allocate correlation vectors
Stack allocating the correlation output generates a call to the copy
constructor of an zero valued vector. We can avoid this extra copy
constructor with a pointer reference and dynamic allocation.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15 23:35:07 -05:00
Thomas Tsou 94edaaeee6 Transceiver52M: Allow separate in/out vectors for delay and decimation
Allow non-in-place use of the delay setting. Internally, the delay call
creates a new vector and copies the contents back into the original.
Instead, provide the option to return the computed output vector
directly and remove an an extra copy in the process.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15 23:35:07 -05:00
Thomas Tsou 0e0e1f4363 Transceiver52M: Setup sinc() call directly with table lookup
On Beagle Board the call into the sinc() function is generating a lot of
load on the peak interpolation. Simplify the sinc() function with a
dedicated table lookup. Eventually, this table may be removed in favour
of using a precomputed filterbank for fractional delay determination.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15 23:35:07 -05:00
Thomas Tsou d0f3ca3e94 Transceiver52M: Preallocate head room for burst correlation
Set a transceiver high level length value that specifies the largest
number of complex or real filter taps that we will encounter. This
allows preallocation of head room and prevents an extra allocation and
copy on every incoming receive burst.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15 23:35:07 -05:00