Recent UHD firmware for the USRP2/N210 replaces the MicroBlaze
with a slower ZPU in addition to changes to the control
transactions. The effect is less predictable reading of the
current time and Tx/Rx sample mis-alignment following
underruns.
After an underrun, this patch drops potentially stale packets
with a fixed interval instead of relying on reading the
current time from the device.
Signed-off-by: Thomas Tsou <ttsou@vt.edu>
The non-UHD implementation tunes the DDC to output an inverted
spectrum that requires swapping on the host. Push I/Q and byte
swapping into the device implementation and strip the related
bits out of the remaining transceiver code.
This also moves the Transceiver closer to the Transcever52M
version.
Signed-off-by: Thomas Tsou <ttsou@vt.edu>
* 'master' of git://openbts.git.sourceforge.net/gitroot/openbts/openbts: (21 commits)
Transceiver52M: Do not delete 'trx' on exit.
common libs: Implemented ISLOGGING() macro to test whether given loglevel is going to be logged.
common libs: Implemented BitVector::unhex() which reads a hex string into a BitVector.
common libs: Lower log level for "setting log path to " message.
common libs: Use gethostbyname2_r() instead of gethostbyname() if available.
control: Save IMEI in TMSI table for informational purposes.
sip: Set display name for To field in a SIP MESSAGE.
control: Use std::string in TransactionEntry to ctore messaging payload.
smqueue: Documentation fixes for sm_state enumeration in smqueue.
gsm: Add 8-bit alphabet to enumeration of GSM alphabets.
sip: More comments and minor code ordering in SIP::sip_message().
smqueue: Fix compiler warning about char* and constant strings.
Transceiver: correctly exit if USRP is not found.
Transceiver52M: Fix wrong memcpy().
Better safety checks in TMSIRecord::load().
Zero file descriptors set before use.
Remove unused variable in BitVector::hex().
Move more code out of asserts.
Don't put real code into assert().
Fix a bug with Timeval difference calculation on 64-bit Linux.
...
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)
I don't see real value of this message, while it's been printed to the screen like something very important.
(cherry picked from commit 3f3c9b2d2599a672f08624b3081c2c687cbba4d4)
gethostbyname() is not thread-safe. It's recommended to use gethostbyname_r() or gethostbyname2_r() instead.
(cherry picked from commit f27e9581cdb6837f83d0aab467f0e5f83e814e7b)
Originally there was a fixed-size char array, which didn't allow to work with long hex strings.
(cherry picked from commit fdc6fc85f9f431438ef7279975c2f7c230cb4aa5)
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)
This time I checked all occurrences of assert() and all others are ok, if I didn't miss anything
(cherry picked from commit 2afd3fd962eb89e08a73420542267191f459815f)
If you compile with optimization and NDEBUG is defined, then the whole assert() is replaced with ((void) 0) and your code is not executed at all.
Don't assert() on pthread_join() return value. If thread was not started yet, then pthread_join() will fail, but it's ok for us.
(cherry picked from commit d0b797e62c, 21a84dcec9cdf25657bba5c221aac9d4bb81d8b3, 8ed37a1f36e1b1266728647e715f95a28df3f900)
Subtracting uint32_t from uin32_t gives you uint32_t. And assigning result to a long doesn't make it a signed value, because on 64-bit Linux long is 64 bits.
(cherry picked from commit 82dd78d698)
* 'master' of git://openbts.git.sourceforge.net/gitroot/openbts/openbts:
gsm: Remove obsolete PCAP stuff from gsmtap.h
gsm: Update and enhance the GSM Tap functionality
gsm: Add same ARFCN()/typeAndOffset() accessors to L1Decoder than L1Encoder
gsm: Save time of received frame for later use in XCCHL1Decoder
gsm: Create more precise TypeAndOffset cste for BCCH/CCCH
transceiver: Fix misusage of ~ in bitfields
misc: Add a proper .gitignore file
build: Fix Transceiver/Makefile.am to use AM_CXXFLAGS instead of CXX_FLAGS
build: Remove all files autogenerated by autoreconf
Fix trivial conflict:
public-trunk/Transceiver/Makefile.am
* switch to the new format
* add uplink frame dump as well
* fill more fields than before (not fully complete yet tough)
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Somehow it seems the author tought using ~ would set that bit to 0. But
it invert all bits and as such set all others to '1'.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Best practice is to not include those in repositories but only
in tar.gz dist tarball.
autoreconf -i will regenerate them
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Fixes the following build error.
UHDDevice.cpp:462: error: ‘EVENT_CODE_SUCCESS’ is not a member of ‘uhd::async_metadata_t’
UHDDevice.cpp:507: error: ‘EVENT_CODE_SUCCESS’ is not a member of ‘uhd::async_metadata_t’
Reported-by: Dirk Kirsten <Dirk.Kirsten@uni-konstanz.de>
Signed-off-by: Thomas Tsou <ttsou@vt.edu>
Fixes the following that occurs with recent uhd changes.
UHDDevice.cpp:260: error: ‘struct uhd::gain_range_t’ has no member named ‘max’
UHDDevice.cpp:260: error: ‘struct uhd::gain_range_t’ has no member named ‘min’
Signed-off-by: Thomas Tsou <ttsou@vt.edu>
The underrun behaviour of the USRP2 is different from the USRP1, and
the adaptive latency mechanism is not directly transferable. Instead,
fix the latency with a higher starting value, which effectively
buffers more samples on the host in front of the Ethernet interface.
An alternative may be to use the adaptive approach with USRP2
specific upper and lower bounds. For now, just use preprocessor
directives until a better solution comes around.
Signed-off-by: Thomas Tsou <ttsou@vt.edu>
There should be a better way to do this. Only the USRP1 option
in non-loopback mode needs the swap.
UHD & !SWLOOPBACK: FLIP_IQ = 0
UHD & SWLOOPBACK: FLIP_IQ = 0
USRP1 & !SWLOOPBACK: FLIP_IQ = 1
USRP1 & SWLOOPBACK: FLIP_IQ = 0
Signed-off-by: Thomas Tsou <ttsou@vt.edu>
Transceiver can be built with UHD by specifiying the --with-uhd
option. Fractional sample rates are not supported by the USRP2
so Transceiver52M is not built.
Otherwise, the default GNU Radio USRP1 implementation is used.
Signed-off-by: Thomas Tsou <ttsou@vt.edu>
This patch adds USRP2 device support and future support for
other UHD based devices. On receive, a sample buffer class,
which is indexable by timestamps, is used to temporarily
hold data until the requested samples are available.
On transmit, samples are sent immediately unless sample
alignment is known to be off - during startup or after the
occurrence of underruns or other errors. To regain
synchronization at these moments, timestamps are compared
against the current device time and dropped unless there
exists significant delay margin to physically arrive at the
device before deadline.
Signed-off-by: Thomas Tsou <ttsou@vt.edu>
Move essential interface components into an abstract Device class
and create a factory method for instantiating compile-time
specified derived types (USRP1 or UHD).
The radioInterface has a device specific type conversion call to
the USRP1 driver, so push that behind the Device interface too.
Signed-off-by: Thomas Tsou <ttsou@vt.edu>
This hack accidentally leaked in the release code ... but it prevents
tuning for certain ARFCN and reduces TX power.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>