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

56 Commits

Author SHA1 Message Date
Thomas Tsou 84ba2673e4 transceiver: move various radio interface definitions
Move them out of the interface file - primarily for
readability.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-10-20 21:03:41 -04:00
Thomas Tsou 9d0beae1a5 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>
2011-10-20 21:03: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 7e3692c087 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>
2011-10-20 21:01:39 -04:00
Thomas Tsou f5575b9240 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>
2011-10-20 21:00:22 -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 331755f458 transceiver: remove extraneous comments
These lines are virtually never enabled.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-10-20 20:49:34 -04:00
Thomas Tsou 86545d1ab9 transceiver: remove extra typedefs to remove warnings
These typedefs serve no purpose and the compiler complains.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-10-20 20:48:56 -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 f8838172ad 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>
2011-08-01 19:56:16 -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 6d34bace87 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>
2011-06-22 13:39:13 -07:00
Thomas Tsou 8301298f88 Merge branch 'remote-cli'
* remote-cli: (22 commits)
  Throw exception if usrp is not found. Don't crash transceiver.
  Update OpenBTS init script
  Correctly exit OpenBTS even if console is not started yet.
  Add option to run OpenBTS in a failsafe loop.
  Shutdown without core dump on a usual SocketError.
  Remove Transceiver PID file on OpenBTS exit.
  Save transceiver PID to a file and use it to kill old transceivers.
  Correct comment for Server.WritePID.
  Set FD_CLOEXEC flag on all sockets.
  Stupid bug fixed - can't move stack variables initialization to a separate function.
  Gracefully shutdown OpenBTS on transceiver timeout/error.
  Make functions and variables in OpenBTS.cpp static to avoid their use outside of the file.
  Remove PID file on program exit.
  Implemented daemon mode, configured from config.
  Better default name for OpenBTS control UNIX socket.
  Initialize logger right after loading config file.
  Use normal cout and cerr while we have only one thread.
  Better comments for previous commit.
  Catch SIGINT, SIGTERM and SIGHUP and shutdown the server gracefully.
  Uncomment real BTS start/stop.
  ...
2011-06-21 19:02:19 -07:00
Alexander Chemeris 23d826d3ba Throw exception if usrp is not found. Don't crash transceiver. 2011-06-21 16:46:55 -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 d186353546 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>
2011-06-03 21:47:27 -07:00
Thomas Tsou e8cb2708b2 usrp1: fix typo in rx gain setting log message
Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-06-03 12:18:25 -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 3896e7499f 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>
2011-05-26 15:40:38 -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 055af67a4e 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>
2011-05-23 19:01:12 -07:00
Thomas Tsou 2ba373fea9 Merge branch 'dboard'
* dboard:
  Transceiver52M: add WBX, DBSRX, and single board support
  Transceiver: add WBX, DBSRX, and single board support

Conflicts:
	public-trunk/Transceiver/radioInterface.cpp
2011-05-23 19:00:44 -07:00
Thomas Tsou db419b17c7 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>
2011-05-23 12:08:09 -07:00
Thomas Tsou e94b1f4827 uhd: disable adaptive buffering in 52 MHz transceiver
Similar to the non-52 Mhz case,

589dd9091e

This drastically reduces underruns on the E100.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-23 12:02:56 -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 67714e4292 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>
2011-05-06 21:01:42 -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 88223de898 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>
2011-05-06 17:42:29 -04:00
Thomas Tsou 8c86da79c0 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>
2011-05-06 17:42:18 -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
Thomas Tsou 2e096d9e9c uhd: remove extra type conversion
Type conversion, if necessary, should happen inside the device.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
2011-05-05 12:18:42 -04:00
Thomas Tsou dff752739d 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>
2011-03-08 22:19:41 -05:00
Alexander Chemeris 3fa2aa19cb Transceiver52M: Do not delete 'trx' on exit.
This should make it slightly less frequent to segfault on exit.
Actually we should shutdown all our threads correctly, but that's a lot of work.

(cherry picked from commit 7cd65d3e5a717e0c224477cacfe932cfd7a45b8f)
2010-12-21 18:29:57 +03:00
Alexander Chemeris 2c0be6d746 Transceiver: correctly exit if USRP is not found.
(cherry picked from commit 8880f019e8071eb7f43f3727ab5414f744aedc4b)
2010-12-21 17:52:18 +03:00
Alexander Chemeris 91d16c65b7 Transceiver52M: Fix wrong memcpy().
1) It should be memmove(), because source and destination regions may overlap.
2) Amount of moved memory was calculated incorrectly and was about 2x times more then really needed. We thus touched memory outside of the allocated array and may crash the program.

(cherry picked from commit fbed302055ebe77ca19b899c8bc307ca05b4a604)
2010-12-21 17:50:35 +03:00