Missing white spaces in text display

Hello everyone,

Firstly, sorry if I didn't find the answer on this forum.

I'm struggling with text display on my laptop. Sometimes, in a really inconsistent way, the white spaces of my text are deleted during the display, even in Psychtoolbox demos like 'DrawSomeTextDemo' (see the image attached).

I'm using :

 - a Hp ZBook laptop under Windows 10
- Psychtoolbox 3.0.14 under Matlab 64-bit
- Gstreamer 1.12.4

This issue become a big deal when the text is in a while loop (for instance when the script is waiting for key press) because at each flip, the white spaces can be there or not...leading to a blinking text (for instance in the text animation loop of 'DrawHighQualityUnicodeTextDemo').

I found that if I set the TextRenderer to 0 (or delete Gstreamer), the problem disapear. But the issue is not solved, because without text renderer my text is cut at the top when using DrawFormattedText (see the second image attached).

I've installed Gstreamer following instructions given on Psychtoolbox website (installation of all offered packages...) and it seems to work fine at the opening of Matlab ('PsychStartup: Adding path of installed GStreamer runtime to library path. [C:\gstreamer\1.0\x86_64\bin]').

Plus, I don't have any error message anywhere...

Does anyone have an idea of what's going on here ?

Thanks,
Romane


XXXIn PSYCHTOOLBOX@yahoogroups.com, <romane.cecchi@...> wrote :

Hello everyone,

Firstly, sorry if I didn't find the answer on this forum.

I'm struggling with text display on my laptop. Sometimes, in a really inconsistent way, the white spaces of my text are deleted during the display, even in Psychtoolbox demos like 'DrawSomeTextDemo' (see the image attached).


-> There aren't any images attached.


I'm using :

 - a Hp ZBook laptop under Windows 10
- Psychtoolbox 3.0.14 under Matlab 64-bit
- Gstreamer 1.12.4

This issue become a big deal when the text is in a while loop (for instance when the script is waiting for key press) because at each flip, the white spaces can be there or not...leading to a blinking text (for instance in the text animation loop of 'DrawHighQualityUnicodeTextDemo').

I found that if I set the TextRenderer to 0 (or delete Gstreamer), the problem disapear. But the issue is not solved, because without text renderer my text is cut at the top when using DrawFormattedText (see the second image attached).

I've installed Gstreamer following instructions given on Psychtoolbox website (installation of all offered packages...) and it seems to work fine at the opening of Matlab ('PsychStartup: Adding path of installed GStreamer runtime to library path. [C:\gstreamer\1.0\x86_64\bin]').

Plus, I don't have any error message anywhere...


-> Ok, this could be a bug outside PTB, but in the graphics driver, or in the font rendering library shipping with GStreamer 1.12.4 or in the Windows 10 operating system, or in the computer hardware.


->Is this a brand-new setup you never used before? Or is it older and only started to happen recently, e.g., since this year? Did the machine receive any security updates or firmware updates since start of this year?


-> What graphics card is used? Is this zBook a hybrid-graphics laptop with two graphics chips, which is known to be highly problematic or even unusable on Windows? If yes, can you switch it to only use Intel onboard graphics? Does it have a HiDPI/Retina display?


-> Does it make a difference if you install an older version of GStreamer? Try 1.12.3, or if that doesn't help 1.12.2. GStreamer 1.12.3 or 1.12.4 may ship with libfreetype version 2.8.1, which apparently introduced a regression in handling of character maps on MS-Windows for certain types of Windows fonts. freetype 2.8.0 didn't have that regression. If that is the reason then downgrading GStreamer and thereby the bundled freetype library might help.


Reference commit:


https://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/src/winfonts/winfnt.c?id=79e3789f81e14266578e71196ce71ecf5381d142


That would not explain why successive DrawText calls would give different results though...


-> Can you rerun at Screen('Preference','Verbosity', 13), with GStreamer installed and TextRenderer at default (1 i think)? And post the full output somewhere accessible for a run when the demo fails? Just posting on the forum might not work, as it might exceed the allowable size of forum text messages.


-mario


Does anyone have an idea of what's going on here ?

Thanks,
Romane


Sorry again for the images, but apparently they won't upload...
But you can see what I mean in the dropbox file.

