Doug Morse | 12 Aug 04:46 2014

VisionEgg.Text object renders inconsistenly

Hi,

In attempting to deal with the "TextureTooLargeError: texel_data is too wide for your video system" error I mentioned on 2014.08.05, I have attempt to create an OpenGL Display List around my usage of the VisionEgg.Text class (code below).  This works, but now every time the cue is drawn by gl.glCallList(), everything else drawn before OR after it is cleared, which makes no sense to me whatsoever.

So, I'm guessing the VisionEgg.Text class is not OpenGL Display Lists "safe".  If I recreate the list every frame cycle (i.e. comment out the "" line in my code below), then things work fine.

So, it seems like, for things to be rendered correctly, I HAVE to re-create a VisionEgg.Text object each frame cycle.

BUT having to do this causes the program to crash (as described in my 2014.08.05 post) if a few minutes pass.  This is rather atypical for a single trial for my design, but I've yet to run participants in the 768 trials I will be collecting, and worry that this texel_data error will crash the program once I start running full sessions.  Moreover, I need to implement a participant-terminated pause after each 96 trials, which likely WILL go beyond a couple of minutes for certain participants, and will thus definitely crash the program.

So, this has become a catch-22: I cannot render rotated text and have it displayed correctly unless I re-create a VisionEgg.Text object EVERY frame cycle (which eventually crashes the program), but if I use display lists to avoid this rather constant object creation and destruction, then the text is rotated and displayed just fine, but for some unknown reason that's ALL that gets displayed.

Thus, this is getting to be a serious issue --- PLEASE HELP! :)

Thanks,
Doug


--

doug morse | dougmorse.org | +1 615 340 3400

Doug Morse | 5 Aug 11:36 2014

[Vision Egg] Critical Error, failure to to release OpenGL texture resources I suspect

Hi Andrew and Fellow Vision Eggers!

In developing a new experimental task, I've run into a Vision Egg critical error that I'm not sure how to resolve.  The Python traceback is included below.

Basically, everything has been working fine until I added use of the VisionEgg.Text class.  Indeed, so far, this critical error does not occur unless I let a stimulus presentation sit for a couple of minutes without any input (i.e., the same stimulus is continually presented, without change).  The critical error does not occur if I do not make use of the VisionEgg.Text class (i.e., I have let the same stimulus, minus the text, sit unattended for over twenty minutes w/o error [1]).  However, once my coding is complete, I'll be running participants in two or three 20-minute blocks and am concerned this error might crop up.  More importantly, I suspect this error fundamentally concerns a failure to release OpenGL texture resources.

My object method for stimulus presentation is quite straightforward:

    def __drawNineDotArray(self, stimulusIdx, cue, cueLocation,  cueOrientation):

        gl.glCallList(self.__DLPreCue)
        gl.glCallList(self.__DLStimuli + (self.trialNumber - 1))

        self.__drawCue(cue, cueLocation, cueOrientation)

as is the object method that adds the text cue:

    def __drawCue(self, cue, cueLocation, cueOrientation):

        # visionegg's text rotation is ccw, so flip it to cw

        if cueOrientation == 90:
            cueOrientation = 270
        elif cueOrientation == 270:
            cueOrientation = 90

        # create a text object and display it

        t1 = VisionEgg.Text.Text( \
            text = cue, \
            angle = cueOrientation, \
            color = (0,0,0), \
            position = self.__cueCoordinates[cueLocation - 1], \
            font_size = 40,
            anchor = 'center', \
            )
        t1.draw()

        # it's important to destroy the text object; otherwise the openg gl
        # texel_data will eventually overflow [nope, didn't help :( ]

        t1 = None

The last line of __drawCue() above, "t1 = None", is my attempt to explicitly call the object destructor, as per Python specifications, but this does not help.

After about two minutes, if the stimulus is not responded to, the following exception is thrown:

    2014-08-05 03:24:30,334 (1289) CRITICAL: Traceback (most recent call last):
      File "/home/morse/lib/active/desktop/VT/FrameMain.py", line 260, in MenuFileRunSession
        session.runSession(sessionName)
      File "/home/morse/lib/active/desktop/VT/SessionController.py", line 257, in runSession
        block.runBlock()
      File "/home/morse/lib/active/desktop/VT/BlockController.py", line 413, in runBlock
        viewport.draw()
      File "/usr/local/lib/python2.7/dist-packages/visionegg-1.2.1-py2.7-linux-x86_64.egg/VisionEgg/Core.py", line 1374, in draw
        stimulus.draw()
      File "/home/morse/lib/active/desktop/VT/RFOO01.py", line 523, in draw
        self.__drawNineDotArray(1, 0, 0, 0, 0)
      File "/home/morse/lib/active/desktop/VT/RFOO01.py", line 810, in __drawNineDotArray
        self.__drawCue('A', 3, 90)
      File "/home/morse/lib/active/desktop/VT/RFOO01.py", line 839, in __drawCue
        anchor = 'center', \
      File "/usr/local/lib/python2.7/dist-packages/visionegg-1.2.1-py2.7-linux-x86_64.egg/VisionEgg/Text.py", line 158, in __init__
        self._render_text()
      File "/usr/local/lib/python2.7/dist-packages/visionegg-1.2.1-py2.7-linux-x86_64.egg/VisionEgg/Text.py", line 166, in _render_text
        self._reload_texture()
      File "/usr/local/lib/python2.7/dist-packages/visionegg-1.2.1-py2.7-linux-x86_64.egg/VisionEgg/Textures.py", line 1181, in _reload_texture
        build_mipmaps = self.constant_parameters.mipmaps_enabled )
      File "/usr/local/lib/python2.7/dist-packages/visionegg-1.2.1-py2.7-linux-x86_64.egg/VisionEgg/Textures.py", line 381, in load
        texture_object.put_new_image( buffer, internal_format=internal_format, mipmap_level=0 )
      File "/usr/local/lib/python2.7/dist-packages/visionegg-1.2.1-py2.7-linux-x86_64.egg/VisionEgg/Textures.py", line 709, in put_new_image
        raise TextureTooLargeError("texel_data is too wide for your video system.")
    TextureTooLargeError: texel_data is too wide for your video system.

