Compare commits

...

12 Commits

Author SHA1 Message Date
Alexander Chemeris
bd9c6215da bump version to 0.1.10~3 2016-06-18 16:11:12 +03:00
Alexander Chemeris
832b610cce bump version to 0.1.10~2 2016-06-18 15:58:49 +03:00
Kirill Zakharenko
032d72a1b7 bump version to 0.1.10~1 2016-06-18 15:58:49 +03:00
Kirill Zakharenko
e1501c24cd debian: compile for atom arch with SSE3 optimizations 2016-06-18 15:58:49 +03:00
Alexander Chemeris
737fc258ba transceiver: WIP: Set default max delay to 2 samples.
Default value of 0 may be too harsh, especially given random Rx/Tx delay
in 1 SPS receive mode.
2016-06-18 15:58:49 +03:00
Alexander Chemeris
58f5333c0a sigProcLib: Change number of head bits in detectRACHBurst() from 4 to 8.
To match GSM 05.02 Access Burst definition.
2016-06-18 15:58:49 +03:00
Alexander Chemeris
ceb417162a transceiver: Add an option to emulate a RACH delay in random filler mode. 2016-06-18 15:58:49 +03:00
Alexander Chemeris
5bf037bf33 transceiver: Log channel number in DEBUG output of demoded bursts. 2016-06-18 15:49:21 +03:00
Alexander Chemeris
a057c7d367 radioInterface: Initialize power scale with a meaningful default.
Right now if you forget to send "POWER" control command, osmo-trx
will transmitt zeros. This is counter-intuitive and I've spent several
hours debugging this "issue". The issue may happen easily, because
osmo-bts doesn't send "POWER" command if there is no "power" setting
in the configuration file. Given that "POWER" command actually sets
attenuation, it's percieved as optional and in absence of it should
default to "POWER 0" (no attenuation), which translates to power
scale being 1.0.
2016-06-18 15:49:21 +03:00
Alexander Chemeris
2ad7101d44 uhd: Fix comment.
It's osmo-trx, not OpenBTS anymore.
2016-06-18 15:49:21 +03:00
Alexander Chemeris
f7e0eb153d radioDevice: GSMRATE macro must have parentheses around its definition.
So we had the following define:
   #define GSMRATE       1625e3/6

Now, I wanted to use it in the following expression:
   3.0/GSMRATE
which turns into:
   3.0/1625e3/6
while what I really wanted is:
   3.0/(1625e3/6) = 3.0/1625e3*6

To avoid this, all macros with calculations must be enclosed in parentheses.
2016-06-18 15:49:21 +03:00
Alexander Chemeris
256ec63115 makefile: Fix build from an external path.
When you build from an external path, compiler can't find convert.h
include, because it was specified relative to the current directory.
Change this to specify the include dit relative to the Makefile
location.
2016-06-18 15:48:40 +03:00
12 changed files with 79 additions and 28 deletions

View File

@@ -21,7 +21,7 @@
include $(top_srcdir)/Makefile.common
AM_CPPFLAGS = -Wall $(STD_DEFINES_AND_INCLUDES) -I./common
AM_CPPFLAGS = -Wall $(STD_DEFINES_AND_INCLUDES) -I${srcdir}/common
AM_CXXFLAGS = -ldl -lpthread
SUBDIRS = arm x86

View File

