Stimuli on mac retina display are in bottom left corner

Hi,

Window parameters that work on a PC running Ubuntu 16.04 result in stimuli that are left-offset on a MacBook Pro (Retina, 15-inch, Mid 2015) running High Sierra 10.13.2. I believe that I’m using the same version of Psychopy (installed via Conda, so without the standalone package/Builder) and I’m using Pyglet 1.3.0. Both operating systems are using a virtual environment that uses Python 2.7.

I’ve tested this using several different task scripts that were previously functional on Ubuntu and this problem seems to be independent of the retina pixel to logical pixel conversion problem (where there are 2 retina pixels for every logical pixel).

I’m new to Psychopy, so there may be some obvious solution that I’m missing – if so, I really appreciate your help!

Window code:

window = visual.Window(size=[1440,900],pos = [0,0], monitor='testMonitor', color = [-1,-1,-1],
       colorSpace = 'rgb', blendMode = 'avg', useFBO = False, allowGUI =
       False,fullscr=False, winType='pyglet',units='cm')

These two fractals should be at the center of the screen:

UPDATE:

The problem persisted whether I used pixels or cm.

Once I upgraded to Psychopy 1.85.6, the problem was resolved, suggesting that the problem was with pyglet’s updating of size value (useRetina was not an attribute of the Window object in the version that I was previously using, so I couldn’t fix it that way). Thank you, everyone, for your help!

As a test, try positioning something in units of pixels instead of cm. If the appearance matches between Ubuntu and MacOS when positions are specified in units of pixels but not when specified in cm, that implies that the bug is somewhere in the cm to pixel units conversion.

The cm to pixels conversion would need to know the monitor dimensions, where does it get those? Seems like the most likely cause is that it has the wrong monitor dimensions. Find out how to read those out and see if they match the actual monitor size.

best,

Allen

1 Like

This is an issue with the retina display conversion; piglet had used the fill retina resolution (twice the height and width) but hasn’t updated its size value to reflect that.
You don’t mention what version of PsychoPy you installed but i think the latest 1.85.6 will fix this and give you full retina resolution. Alternatively turn retina to be False in the window creation

1 Like

Hi Jon,

Is there a way to install this version outside the downloadable stand-alone version? Pip installs/upgrades only version 1.85.3, not any higher. Maybe I am missing something.

Many thanks!
Jordy

1 Like

I’ve pushed 1.85.6 to PyPI so pip install -U psychopy should work now.

2 Likes

Hi Jon,

Thank you very much for pushing 1.85.6. This fixes the above mentioned issue. It, however, does not solve the following two issues:

  1. Opening a window on an external monitor cannot operate in full screen. Full screen does work for the main screen (screen=0). Also, opening a window on an external monitor opened a window that was not at pos=(0, 0) by default, I had to add pos=(0, 0) in the call to visual.Window().
  2. Stimuli and text do not appear in the window when the window is opened on an external monitor. The stimuli and text do appear when the window was opened on the main screen (screen=0).

Code snippet:

from psychopy import visual, core

win = visual.Window(screen=1, monitor="testMonitor", fullscr=False, pos=(0, 0), size=(1680, 1050))

msg = visual.TextStim(win, text="Hello World!", pos=(0, 0))
msg.draw()
win.flip()

core.wait(5)

win.close()
core.quit()

I am using python 2.7.14, Psychopy version 1.85.6, on Mac OS X El Capitain (version 10.11.6).

hey jon,

Sorry to revive this thread, but I’m having the same problem as the OP. I’m trying to run some v simple stuff (playing around while making a task in the coder) but stimuli are presented in the bottom left of the screen. This happens regardless of whether useRetina is set to true or false, and whether using pyglet or pygame backends

e.g.

screen = visual.Window(size = (1680,1050), units = 'deg', colorSpace = 'rgb', fullscr = True, monitor = 'mbp', useRetina = True)

fixation = visual.TextStim(screen, text = '+', font = '', pos = (0,0), color = [-.3,-.3,-.3], height = 2)
bar1 = visual.Rect(screen, width = 4, height = .5, pos = (-6,0), ori = 23, lineColor = [1,1,0], fillColor = [1,1,0])
bar2 = visual.Rect(screen, width = 4, height = .5, pos = (6,0), ori = 161, lineColor = [0,0,1], fillColor = [0,0,1])

fixation.draw()
bar1.draw()
bar2.draw()
screen.flip()

everything is displaced into the bottom left when i run this.

Not sure why i’m getting this problem: i’m running v1.90 dev1 installed from standalone (so should be fixed compared to previous posts) on a High Sierra Mac OS X (10.13.2).

any help massively appreciated!

I don’t understand how that could be but maybe you can check again when we have the final 1.90.0 out (I’m hoping that’s tomorrow)

cheers for this, i’ll update when it’s released and keep my fingers crossed…

sorry for spamming, been playing around. It seems like there may be an interaction betwee useRetina and fullscr arguments. When fullscr=False and useRetina=True, although the screen is weirdly not fullscreen, the actual presentation of the stimuli is in the right position. when both arguments are True though, it goes back to this issue of things being presented in the bottom left. Hopefully that helps with identifying the issue in the code?

ok sorry for more spam, just playing around to debug this issue. It seems like it’s an issue with pygame. When i run the code in a pyglet window, the appearance of the stimuli on the screen is fine, but it screws up something later down the line. In pygame, that all generally works well except its in the bottom left (and still having problems with mouse.mouseMoved() apparently not being a thing.

in the interests of ease, and so there’s something to play around with on your own computer to see if you get the same problem, i’ve attached the code here (test_trial.py). Hopefully you could be able to run it and see the problem too.

test_trial.py (4.8 KB)

I’m not working on pygame any more. I found it poorly supported and I don’t have access to the underlying code that I would want to change (e.g. to fix this issue).

I’m happy to work on fixing the issue in pyglet, to the extent that it is a problem there (I can’t see any problems there on a retina screen using any configuration of useFBO=True/False, useRetina=True/False fullScreen=True/False)

Your script also has some errors to do with the mouse (looks like you’re trying to make calls to event.mouse rather than using the mouse object that you create at the top of the scirpt)

the event.mouse calls were deliberate rather than errors (when calling mouse.func it failed to work a lot of the time for some reason, and only really worked with event.mouse.func, so used these temporarily). what is the useFBO arg? it isn’t explained in the documentation

looks like defaults in preferences were for pygame, which was overriding winType=‘pyglet’ call within the window creation (just checked this, and seems fixed (and also then wound up fixing issues with failing to recognise the mouse creation. v strange, sorry to have bothered you about this!