Disappearing Screen

Hello,

I have a question regarding disappearing screen. I use the following code to display a text and then wait for Space key. After a few seconds, the text disappears. Also occasionally the mouse pointer appears and spinning, like there is a process happening in the background. I have recorded two videos from this behaviour and put in this dropbox link. If I replace the highlighted text with the WaitSecs command, the text stays on the screen without any problem.

[w, WindowRect] = Screen('OpenWindow', 1, 255, [], 32, 2);
DrawFormattedText(w, 'Please press SPACE to continue!', 'center', 'center', 50);
Screen('Flip', w);

% WaitSecs(20);
while(1)
[FlagKeyPressed, ~, KeyList] = KbCheck;

if(any(find(KeyList) == 32))
break;
end
end

CloseAll

Specifications of my computer:
  • Windows 7 Professional
  • MATLAB 2015a
  • Psychtoolbox recently updated
  • Dual monitor
I understand that dual monitor makes some problems occasionally. I tried "extended" and "computer only" displays and the same problem happens. I tried the same code on another computer with two monitors but "cloned" and there was no problem. I am wondering whether the whole problem is due to dual monitor settings, or there is something else. Many thanks.

Greetings
Amir-Homayoun

XX---In PSYCHTOOLBOX@yahoogroups.com, <a.h.javadi@...> wrote :

Hello,

I have a question regarding disappearing screen. I use the following code to display a text and then wait for Space key. After a few seconds, the text disappears. Also occasionally the mouse pointer appears and spinning, like there is a process happening in the background. I have recorded two videos from this behaviour and put in this dropbox link.  If I replace the highlighted text with the WaitSecs command, the text stays on the screen without any problem. 

[w, WindowRect] = Screen('OpenWindow', 1, 255, [], 32, 2);
DrawFormattedText(w, 'Please press SPACE to continue!', 'center', 'center', 50); 
Screen('Flip', w);
 

% WaitSecs(20);
while(1)
[FlagKeyPressed, ~, KeyList] = KbCheck;

if(any(find(KeyList) == 32))
break;
end
end
 

CloseAll

Specifications of my computer:
  • Windows 7 Professional
  • MATLAB 2015a
  • Psychtoolbox recently updated
  • Dual monitor
I understand that dual monitor makes some problems occasionally. I tried "extended" and "computer only" displays and the same problem happens. I tried the same code on another computer with two monitors but "cloned" and there was no problem. I am wondering whether the whole problem is due to dual monitor settings, or there is something else. Many thanks.

-> You just have to unplug the 2nd monitor and you will know if that is the reason?

-> Windows Vista/7/8/10 is all problematic for multi-display setups, especially for multi-display stimulation, but also for setups where one monitor is only used for the GUI. My impression from light testing with two Windows-10 machines is that Windows-10 may be a bit less fragile if one monitor is for visual stimulation, the other for the GUI, but then n=2, your mileage may vary.

-> You can try if it helps to periodically call GetMouse() in that loop to trigger PTB's Windows event processing. KbWait.m does this on Windows, and it seems to help somewhat. Other than that i don't have any advice, apart from generally making friendship with Linux.

Best,
-mario


Greetings
Amir-Homayoun

Dear Mario

Thanks for your reply.

I disconnected one of the monitors and it solved the problem of disappearing screen.

But still the mouse appears sometimes. I've now added a code to move the mouse to a corner to avoid distraction.

Thanks again.

Have a good time

Amir-Homayoun

--

On 23 November 2016 at 03:39, mario.kleiner@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:

XX---In PSYCHTOOLBOX@yahoogroups.com, <a.h.javadi@...> wrote :


Hello,

I have a question regarding disappearing screen. I use the following code to display a text and then wait for Space key. After a few seconds, the text disappears. Also occasionally the mouse pointer appears and spinning, like there is a process happening in the background. I have recorded two videos from this behaviour and put in this dropbox link. If I replace the highlighted text with the WaitSecs command, the text stays on the screen without any problem.

[w, WindowRect] = Screen('OpenWindow', 1, 255, [], 32, 2);
DrawFormattedText(w, 'Please press SPACE to continue!', 'center', 'center', 50);
Screen('Flip', w);

% WaitSecs(20);
while(1)
[FlagKeyPressed, ~, KeyList] = KbCheck;

if(any(find(KeyList) == 32))
break;
end
end

CloseAll

Specifications of my computer:
  • Windows 7 Professional
  • MATLAB 2015a
  • Psychtoolbox recently updated
  • Dual monitor
I understand that dual monitor makes some problems occasionally. I tried "extended" and "computer only" displays and the same problem happens. I tried the same code on another computer with two monitors but "cloned" and there was no problem. I am wondering whether the whole problem is due to dual monitor settings, or there is something else. Many thanks.

-> You just have to unplug the 2nd monitor and you will know if that is the reason?

-> Windows Vista/7/8/10 is all problematic for multi-display setups, especially for multi-display stimulation, but also for setups where one monitor is only used for the GUI. My impression from light testing with two Windows-10 machines is that Windows-10 may be a bit less fragile if one monitor is for visual stimulation, the other for the GUI, but then n=2, your mileage may vary.

-> You can try if it helps to periodically call GetMouse() in that loop to trigger PTB's Windows event processing. KbWait.m does this on Windows, and it seems to help somewhat. Other than that i don't have any advice, apart from generally making friendship with Linux.

