From 83020d4fa34c287c63ea2589924da2265da57a77 Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Mon, 28 Mar 2022 12:24:26 +0200 Subject: [PATCH] Increased priority of CODEC2 thread, this fixes glitches when generating M17 baseband signal --- openrtx/src/rtx/OpMode_M17.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openrtx/src/rtx/OpMode_M17.cpp b/openrtx/src/rtx/OpMode_M17.cpp index 6a52c840..ad001abd 100644 --- a/openrtx/src/rtx/OpMode_M17.cpp +++ b/openrtx/src/rtx/OpMode_M17.cpp @@ -237,6 +237,12 @@ void OpMode_M17::startCodec() pthread_attr_t codecAttr; pthread_attr_init(&codecAttr); pthread_attr_setstacksize(&codecAttr, 16384); + #ifdef _MIOSIX + // Set priority of CODEC2 thread to the maximum one, the same of RTX thread. + struct sched_param param; + param.sched_priority = sched_get_priority_max(0); + pthread_attr_setschedparam(&codecAttr, ¶m); + #endif pthread_create(&codecThread, &codecAttr, threadFunc, NULL); }