Change in ...osmo-trx[master]: radioInterface: Clarify how underruns are handled driving a radioDevice

pespin gerrit-no-reply at lists.osmocom.org
Thu Aug 1 12:04:20 UTC 2019


pespin has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-trx/+/14987 )

Change subject: radioInterface: Clarify how underruns are handled driving a radioDevice
......................................................................

radioInterface: Clarify how underruns are handled driving a radioDevice

The underrun parameter in radioDevice's readSamples() is not a "Rx
Underrun" event, but rather it's used to retrieve a "Tx Underrun" which
on some SDRs (like USRP1) seems to be (so far) available only at
readSamples() times.

Thus, underrun parameter for both readSamples() and writeSamples() is
actually flagging the same event, and should be ORed in pushBuffer() as
it's already done in pullBuffer(). Otherwise if implementation is
setting the underrun pointer to false, it could erase the flag being
marked by the counterpart function before isUnderrun() is called (which
is the one responsible to clear the flag).

Change-Id: Id549489fc1485e0d762818c8e682aaddd5041f1c
---
M Transceiver52M/radioInterface.cpp
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, but someone else must approve
  daniel: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved



diff --git a/Transceiver52M/radioInterface.cpp b/Transceiver52M/radioInterface.cpp
index e32848e..0d33f22 100644
--- a/Transceiver52M/radioInterface.cpp
+++ b/Transceiver52M/radioInterface.cpp
@@ -348,6 +348,7 @@
 /* Send timestamped chunk to the device with arbitrary size */
 bool RadioInterface::pushBuffer()
 {
+  bool local_underrun;
   size_t numSent, segmentLen = sendBuffer[0]->getSegmentLen();
 
   if (sendBuffer[0]->getAvailSegments() < 1)
@@ -363,8 +364,9 @@
   /* Send the all samples in the send buffer */
   numSent = mRadio->writeSamples(convertSendBuffer,
                                  segmentLen,
-                                 &underrun,
+                                 &local_underrun,
                                  writeTimestamp);
+  underrun |= local_underrun;
   writeTimestamp += numSent;
 
   return true;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/14987
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: Id549489fc1485e0d762818c8e682aaddd5041f1c
Gerrit-Change-Number: 14987
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190801/457172cc/attachment.html>


More information about the gerrit-log mailing list