RSVP task in the centre with a movie in the periphery

Dear all,

I am trying to show twelve RSVP items each lasting for 500 msec while showing an animation in the periphery. This RSVP stream first starts with a blank, then the RSVP stream continues with ISI blanks lasting between 250-350 msec. So, overall, I have 12 RSVP stimuli lasting for 6 sec in total, and 13 ISI blanks lasting 4 sec in total. While RSVP stream is displayed on the center of the screen, I have an 61 frame with 1 sec duration animation that I call frame by frame by using GetFrames and then FillOval. Because this animation lasts for 1 sec, I have put both the animation and the RSVP task into a 10-itiretation loop.

Within the loop, I have a value that goes over every frame starting from 1 to 610. Each RSVP item and its subsequent ISI has their own onset frame (i.e. 1, 17, 48, …, 610). Because I cannot use WaitSecs() command within the animation frame loop, I have included an if-contingency in which I say if the frame value is between RSVP item one onset frame and ISI onset frame, then Flip. Although the script works without any error, only one flip of the RSVP stimuli is displayed. So, each RSVP item is shown for 16 msec rather than 500 msec. I couldn’t understand why this is the case and how can I make it 500 msec last. I would appreciate any help and comment. Thank you!

My OS is Windows 8 (Version 6.2). I am using PTB-3 and Matlab 64-Bit (Version 3.0.15 - Build date: Oct 19 2018). I have to use SkipSyncTests, and other details regarding my hardware is as follows:
PTB-INFO: OpenGL-Renderer is ATI Technologies Inc. :: AMD Radeon R9 M265X :: 4.3.12793 Compatibility Profile Context 13.351.1001.0
PTB-INFO: VBL startline = 900 , VBL Endline = 900
PTB-INFO: Measured monitor refresh interval from beamposition = 16.666021 ms [60.002325 Hz].
PTB-INFO: Will use beamposition query for accurate Flip time stamping.
PTB-INFO: Measured monitor refresh interval from VBLsync = 16.678833 ms [59.956235 Hz]. (50 valid samples taken, stddev=0.480287 ms.)
PTB-INFO: Reported monitor refresh interval from operating system = 16.666667 ms [60.000000 Hz].
RAM= 8 GB; Intel Core i7; HardDrive= 1 TB. Video Card Memory= 2 GB. (other details are available: https://www.vatanbilgisayar.com/toshiba-satellite-l70-core-i7-5500u-2-4ghz-8gb-1tb-2gb-17-3-w10-notebook.html#urun-ozellikleri)

My code is basically like this: (nFrames=61)
tDisp_count=1; jDisp_count=1;
for i=1:10
for j=1:nFrames
onset=nFrames*(i-1)+j;
ts=GetFrame(j);
Screen(‘FillOval’, win, color, coordinates);
if onset >= round(jFrames(jDisp_count)) && onset < round(tFrames(tDisp_count))
Screen(‘FillRect’, win, [190 190 190],[750; 350; 850; 550]);
Screen(‘Flip’, win);
if jDisp_count < 13 && tDisp_count < 13
jDisp_count = jDisp_count + 1;
end
elseif onset >= round(tFrames(tDisp_count)) && onset < round(jFrames(jDisp_count))
curTOrientation= [-17, 17, 0, 0; -10, -10, -23, 23];
curTColor= tDisp(tDisp_count,2);
Tonset=GetSecs;
Screen(‘DrawLines’, win, [-17, 17, 0, 0; -10, -10, -23, 23], 8, [255 0 0], winCenter);
Screen(‘Flip’, win);
if jDisp_count <13 && tDisp_count <13
tDisp_count = tDisp_count + 1;
end
else
Screen(‘Flip’, win);
end

You could use the VBL time returned from Screen('Flip') to handle your logic, you don’t need to use WaitSecs(). Having said that, the overall logic will have to be similar whether you use frame ticks or VBL times (and the advantage of ticks is that they are easier to step-debug). For more complex animations I normally use a single “global tick”, that is updated for every flip; that makes it a bit easier to work out what is going on during debugging. You will need to step-debug through that loop to really understand what is going on…

1 Like

Thank you for your comment and explanation!
Could you please elaborate on what you mean by “global tick”? And because I need to put “SkipSyncTests” on the top of my script, vbl may not be usable, but I guess can use flip interval instead, right?
Thank you once again.

All I mean by global tick is a variable that is always updated after Screen flips (you can move your flip so it is in one place. This gives you an absolute marker for where you are in the overall animation cycle:

tick = 0
for i = 1:20
    for j = 1:20
        if x > y
            %do somethings
        elseif x < z
            %do something else
        else
            %otherwise
        end
        vbl = Screen('Flip');
        tick = tick + 1;
    end
end

You still need your other counters, but tick will let you know exactly which flip you are in the progression of your nested loops running on several counters. It may make your debugging a little easier (compare your counters to the overall tick as you step debug through your loop).

Regarding VBL, even if you disable sync tests, flip still returns this value (even if your use of Windows means your temporal fidelity is poor). Offtopic, but you may also want to try to slightly relax the sync testing acceptable variance (value is in seconds, 0.001 is 1ms) using:

Screen('Preference', 'SyncTestSettings', 0.001)

Change the value to something that balances your system noise and the absolute requirements of your experiment (not everyone needs submillisecond fidelity). This means you can still let PTB test timing, without the strict default value (0.2ms IIRC) that only Linux+AMD cards can easily meet.

1 Like

Thank you very much! I’ll include what you said into my code.

As a clarification: The 0.2 ms setting is something any OS should meet unless something is badly broken. Linux would perform to much higher accuracy. The value for stddev reported here almost certainly means that visual timing is completely broken on that Windows 8 machine, and all timing/timestamps are to be considered not trustworthy, with errors that can easily reach 50 msecs.

I wouldn’t trust that machine for anything that involves timing until that is fixed, if fixable. It looks like a single-display standard pixel density setup, and with an AMD gpu, so i wouldn’t expect such bad failures on Windows. But then Windows 8 was not ever tested for compatibility, only Windows 7 (now dead since a couple of days – r.i.p.) and Windows 10. Windows 8 btw. is also end-of-life and unsupported since years. Could be Windows 8 is just especially buggy…

@mariokleiner: I have a brand new high-powered Dell Workstation with an NVidia RTX 2070 (that is used because of CUDA dependencies elsewhere). With Ubuntu 19.10, a low latency kernel, gamemode installed, 435 drivers and multi-monitor set up using xorgconfcreator, that machine never reliably makes 0.2ms, usually returning values around 0.4ms – 0.8ms. All other PTB tests work fine, and I rarely ever see dropped frames or any visual artifacts. My solution was to raise the variance ceiling a bit but your advice is to stop using this hardware?

0.4 - 0.8 ms would be the worst performance ever observed on Linux.
If you have gamemode installed, i wonder if it puts the gpu into high performance mode? Our gamemode.ini config file enables high-perf mode, but also has this comment: “Requires the coolbits extension activated in nvidia-xconfig”. I don’t remember if i tested gamemode with NVidia proprietary drivers, so that might be something to check.

That said, PTB on Linux has additional builtin checks for the NVidia proprietary driver, based on the GLX_buffer_age extension, so if PTB doesn’t complain with any warnings/errors at runtime after you loosened the threshold, it would be probably ok.

On other operating systems, those startup timing tests are almost the only way of testing for trouble, so loosening the thresholds would usually just cause the test to miss brokenness and create a false sense of confidence.
So probably you are fine.

The same threshold setting on Windows 8 will basically guarantee that a totally broken visual stimulation setup will be reported as fine, so the original poster will be screwed if they do that. I think Windows-8 was the worst MS OS since Vista, combining all the bugs and limitations of Windows-7 with those of Windows-10 while not having any of their respective advantages. Also, Windows 8 is end-of-life since quite a while, a major security hazard if still connected to a network. I’d upgrade to Windows-10 or - ideally - Linux if i were the original poster.

1 Like

Thanks for clarification! Would it be a good idea if I upgrade to Win-10 and dual boot ubuntu?

Installing Ubuntu alone or as dual-boot for Psychtoolbox would be a good idea. Your AMD Southern Islands gpu should be well working timing-wise. What you do with Windows, i don’t care, but if you want to keep it, i’d upgrade to Windows-10 or Windows-8.1 (which seems to get security updates until january 2023) purely for computer security reasons. Windows-8 is an easy target for hackers and stuff since over 4 years.