@Raziel
Ok, got my priority booster app working. Yesterday I was testing some app that wasn't using SDL2 for audio (Super Methane Bros uses some other lib).
So, could you kindly compile this program, start your ScummVM build and then run this booster? Then we should be able to rule out the audio priority if boosting it to 15 doesn't change anything.
If you run the app twice, or use Ranger, you should see the new priority applied. Also, if you could provide the results, then maybe we can see the priorities of other processes (but not pure Exec tasks).
/* gcc FindSdl2AudioTask.c -Wall */
#include <proto/exec.h>
#include <proto/dos.h>
#include <stdio.h>
#include <string.h>
static int32 HookFunc(struct Hook* hook, uint32 userdata, struct Process* process)
{
struct Task* t = (struct Task *)process;
struct Node* n = &t->tc_Node;
struct CommandLineInterface* cli = BADDR(process->pr_CLI);
if (cli) {
static char buffer[128];
IDOS->CopyStringBSTRToC(cli->cli_CommandName, buffer, sizeof(buffer));
printf("CLI Process %p (%s), priority %d. Process ID %lu, parent ID %lu\n",
process, buffer, n->ln_Pri, process->pr_ProcessID, process->pr_ParentID);
} else {
printf("Process %p (%s), priority %d. Process ID %lu, parent ID %lu\n",
process, n->ln_Name, n->ln_Pri, process->pr_ProcessID, process->pr_ParentID);
if (strncmp(n->ln_Name, "SDL thread SDLAudioP", 20) == 0) {
printf("*** Found SDL2 audio task, boosting priority... ***\n");
IExec->SetTaskPri(t, 15);
}
}
return 0;
}
int main()
{
struct Hook hook = {
{ 0, 0 },
(void*)HookFunc,
NULL,
0
};
int32 r = IDOS->ProcessScan(&hook, NULL, 0);
printf("ProcessScan result %ld\n", r);
return 0;
}
PS. newlines are broken...