laforge
/
openbts-osmo
Archived
1
0
Fork 0
Commit Graph

26 Commits

Author SHA1 Message Date
Thomas Tsou eb10d9b31d 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>
2011-10-20 21:10:41 -04:00
Thomas Tsou bb1c2f2ad2 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>
2011-10-20 21:02:37 -04:00
Thomas Tsou b667ea6267 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>
2011-10-20 21:02:12 -04:00
Thomas Tsou 285b0a481c transceiver: uhd: update copyright header
Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-10-20 20:49:34 -04:00
Thomas Tsou 0b974109a8 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>
2011-10-20 20:49:34 -04:00
Thomas Tsou 1898c37e43 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>
2011-10-07 13:45:06 -04:00
Thomas Tsou 980d31a404 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>
2011-08-10 16:52:09 -07:00
Thomas Tsou fda11abe6c 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>
2011-08-05 12:29:31 -07:00
Thomas Tsou 44aff7de0b 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>
2011-07-08 17:37:11 -07:00
Thomas Tsou 96710c8077 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>
2011-06-09 12:47:32 -07:00
Thomas Tsou e8b9db51e2 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>
2011-06-02 11:19:30 -07:00
Thomas Tsou e161523c8b 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>
2011-05-26 15:39:54 -07:00
Thomas Tsou a3bd572e45 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>
2011-05-25 17:02:10 -07:00
Thomas Tsou 99a1466155 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>
2011-05-23 19:01:32 -07:00
Thomas Tsou 6ddbc257c8 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>
2011-05-23 19:01:21 -07:00
Thomas Tsou 4f08ddf45a 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>
2011-05-23 11:52:46 -07:00
Thomas Tsou de018f7fef 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>
2011-05-23 11:32:37 -07:00
Thomas Tsou 551dbd3326 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>
2011-05-08 13:46:29 -04:00
Thomas Tsou 17750fd756 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>
2011-05-06 20:35:47 -04:00
Thomas Tsou 258ad91549 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>
2011-05-06 17:42:09 -04:00
Thomas Tsou 79a1cf3d34 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>
2011-05-06 13:34:30 -04:00
Thomas Tsou 0ff69c95ff 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>
2011-05-06 13:19:47 -04:00
Thomas Tsou 39f0bcfd18 uhd: log useful information on monotonic errors
Track the current errant and previous timestamp values.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-06 12:58:41 -04:00
Thomas Tsou 6c51f54909 uhd: only the E100 supports FPGA timestamps and adjustable clock rate
Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-05 12:21:17 -04:00
Thomas Tsou b4fa0c4074 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>
2011-05-05 12:21:08 -04:00
Thomas Tsou 90d7633583 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>
2011-05-05 12:20:08 -04:00