PTB Critical Error

Hi,

I am running a modified version of the PsychPortAudioTimingTest which includes recording the sound and the flash of light through a data acquisition device.

I've run the code several times over the last few days with no errors or problems and today for some reason the following critical error appeared:

PTBCRITICAL -ERROR: PsychTimeGlue - Win32 syscall SetThreadAffinityMask() failed!!! Timing could be inaccurate.
PTBCRITICAL -ERROR: Time measurement may be highly unreliable - or even false!!!
PTBCRITICAL -ERROR: FIX YOUR SYSTEM! In its current state its not useable for conduction of studies!!!
PTBCRITICAL -ERROR: Check the FAQ section of the Psychtoolbox Wiki for more information.


I've checked the FAQ's and I couldn't find any mention of this timing error.

Any help would be appreciated

Al
I removed the graphics card and sound card to test it oon another computer but I simply placed them back into their original slots on this computer and it worked fine for 2 days then suddenly i got this error. I haven't installed any new hardware on the PC in over a month or so.

I'm using windows XP and I have the following line in my code to activate all of the processor cores which may be the problem:

PsychTweak('ExecuteOnCPUCores', [0:7]); % Allows computer to use all 8 cores instead of the default of only core zero

I've rebooted several times and it doesn't seem to solve the problem.

thanks,

Al

--- In psychtoolbox@yahoogroups.com, "Mario" wrote:
>
>
>
> Does rebooting the system help? There's no entry on the Wiki because this is afaik the first time ever somebody encountered this error.
>
> Did you install some new software inbetween? What os? How many processor cores?
>
> -mario
>
> --- In psychtoolbox@yahoogroups.com, "masondar123" wrote:
> >
> > Hi,
> >
> > I am running a modified version of the PsychPortAudioTimingTest which includes recording the sound and the flash of light through a data acquisition device.
> >
> > I've run the code several times over the last few days with no errors or problems and today for some reason the following critical error appeared:
> >
> > PTBCRITICAL -ERROR: PsychTimeGlue - Win32 syscall SetThreadAffinityMask() failed!!! Timing could be inaccurate.
> > PTBCRITICAL -ERROR: Time measurement may be highly unreliable - or even false!!!
> > PTBCRITICAL -ERROR: FIX YOUR SYSTEM! In its current state its not useable for conduction of studies!!!
> > PTBCRITICAL -ERROR: Check the FAQ section of the Psychtoolbox Wiki for more information.
> >
> >
> > I've checked the FAQ's and I couldn't find any mention of this timing error.
> >
> > Any help would be appreciated
> >
> > Al
> >
>
Hi,

I'm using windows XP on my computer. Rebooting doesn't help unfortunately the problem still remains.

No new software has been installed all I did was remove the graphics card and sound card to try it out on another computer. But when I put them into this computer again everything worked fine with no errors and now suddenly i get this error.

I use this line in my code which may cause the problem I'm not sure:

PsychTweak('ExecuteOnCPUCores', [0:7]); % Allows computer to use all 8 cores instead of the default of only core zero

thanks,

Al


--- In psychtoolbox@yahoogroups.com, "Mario" wrote:
>
>
>
> Does rebooting the system help? There's no entry on the Wiki because this is afaik the first time ever somebody encountered this error.
>
> Did you install some new software inbetween? What os? How many processor cores?
>
> -mario
>
> --- In psychtoolbox@yahoogroups.com, "masondar123" wrote:
> >
> > Hi,
> >
> > I am running a modified version of the PsychPortAudioTimingTest which includes recording the sound and the flash of light through a data acquisition device.
> >
> > I've run the code several times over the last few days with no errors or problems and today for some reason the following critical error appeared:
> >
> > PTBCRITICAL -ERROR: PsychTimeGlue - Win32 syscall SetThreadAffinityMask() failed!!! Timing could be inaccurate.
> > PTBCRITICAL -ERROR: Time measurement may be highly unreliable - or even false!!!
> > PTBCRITICAL -ERROR: FIX YOUR SYSTEM! In its current state its not useable for conduction of studies!!!
> > PTBCRITICAL -ERROR: Check the FAQ section of the Psychtoolbox Wiki for more information.
> >
> >
> > I've checked the FAQ's and I couldn't find any mention of this timing error.
> >
> > Any help would be appreciated
> >
> > Al
> >
>
--- In psychtoolbox@yahoogroups.com, "masondar123" wrote:
>
> I removed the graphics card and sound card to test it oon another computer but I simply placed them back into their original slots on this computer and it worked fine for 2 days then suddenly i got this error. I haven't installed any new hardware on the PC in over a month or so.
>
> I'm using windows XP and I have the following line in my code to activate all of the processor cores which may be the problem:
>
> PsychTweak('ExecuteOnCPUCores', [0:7]); % Allows computer to use all 8 cores instead of the default of only core zero
>

Do you have 8 cores on that machine? That would explain it. Normally PTB on WindowsXP will run timing sensitive threads only on core zero, because a fraction of pc hardware + WindowsXP is known to have severe bugs in their clock system, causing wrong time returned by the clock, things like jumps forward or backward in time, time slowing down or getting faster, etc., stuff that is not very healthy for timed stimulus presentation, reaction time measurements or sync across modalities. One source of this trouble is multi-core operation, so we avoid that cause of trouble by running effectively single core whenever timing matters. On Vista and later we run on all cores by default, but revert to single core in case clock malfunctions get detected - assuming Microsoft improved their later OS'es. 'ExecuteOnCores' is an override. So you are making your scripts more susceptible to timing trouble. Also MS-Docu says that the underlying SetThreadAffinity() function will fail if you ask to run on cores that the parent process (Matlab) is not allowed to run, or probably on non-existent or unavailable cores. I don't know how WindowsXP handles this or if some of your other software maybe reserves cores for exclusive use, but that PsychTweak call is probably the trigger on your system. Also WindowsXP comes from the stone-age of multi-threading, i could imagine it has some deficiencies.

