From 3f816813c1f66d494ee44b074a6ccf05496eaef4 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Fri, 25 May 2018 11:53:18 +0200 Subject: [PATCH] Restored async Late/Underflow monitor thread in USRP. Added option silent to turn it off --- lib/src/phy/rf/rf_uhd_imp.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/src/phy/rf/rf_uhd_imp.c b/lib/src/phy/rf/rf_uhd_imp.c index 797a9528a..d9099d5f1 100644 --- a/lib/src/phy/rf/rf_uhd_imp.c +++ b/lib/src/phy/rf/rf_uhd_imp.c @@ -35,7 +35,7 @@ #include "srslte/phy/rf/rf.h" #include "uhd_c_api.h" -#define HAVE_ASYNC_THREAD 0 +#define HAVE_ASYNC_THREAD 1 typedef struct { char *devname; @@ -396,6 +396,13 @@ int rf_uhd_open_multi(char *args, void **h, uint32_t nof_channels) clock_src = DEFAULT; } + bool start_async_thread = true; + + if (strstr(args, "silent")) { + REMOVE_SUBSTRING_WITHCOMAS(args, "silent"); + start_async_thread = false; + } + // Set over the wire format char *otw_format = "sc16"; if (strstr(args, "otw_format=sc12")) { @@ -584,11 +591,13 @@ int rf_uhd_open_multi(char *args, void **h, uint32_t nof_channels) uhd_meta_range_free(&gain_range); #if HAVE_ASYNC_THREAD - // Start low priority thread to receive async commands - handler->async_thread_running = true; - if (pthread_create(&handler->async_thread, NULL, async_thread, handler)) { - perror("pthread_create"); - return -1; + if (start_async_thread) { + // Start low priority thread to receive async commands + handler->async_thread_running = true; + if (pthread_create(&handler->async_thread, NULL, async_thread, handler)) { + perror("pthread_create"); + return -1; + } } #endif