[LAD] Re: jack_is_realtime(client) issues

Hermann Meyer <brummer--S0/[email protected]> Mon, 25 Aug 2025 09:33:07 +0200
Newsgroups gmane.linux.audio.devel
Message-ID <[email protected]>
Am 25.08.25 um 08:13 schrieb Florian Paul Schmidt:
> On August 24, 2025 4:15:37 PM GMT+02:00, Hermann Meyer<brummer--S0/[email protected]> wrote:
>> Hi
>>
>> I running into issues with the jack_is_realtime(client) currently. The issue is, when the user didn't have permission to run real-time tasks, jackd starts with no real-time permission but jack_is_realtime(client) reports true as soon the -R is in the jackd commandline. The same is true for jack_client_real_time_priority(client). This call reports the real-time priority given in the command line, but not the one in use. So, when jackd starts without real-time priority, but -R is given on the command-line, it reports the priority from jackdrc while it runs at SCHED_OTHER without any priority.
>>
>> Now, when I want to start my own threads I cant relay on the values reported by jackd, which render the functions useless.
>>
>> I need to run my own tests in order to check if real-time priority could be set by the user or not.
>>
>> regards
>>
>> hermann
>> _______________________________________________
>> Linux-audio-dev mailing list --linux-audio-dev-cunTk1MwBs/[email protected]
>> To unsubscribe send an email tolinux-audio-dev-leave-cunTk1MwBs/[email protected]
> The documentation for this API call is a little unclear about what it really does:
>
> <https://jackaudio.org/api/group__ClientFunctions.html#ga15719a4abdcc5fa8415167dd6ed6512c>
>
> And one could consider the implementation to be conforming.
>
> I would still consider this a bug though - but rather both in the documentation and the implementation.
>
> Also wasn't there a difference between jack1 and jack2 in how they handle the failure to acquire rt scheduling? IIRC jack1 errors out while jack2 just prints a warning.
>
> With jack1 the behaviour then would be precisely what one wants since -R and having this call returning 1 actually implies having rt scheduling. With jack2 that's not the case anymore.
>
>
> Kind regardsv
> FPS
> ______________________

As I want to know if jack run with realtime privileges before I activate 
the client I cant use the solution from Fons. My solution for now is to 
create a test thread and check if I could set it to SCHED_FIFO. If that 
works I could trust the outcome from jack_is_realtime(client) and 
jack_client_real_time_priority(client). If not, I assume that jack 
didn't run with realtime privileges and init my threads into SCHED_OTHER.

regards

hermann

_______________________________________________
Linux-audio-dev mailing list -- linux-audio-dev-cunTk1MwBs/[email protected]
To unsubscribe send an email to linux-audio-dev-leave-cunTk1MwBs/[email protected]