-mario


> I've rebooted several times and it doesn't seem to solve the problem.
>
> thanks,
>
> Al
>
> --- In psychtoolbox@yahoogroups.com, "Mario" wrote:
> >
> >
> >
> > Does rebooting the system help? There's no entry on the Wiki because this is afaik the first time ever somebody encountered this error.
> >
> > Did you install some new software inbetween? What os? How many processor cores?
> >
> > -mario
> >
> > --- In psychtoolbox@yahoogroups.com, "masondar123" wrote:
> > >
> > > Hi,
> > >
> > > I am running a modified version of the PsychPortAudioTimingTest which includes recording the sound and the flash of light through a data acquisition device.
> > >
> > > I've run the code several times over the last few days with no errors or problems and today for some reason the following critical error appeared:
> > >
> > > PTBCRITICAL -ERROR: PsychTimeGlue - Win32 syscall SetThreadAffinityMask() failed!!! Timing could be inaccurate.
> > > PTBCRITICAL -ERROR: Time measurement may be highly unreliable - or even false!!!
> > > PTBCRITICAL -ERROR: FIX YOUR SYSTEM! In its current state its not useable for conduction of studies!!!
> > > PTBCRITICAL -ERROR: Check the FAQ section of the Psychtoolbox Wiki for more information.
> > >
> > >
> > > I've checked the FAQ's and I couldn't find any mention of this timing error.
> > >
> > > Any help would be appreciated
> > >
> > > Al
> > >
> >
>
Hi Mario,

My problem magically fixed itself without any need for me to change my code. I will still remove the line relating to the cores on the PC but I am no longer receiving any critical warnings with it present in the script.

thanks for your help,

Alan

--- In psychtoolbox@yahoogroups.com, "Mario" wrote:
>
>
>
>
>
> --- In psychtoolbox@yahoogroups.com, "masondar123" wrote:
> >
> > I removed the graphics card and sound card to test it oon another computer but I simply placed them back into their original slots on this computer and it worked fine for 2 days then suddenly i got this error. I haven't installed any new hardware on the PC in over a month or so.
> >
> > I'm using windows XP and I have the following line in my code to activate all of the processor cores which may be the problem:
> >
> > PsychTweak('ExecuteOnCPUCores', [0:7]); % Allows computer to use all 8 cores instead of the default of only core zero
> >
>
> Do you have 8 cores on that machine? That would explain it. Normally PTB on WindowsXP will run timing sensitive threads only on core zero, because a fraction of pc hardware + WindowsXP is known to have severe bugs in their clock system, causing wrong time returned by the clock, things like jumps forward or backward in time, time slowing down or getting faster, etc., stuff that is not very healthy for timed stimulus presentation, reaction time measurements or sync across modalities. One source of this trouble is multi-core operation, so we avoid that cause of trouble by running effectively single core whenever timing matters. On Vista and later we run on all cores by default, but revert to single core in case clock malfunctions get detected - assuming Microsoft improved their later OS'es. 'ExecuteOnCores' is an override. So you are making your scripts more susceptible to timing trouble. Also MS-Docu says that the underlying SetThreadAffinity() function will fail if you ask to run on cores that the parent process (Matlab) is not allowed to run, or probably on non-existent or unavailable cores. I don't know how WindowsXP handles this or if some of your other software maybe reserves cores for exclusive use, but that PsychTweak call is probably the trigger on your system. Also WindowsXP comes from the stone-age of multi-threading, i could imagine it has some deficiencies.
>
> -mario
>
>
> > I've rebooted several times and it doesn't seem to solve the problem.
> >
> > thanks,
> >
> > Al
> >
> > --- In psychtoolbox@yahoogroups.com, "Mario" wrote:
> > >
> > >
> > >
> > > Does rebooting the system help? There's no entry on the Wiki because this is afaik the first time ever somebody encountered this error.
> > >
> > > Did you install some new software inbetween? What os? How many processor cores?
> > >
> > > -mario
> > >
> > > --- In psychtoolbox@yahoogroups.com, "masondar123" wrote:
> > > >
> > > > Hi,
> > > >
> > > > I am running a modified version of the PsychPortAudioTimingTest which includes recording the sound and the flash of light through a data acquisition device.
> > > >
> > > > I've run the code several times over the last few days with no errors or problems and today for some reason the following critical error appeared:
> > > >
> > > > PTBCRITICAL -ERROR: PsychTimeGlue - Win32 syscall SetThreadAffinityMask() failed!!! Timing could be inaccurate.
> > > > PTBCRITICAL -ERROR: Time measurement may be highly unreliable - or even false!!!
> > > > PTBCRITICAL -ERROR: FIX YOUR SYSTEM! In its current state its not useable for conduction of studies!!!
> > > > PTBCRITICAL -ERROR: Check the FAQ section of the Psychtoolbox Wiki for more information.
> > > >
> > > >
> > > > I've checked the FAQ's and I couldn't find any mention of this timing error.
> > > >
> > > > Any help would be appreciated
> > > >
> > > > Al
> > > >
> > >
> >
>