[PlanetCCRMA] sched_setscheduler seeming to have no effect
Kjetil S. Matheussen
kjetil@ccrma.Stanford.EDU
Fri Dec 23 15:48:01 2005
Eric Weaver:
>
> I am running 2.4.24-1.ll.rh90.ccrma with ALSA 1.0.10 using snd-asihpi
> and usb audio over OSS (long story, that). Since upgrading to ALSA
> 1.0.10 from I think 1.0.4, I have been getting occasional overrun
> notifications from arecord (nothing drastic or too frightening but
> should not be happening at all with the buffer sizes I'm using).
>
> My capture scripts are indeed running (sudoing as root) a little program
> I wrote to put arecord into SCHED_FIFO at priority 98 (using
> sched_setscheduler). It reports normal completion of that system call,
> verified tracing it with gdb.
>
> Yet when I test this using "sleep 999 &" and changing its scheduling as
> above, and look at the target process with "ps -O policy,rtprio" it
> reports "-" and "0", respectively.
>
> Is there anything I'm missing here?
>
Its probably okey. I'm pretty sure ps can not be used to show
whether a process is SCHED_FIFO or not on linux 2.4.
PS. If you insert a system("/usr/bin/givertcap") into your code, you
don't have to run as root or sudoing to get SCHED_FIFO/SCHED_RR.
--