Best,
-mario


Greetings
Amir-Homayoun


Dear Mario

Thanks for your reply.

I disconnected one of the monitors and it solved the problem of disappearing screen. 

But still the mouse appears sometimes. I've now added a code to move the mouse to a corner to avoid distraction. 

-> Did you try the other tips?
-> If you don't need the mouse you can simply call HideCursor(screenId) to hide the cursor and ShowCursor(screenId) at the end of your script.

best,
-mario


Thanks again.

Have a good time

Amir-Homayoun

--

On 23 November 2016 at 03:39, mario.kleiner@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:
 

XX---In PSYCHTOOLBOX@yahoogroups.com, <a.h.javadi@...> wrote :


Hello,

I have a question regarding disappearing screen. I use the following code to display a text and then wait for Space key. After a few seconds, the text disappears. Also occasionally the mouse pointer appears and spinning, like there is a process happening in the background. I have recorded two videos from this behaviour and put in this dropbox link.  If I replace the highlighted text with the WaitSecs command, the text stays on the screen without any problem. 

[w, WindowRect] = Screen('OpenWindow', 1, 255, [], 32, 2);
DrawFormattedText(w, 'Please press SPACE to continue!', 'center', 'center', 50); 
Screen('Flip', w);
 

% WaitSecs(20);
while(1)
[FlagKeyPressed, ~, KeyList] = KbCheck;

if(any(find(KeyList) == 32))
break;
end
end
 

CloseAll

Specifications of my computer:
  • Windows 7 Professional
  • MATLAB 2015a
  • Psychtoolbox recently updated
  • Dual monitor
I understand that dual monitor makes some problems occasionally. I tried "extended" and "computer only" displays and the same problem happens. I tried the same code on another computer with two monitors but "cloned" and there was no problem. I am wondering whether the whole problem is due to dual monitor settings, or there is something else. Many thanks.

-> You just have to unplug the 2nd monitor and you will know if that is the reason?

-> Windows Vista/7/8/10 is all problematic for multi-display setups, especially for multi-display stimulation, but also for setups where one monitor is only used for the GUI. My impression from light testing with two Windows-10 machines is that Windows-10 may be a bit less fragile if one monitor is for visual stimulation, the other for the GUI, but then n=2, your mileage may vary.

-> You can try if it helps to periodically call GetMouse() in that loop to trigger PTB's Windows event processing. KbWait.m does this on Windows, and it seems to help somewhat. Other than that i don't have any advice, apart from generally making friendship with Linux.

Best,
-mario


Greetings
Amir-Homayoun


Dear Mario

Yes. Sorry, I was not clear enough. I call HideCursor on top of the code. Yet, the mouse pointer appears every now and then for couple of seconds. I also tried adding GetMouse in the loop, but it didn't help either.

I have to add that this behaviour is specific to only few machines in my lab, and not always they appear.

Thanks.

Amir-Homayoun

--

On 29 November 2016 at 00:05, mario.kleiner@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:


Dear Mario

Thanks for your reply.

I disconnected one of the monitors and it solved the problem of disappearing screen.

But still the mouse appears sometimes. I've now added a code to move the mouse to a corner to avoid distraction.

-> Did you try the other tips?
-> If you don't need the mouse you can simply call HideCursor(screenId) to hide the cursor and ShowCursor(screenId) at the end of your script.

best,
-mario


Thanks again.

Have a good time

Amir-Homayoun

--

On 23 November 2016 at 03:39, mario.kleiner@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:

XX---In PSYCHTOOLBOX@yahoogroups.com, <a.h.javadi@...> wrote :


Hello,

I have a question regarding disappearing screen. I use the following code to display a text and then wait for Space key. After a few seconds, the text disappears. Also occasionally the mouse pointer appears and spinning, like there is a process happening in the background. I have recorded two videos from this behaviour and put in this dropbox link. If I replace the highlighted text with the WaitSecs command, the text stays on the screen without any problem.

[w, WindowRect] = Screen('OpenWindow', 1, 255, [], 32, 2);
DrawFormattedText(w, 'Please press SPACE to continue!', 'center', 'center', 50);
Screen('Flip', w);

% WaitSecs(20);
while(1)
[FlagKeyPressed, ~, KeyList] = KbCheck;

if(any(find(KeyList) == 32))
break;
end
end

CloseAll

Specifications of my computer:
  • Windows 7 Professional
  • MATLAB 2015a
  • Psychtoolbox recently updated
  • Dual monitor
I understand that dual monitor makes some problems occasionally. I tried "extended" and "computer only" displays and the same problem happens. I tried the same code on another computer with two monitors but "cloned" and there was no problem. I am wondering whether the whole problem is due to dual monitor settings, or there is something else. Many thanks.

-> You just have to unplug the 2nd monitor and you will know if that is the reason?

-> Windows Vista/7/8/10 is all problematic for multi-display setups, especially for multi-display stimulation, but also for setups where one monitor is only used for the GUI. My impression from light testing with two Windows-10 machines is that Windows-10 may be a bit less fragile if one monitor is for visual stimulation, the other for the GUI, but then n=2, your mileage may vary.

-> You can try if it helps to periodically call GetMouse() in that loop to trigger PTB's Windows event processing. KbWait.m does this on Windows, and it seems to help somewhat. Other than that i don't have any advice, apart from generally making friendship with Linux.

Best,
-mario


Greetings
Amir-Homayoun