Sorry, don't know what it does.. could you explain what and how ;-)

On Linux (and most other UNIXes), processes have a scheduling policy and a scheduling priority. The policy determines what algorithm is used for choosing which processes to cycle between, and the priority determines within those policies, which ones are more important.

On the empeg, the player is generally (by default) the only process that runs using what's called realtime scheduling (SCHED_RR is one of the two available realtime scheduling policies.) This means that, for all intents and purposes, user apps get a tiny share of CPU, and they get it whenever the player or other apps which are using realtime scheduling feel like giving it up. (Sorta, it's a little more complicated than that on the micro level.)

So by default, programs use SCHED_OTHER, which is the non-realtime scheduler. To change the scheduling policy to realtime, you do the following in your program. The following is lifted directly from my emptriv source, so it might not look exactly like yours. You might not be forking off a new process to start off with, for instance, if you're not, take the if fork()... stuff out. Also, checkRC is just a macro which checks the return value of these calls (>0 is error.) Substitute in your own error checking.


// include section
#include <sched.h>

// define the process priority
#define PRIORITY 30

// variable declarations
struct sched_param sched_param;
int old_policy;
int iPid;

// early on in your int main(), do the following:
if ( fork( ) != 0 ) // Fork off the process, if parent, return
return 0;
else
{
iPid = getpid();

old_policy = sched_getscheduler( iPid );
rc = sched_getparam(iPid, &sched_param);
checkRC("sched_getparam()\n", rc);
sched_param.sched_priority = PRIORITY;

rc = sched_setscheduler(iPid, SCHED_RR, &sched_param);
checkRC("sched_setscheduler()\n", rc);
rc = sched_setparam(iPid, &sched_param);
checkRC("sched_setparam()\n", rc);
}
// continue on with your program


.

Basically what the above does is set the priority and scheduling policy of your process. I think if you add this code to your program, you'll definitely notice it's more responsive. You should be able to scroll a little faster, and get a slice of CPU more than every 20 ms. Give it a shot, or give me your source code so I can do it.
_________________________
- Tony C
my empeg stuff