summaryrefslogtreecommitdiffstats
path: root/src/OutputUHD.h
diff options
context:
space:
mode:
authorKenneth Mortensen <mortensenit@users.noreply.github.com>2015-04-22 11:39:19 +0200
committerKenneth Mortensen <mortensenit@users.noreply.github.com>2015-04-22 11:39:19 +0200
commitd45f9b924c54fc40c228b8d3709e93fed7720705 (patch)
tree1192e317e6fdfae692f67843400b698c49ee7a1f /src/OutputUHD.h
parent191817b42ad86a250bbff02895e9646f51531672 (diff)
parent81775f47227c5d08a05b43ffb3855bff0a237c1d (diff)
downloaddabmod-d45f9b924c54fc40c228b8d3709e93fed7720705.tar.gz
dabmod-d45f9b924c54fc40c228b8d3709e93fed7720705.tar.bz2
dabmod-d45f9b924c54fc40c228b8d3709e93fed7720705.zip
Merge remote-tracking branch 'upstream/master'
Conflicts: src/InputFileReader.cpp
Diffstat (limited to 'src/OutputUHD.h')
-rw-r--r--src/OutputUHD.h44
1 files changed, 32 insertions, 12 deletions
diff --git a/src/OutputUHD.h b/src/OutputUHD.h
index a2ffb7d..aed80f6 100644
--- a/src/OutputUHD.h
+++ b/src/OutputUHD.h
@@ -83,9 +83,20 @@ struct UHDWorkerFrameData {
struct frame_timestamp ts;
};
+struct fct_discontinuity_error : public std::exception
+{
+ const char* what () const throw ()
+ {
+ return "FCT discontinuity detected";
+ }
+};
+
enum refclk_lock_loss_behaviour_t { CRASH, IGNORE };
struct UHDWorkerData {
+ bool running;
+ bool failed_due_to_fct;
+
#if FAKE_UHD == 0
uhd::usrp::multi_usrp::sptr myUsrp;
#endif
@@ -130,28 +141,26 @@ struct UHDWorkerData {
class UHDWorker {
public:
- UHDWorker () {
- running = false;
- }
-
void start(struct UHDWorkerData *uhdworkerdata) {
- running = true;
uwd = uhdworkerdata;
- uhd_thread = boost::thread(&UHDWorker::process, this);
+
+ uwd->running = true;
+ uwd->failed_due_to_fct = false;
+ uhd_thread = boost::thread(&UHDWorker::process_errhandler, this);
}
void stop() {
- running = false;
+ uwd->running = false;
uhd_thread.interrupt();
uhd_thread.join();
}
+ private:
void process();
+ void process_errhandler();
- private:
struct UHDWorkerData *uwd;
- bool running;
boost::thread uhd_thread;
uhd::tx_streamer::sptr myTxStream;
@@ -171,6 +180,7 @@ struct OutputUHDConfig {
double txgain;
bool enableSync;
bool muteNoTimestamps;
+ unsigned dabMode;
/* allowed values : auto, int, sma, mimo */
std::string refclk_src;
@@ -188,9 +198,10 @@ struct OutputUHDConfig {
class OutputUHD: public ModOutput, public RemoteControllable {
public:
+
OutputUHD(
- OutputUHDConfig& config,
- Logger& logger);
+ const OutputUHDConfig& config,
+ Logger *logger);
~OutputUHD();
int process(Buffer* dataIn, Buffer* dataOut);
@@ -216,7 +227,7 @@ class OutputUHD: public ModOutput, public RemoteControllable {
protected:
- Logger& myLogger;
+ Logger *myLogger;
EtiReader *myEtiReader;
OutputUHDConfig myConf;
uhd::usrp::multi_usrp::sptr myUsrp;
@@ -229,6 +240,15 @@ class OutputUHD: public ModOutput, public RemoteControllable {
// muting can only be changed using the remote control
bool myMuting;
+ private:
+ // Resize the internal delay buffer according to the dabMode and
+ // the sample rate.
+ void SetDelayBuffer(unsigned int dabMode);
+
+ // data
+ int myStaticDelayUs; // static delay in microseconds
+ int myTFDurationMs; // TF duration in milliseconds
+ std::vector<complexf> myDelayBuf;
size_t lastLen;
};