A realtime thread creation with SCHED_FIFO flag worked for months, then today it keeps failing.
Long story short, I have a DietPi Armbian Trixie OS with kernel v6.18 installed on what used to be an Android STB (Amlogic S905X)
I have been developing my realtime audio app with it for the past 3 months. The app creates a thread for the audio tasks with a SCHED_FIFO flag, using pthread.
10 hours ago, I shutdown the system as usual, and went to do other things, then came back later to it to continue working on the app again as usual. Booted into the system, but suddenly the compiled app couldn't create the thread, no matter how many times I tried, even across multiple reboots and power cycles.
The returned error code from trying to create the thread is 1, which means the kernel is not allowing the SCHED_FIFO flag anymore. Replaced the flag with SCHED_OTHER, and the thread creation is always a success and my app runs fine.
Why??
The box does not have internet connection, and the last time I updated the system was after I installed it, which is 3 months ago.
I don't understand why suddenly the OS decided that I should not have the permission for a real-time thread, even though I did not make any changes to the system. Why would I mess around with it? I'm a noob Linux user, this is the longest I have been on the OS.
Have any of you experienced this before? And if you did, how would you be able to fix it, other than reinstalling?