@@ -71,7 +71,7 @@ TransceiverState::~TransceiverState()
}
}
bool TransceiverState::init(int filler, size_t sps, float scale, size_t rtsc)
bool TransceiverState::init(int filler, size_t sps, float scale, size_t rtsc, unsigned rach_delay)
{
signalVector *burst;
@@ -91,7 +91,7 @@ bool TransceiverState::init(int filler, size_t sps, float scale, size_t rtsc)
burst = generateEdgeBurst(rtsc);
break;
case Transceiver::FILLER_ACCESS_RAND:
burst = genRandAccessBurst(sps, n);
burst = genRandAccessBurst(rach_delay, sps, n);
break;
case Transceiver::FILLER_ZERO:
default:
@@ -122,7 +122,7 @@ Transceiver::Transceiver(int wBasePort,
mTransmitLatency(wTransmitLatency), mRadioInterface(wRadioInterface),
rssiOffset(wRssiOffset),
mSPSTx(tx_sps), mSPSRx(rx_sps), mChans(chans), mOn(false),
mTxFreq(0.0), mRxFreq(0.0), mTSC(0), mMaxExpectedDelayAB(0), mMaxExpectedDelayNB(0),
mTxFreq(0.0), mRxFreq(0.0), mTSC(0), mMaxExpectedDelayAB(2*rx_sps), mMaxExpectedDelayNB(2*rx_sps),
mWriteBurstToDiskMask(0)
{
txFullScale = mRadioInterface->fullScaleInputValue();
@@ -160,7 +160,7 @@ Transceiver::~Transceiver()
* are still expected to report clock indications through control channel
* activity.
*/
bool Transceiver::init(int filler, size_t rtsc)
bool Transceiver::init(int filler, size_t rtsc, unsigned rach_delay)
{
int d_srcport, d_dstport, c_srcport, c_dstport;
@@ -216,7 +216,7 @@ bool Transceiver::init(int filler, size_t rtsc)
if (i && filler == FILLER_DUMMY)
filler = FILLER_ZERO;
mStates[i].init(filler, mSPSTx, txFullScale, rtsc);
mStates[i].init(filler, mSPSTx, txFullScale, rtsc, rach_delay);
}
return true;
@@ -912,10 +912,11 @@ void Transceiver::driveReceiveRadio()
}
}
void Transceiver::logRxBurst(SoftVector *burst, GSM::Time time, double dbm,
void Transceiver::logRxBurst(size_t chan, SoftVector *burst, GSM::Time time, double dbm,
double rssi, double noise, double toa)
{
LOG(DEBUG) << std::fixed << std::right
<< " chan: " << chan
<< " time: " << time
<< " RSSI: " << std::setw(5) << std::setprecision(1) << rssi
<< "dBFS/" << std::setw(6) << -dbm << "dBm"
@@ -948,7 +949,7 @@ void Transceiver::driveReceiveFIFO(size_t chan)
nbits = gSlotLen * 3;
dBm = RSSI + rssiOffset;
logRxBurst(rxBurst, burstTime, dBm, RSSI, noise, TOA);
logRxBurst(chan, rxBurst, burstTime, dBm, RSSI, noise, TOA);
TOAint = (int) (TOA * 256.0 + 0.5); // round to closest integer

View File

@@ -54,7 +54,7 @@ struct TransceiverState {
~TransceiverState();
/* Initialize a multiframe slot in the filler table */
bool init(int filler, size_t sps, float scale, size_t rtsc);
bool init(int filler, size_t sps, float scale, size_t rtsc, unsigned rach_delay);
int chanType[8];
@@ -107,7 +107,7 @@ public:
~Transceiver();
/** Start the control loop */
bool init(int filler, size_t rtsc);
bool init(int filler, size_t rtsc, unsigned rach_delay);
/** attach the radioInterface receive FIFO */
bool receiveFIFO(VectorFIFO *wFIFO, size_t chan)
@@ -276,7 +276,7 @@ protected:
/** set priority on current thread */
void setPriority(float prio = 0.5) { mRadioInterface->setPriority(prio); }
void logRxBurst(SoftVector *burst, GSM::Time time, double dbm,
void logRxBurst(size_t chan, SoftVector *burst, GSM::Time time, double dbm,
double rssi, double noise, double toa);
};

View File

@@ -170,7 +170,7 @@ static double select_rate(uhd_dev_type type, int sps, bool diversity = false)
}
/*
Sample Buffer - Allows reading and writing of timed samples using OpenBTS
Sample Buffer - Allows reading and writing of timed samples using osmo-trx
or UHD style timestamps. Time conversions are handled
internally or accessable through the static convert calls.
*/

View File

@@ -70,6 +70,7 @@ struct trx_config {
unsigned rx_sps;
unsigned chans;
unsigned rtsc;
unsigned rach_delay;
bool extref;
Transceiver::FillerType filler;
bool diversity;
@@ -265,7 +266,7 @@ Transceiver *makeTransceiver(struct trx_config *config, RadioInterface *radio)
trx = new Transceiver(config->port, config->addr.c_str(),
config->tx_sps, config->rx_sps, config->chans,
GSM::Time(3,0), radio, config->rssi_offset);
if (!trx->init(config->filler, config->rtsc)) {
if (!trx->init(config->filler, config->rtsc, config->rach_delay)) {
LOG(ALERT) << "Failed to initialize transceiver";
delete trx;
return NULL;
@@ -317,8 +318,8 @@ static void print_help()
" -c Number of ARFCN channels (default=1)\n"
" -f Enable C0 filler table\n"
" -o Set baseband frequency offset (default=auto)\n"
" -r Random burst test mode with TSC\n"
" -A Random burst test mode with Access Bursts\n"
" -r Random Normal Burst test mode with TSC\n"
" -A Random Access Burst test mode with delay\n"
" -R RSSI to dBm offset in dB (default=0)\n"
" -S Swap channels (UmTRX only)\n",
"EMERG, ALERT, CRT, ERR, WARNING, NOTICE, INFO, DEBUG");
@@ -333,6 +334,7 @@ static void handle_options(int argc, char **argv, struct trx_config *config)
config->rx_sps = DEFAULT_RX_SPS;
config->chans = DEFAULT_CHANS;
config->rtsc = 0;
config->rach_delay = 0;
config->extref = false;
config->filler = Transceiver::FILLER_ZERO;
config->diversity = false;
@@ -341,7 +343,7 @@ static void handle_options(int argc, char **argv, struct trx_config *config)
config->swap_channels = false;
config->edge = false;
while ((option = getopt(argc, argv, "ha:l:i:p:c:dxfo:s:r:AR:Se")) != -1) {
while ((option = getopt(argc, argv, "ha:l:i:p:c:dxfo:s:r:A:R:Se")) != -1) {
switch (option) {
case 'h':
print_help();
@@ -382,6 +384,7 @@ static void handle_options(int argc, char **argv, struct trx_config *config)
config->filler = Transceiver::FILLER_NORM_RAND;
break;
case 'A':
config->rach_delay = atoi(optarg);
config->filler = Transceiver::FILLER_ACCESS_RAND;
break;
case 'R':
@@ -420,6 +423,12 @@ static void handle_options(int argc, char **argv, struct trx_config *config)
print_help();
exit(0);
}
if (config->rach_delay > 68) {
printf("RACH delay is too big %i\n\n", config->rach_delay);
print_help();
exit(0);
}
}
int main(int argc, char *argv[])

View File

@@ -22,7 +22,7 @@
#include "config.h"
#endif
#define GSMRATE 1625e3/6
#define GSMRATE (1625e3/6)
/** a 64-bit virtual timestamp for radio data */
typedef unsigned long long TIMESTAMP;

View File

@@ -70,6 +70,8 @@ bool RadioInterface::init(int type)
convertSendBuffer[i] = new short[sendBuffer[i]->size() * 2];
convertRecvBuffer[i] = new short[recvBuffer[i]->size() * 2];
powerScaling[i] = 1.0;
}
sendCursor = 0;

View File

@@ -1017,30 +1017,36 @@ signalVector *genRandNormalBurst(int tsc, int sps, int tn)
/*
* Generate a random GSM access burst.
*/
signalVector *genRandAccessBurst(int sps, int tn)
signalVector *genRandAccessBurst(int delay, int sps, int tn)
{
if ((tn < 0) || (tn > 7))
return NULL;
if ((sps != 1) && (sps != 4))
return NULL;
if (delay > 68)
return NULL;
int i = 0;
BitVector *bits = new BitVector(88);
BitVector *bits = new BitVector(88+delay);
signalVector *burst;
/* delay */
for (; i < delay; i++)
(*bits)[i] = 0;
/* head and synch bits */
for (int n = 0; i < 49; i++, n++)
for (int n = 0; i < 49+delay; i++, n++)
(*bits)[i] = gRACHBurst[n];
/* Random bits */
for (; i < 85; i++)
for (; i < 85+delay; i++)
(*bits)[i] = rand() % 2;
/* Tail bits */
for (; i < 88; i++)
for (; i < 88+delay; i++)
(*bits)[i] = 0;
int guard = 68 + !(tn % 4);
int guard = 68-delay + !(tn % 4);
burst = modulateBurst(*bits, guard, sps);
delete bits;
@@ -1858,7 +1864,7 @@ int detectGeneralBurst(signalVector &rxBurst,
*
* Correlation window parameters:
* target: Tail bits + RACH length (reduced from 41 to a multiple of 4)
* head: Search 4 symbols before target
* head: Search 8 symbols before target
* tail: Search 4 symbols + maximum expected delay
*/
int detectRACHBurst(signalVector &rxBurst,
@@ -1872,7 +1878,7 @@ int detectRACHBurst(signalVector &rxBurst,
CorrelationSequence *sync;
target = 8 + 40;
head = 4;
head = 8;
tail = 4 + maxTOA;
sync = gRACHSequence;

View File

@@ -123,7 +123,7 @@ signalVector *generateEmptyBurst(int sps, int tn);
signalVector *genRandNormalBurst(int tsc, int sps, int tn);
/** Generate an access GSM burst with random payload - 4 or 1 SPS */
signalVector *genRandAccessBurst(int sps, int tn);
signalVector *genRandAccessBurst(int delay, int sps, int tn);
/** Generate a dummy GSM burst - 4 or 1 SPS */
signalVector *generateDummyBurst(int sps, int tn);

View File

@@ -1,5 +1,5 @@
if !ARCH_ARM
AM_CFLAGS = -Wall -std=gnu99 -march=native -I../common
AM_CFLAGS = -Wall -std=gnu99 -march=native -I${srcdir}/../common
noinst_LTLIBRARIES = libarch.la

32
debian/changelog vendored
View File

@@ -1,3 +1,33 @@
osmo-trx (0.1.10~3) trusty; urgency=medium
* 737fc25 transceiver: WIP: Set default max delay to 2 samples.
* 58f5333 sigProcLib: Change number of head bits in detectRACHBurst() from 4 to 8.
* ceb4171 transceiver: Add an option to emulate a RACH delay in random filler mode.
* 5bf037b transceiver: Log channel number in DEBUG output of demoded bursts.
* a057c7d radioInterface: Initialize power scale with a meaningful default.
* 3b093bb uhd: Set minimum UHD version requirement for E3XX
* 0fe41a5 uhd: Set default Tx sampling to 4 sps
* a5e0f1c uhd: Update default E3XX settings
* 2c650a6 common: Add mandatory length field to UDP receive calls
* d4555f2 common: Restrict UDP binding to localhost only
-- Alexander Chemeris <Alexander.Chemeris@gmail.com> Sat, 18 Jun 2016 16:07:17 +0300
osmo-trx (0.1.10~2) trusty; urgency=medium
* c88385c makefile: Fix build from an external path.
* 0479562 EDGE: Fix demodulation slicer input
* d2b0703 uhd: Correct timing alignment in 8-PSK and GMSK downlink bursts
-- Alexander Chemeris <Alexander.Chemeris@gmail.com> Sat, 30 Apr 2016 01:57:45 +0300
osmo-trx (0.1.10~1) trusty; urgency=medium
* some EDGE support in master
* fairwaves/rach-filler branch
-- Kirill Zakharenko <earwin@gmail.com> Sun, 27 Mar 2016 19:37:39 +0100
osmo-trx (0.1.9) trusty; urgency=medium
* Ask Ivan, really
@@ -6,6 +36,6 @@ osmo-trx (0.1.9) trusty; urgency=medium
osmo-trx (0.1.8) precise; urgency=low
* Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP
* Initial release
-- Ivan Klyuchnikov <Ivan.Kluchnikov@fairwaves.ru> Sun, 9 Mar 2014 14:10:10 +0400

3
debian/rules vendored
View File

@@ -5,6 +5,9 @@ DEB_BUILD_HARDENING=1
%:
dh $@ --with autoreconf
override_dh_auto_configure:
dh_auto_configure -- --without-sse CFLAGS="-DHAVE_SSE3 -march=atom -mtune=atom -O2" CXXFLAGS="-DHAVE_SSE3 -march=atom -mtune=atom -O2"
override_dh_shlibdeps:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info