aboutsummaryrefslogtreecommitdiffstats
path: root/src/OutputUHD.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-10-17 06:29:29 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-10-17 06:29:29 +0200
commitad311a62d4020e3fd7a7048e9d25bd5735206c81 (patch)
tree9ca1308c636129d6c1ff1bccfe6fad630cb5c37a /src/OutputUHD.cpp
parent3446e66971ed340146c1885b7768eefbaecac1bc (diff)
downloaddabmod-ad311a62d4020e3fd7a7048e9d25bd5735206c81.tar.gz
dabmod-ad311a62d4020e3fd7a7048e9d25bd5735206c81.tar.bz2
dabmod-ad311a62d4020e3fd7a7048e9d25bd5735206c81.zip
Recover OutputUHDFeedback failure
Diffstat (limited to 'src/OutputUHD.cpp')
-rw-r--r--src/OutputUHD.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/OutputUHD.cpp b/src/OutputUHD.cpp
index 10e605f..e1fe9dd 100644
--- a/src/OutputUHD.cpp
+++ b/src/OutputUHD.cpp
@@ -281,7 +281,8 @@ OutputUHD::OutputUHD(
myUsrp->set_rx_gain(myConf.rxgain);
etiLog.log(debug, "OutputUHD:Actual RX Gain: %f", myUsrp->get_rx_gain());
- uhdFeedback.setup(myUsrp, myConf.dpdFeedbackServerPort, myConf.sampleRate);
+ uhdFeedback = std::make_shared<OutputUHDFeedback>(
+ myUsrp, myConf.dpdFeedbackServerPort, myConf.sampleRate);
MDEBUG("OutputUHD:UHD ready.\n");
}
@@ -451,7 +452,7 @@ int OutputUHD::process(Buffer* dataIn)
async_rx_thread.join();
first_run = true;
- etiLog.level(error) << "OutputUHD: Error, UHD worker failed";
+ etiLog.level(error) << "OutputUHD UHD worker failed";
throw std::runtime_error("UHD worker failed");
}
@@ -460,7 +461,16 @@ int OutputUHD::process(Buffer* dataIn)
"OutputUHD: dropping one frame with invalid FCT";
}
else {
- uhdFeedback.set_tx_frame(frame.buf, frame.ts);
+ try {
+ uhdFeedback->set_tx_frame(frame.buf, frame.ts);
+ }
+ catch (const runtime_error& e) {
+ etiLog.level(warn) <<
+ "OutputUHD: Feedback server failed, restarting...";
+
+ uhdFeedback = std::make_shared<OutputUHDFeedback>(
+ myUsrp, myConf.dpdFeedbackServerPort, myConf.sampleRate);
+ }
size_t num_frames = frames.push_wait_if_full(frame,
FRAMES_MAX_SIZE);