EDIT : I've tried to set the graphic card settings to 'Use global setting (Auto-select NVIDIA GPU)', which is the default setting, for the first time after the laptop reset and it works !!

So apparently something happened when I reset the laptop because, as I mentionned, before this I couldn't run PTB with the default setting without having an error due to VBLSync...

Sorry for the useless post...
Maybe someone could have an explanation for that.

Thanks again for your response.
Romane
I’m just guessing but it sounds like a missing or damaged font. Try specifying another font.
Denis

On Wed, Jan 17, 2018 at 2:32 PM romane.cecchi@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:

Hello everyone,

Firstly, sorry if I didn't find the answer on this forum.

I'm struggling with text display on my laptop. Sometimes, in a really inconsistent way, the white spaces of my text are deleted during the display, even in Psychtoolbox demos like 'DrawSomeTextDemo' (see the image attached).

I'm using :

- a Hp ZBook laptop under Windows 10
- Psychtoolbox 3.0.14 under Matlab 64-bit
- Gstreamer 1.12.4

This issue become a big deal when the text is in a while loop (for instance when the script is waiting for key press) because at each flip, the white spaces can be there or not...leading to a blinking text (for instance in the text animation loop of 'DrawHighQualityUnicodeTextDemo').

I found that if I set the TextRenderer to 0 (or delete Gstreamer), the problem disapear. But the issue is not solved, because without text renderer my text is cut at the top when using DrawFormat! tedText (see the second image attached).

I've installed Gstreamer following instructions given on Psychtoolbox website (installation of all offered packages...) and it seems to work fine at the opening of Matlab ('PsychStartup: Adding path of installed GStreamer runtime to library path. [C:\gstreamer\1.0\x86_64\bin]').

Plus, I don't have any error message anywhere...

Does anyone have an idea of what's going on here ?

Thanks,
Romane


XXXIn PSYCHTOOLBOX@yahoogroups.com, <romane.cecchi@...> wrote :

Sorry again for the images, but apparently they won't upload...
But you can see what I mean in the dropbox file.

-> Yep. The most interesting infos were missing from the log. I forgot that Matlab on Windows, especially in GUI mode, swallows all the useful debug output from the text renderer plugin. Anyway, you found the bug.

EDIT : I've tried to set the graphic card settings to 'Use global setting (Auto-select NVIDIA GPU)', which is the default setting, for the first time after the laptop reset and it works !!

So apparently something happened when I reset the laptop because, as I mentionned, before this I couldn't run PTB with the default setting without having an error due to VBLSync...

Sorry for the useless post...
Maybe someone could have an explanation for that.

-> If it works with the NVidia, then it looks like an Intel graphics driver bug. They are known to be pretty buggy on MS-Windows, but this is a new variant. Most of the time it is presentation timing issues, tearing and such... You could try upgrading or downgrading the Intel driver. Of course that might break Optimus or just exchange bugs...

-> Wrt. to NVidia and the sync tests now working: If that is true then you are lucky. Most Optimus laptops have totally broken visual presentation timing when using the NVidia card on Windows due to the way Optimus is implemented on Windows, so that vblsync errors were fully expected.

So either you are lucky with your laptops specific Optimus implementation, or timing is still broken, but PTB can't immediately detect it during startup. It's ability to detect or fix broken timing is more limited on Windows 8 and later, hence those boilerplate warnings about the DWM being active and Windows-10...

A high stddev reported from the sync tests is often a telltale sign, or failures when running VBLSyncTest([],1), VBLSyncTest([],2), VBLSyncTest([],3), although no warnings/errors/failures at all don't mean the system works reliably. Essentially you must use photo-diodes or other measurement equipment on such laptops to be certain.

For more info on that "help HybridGraphics".
-mario

Thanks again for your response.
Romane
Can you confirm that missing white spaces is a PTB issue and not a Matlab issue that arises from using the ’strcat’ function?

From Matlab:
Notes:
 
    For character array inputs, strcat removes trailing ASCII white-space
    characters: space, tab, vertical tab, newline, carriage return, and
    form-feed. To preserve trailing spaces when concatenating character
    arrays, use horizontal array concatenation, [s1, s2, ..., sN].

Stéphane


-------------------------------------------------------------------------------------
Stéphane Rainville, PhD

Founder, CEO, and Lead Consultant
VizirLabs - Accelerate Your Science

-------------------------------------------------------------------------------------