Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Temporal resolution using the psycho back-end seems too good

Hi all,

A lab I'm working with says they are having a timing issue with psycho-py (https://discourse.psychopy.org/t/strange-behavior-of-the-win-flip-function-with-144hz-lcd-monitor/4211/8). They want to know if an opensesame experiment that they are running with the psycho back-end will be affected. I have done an analysis of time stamps, and I'm hoping for some advice on the result.

My stimuli are contained in a coroutine, with an onset delay within the routine that is set randomly on a trial to trial basis. What I have done is examined the expected timing of stimuli versus the psychopy time stamps indicating when they were really presented:

This looks great to me, except for one thing. I am concerned that the timing is 'too good'. The monitor uses a 144hz refresh rate and vsync is enabled. My understanding is that timing should be no better than 1000/144/2 = 3.47 ms. Yet, the mean error I get is a little less, around 2.12ms. I have checked this over a couple of 220 trial pilot data sets, and the result is the same.

Any idea how the time stamps could correspond this precisely to the requested stimulus presentation time?

Thanks very much

Comments

  • Hi,

    Without knowing the details, your graph is a little hard to interpret, but here are few general remarks to clear things up:

    They want to know if an opensesame experiment that they are running with the psycho back-end will be affected.

    When using the psycho backend, OpenSesame will simply use PsychoPy, so everything that applies to PsychoPy then also applies to OpenSesame. So: yes.

    This looks great to me, except for one thing. I am concerned that the timing is 'too good'. The monitor uses a 144hz refresh rate and vsync is enabled. My understanding is that timing should be no better than 1000/144/2 = 3.47 ms. Yet, the mean error I get is a little less, around 2.12ms. I have checked this over a couple of 220 trial pilot data sets, and the result is the same.

    Again, without details I cannot interpret this graph, but here's how things should work.

    When you call Canvas.show() (which uses the PsychoPy Window.flip() function), the experiment should pause until the onset of a new display refresh cycle, and then return the timestamp of the moment that the display is actually shown. This is called a blocking flip.

    Therefore, the interval between consecutive presentation times should always be a multiple of refresh-cycle durations (e.g. a multiple of 16.67 ms on a 60 Hz monitor), with little to no jitter. If this is the case, then blocking flip works. If it's not, then blocking flip doesn't work.

    See also:

    My impression is that blocking flip becomes increasingly problematic, because modern operating systems don't allow you to access the video hardware as directly as they used to. So it's definitely worth checking whether things work as expected on lab computers.

    Cheers,
    Sebastiaan

    PS. The following script will run a quick benchmark:

    import numpy as np
    
    N = 100 # number of frames
    DUR = 45 # pause between frames
    
    c1 = Canvas()
    c1.rect(-100, -100, 200, 200, color='yellow', fill=True)
    c2 = Canvas()
    c2.rect(-100, -100, 200, 200, color='blue', fill=True)
    
    timestamps = np.empty(N)
    for i in range(N):
        timestamps[i] = c1.show()
        c1, c2 = c2, c1
        clock.sleep(DUR)
    
    framerates = timestamps[1:] - timestamps[:-1]
    print(framerates)
    print('M = %.2f, SD = %.2f' % (framerates.mean(), framerates.std()))
    
  • edited April 2018

    Sorry the graph was confusing, thanks very much for the help!

    Ok so on the 59hz monitor I have here I got the below, which seems about right. I'll pass this on to test!

    49.98553242 50.07567327 49.99965447 50.03931647 50.08649017
    49.99755119 50.04983291 50.05193618 50.02549483 50.04021787
    50.04442442 50.08138221 50.01347605 50.05554185 50.03691267
    50.03090331 50.04953244 50.03961694 50.03721314 50.05403952
    50.05073425 50.02369208 50.04803004 50.04622729 50.05283759
    50.06064981 50.00746663 50.05824607 50.03420846 50.02339155
    50.06275309 50.02399255 50.05343852 50.03931647 50.04232115
    50.04322255 50.07086578 50.01437746 50.04772963 50.03390799
    50.04232115 50.04863103 50.0375136 50.07957941 50.00506289
    50.03721319 50.05824601 50.03330711 50.06004882 50.01888453
    50.04202068 50.04232115 50.05524139 50.03240565 50.06305355
    50.02519436 50.03480939 50.05433998 50.0300019 50.05343852
    50.03150424 50.04893144 50.00806763 50.0654573 50.19646214
    50.04262162 50.03180471 50.03841501 50.05043384 50.04742916
    50.03360752 50.04953244 50.04412396 50.04712869 50.02158874
    50.05163571 50.06756057 50.02759816 50.03901594 50.02339161
    50.05193618 50.04622723 50.03961694 50.0357108 50.03390805
    50.04803004 50.04953244 50.05824607 50.01948541 50.04502542
    50.0564432 50.03360752 50.04232115 50.03510992 50.04532583
    50.06335402 50.02098781 50.04051834 50.06425543]
    M = 50.04, SD = 0.02

    Cheers

  • Yes, that's a perfect outcome. In other words, this system is fine.

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games