From 2173abfe56edbffbf8ca265523a35e7a566db66a Mon Sep 17 00:00:00 2001 From: ttsou Date: Wed, 8 Aug 2012 00:51:31 +0000 Subject: transceiver: b100: raise minimum transmit latency value Put a floor on the transmit latency of the B100 in order to suppress underruns in typical conditions. Empirical data from a handful of relatively recent machines shows that the B100 will underrun when the transmit threshold is reduced to a time of 6 and a half frames, so we set a minimum 7 frame threshold. The overall benefit should be marginal and may increase the possibility of bursts arriving stale (after the trasmit deadline), but will reduce the number of alarming UHD related messages that appear in the log file. This patch is UHD and B100 specific - USRP1 is unaffected. Signed-off-by: Thomas Tsou git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@3980 19bc5d8c-e614-43d4-8b26-e1612bc8e597 --- Transceiver52M/Transceiver.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'Transceiver52M') diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index d152b2d..caf7bf0 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -32,7 +32,17 @@ #include "Transceiver.h" #include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define USB_LATENCY_INTRVL (10,0) +#if USE_UHD +# define USB_LATENCY_MIN (6,7) +#else +# define USB_LATENCY_MIN (1,1) +#endif Transceiver::Transceiver(int wBasePort, const char *TRXAddress, @@ -716,8 +726,8 @@ void Transceiver::driveTransmitFIFO() // enough. Need to increase latency by one GSM frame. if (mRadioInterface->getBus() == RadioDevice::USB) { if (mRadioInterface->isUnderrun()) { - // only do latency update every 10 frames, so we don't over update - if (radioClock->get() > mLatencyUpdateTime + GSM::Time(10,0)) { + // only update latency at the defined frame interval + if (radioClock->get() > mLatencyUpdateTime + GSM::Time(USB_LATENCY_INTRVL)) { mTransmitLatency = mTransmitLatency + GSM::Time(1,0); LOG(INFO) << "new latency: " << mTransmitLatency; mLatencyUpdateTime = radioClock->get(); @@ -726,7 +736,7 @@ void Transceiver::driveTransmitFIFO() else { // if underrun hasn't occurred in the last sec (216 frames) drop // transmit latency by a timeslot - if (mTransmitLatency > GSM::Time(1,1)) { + if (mTransmitLatency > GSM::Time(USB_LATENCY_MIN)) { if (radioClock->get() > mLatencyUpdateTime + GSM::Time(216,0)) { mTransmitLatency.decTN(); LOG(INFO) << "reduced latency: " << mTransmitLatency; -- cgit v1.2.3