RT not measured from start of keyboard component

OS: Win11
PsychoPy version: 2024.1.1
Standard Standalone
What are you trying to achieve?: Record RT from onset of keyboard component
What did you try to make it work?: Used an older version
What specifically went wrong when you tried that?:
Nothing. Versions up to 2023.2.1 work fine. But versions from 2023.2.2 onward don’t seem to be measuring RT from the start of the keyboard component, but instead seem to be measuring it from the start of the whole experiment, since the values look cumulative, e.g. 1.9845966, 2.8326068, 3.6408739, 4.4330681, 5.272922, … Of course you can still calculate the real RT by subtracting the time given for the onset of the component (e.g. key_resp.started) from this thing misleadingly called “RT” (e.g. key_resp.rt), but in all previous versions RT was calculated automatically.

Am I nuts? How can this be possible? Here’s a dummy experiment to play with (five trials collecting space key responses) - try changing version numbers as described above to see what’s recorded under “key_resp.rt” in the data file:

Thanks for the spot. I’ve replicated it with your code and a new experiment, and I’ve raised a bug report. The reaction times are correctly stored online.

1 Like

Thanks, was just about to post about this.

In the meantime I’ve been looking at using the following code in End Routine:

rt = t
thisExp.addData("rt", rt)

This seems accurate to +/- 10ms from the actual RTs, so I’m expecting to use this as a temporary fix for aspects of the experiment’s internal logic that rely on RT (e.g., providing different feedback based on response time). Unless there’s a method that would provide 1:1 accurate RTs until this is fixed?

Is t ± 10ms or is it actually more consistently +16ms (i.e. one frame)?

This will be fixed in 2024.1.2

Just checked again. Yes it seems to be consistently greater than real RT to a value inside one frame + <16ms.

What I sometimes do for RTs from mouse events is record the value of t in the Each Frame code that ends the routine rather than the value in End Routine.

Thanks for the quick response, and I’m glad that it’s not also a problem in the online version. I hope this isn’t generally the case, though, i.e. that problems are noticed and fixed online first, since I have no choice but to run my experiments offline. E.g. I also have the problem discussed below - not to change the topic, just to express the hope that despite the limited resources available to any “free” project like this, both versions will be maintained with the same amount of vim and vigor.

Thanks, will give that a try!

Is it part of the same bug that I cannot get most of the attributes of keyboard to work? No matter if I want to get key_resp.duration, .value, .name, .t, .started, I always get AttributeError: 'Keyboard' object has no attribute 'name_of_attribute'?

In the meantime, I wanted to use the trick to calculate RT as rt = key_resp.started - key_resp.rt but the above error won’t let me.

I, the original complainer, don’t get that extra problem. Do get you this in version 2024.1.1 in Windows even when running my toy experiment linked above?

I do note, however, that when I go into settings and set “Use PsychoPy version” to “2024.1.1”, rather than just running version 2024.1.1 with that option blank, it refuses to run and just gives me this error:

“OSError: Requested PsychoPy version 2024.1.1 does not support installed Python version 3.8. The last version of PsychoPy to support 3.8 was version 2024.1.0.”

This despite the big blue download button for Windows currently saying “Standalone PsychoPy® 2024.1.1 for 64bit Windows (using Python3.8)”.

I’m using Python 3.10.11.

Just FYI - I personally can afford to wait to the next update.

That looks like a different error - could you share the experiment you’re getting this in? .rt is created in the initialisation function of Keyboard so it absolutely should be there. My guess is either there’s another object with the same name (maybe the ioHub Keyboard class?) which is being queried instead.

Hi @TParsons, thank you for taking a look. I have uploaded the task here: habituation_task/task_habituation at main · johannesjuliusm/habituation_task · GitHub I’m currently also working on another task which is a visual search paradigm. I’m using mouse tracking and want to use mouse.time to give feedback to the user. Running into the same problem there too, that the attribute does not exist for mouse. It is a general pattern that I get this error for most attributes I want to use and I’m not sure where the problem lies.

Hi,
I had the same problem with the cumulative RTs, as mentioned at the beginning of this post, with version 2024.1.1.

I just switched to 2024.1.3 and now I don’t get cumulative RTs but negative numbers: -366833.029406667, -366835.804542417, …

OS: macOS 14
PsychoPy version: 2024.1.3
Standard Standalone

2 Likes

I just tested it on a Windows machine as well (OS: Windows 10). The same problem appears.

For me on Win10, versions up to 2023.2.3 work fine. I also tested it with the dummy experiment linked in the first post. The problems start with 2024.1.0.

I was experiencing a similar issue. You can fix this issue by changing the setting in the following way: Experiment Settings → Input and set the keyboard backend to “Psychtoolbox”

1 Like

That solves the problem also for me. Thank you!

Just letting you guys know, this problem is now fixed in PsychoPy version 2024.1.4 :slight_smile: