[Bug]: Emulated Keyboard Keystrokes Missed By Psychopy. Cedrus Riponda Box Has Various Issues. No Duration, And does Not Appear To Be A Subclass...

by ADMIN 154 views

Introduction

Psychopy is a popular open-source software for creating and running psychological experiments. However, users have reported several issues with the Cedrus Riponda box, a device used for collecting button press data. In this article, we will explore the problems encountered with the Cedrus Riponda box in Psychopy, including missed keyboard keystrokes, duration issues, and crashes.

PsychoPy Version and Operating System

The version of PsychoPy used in this article is 2024.2.4, and the operating system is Windows 11.

Bug Description

There are multiple small issues with the Cedrus Riponda box in Psychopy.

1. Missed Keyboard Keystrokes

When emulating a keyboard, the computer recognizes each Cedrus button press, but Psychopy does not. This is because the key down and key up events occur virtually simultaneously, and depending on how things get checked, Psychopy may miss these super quick events.

Speculation

This issue is similar to one encountered in a PyGame program, where the loop was checking for currently pressed keys but not a list of all events since it last checked. This led to missed key presses.

2. Duration Issue

When working as a Cedrus input box (and not emulating a keyboard), there is a problem with the duration. The component has no duration, and this can be fixed by setting the duration to a high value, such as 9999.

3. Crash Issue

The larger issue is that Psychopy crashes when it registers a key press in Riponda button box mode. This is indicated by the warning message:

Component 'LuminaButtonBoxBackend does not appear to be a subclass of psychopy.experiment.components._base.BaseComponent. This will be skipped.`

Full Error Message

The full error message is:

2.5710     WARNING     Component `LuminaButtonBoxBackend` does not appear to be a subclass of `psychopy.experiment.components._base.BaseComponent`. This will be skipped.
2.5710     WARNING     Component `RBButtonBoxBackend` does not appear to be a subclass of `psychopy.experiment.components._base.BaseComponent`. This will be skipped.
2.5710     WARNING     Component `RBPhotodiodeValidatorBackend` does not appear to be a subclass of `psychopy.experiment.components._base.BaseComponent`. This will be skipped.
2.5711     WARNING     Component `RipondaButtonBoxBackend` does not appear to be a subclass of `psychopy.experiment.components._base.BaseComponent`. This will be skipped.
2.5711     WARNING     Component `RipondaPhotodiodeValidatorBackend` does not appear to be a subclass of `psychopy.experiment.components._base.BaseComponent`. This will be skipped.
2.5711     WARNING     Component `StimTrackerButtonBoxBackend` does not appear to be a subclass of `psychopy.experiment.components._base.BaseComponent`. This will be skipped.
2.5711     WARNING     Component `StimTrackerPhotodiodeValidatorBackend` does not appear to be a subclass of `psychopy.experiment.components._base.BaseComponent`. This will be skipped.
8.8995     WARNING     User requested fullscreen with size [1280  720], but screen is actually [1920, 1080]. Using actual size
1.1006     WARNING     Monitor specification not found. Creating a temporary one...
ioHub Server Process Completed With Code:  0
################ Experiment ended with exit code 0 [pid:16968] #################

Expected Behaviour

The program should:

  1. Register the key press when the Riponda is in keyboard mode.
  2. Not crash when it registers a key press in Riponda button box mode.

Steps to Reproduce

  1. Use the Cedrus button box in keyboard emulator mode. Notice how it only catches about two-thirds of the key presses.
  2. Use the Cedrus Riponda in their mode, and notice how the program crashes.

Additional Context

No additional context is provided.

Conclusion

Introduction

In our previous article, we explored the issues with the Cedrus Riponda box in Psychopy, including missed keyboard keystrokes, duration issues, and crashes. In this article, we will answer some frequently asked questions (FAQs) related to these issues.

Q: What is the cause of the missed keyboard keystrokes?

A: The cause of the missed keyboard keystrokes is due to the key down and key up events occurring virtually simultaneously. Depending on how things get checked, Psychopy may miss these super quick events.

Q: How can I fix the duration issue?

A: To fix the duration issue, you can set the duration to a high value, such as 9999. This will ensure that the component has a duration and will not cause any issues.

Q: Why does Psychopy crash when it registers a key press in Riponda button box mode?

A: Psychopy crashes when it registers a key press in Riponda button box mode because the component does not appear to be a subclass of psychopy.experiment.components._base.BaseComponent. This is indicated by the warning message:

Component 'LuminaButtonBoxBackend does not appear to be a subclass of psychopy.experiment.components._base.BaseComponent. This will be skipped.`

Q: How can I troubleshoot the crash issue?

A: To troubleshoot the crash issue, you can try the following:

  1. Check the warning messages to see if there are any other issues that may be causing the crash.
  2. Try to reproduce the crash by running the experiment multiple times.
  3. Check the Psychopy logs to see if there are any error messages that may indicate the cause of the crash.

Q: What are some common causes of crashes in Psychopy?

A: Some common causes of crashes in Psychopy include:

  1. Incompatible hardware or software.
  2. Outdated or corrupted Psychopy files.
  3. Conflicting plugins or extensions.
  4. Insufficient system resources.

Q: How can I prevent crashes in Psychopy?

A: To prevent crashes in Psychopy, you can try the following:

  1. Regularly update Psychopy to the latest version.
  2. Check for incompatible hardware or software and update or replace as necessary.
  3. Use a reliable and up-to-date operating system.
  4. Avoid using conflicting plugins or extensions.

Q: What are some best practices for troubleshooting issues with the Cedrus Riponda box in Psychopy?

A: Some best practices for troubleshooting issues with the Cedrus Riponda box in Psychopy include:

  1. Read the Psychopy documentation and user manual carefully.
  2. Search online for solutions to common issues.
  3. Join online communities or forums for Psychopy users.
  4. Contact Psychopy support for assistance.

Conclusion

In conclusion, troubleshooting issues with the Cedrus Riponda box in Psychopy can be challenging, but by following the best practices and FAQs outlined in this article, you can resolve common issues and ensure a smooth and successful experiment.