It seems pretty clear to me that every clock cycle my call to VisionEgg.Text is allocate some OpenGL texture resource that somehow is not getting released when I explicitly destroy the VisionEgg.Text object, but I could be wrong about this.  Either way, it seems pretty clear that the problem is not with my code but within the VisionEgg.Textures class (or perhaps the VisionEgg.Text class' use of the VisionEgg.Textures class), but I could be wrong about that as well.  It also occurs to me that the problem could be specific to use cases where I rotate the text, but I have yet to test this (i.e., I mention this as perhaps a first place to look for OpenGL texture resources not being released in some __del__ method).

Any and all help / comments / feedback most appreciated!

Thanks!
Doug


[1] Specifically by commenting out the last line of my __drawNineDotArray method, that is, commenting out the "self.__drawCue(cue, cueLocation, cueOrientation)" line.


--

doug morse | dougmorse.org | +1 615 340 3400

Schutzenberger, Anna | 7 May 20:03 2014
Picon

Specify gamma lookup tables for different monitors

Dear all,

I am using VisionEgg to display a stimulus on two monitors.
The monitors are requiring different gamma lookup tables, however, I only know how to customize a general lookup table in VisionEgg. Do you have a simple solution for how I can specify lookup tables specifically for the monitors?
At the moment I create two Viewports, use the same screen for each of them (with get_default_screen), and define my stimulus for each Viewport, i.e. monitor. I will probably have to create two screens, one for each Viewport, but I would like to avoid having two configuration files for each.
Thanks for your help!
Best,
Anna
Roger Santer [rds5] | 3 Oct 11:47 2013
Picon

FW: Generating a star field

Dear all,

 

I am struggling to develop a star-field stimulus using Vision Egg (similar to the old Windows screen saver, giving the illusion of forward movement). I wondered whether anyone subscribing to this list had worked on anything similar, and whether they’d be willing to share their code with me?

 

Sorry if this seems lazy... I’m very much a novice programmer, and am out of my depth on this one.

 

Thanks in advance,

 

Roger

Shih-Yu Lo | 4 May 03:02 2013
Picon

making quicktime movie

Hi all,

I want to make my experiment stimuli into a QuickTime movie. How should I do? Does anyone have any sample codes? Thanks!

Shih-Yu
Angelique Paulk | 6 Dec 03:56 2012
Picon

Linux VisionEgg

Hi, All,
I had a strange question.  We are using VisonEgg on a Linux Ubuntu 11 as well as on other Windows platforms.  We notice that VisionEgg is updating per frame at 714 Hz on the Linux box, but is at the pre-set OpenGL settings (200 Hz) on Windows.  Is there something different with how OpenGL interfaces with VisionEgg on Linux?
Thank you,
Angelique Paulk
Eamon Caddigan | 22 Oct 02:22 2012
Picon

quicktime.py

Hi all,

I'm having trouble playing quicktime files in VisionEgg. Playback is
choppy (even though the machine is quite capable (16 GB of RAM and a
solid-state disk), and the video is not rendering correctly -- the
image is skewed.

Details:
Windows 7, 64-bit
Python 2.7.3 (32-bit version)
Pygame 1.9.2a0 (32-bit)
visionegg 1.2.1
Quicktime 7.7.2

Example file: https://www.dropbox.com/s/kvvkxxodo8ox8q0/test.mp4

Has anybody seen this?

Thanks,
Eamon
======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html
Andrew Straw | 13 Jul 15:37 2012
Picon

Re: Ubuntu

It is certainly possible to set a 2nd display to > 75Hz in Ubuntu 12.04 
-- we're doing that as standard practice in my lab. Try replacing your 
Screen1 section in /etc/X11/xorg.conf with the following and reboot.

Section "Screen"
     Identifier     "Screen1"
     Device         "Device1"
     Monitor        "Monitor1"
     DefaultDepth    24
     Option         "TwinView" "0"
     Option         "metamodes" "CRT: 1024x768_120 +0+0"
     SubSection     "Display"
         Depth       24
     EndSubSection
EndSection

On 07/13/2012 02:05 PM, Yanqiong Zhou wrote:
> Thanks Andrew,
>
> The second issue should be resolved as you suggestion.
> I tried the nvidia-settings and xrandr command, both of them failed.
> I can change the resolution of both monitors and refresh rate of primary monitor, but not the refresh rate
of second monitor.
> It seems that other people have similar issue caused by display card driver.
> I could not find a suitable driver for my display card in Ubuntu 12.04.
> I probably need go back to Ubuntu 11.
>
> Warm Regards,
>
> Yan-Qiong
>
>
>
> On Fri, Jul 13, 2012 at 5:38 PM, Andrew Straw
<andrew.straw@...<mailto:andrew.straw@...>> wrote:
> Dear Yan-Qiong,
>
> The "nvidia-settings" program should let you adjust the frame rate of your display. See the attached
image. I had to also select my monitor resolution to allow me to set this.
>
> For issue #2, I think this is the same problem as described here: SDL 1.2 meets Gnome
3<http://frozenbyte.com/board/viewtopic.php?f=17&t=4229>. My suggestion is not to open VE
programs in fullscreen mode but rather use a window the size of the display and set the "No frame around
window" option.
>
> Best regards,
> Andrew
>
>
> On 07/12/2012 12:59 PM, Yanqiong Zhou wrote:
>
> Hi Andrew,
>
> Sorry to trouble you.
> I'm Yanqiong, working with Angelique in Bruno's lab.
> I have two stupid questions about running visionegg on the linux system:
> (1) I can't set up the second monitor (LED panels) to a refresh rate higher than 75HZ in Ubuntu12.04, using
NVIDIA Geforce 9600GT. I tried nouveau, NVIDIA 295.49 driver and higher NVIDIA driver... ...
> Do you have any suggestion about the version of Ubuntu and NVIDIA driver that can allow me to set up the
second monitor to a high refresh rate?
>
> (2) When I using vision egg to display visual stimulus on the second monitor in Ubuntu, it showed
"visionegg" on the top-left corner. How can I only show the visual stimulus?
>
> Many thanks for your consideration.
>
> Best Regards,
>
> Yan-Qiong
>
>
>
>
>
> --
> Andrew D. Straw, Ph.D.
> Research Institute of Molecular Pathology (IMP)
> Vienna, Austria
> http://strawlab.org/
>
>
>

--

-- 
Andrew D. Straw, Ph.D.
Research Institute of Molecular Pathology (IMP)
Vienna, Austria
http://strawlab.org/

======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html
Andrew Straw | 13 Jul 09:38 2012
Picon

Re: Ubuntu

Dear Yan-Qiong,

The "nvidia-settings" program should let you adjust the frame rate of your display. See the attached image. I had to also select my monitor resolution to allow me to set this.

For issue #2, I think this is the same problem as described here: SDL 1.2 meets Gnome 3. My suggestion is not to open VE programs in fullscreen mode but rather use a window the size of the display and set the "No frame around window" option.

Best regards,
Andrew

On 07/12/2012 12:59 PM, Yanqiong Zhou wrote:
Hi Andrew, Sorry to trouble you. I'm Yanqiong, working with Angelique in Bruno's lab. I have two stupid questions about running visionegg on the linux system: (1) I can't set up the second monitor (LED panels) to a refresh rate higher than 75HZ in Ubuntu12.04, using NVIDIA Geforce 9600GT. I tried nouveau, NVIDIA 295.49 driver and higher NVIDIA driver... ... Do you have any suggestion about the version of Ubuntu and NVIDIA driver that can allow me to set up the second monitor to a high refresh rate? (2) When I using vision egg to display visual stimulus on the second monitor in Ubuntu, it showed "visionegg" on the top-left corner. How can I only show the visual stimulus? Many thanks for your consideration. Best Regards, Yan-Qiong

-- Andrew D. Straw, Ph.D. Research Institute of Molecular Pathology (IMP) Vienna, Austria http://strawlab.org/
Andrew Straw | 16 Apr 07:36 2012
Picon

Re: SinGrating2D function

Yes, but set it much more than 1, e.g. 1e6.

On 16-Apr-12 06:32, Shih-Yu Lo wrote:
P {margin-top:0;margin-bottom:0;}
Hi all,

In the SinGrating2D fuction, if I set the contrast parameter more than 1, then the grating becomes a square wave. Is it true?




-- Andrew D. Straw, Ph.D. Research Institute of Molecular Pathology (IMP) Vienna, Austria http://strawlab.org/
Shih-Yu Lo | 16 Apr 07:32 2012
Picon

SinGrating2D function

Hi all,

In the SinGrating2D fuction, if I set the contrast parameter more than 1, then the grating becomes a square wave. Is it true?



Gmane