diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-06-05 10:09:18 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-06-05 10:09:18 +0200 |
commit | 01f55e125cdc2156bb6936f70aa52d13ff40420f (patch) | |
tree | 937c4e753c618409b87ce7f4498b0c73b340b4f1 /src/OutputUHD.cpp | |
parent | 23ad47277e73348bca32226d87274541e56bbebb (diff) | |
parent | c8b792fee07cfa591339cbf6f67454cb1cf4535b (diff) | |
download | dabmod-01f55e125cdc2156bb6936f70aa52d13ff40420f.tar.gz dabmod-01f55e125cdc2156bb6936f70aa52d13ff40420f.tar.bz2 dabmod-01f55e125cdc2156bb6936f70aa52d13ff40420f.zip |
Merge branch 'next' into tii
Diffstat (limited to 'src/OutputUHD.cpp')
-rw-r--r-- | src/OutputUHD.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/OutputUHD.cpp b/src/OutputUHD.cpp index 28df515..6ad7dfd 100644 --- a/src/OutputUHD.cpp +++ b/src/OutputUHD.cpp @@ -104,12 +104,8 @@ OutputUHD::OutputUHD( RC_ADD_PARAMETER(muting, "Mute the output by stopping the transmitter"); RC_ADD_PARAMETER(staticdelay, "Set static delay (uS) between 0 and 96000"); - // TODO: find out how to use boost::bind to give the logger to the - // uhd_msg_handler uhd::msg::register_handler(uhd_msg_handler); - uhd::set_thread_priority_safe(); - //create a usrp device MDEBUG("OutputUHD:Creating the usrp device with: %s...\n", device.str().c_str()); @@ -353,6 +349,7 @@ int OutputUHD::process(Buffer* dataIn, Buffer* dataOut) " to " << dataIn->getLength(); throw std::runtime_error("Non-constant input length!"); } + mySyncBarrier.get()->wait(); if (!uwd.running) { @@ -477,6 +474,16 @@ void UHDWorker::process() // Transmit timeout const double timeout = 20.0; + // Set thread priority to realtime + const int policy = SCHED_RR; + sched_param sp; + sp.sched_priority = sched_get_priority_min(policy); + int ret = pthread_setschedparam(pthread_self(), policy, &sp); + if (ret != 0) { + etiLog.level(error) << "Could not set priority for UHD thread:" << ret; + } + + #if FAKE_UHD == 0 uhd::stream_args_t stream_args("fc32"); //complex floats uhd::tx_streamer::sptr myTxStream = uwd->myUsrp->get_tx_stream(stream_args); |