Re: [psychopy-users] Problem with display times

112 views
Skip to first unread message

Jonathan Peirce

unread,
Oct 26, 2012, 7:12:13 AM10/26/12
to psychop...@googlegroups.com
Most likely your windows laptop and older macbook have weaker graphics cards (or CPUs). In particular it is taking a long time to render your text stimuli which delays the initial presentation of the images.

Text is, in general, slower to render than images. So if you need to work on a slower machine you could try constructing your text as an image (e.g. in poewrpoint and saving as an image file) and then draw that instead of raw text.

I've seen a lot of people do this for instructions screens especially where they can add lots of complex elements (images and decoration) in the screen, which are easier to set up in powerpoint.

Jon

On 25/10/2012 15:14, Sarah C wrote:
Hi, 

I'm new to PsychoPy and have created my first experiment using the builder on version 1.75.01 on a Macbook with 10.8.2.

I would like the presentation of my experiment to run as follows: 
  • Fixation point (text) presented for 0.6s
  • Target images (image files) for 0.6s
  • Response (text) until keyboard response
The timings seem to run fine on my Macbook, but when I try to run the experiment on a laptop running Windows Vista (still with PsychoPy 1.75.01) the timings do not display properly. The fixation point seems to appear for about 1 second and the target images only flash up very quickly (perhaps 0.1s). I have also tried this on an older macbook (sorry, I don't know the details) and the same thing happened. 

Any help would be really appreciated. If this has already been discussed elsewhere and I've missed it, I'd be grateful for a link. 

Thanks, 
Sarah 
--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To post to this group, send email to psychop...@googlegroups.com.
To unsubscribe from this group, send email to psychopy-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/psychopy-users/-/A9W18cBTacwJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk

This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.

Sarah C

unread,
Oct 26, 2012, 9:39:08 AM10/26/12
to psychop...@googlegroups.com
Hi Jon, 

Thanks for getting back to me. Your explanation seems logical, but unfortunately changing the text into images has not solved the problem for me. 

I could run the experiment on my own Macbook on which the timings work fine (and this would be more convenient) but I have a problem with the display that I cannot seem to fix either. The experiment runs off centre on the screen- please see attached image where the question mark should be in the centre of the screen. This could be related to the Macbook being a retina display model as the issue doesn't happen on any of the other computers I've tried it on with various screen sizes and resolutions. Nothing I change in the monitor centre (screen distance, size, screen width) seems to have any effect on the experiment when I run it. I've realised I need to change the selected monitor in the experiment settings to match the new monitor settings I've added (I really am a beginner!), but is there something else I'm missing to make these changes take effect? 

Any more advice would be very much appreciated!
Sarah 
Screen Shot 2012-10-26 at 14.21.27.png

Jeremy Gray

unread,
Oct 26, 2012, 10:08:54 AM10/26/12
to psychop...@googlegroups.com
I get that display offset as well, but only sometimes (retina display
mac with Mountain Lion). it's very mysterious to me what triggers it.
when it does happen, I get a ctypes error about _check_agl (or
something like that). I think this is happening when pyglet is
imported, but I'm not really sure. I can't reliably reproduce it,
unfortunately. rebooting does not clear it up.

--Jeremy
> https://groups.google.com/d/msg/psychopy-users/-/IqNL_mRemqUJ.

Sarah C

unread,
Oct 26, 2012, 10:21:37 AM10/26/12
to psychop...@googlegroups.com
Hi Jeremy, 

Okay thank you- at least that narrows it down to being a retina display thing then. Perhaps I need to find a laptop with a good enough graphics card, but less fancy screen! 

For the record, this happens every time I run a PsychoPy experiment on my macbook, and I've tried a few experiments created by other people. 

Thanks for the quick response!
Sarah 

Jonathan Peirce

unread,
Oct 26, 2012, 10:30:40 AM10/26/12
to psychop...@googlegroups.com
I wonder if lion is incorrectly reporting its screen dimensions to pyglet.
Is the problem independent of which units you use?

Jon
To view this discussion on the web visit https://groups.google.com/d/msg/psychopy-users/-/d5yfP5j010wJ.

For more options, visit https://groups.google.com/groups/opt_out.
 
 
-- 
Jonathan Peirce
Nottingham Visual Neuroscience

Sarah C

unread,
Oct 26, 2012, 10:40:03 AM10/26/12
to psychop...@googlegroups.com
Hi Jon, 

Yes I think so- I've just fiddled around with it and it is still offset with all different unit types. 

Sarah 

Jeremy Gray

unread,
Oct 26, 2012, 10:51:58 AM10/26/12
to psychop...@googlegroups.com
> I wonder if lion is incorrectly reporting its screen dimensions to pyglet.
> Is the problem independent of which units you use?

The problem comes and goes (for me), so is not purely a Lion thing, or
a retina display thing. I don't mind so much, since I develop on my
laptop, rather than run actual experiments. But its an issue. My
screen would change to have ~5% trimmed off the top and 5% off the
bottom (replaced by black), as if the screen resolution had been
changed to an aspect ratio that no longer fit my screen size.

I suspect that the Carbon libs may be involved, because the error
messages from pyglet also had carbon in them. This in turn might be an
effect of using 32-bit python. maybe something somewhere is smart
enough to avoid using Carbon in some situations, but can't do so in
others.

for a while, it seemed like starting PsychoPy, running the
time-by-frames.py coder demo would then allow other scripts to work
fine. but that may have been illusory (it worked about 10 times in a
row when I was trying to track down a reproducible fix, but then it
failed the next day). So it may have been real, but revealing yet
another quirk / context dependence.

So I am wondering if it might be time to migrate to pyglet 1.2alpha. I
tried that, and the short story is that its not a drop-in replacement,
you get lots of errors. So this will be real work. Its probably
inevitable anyway, quite apart from anything mac-related.

--Jeremy

Sarah C

unread,
Oct 26, 2012, 11:02:26 AM10/26/12
to psychop...@googlegroups.com
Ah yes sorry, of course that doesn't narrow it down to being a retina display thing if it works for you sometimes. Friday afternoon! 

I think for the meantime I will try to run it on another laptop. Thanks for all your help.

Sarah 

Jonathan Peirce

unread,
Oct 29, 2012, 11:25:05 AM10/29/12
to psychop...@googlegroups.com

On 29/10/2012 11:17, Matthew Inglis wrote:
Hi Jon


On Friday, 26 October 2012 12:12:14 UTC+1, Jon wrote:
Most likely your windows laptop and older macbook have weaker graphics cards (or CPUs). In particular it is taking a long time to render your text stimuli which delays the initial presentation of the images.

Thanks for this suggestion. Sarah and I have just been playing around with this. The windows laptop where the timings are off in PsychoPy runs a similar experiment fine with E-Prime, so I assume it cannot be the graphics card?

There are many ways that things can be rendered. For instance, PsychoPy aims to do everything on-the-fly as far as possible. That means things can be dynamic, which is good, but it places a heavy load on rendering at times. Fonts are at the extreme end of that, because laying out lots of letters takes computational power. It might well be that EPrime renders everything to images in advance and then just displays those images.
(To be fair there may also be efficiency improvements to be made if I rewrite the font-rendering myself rather than relying on general-purpose libs, but that takes time to do).
I am a bit nervous about this: we only noticed this because the timings are so far off what we asked for (<100ms when we asked for 600ms). Is there a chance that there are more subtle timing errors introduced on other experiments which aren't so easily noticed?
You should be nervous about this on all software, not just PsychoPy. All software can fail to produce things that you request at precise times, given a heavy load, and you should try to check such things. At least in PsychoPy you can generate a log file that tells you exactly when things actually occurred very precisely (for visual stimuli - for sounds and keyboard presses it's less so, as they will be the with EPrime). It should also be spitting out warnings telling you if/when frames were dropped.
True that we should probably spit out more severe warnings if something has gone wrong by a substantial period like this.

Jon

-- 
Jonathan Peirce
Nottingham Visual Neuroscience

Jeremy Gray

unread,
Oct 29, 2012, 11:58:39 AM10/29/12
to psychop...@googlegroups.com
I am wondering if the video card is not syncing to the refresh, and
hence ends up going faster than expected. maybe EPrime does not handle
timing based on video card sync'ing, and so does not have the same
issue.

so in theory its still possible that updating the graphics card
drivers could help. if you want to use PsychoPy on that machine, give
it a try (if you have not done so already). download new drivers
directly from the card manufacturer (not through windows update).

--Jeremy
> --
> You received this message because you are subscribed to the Google Groups
> "psychopy-users" group.
> To post to this group, send email to psychop...@googlegroups.com.
> To unsubscribe from this group, send email to
> psychopy-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages