[Solved] E xx: xxxx:xx ERR thread 0x536753929472 setscheduler failed Operation not permitted

E xx: xxxx:xx ERR thread 0x536753929472 setscheduler failed Operation not permitted

The “setscheduler failed Operation not permitted” error occurred when setting the thread priority via sched_setscheduler.

int ret = sched_setscheduler(pthread_gettid_np((pthread_t)pHandle), SCHED_RR, &prio);

 

Solution:
add the following contents to the process startup parameters:

capabilities SYS_NICE

init.target.rc

service xxxxxx /system/vendor/bin/xxxxxx
    class core
    user system
    group camera input graphics
    disabled
    onrestart restart evs_driver
    onrestart restart qcarcam_hal
    capabilities SYS_NICE

Read More: