<p>So I've had a chance to try out the RPi for this purpose. Short answer: it works great (with some limitations).</p>

<p>The RPi does not support OpenGL. I approached this system with the idea of using a python environment to create and present experiments. There are two good options for this that I know of, opensesame and psychopy. Psychopy requires an OpenGL python backend (pyglet), so it won't run on the Rpi. Opensesame gives you the option of using the same backend as PsychoPy uses but has other options, one of which does not rely on openGL (based on pygames). This 'legacy' backend works just fine. But the absence of openGL means that graphics rely solely on the 700 mHz CPU, which quickly gets overloaded with any sort of rapidly changing visual stimuli (ie. flowing gabors, video, etc.). </p>

<p>The RPi does have a very good video card (for a $25 computer) that supports OpenGL ES. Riverbank software provides python bindings for OpenGL ES (pogles), so there is the possibility for hardware acceleration in python. This has not currently been implemented on PsychoPy or Opensesame. It probably won't happen anytime soon, because there is currently an additional limitation on this system: there's no way to use OpenGL ES in the linux windowing environment (xwindows). This will probably be developed in the medium-term. But currently even a lightweight version of xwindows on the RPi is noticeably clunky and slow (overclocking the CPU helps with this). OpenGL can be used on the Pi through CPU emulation (via Mesa)... but this so heavily overloads the CPU that it's effectively useless. </p>

<p>So the RPi is not well suited for displaying rapidly changing visual stimuli (ie. flowing gabors, video). And PsychoPy effectively doesn't run. But Opensesame runs fine with the non-openGL 'legacy' backend. For a manual RT experiment involving the presentation of static images, this setup running on the Pi will have much the same timing resolution as the same setup running on any other computer. </p>

<p>And it will get better, probably pretty quickly. OpenGL ES support in xwindows should come pretty quick, and once this is available it will be possible to use OpenGL ES python bindings currently under development to make backends for PsychoPy and OpenSesame. These will support fluid moving stimuli and video, and free up the CPU for other tasks. My personal hope is that this will free enough resources to allow the RPi to interface with other systems... like an eye-tracker computer or an eeg amp. </p>

<p>But for now it seems just fine for basic no-video psychophysics. And it's very, very cheap... even factoring in the cost of a small DVI monitor you should be able to get a data collection system up and running for less than 100 euro. </p>

CC BY-SA 3.0
2013-01-29T15:06:21.670Z
2013-01-29T15:06:21.670Z
appositive
<p>Your question is not specific enough.</p>

<p>There will be necessary a delay, the actual question is how long will it be and what delay is acceptable for you.</p>

<p>The first question could be answered by knowing the complexity of your program, the language used (Python is slow), and the power of your hardware (the Pi should not be very powerful).</p>

<p>So, if you have a code example that could help. Just an idea, but you can also ask the video game community which could be good at optimizing such things ;)</p>

<p>Considering the second question, I don't know literature on current production software capacities. Psycho-physic literature could help as well as asking more details to open source developers such as those of:</p>

<ul>
<li>Psychopy (Python)</li>
<li>Psychtoolbox-3 (MatLab)</li>
</ul>

CC BY-SA 3.0
2013-01-25T08:28:37.537Z
2013-01-25T08:28:37.537Z
Cheatboy2
<p>I'm outfitting a small behavioural lab with a fiscal-austerity-induced budget. I'm considering trying out a Raspberry pi for individual participant systems. My tentative plan is to run linux and code experiments in python. </p>

<p>Does anyone have any experience with this? </p>

<p>My primary concern is whether the processor and video capabilities of the Pi will make it accurate enough in terms of timing. Will the Pi have substantial delay / variability between a call to present complicated visual stimuli (like arrays of Gabors) and the time stimuli actually appear on the screen? When a keyboard or mouse button gets pressed, what will be the delay / variability between the actual response time and the recorded response time? </p>

CC BY-SA 3.0
2013-01-18T05:09:26.557Z
Interesting idea. What kinds of experiments were you planning on running with it? I wonder whether you'll get a better answer here or on http://raspberrypi.stackexchange.com/
Jeromy Anglim
CC BY-SA 3.0
2013-01-19T13:17:01.307Z
Hi Jeromy, I have indeed asked the same question on the raspberry pi stackexchange. So far it seems like the pi should work find. But it would be great to hear of first hand experiences with this application... as for experiments, things like visual search, stroop task.
appositive
CC BY-SA 3.0
2013-01-21T19:55:40.633Z
I have tried to limit the parameters of the question a bit to make it more focused and answerable.  If these aren't the type of characteristics you are looking for in your experiments, please don't hesitate to edit your own requirements in.  I think that the question being just "what does your lab do?" makes it less constructive.  As it is, it looks a bit like a "list" question now, but if you narrow down your requirements enough, it should be fine.
Chuck Sherrington
CC BY-SA 3.0
2013-01-21T20:03:54.097Z
(a related question on DSP.SE - http://dsp.stackexchange.com/questions/611/is-real-time-signal-processing-possible-under-windows by some clown named jonsca ;) )
Chuck Sherrington
CC BY-SA 3.0
2013-01-21T21:20:16.063Z
Chuck, thanks for your help. I'm learning what's expected of the questions here. Your edits moved the topic away from a question about the raw capability of the system to a question about parameters. So I've edited it myself to make things a little clearer and more specific. Thanks also for the link to the dsp.se question.
appositive
CC BY-SA 3.0
2013-04-01T12:55:28.670Z
[subsequent question asked on raspberrypi SE](http://raspberrypi.stackexchange.com/questions/4560/could-the-raspberry-pi-be-used-for-stimulus-presentation-in-psychological-experi)
Jeromy Anglim
<methodology><experimental-psychology>
Is the Raspberry Pi capable of operating as a stimulus presentation system for experiments?
appositive
# Is the Raspberry Pi capable of operating as a stimulus presentation system for experiments?

(Asked by: username_0 on 2013-01-17)

I'm outfitting a small behavioural lab with a fiscal-austerity-induced budget. I'm considering trying out a Raspberry pi for individual participant systems. My tentative plan is to run linux and code experiments in python.

Does anyone have any experience with this?

My primary concern is whether the processor and video capabilities of the Pi will make it accurate enough in terms of timing. Will the Pi have substantial delay / variability between a call to present complicated visual stimuli (like arrays of Gabors) and the time stimuli actually appear on the screen? When a keyboard or mouse button gets pressed, what will be the delay / variability between the actual response time and the recorded response time?

**Tags:** methodology, experimental-psychology

> **Comments:**
> **username_1**: Interesting idea. What kinds of experiments were you planning on running with it? I wonder whether you'll get a better answer here or on http://raspberrypi.stackexchange.com/  
> **username_0**: Hi Jeromy, I have indeed asked the same question on the raspberry pi stackexchange. So far it seems like the pi should work find. But it would be great to hear of first hand experiences with this application... as for experiments, things like visual search, stroop task.  
> **username_2**: I have tried to limit the parameters of the question a bit to make it more focused and answerable.  If these aren't the type of characteristics you are looking for in your experiments, please don't hesitate to edit your own requirements in.  I think that the question being just "what does your lab do?" makes it less constructive.  As it is, it looks a bit like a "list" question now, but if you narrow down your requirements enough, it should be fine.  
> **username_2**: (a related question on DSP.SE - http://dsp.stackexchange.com/questions/611/is-real-time-signal-processing-possible-under-windows by some clown named jonsca ;) )  
> **username_0**: Chuck, thanks for your help. I'm learning what's expected of the questions here. Your edits moved the topic away from a question about the raw capability of the system to a question about parameters. So I've edited it myself to make things a little clearer and more specific. Thanks also for the link to the dsp.se question.  
> **username_1**: [subsequent question asked on raspberrypi SE](http://raspberrypi.stackexchange.com/questions/4560/could-the-raspberry-pi-be-used-for-stimulus-presentation-in-psychological-experi)  

---

## 2 answers

### Answer by username_0 on 2013-01-29. Score: 2 | Accepted answer

So I've had a chance to try out the RPi for this purpose. Short answer: it works great (with some limitations).

The RPi does not support OpenGL. I approached this system with the idea of using a python environment to create and present experiments. There are two good options for this that I know of, opensesame and psychopy. Psychopy requires an OpenGL python backend (pyglet), so it won't run on the Rpi. Opensesame gives you the option of using the same backend as PsychoPy uses but has other options, one of which does not rely on openGL (based on pygames). This 'legacy' backend works just fine. But the absence of openGL means that graphics rely solely on the 700 mHz CPU, which quickly gets overloaded with any sort of rapidly changing visual stimuli (ie. flowing gabors, video, etc.).

The RPi does have a very good video card (for a $25 computer) that supports OpenGL ES. Riverbank software provides python bindings for OpenGL ES (pogles), so there is the possibility for hardware acceleration in python. This has not currently been implemented on PsychoPy or Opensesame. It probably won't happen anytime soon, because there is currently an additional limitation on this system: there's no way to use OpenGL ES in the linux windowing environment (xwindows). This will probably be developed in the medium-term. But currently even a lightweight version of xwindows on the RPi is noticeably clunky and slow (overclocking the CPU helps with this). OpenGL can be used on the Pi through CPU emulation (via Mesa)... but this so heavily overloads the CPU that it's effectively useless.

So the RPi is not well suited for displaying rapidly changing visual stimuli (ie. flowing gabors, video). And PsychoPy effectively doesn't run. But Opensesame runs fine with the non-openGL 'legacy' backend. For a manual RT experiment involving the presentation of static images, this setup running on the Pi will have much the same timing resolution as the same setup running on any other computer.

And it will get better, probably pretty quickly. OpenGL ES support in xwindows should come pretty quick, and once this is available it will be possible to use OpenGL ES python bindings currently under development to make backends for PsychoPy and OpenSesame. These will support fluid moving stimuli and video, and free up the CPU for other tasks. My personal hope is that this will free enough resources to allow the RPi to interface with other systems... like an eye-tracker computer or an eeg amp.

But for now it seems just fine for basic no-video psychophysics. And it's very, very cheap... even factoring in the cost of a small DVI monitor you should be able to get a data collection system up and running for less than 100 euro.


---

### Answer by username_3 on 2013-01-25. Score: 1

Your question is not specific enough.

There will be necessary a delay, the actual question is how long will it be and what delay is acceptable for you.

The first question could be answered by knowing the complexity of your program, the language used (Python is slow), and the power of your hardware (the Pi should not be very powerful).

So, if you have a code example that could help. Just an idea, but you can also ask the video game community which could be good at optimizing such things ;)

Considering the second question, I don't know literature on current production software capacities. Psycho-physic literature could help as well as asking more details to open source developers such as those of:

* Psychopy (Python)
* Psychtoolbox-3 (MatLab)


---

