diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-09-13 18:23:47 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-09-13 18:53:29 +0200 |
commit | 25383a361075d3aa0ffef6fb1e9a837e6da53340 (patch) | |
tree | 68ab220166cca293336fbd51b73760b4ea5ee8a2 | |
parent | UHDDevice: Drop unneeded MULTI_ARFCN checks (diff) | |
download | OsmoTRX-25383a361075d3aa0ffef6fb1e9a837e6da53340.tar.xz OsmoTRX-25383a361075d3aa0ffef6fb1e9a837e6da53340.zip |
radioInterface{Multi,Resamp}: Fix successful writeSamples() masking underrun from readSamples()
The only who should be setting class instance value "underrun" to false
is isUnderrun().
Similar fixes were already applied lately to radioInterface.cpp.
Change-Id: I3239b1df4536c080365106b3e4daa523b57f5dff
-rw-r--r-- | Transceiver52M/radioInterfaceMulti.cpp | 4 | ||||
-rw-r--r-- | Transceiver52M/radioInterfaceResamp.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/Transceiver52M/radioInterfaceMulti.cpp b/Transceiver52M/radioInterfaceMulti.cpp index 4022d3a..99f6231 100644 --- a/Transceiver52M/radioInterfaceMulti.cpp +++ b/Transceiver52M/radioInterfaceMulti.cpp @@ -309,6 +309,7 @@ int RadioInterfaceMulti::pullBuffer() /* Send a timestamped chunk to the device */ bool RadioInterfaceMulti::pushBuffer() { + bool local_underrun; if (sendBuffer[0]->getAvailSegments() <= 0) return false; @@ -341,12 +342,13 @@ bool RadioInterfaceMulti::pushBuffer() size_t num = mDevice->writeSamples(convertSendBuffer, outerSendBuffer->size(), - &underrun, + &local_underrun, writeTimestamp); if (num != outerSendBuffer->size()) { LOG(ALERT) << "Transmit error " << num; } + underrun |= local_underrun; writeTimestamp += num; return true; diff --git a/Transceiver52M/radioInterfaceResamp.cpp b/Transceiver52M/radioInterfaceResamp.cpp index d6dc52c..864cdee 100644 --- a/Transceiver52M/radioInterfaceResamp.cpp +++ b/Transceiver52M/radioInterfaceResamp.cpp @@ -204,6 +204,7 @@ int RadioInterfaceResamp::pullBuffer() /* Send a timestamped chunk to the device */ bool RadioInterfaceResamp::pushBuffer() { + bool local_underrun; int rc; size_t numSent; @@ -225,12 +226,13 @@ bool RadioInterfaceResamp::pushBuffer() numSent = mDevice->writeSamples(convertSendBuffer, resamp_outchunk, - &underrun, + &local_underrun, writeTimestamp); if (numSent != resamp_outchunk) { LOG(ALERT) << "Transmit error " << numSent; } + underrun |= local_underrun; writeTimestamp += resamp_outchunk; return true; |