diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2022-10-25 13:46:40 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2022-10-25 13:46:40 +0200 |
commit | 8ce3fce9ed2fa7d2a0eb2d9e0c2a0fecdc0c2844 (patch) | |
tree | ff04ea1a637729c9be2970d72b2f354b320e7d92 /src/output | |
parent | a2be0c3ab77dab50ded4850f38d2b796b322d0c4 (diff) | |
parent | 56e046c3390a15aab4baddb502a490bb4505942a (diff) | |
download | dabmod-8ce3fce9ed2fa7d2a0eb2d9e0c2a0fecdc0c2844.tar.gz dabmod-8ce3fce9ed2fa7d2a0eb2d9e0c2a0fecdc0c2844.tar.bz2 dabmod-8ce3fce9ed2fa7d2a0eb2d9e0c2a0fecdc0c2844.zip |
Merge branch 'next' into dexter
Diffstat (limited to 'src/output')
-rw-r--r-- | src/output/Dexter.cpp | 2 | ||||
-rw-r--r-- | src/output/SDR.cpp | 9 | ||||
-rw-r--r-- | src/output/SDR.h | 2 | ||||
-rw-r--r-- | src/output/SDRDevice.h | 7 | ||||
-rw-r--r-- | src/output/Soapy.cpp | 2 | ||||
-rw-r--r-- | src/output/UHD.cpp | 2 |
6 files changed, 16 insertions, 8 deletions
diff --git a/src/output/Dexter.cpp b/src/output/Dexter.cpp index 9437ae6..ad4711c 100644 --- a/src/output/Dexter.cpp +++ b/src/output/Dexter.cpp @@ -401,7 +401,7 @@ void Dexter::transmit_frame(const struct FrameData& frame) etiLog.level(debug) << "TIMESTAMP_STATE STREAMING 2"; } - if (frame.ts.timestamp_refresh) { + if (m_require_timestamp_refresh) { etiLog.level(debug) << "TIMESTAMP_STATE WAIT_FOR_UNDERRUN"; timestamp_state = timestamp_state_t::WAIT_FOR_UNDERRUN; long long attr_value = 0; diff --git a/src/output/SDR.cpp b/src/output/SDR.cpp index 53f68c2..ae09acd 100644 --- a/src/output/SDR.cpp +++ b/src/output/SDR.cpp @@ -2,7 +2,7 @@ Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2018 + Copyright (C) 2022 Matthias P. Braendli, matthias.braendli@mpb.li http://opendigitalradio.org @@ -302,6 +302,10 @@ void SDR::handle_frame(struct FrameData& frame) return; } + if (frame.ts.offset_changed) { + m_device->require_timestamp_refresh(); + } + if (last_tx_time_initialised) { const size_t sizeIn = frame.buf.size() / frame.sampleSize; @@ -330,8 +334,7 @@ void SDR::handle_frame(struct FrameData& frame) tx_second << "+" << (double)tx_pps/16384000.0 << "(" << tx_pps << ")"; - frame.ts.timestamp_refresh = true; -#error "wrong, as the frame could be discarded" + m_device->require_timestamp_refresh(); } } diff --git a/src/output/SDR.h b/src/output/SDR.h index 4dfde73..d7f7b46 100644 --- a/src/output/SDR.h +++ b/src/output/SDR.h @@ -2,7 +2,7 @@ Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2018 + Copyright (C) 2022 Matthias P. Braendli, matthias.braendli@mpb.li http://opendigitalradio.org diff --git a/src/output/SDRDevice.h b/src/output/SDRDevice.h index 0bba74a..f4b6c34 100644 --- a/src/output/SDRDevice.h +++ b/src/output/SDRDevice.h @@ -2,7 +2,7 @@ Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2019 + Copyright (C) 2022 Matthias P. Braendli, matthias.braendli@mpb.li http://opendigitalradio.org @@ -143,6 +143,11 @@ class SDRDevice { virtual bool is_clk_source_ok(void) const = 0; virtual const char* device_name(void) const = 0; + + virtual void require_timestamp_refresh() { m_require_timestamp_refresh = true; } + + protected: + bool m_require_timestamp_refresh = false; }; } // namespace Output diff --git a/src/output/Soapy.cpp b/src/output/Soapy.cpp index 50f91a4..c2c5046 100644 --- a/src/output/Soapy.cpp +++ b/src/output/Soapy.cpp @@ -311,7 +311,7 @@ void Soapy::transmit_frame(const struct FrameData& frame) const bool eob_because_muting = m_conf.muting; const bool end_of_burst = eob_because_muting or ( frame.ts.timestamp_valid and - frame.ts.timestamp_refresh and + m_require_timestamp_refresh and samps_to_send <= mtu ); int flags = 0; diff --git a/src/output/UHD.cpp b/src/output/UHD.cpp index 9b22dde..6e38f73 100644 --- a/src/output/UHD.cpp +++ b/src/output/UHD.cpp @@ -348,7 +348,7 @@ void UHD::transmit_frame(const struct FrameData& frame) // EOB and quit the loop afterwards, to avoid an underrun. md_tx.end_of_burst = eob_because_muting or ( frame.ts.timestamp_valid and - frame.ts.timestamp_refresh and + m_require_timestamp_refresh and samps_to_send <= usrp_max_num_samps ); //send a single packet |