psychopy.org | Reference | Downloads | Github

Refresh rate using DLP Lightcrafter 3000


#1

I have some trouble to configure the refresh rate using my DLP. I have written a simple code to check the outputs

from psychopy import visual, core, monitors
from windowframepack import ProjectorFramePacker

Set-up screen

win1 = visual.Window([600, 600], color=‘white’, screen = 1, monitor = “DLP”, useFBO = True)
framePacker = ProjectorFramePacker (win1)
win2 = visual.Window([600, 600], color=‘white’, screen = 1, monitor = “computer screen”, useFBO = True)

#Check refresh rate
rate1 = win1.getActualFrameRate(nIdentical=10, nMaxFrames=100, nWarmUpFrames=10, threshold=1)
print(rate1)
rate2 = win2.getActualFrameRate(nIdentical=10, nMaxFrames=100, nWarmUpFrames=10, threshold=1)
print(rate2)

Using such code, I obtained various frequencies concerning the DLP. However, I would like precise frequencies that would correspond to my apparatus (for examples, 1bits RGB at 480Hz, or 4bits RGB at 120Hz).
I thank you in advance for your kind help.


#2

I don’t really understand how a Lightcrafter works, but doesn’t it do some magic to display restricted signals at some multiple of the source input frequency? i.e. from the computer’s point of view, does the display always appear to be running at full-colour 60 Hz, although the Lightcrafter itself is running much faster, at a lower bit depth?


#3

Indeed, it seems that it works in such way.
My problem is that I would like to show stimulus at very high frequencies using the function “for FrameN (…):”, but my stimulus does not appear at high frequency, although the projector is set-up for high frequencies.


#4

I went further and wrote this program:

# Imports
import math
from windowframepack import *
from psychopy import visual, core, monitors
import psychopy.event
import pyautogui
width, height= pyautogui.size()
from Parameters import *

# Set-up screen
mywin = visual.Window([608, 684],fullscr=True, color='white', 
screen = 1, monitor = "DLP", useFBO = True)
framePacker = ProjectorFramePacker (mywin) 
winmenu = visual.Window(size = (400,400), color='white', 
screen = 0)
clock = core.Clock()

# Menu 
message = visual.TextStim(winmenu, text='Would you like to: 
\n\n- Display a looming stimuli at 30Hz (press 1) \n\n- Display a 
looming stimuli at 60Hz (press 2) \n\n- Display a looming stimuli 
at 250Hz (press 3) \n\n- Display a looming stimuli at 1000Hz 
(press 4) \n\n- Exit (press e)', height=0.06, wrapWidth=800, 
pos=(0,0), color='black') 
message.setAutoDraw(True)  # automatically draw every frame
winmenu.flip()
while psychopy.event.getKeys != 'e':
    keys=psychopy.event.waitKeys()

    if '5' in keys: 
        rate = mywin.getActualFrameRate(nIdentical=10, 
        nMaxFrames=100, nWarmUpFrames=10, threshold=1)
        print(rate)
        rate2 = winmenu.getActualFrameRate(nIdentical=10, 
        nMaxFrames=100, nWarmUpFrames=10, threshold=1)
        print(rate2)
    
    # Stimuli approaching
    if '1' in keys: 
        x=xcorr
        y=ycorr
        stimuli = visual.Circle(mywin, units='pix', radius=0, 
        edges=e, pos=(x, y), lineColor='black', fillColor='black')
        timer = core.Clock()
        for FrameN in range(d):
                z=minr+(2* 
                (maxr)*math.tan(math.exp(-1))/(FrameN+1))
                stimuli.radius=z  
                stimuli.setAutoDraw(True)  
                mywin.flip()
        y= timer.getTime()
        print ('total time: ' + str(y) + ' sec to show ' + str(d))
        core.wait(wa)
        stimuli.setAutoDraw(False)
        mywin.flip()


    # Exit
    if 'e' in keys:    
        mywin.close()
        winmenu.close()
        core.quit()
        break
    
    # Error
    else:    
        message.setAutoDraw(True) 
        winmenu.flip()     

My problem is double, when I asked for telling me the frequency of the screens, it says:
None
632.3788333909163
None
841.4918067730555
None
736.8432221274081
None
604.6643445011365
None
778.3691826490057
None
789.3315214315422
None
1042.8096294019476
None

When I did the visual stimuli, I got very variables responses:
total time: 2.4257541370006948 sec to show 200
total time: 2.3384845900000073 sec to show 200
total time: 2.2981673310005135 sec to show 200
total time: 2.813584258999981 sec to show 200

Any ideas about how to solve this?


#5

What are the video card vertical sync settings currently in your operating system preferences/control panel?


#6

I use a mac book air mid2012… not sure how to find this information.


#7

OK, I misunderstood how this works. PsychoPy should be drawing at 180 Hz at a software level, even if the signal that gets sent over the cable is actually going at 60 Hz, using the magic of frame packing (I’m not sure if it is capable of running at the other frequencies you mention, as it is just doing simple RGB channel separation, which allows a multiplier of × 3 only).

But having said that, I’m not sure that a six year old MacBook Air is ideal for this. Airs don’t have a discrete graphics card, just Intel integrated graphics. So it might struggle a bit. But the only way to tell is to have physical validation of your output, using a photodiode or similar, as in this thread:


#8

Dear Michael,
Thank you for your help. I can understand a little bit more now.
I think that it would be good to test it with a proper computer that possess a graphic card and see what I can obtain from this.
As alternative, do you think that a two-years old surface pro would be enough?