lms: Use same timestamp offset like when using LimeSDR via UHD
The tx timestamp offset was not set. We set it to the same value as it
was in UHD interface for LimeSDR
Change-Id: I78bc40cd575097f71a5f82b63467fa81c3f8d837
diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp
index d9b5ba6..3e3c5f6 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -139,8 +139,7 @@
LOG(DEBUG) << "Sample Rate: Host=" << sr_host << " RF=" << sr_rf;
/* FIXME: make this device/model dependent, like UHDDevice:dev_param_map! */
- //ts_offset = static_cast<TIMESTAMP>(8.9e-5 * GSMRATE);
- ts_offset = 0;
+ ts_offset = static_cast<TIMESTAMP>(8.9e-5 * GSMRATE * sps); /* time * sample_rate */
switch (ref) {
case REF_INTERNAL:
@@ -489,8 +488,6 @@
lms_stream_meta_t rx_metadata = {};
rx_metadata.flushPartialPacket = false;
rx_metadata.waitForTimestamp = false;
- /* Shift read time with respect to transmit clock */
- timestamp += ts_offset;
rx_metadata.timestamp = 0;
if (bufs.size() != chans) {
@@ -539,7 +536,7 @@
lms_stream_meta_t tx_metadata = {};
tx_metadata.flushPartialPacket = false;
tx_metadata.waitForTimestamp = true;
- tx_metadata.timestamp = timestamp;
+ tx_metadata.timestamp = timestamp - ts_offset; /* Shift Tx time by offset */
if (isControl) {
LOG(ERR) << "Control packets not supported";