Questions about real-time threads

Hi there,

I have a few questions about real-time threads on ELK OS:

  1. Can I run any real-time thread, by setting SCHED_FIFO, without an expansion shield on a raspberry pi 3b+?
  2. If I have a raspberry pi 3b+ with expansion shield, can I run any real-time thread other than the audio capture & playback related threads? e.g. UDP networking thread, audio processing thread. If I can, could these threads have higher priority than audio capture & playback related threads?


Hi @Piasy,

Of course. But in a system with Elk running on top of Xenomai, those are not 1st class citizen “real-time” threads. They will always have lower priority than Xenomai’s Cobalt kernel real-time tasks.

If you need to access any Linux infrastructure (e.g. for a networking thread), then they will never have higher priority than the audio driver threads.

It’s possible to spawn a new thread that doesn’t do any I/O, purely for DSP computation, at a similar priority level than the main audio RT thread. Take a look for example at the TWINE library which, on Xenomai-enabled systems, spawns Xenomai’s RT threads:

It is not a good idea to have any threads at higher priority than the audio driver, though, since in a RT audio system that always has to have the priority over all the rest.

1 Like

Okay, I got it, thank you!