This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Building Qt4.6.2 for OMAP3530 (BEAGLEBOARD) OpenGL for ubuntu-lucid

Hello,

 I have managed to run some of  the SGX  demos on Raw(not X11) (not all are working) with ubuntu-lucid, using the instructions from the following sites:

http://elinux.org/BeagleBoardUbuntu#SGX_Video_Acceleration

1. using the 3.01.00.02 Graphics SDK (OMAP35x_Graphics_SDK_setuplinux_3_01_00_02.bin),

2. https://code.launchpad.net/~beagleboard-kernel/+junk/2.6-stable (revision 67) (not working with 3_01_00_06, but apparently works with 02. I used Sourcery G++ Lite 2009q3-68 EABI as cross compiler)

I have build and integrated the kernel (2.6.32.11) and required kernel modules, booted and managed to run some of the demos. Havent tried everything but Chameleon man do not seem to run propery (the man's polygon is messed up). Lighting demo crashes. EvilSkull seems to run fine, so does particles.

I have also tried to build and run qt-4.6.2 on the same environment with opengl es2 support using the 3_01_00_02 libraries.

I based the mkspec and config parameters following the instructions at this site:

http://labs.trolltech.com/blogs/2009/11/20/building-qt-to-make-use-of-the-beagle-boards-sgx-gpu/ (I used Sourcery G++ Lite 2009q3-67 GNU/Linux)

The compilations seem to go well but when i try to run the applications such as hellogl_es2 and 2dpainting, it fails with the same message:

'cannot initiate virtual console switching'

'QEglcontext :: createSurface : unable to create surface, error = 0x300b

The opengl portion is all green, similar to what someone reported at:

http://bugreports.qt.nokia.com/browse/QTBUG-7362

I have set the /etc/powervr.ini as:

[default]
WindowSystem=libpvrQWSWSEGL.so

and using gdb, it says that libpvrQWSWSEGL.so is loaded. I have also tried QT_DEBUG_PLUGINS=1
as environment variable: output is like

QFactoryLoader::QFactoryLoader() looking at "/usr/local/Trolltech/QtEmbedded-4.6.2-arm/plugins/gfxdrivers/libqgfxpvregl.so"
keys ("powervr")

which is not exactly helpful.

I hesitate to ask too much about qt opengl at this forum but would someone please enlighten me as to whether this is a qt problem or some other problem.

Thanks in advance.

 

 

  • 'cannot initiate virtual console switching' --> Is only a warning from Qt, it may not be related to the other error.

    Before proceeding, can you post your setup information, using the SGX Graphics environment check script at,

     

    https://gforge.ti.com/gf/project/gleslayer/scmsvn/?action=browse&path=%2Ftrunk%2FPackages%2FOMAP3_Graphics_SDK%2Fsgxperf_check.sh&view=log

     

     

  • Thank you for the prompt reply. I have posted the result of the check script:

    ubuntu@beagleboard:~/speed_test$ . ./sgxcheck.sh
    WSEGL settings
    [default]
    WindowSystem=libpvrQWSWSEGL.so
    #WindowSystem=libpvrPVR2D_FRONTWSEGL.so
    ------
    ARM CPU information
    Processor       : ARMv7 Processor rev 3 (v7l)
    BogoMIPS        : 725.77
    Features        : swp half thumb fastmult vfp edsp thumbee neon vfpv3
    CPU implementer : 0x41
    CPU architecture: 7
    CPU variant     : 0x1
    CPU part        : 0xc08
    CPU revision    : 3

    Hardware        : OMAP3 Beagle Board
    Revision        : 0020
    Serial          : 0000000000000000
    ------
    SGX driver information
    Version 1.4.14.2514 (release) /home/vadmin/Beagleboard/2.6-stable/omap3-sgx-modules
    System Version String: SGX revision = 1.2.1
    ------
    Framebuffer settings

    mode "640x480-59"
        # D: 23.500 MHz, H: 29.375 kHz, V: 59.464 Hz
        geometry 640 480 640 480 16
        timings 42553 80 48 3 7 32 4
        rgba 5/11,6/5,5/0,0/0
    endmode

    Frame buffer device information:
        Name        : omapfb
        Address     : 0x8089d000
        Size        : 614400
        Type        : PACKED PIXELS
        Visual      : TRUECOLOR
        XPanStep    : 1
        YPanStep    : 1
        YWrapStep   : 0
        LineLength  : 1280
        Accelerator : No
    ------
    Rotation settings
    0
    ------
    Kernel Module information
    Module                  Size  Used by
    bufferclass_ti          3479  0
    omaplfb                 8242  0
    pvrsrvkm              122995  2 bufferclass_ti,omaplfb
    joydev                  7997  0
    dm9601                  5506  0
    usbnet                 11625  1 dm9601
    usbhid                 33052  0
    rtc_twl4030             4103  0
    ------
    Boot settings
    console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootwait omapfb.mode=dvi:640x480MR-16@60
    ------
    Linux Kernel version
    Linux beagleboard 2.6.32.11-l13 #1 PREEMPT Mon Apr 19 03:03:25 PDT 2010 armv7l GNU/Linux

  • This environment seems proper. Since the standalone SGX examples work,  this could be an issue with the Powervr Qt screen driver. Is it possible for you to instrument the below files with debug messages, to indicate which function is returning error ?

    /src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c

    /src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c

     

  • Thank you for the reply.

    I have tried to insert debug messages into the files mentioned. Tried inserting kprintf into 'wseglInitializeDisplay' in '/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c'. (I could only compile kprintf successfully without including other headers.  Also tried to insert in 'wseglIsDisplayValid'.However, I'm not seeing any messages that I output using 'dmesg'. Maybe I'm wrong but could it be that the error occured before functions in the powervr qt screen driver is called? or maybe shouldn't use kprintf? Or are there any particular functions which I should look out for?

    Also, I traced the error on the QT side where the error message occured: QEglContext::createSurface(): Unable to create EGL surface, error = 0x300b. I traced it to a file: /src/opengl/qgl_qws.cpp, in function 'qt_egl_create_surface', a function 'eglCreateWindowSurface' is called, the returned result 'surf' is EGL_NO_SURFACE. I cannot trace this 'eglCreateWindowSurface' to anywhere but in the SGX_SDK.

    how should I proceed?

    Regards,

    Otsuki

     

  • >> Tried inserting kprintf into 'wseglInitializeDisplay'

    These screen driver plugins are user space shared libraries, not kernel drivers. You can use like below to get debug prints on the terminal,

     

    fprintf(stderr, "debug text %d \n", someIntVal);

     

  • Hi Otsuki-san:

     

    I am also trying to bring up Lucid with Qt and the SGX drivers and I'm wondering if you've been able to make any progress? I'm trying to work with Robert on getting the 06 SGX drivers working but that still isn't successful.

     

    Best Regards,

    George

  • Hi George,

    For lucid, I am still in the process of trying to debug the Qt screen driver, by editing the source files:

    /src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c

    /src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c

    On another attempt (Narcissus Angstrom online builder, I managed to run the qt demo successfully, after a discussion on how to proceed at http://beagleboard.org/chat. For this attempt however, the qt package was created by the online builder,not cross compiled. I Also tried to build Angstrom using open embedded. The SGX demos run fine but the cross compiled qt do not. As for the cross compilation part, i followed all the directions at http://labs.trolltech.com/blogs/2009/11/20/building-qt-to-make-use-of-the-beagle-boards-sgx-gpu/ .

    I will continue to debug the Qt screen driver and will post once I have something.

    Regards,

    Otsuki

     

  • To Prabindh Sundareson,

    I tried to output debug message as told for the following files:  /src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c,     /src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c

    The following is a code path trace: (output here are print messages)

    root@beagleboard:/media/sda1/proj/speed_test# ./hellogl_es2 -qws -display powervr

     pvrQwsScreenWindow ( libpvrQWSWSEGL.so.1.0.0, src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c)
     pvrQwsEnsureScreen  " "
     pvrQwsAddDrawable  " "
     pvrQwsDisplayOpen  " "
     pvrQWSInitFbScreen  " "
     pvrQwsFetchWindow " "
    PvrEglWindowSurface(libqgfxpvregl.so, plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp)
     pvrQwsCreateWindow ( libpvrQWSWSEGL.so.1.0.0, src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c)
     pvrQwsEnsureScreen " "
     pvrQwsAddDrawable " "
     pvrQwsCreateWindow " "
     pvrQwsSetRotation " "

    eglCreateWindowSurface (/src/opengl/qgl_qws.cpp, included this for possible relation to where the error occured)
     QEglContext::createSurface(): Unable to create EGL surface, error = 0x300b


     pvrQwsSetGeometry (libpvrQWSWSEGL.so.1.0.0, src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c)
     pvrQwsSetRotation
     pvrQwsSetVisibleRegion
     pvrQwsSetRotation
     pvrQwsSwapBuffers

     

    There was no output from (/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c). To narrow down the problem, should I watch out for any specific variable? As far as I can tell, the code from 'pvrqwsdrawable.c' is not called.

    Thanks in advance,

    Otsuki

     

  • This does not help - what is really needed is the output when a return happens due to a failure - print debug statements when a failure happens. In Qt driver, this happens when a "return 0" happens.  Successful operations return with 1.

    I also see "pvrQwsSwapBuffers" in your mail above. Does that actually get called - or did you just mention for the code flow ?

     

  • I realize that but I have not debugged  all the possible cases of return 0, so I did not include in the message above. I wil be doing them now. 

    Btw, I only included functions in the code flow that was called, so pvrQwsSwapBuffers must have been called.

  • Hello, I debugged all instances of functions that might return 0.

    pvrQwsEnsureScreen, returns 1
    pvrQwsAddDrawable, returns 1
    pvrQwsScreenWindow, returns drawable=272672
    pvrQwsInitFbScreen returns 1
    pvrQwsDisplayOpen, returns 1
    pvrQwsFetchWindow, returns drawable=0
    pvrQwsEnsureScreen, returns 1
    pvrQwsAddDrawable, returns 1
    pvrQwsCreateWindow, returns drawable=204136
    pvrQwsSetRotation (void)
    pvrQwsSetGeometry (void)
    pvrQwsInvalidateBuffers (void)
    pvrQwsSetRotation (void)
    pvrQwsSetVisibleRegion (void)
    pvrQwsSetRotation (void)
    pvrQwsSwapBuffers, returns 0

    Only case of return 0 was pvrQwsSwapBuffers, the code segment is given below:

     /* Bail out if the back buffers have been invalidated */
        if (!drawable->backBuffersValid)
        {
            fprintf(stderr, "pvrQwsSwapBuffers, error 1\n"); //my own code
            return 0;
        }

    I hope this time it's meaningful.

    Regards,

    Otsuki

     

  • >> I hope this time it's meaningful.

    Yes, it is, thank you.

     It appears the flow of commands to the powervr driver are not correct, can you please try the below:

    - Comment out the calls to "pvrQwsInvalidateBuffers(drawable);", in both the functions - pvrQwsSetGeometry(), and pvrQwsSetRotation()

    Let us know the result.

     

  • Thanks, but no success.

    pvrQwsEnsureScreen, returns 1
    pvrQwsAddDrawable, returns 1
    pvrQwsScreenWindow, returns drawable=195224
    pvrQwsInitFbScreen returns 1
    pvrQwsDisplayOpen, returns 1
    pvrQwsFetchWindow, reutrns drawable=0
    pvrQwsEnsureScreen, returns 1
    pvrQwsAddDrawable, returns 1
    pvrQwsCreateWindow, returns drawable=267328
    pvrQwsSetRotation
    QEglContext::createSurface(): Unable to create EGL surface, error = 0x300b
    pvrQwsSetGeometry
    pvrQwsSetRotation
    pvrQwsSetVisibleRegion
    pvrQwsSetRotation
    pvrQwsSwapBuffers, returns 0

    I observed that in pvrQwsSetRotation, pvrQwsInvalidateBuffers is not called even before commenting out, unlike pvrQwsSetGeometry.

    What is the correct flow of commands to powervr driver? Also, I would like to know whether the position of the error output by QEglContext matters in any way.

     

  • Hi Otsuki-san:

    I'm getting different results than you although I'm running a slightly newer kernel (2.6.33.3-l1). When I run the hellogl_es2 demo before the actual demo starts I get an error that says something like permission denied for TTY0 but then the demo runs in full screen. At this point the demo does not respond to the mouse and I cannot find a way to stop the demo unless I close the terminal window that it was started from and then I lose that error message and I can't seem to find it any log files. After I close the demo the image is left on the screen (I suppose because I could not actual close the demo properly) and I have to "re-paint" the screen.

    For reference I too am using the 3_01_00_02 SGX drivers (still haven't been able to get the 06 drivers to load). and am compiling with 2009q3. For Qt I just did a git clone of the main but I decided to not pull from the 4.6.omap3_build branch and instead just used the default. For configuring Qt I used the TI example more than the one listed on the Qt blog.

    Since I've had so much trouble getting everything to work properly I've been creating a ste-by-step instruction document that I plan on posting once we can resolve and get everything working properly.

    Here's the output from running the sgxperf_check.sh script:

    WSEGL settings
    [default]
    WindowSystem=libpvrQWSWSEGL.so
    #WindowSystem=libpvrPVR2D_FLIPWSEGL.so
    ------
    ARM CPU information
    Processor : ARMv7 Processor rev 3 (v7l)
    BogoMIPS : 736.28
    Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3
    CPU implementer : 0x41
    CPU architecture: 7
    CPU variant : 0x1
    CPU part : 0xc08
    CPU revision : 3

    Hardware : OMAP3 Beagle Board
    Revision : 0020
    Serial  : 0000000000000000
    ------
    SGX driver information
    Version 1.4.14.2514 (release) /home/george/beagle/2.6-stable/omap3-sgx-modules
    System Version String: SGX revision = 1.2.1
    ------
    Framebuffer settings

    mode "1280x720-58"
        # D: 61.717 MHz, H: 42.859 kHz, V: 57.839 Hz
        geometry 1280 720 1280 720 16
        timings 16203 80 48 3 13 32 5
        rgba 5/11,6/5,5/0,0/0
    endmode

    Frame buffer device information:
        Name        : omapfb
        Address     : 0x809a1000
        Size        : 1843200
        Type        : PACKED PIXELS
        Visual      : TRUECOLOR
        XPanStep    : 1
        YPanStep    : 1
        YWrapStep   : 0
        LineLength  : 2560
        Accelerator : No
    ------
    Rotation settings
    0
    ------
    Kernel Module information
    Module                  Size  Used by
    bufferclass_ti          3249  0
    omaplfb                 7926  0
    pvrsrvkm              125022  6 bufferclass_ti,omaplfb
    arc4                    1057  2
    rtl8187                52672  0
    mac80211              173379  1 rtl8187
    cfg80211              119743  2 rtl8187,mac80211
    rfkill                 14494  1 cfg80211
    usbhid                 37009  0
    eeprom_93cx6            1663  1 rtl8187
    rtc_twl                 3967  0
    mailbox_mach            3807  0
    mailbox                 3342  1 mailbox_mach
    rtc_core               12869  1 rtc_twl
    ------
    Boot settings
    console=ttyS2,115200n8 mpurate=720 vram=12M omapfb.mode=dvi:1280x720MR-16@60 omapdss.def_disp=dvi nfsroot=192.168.10.104:/home/george/beagle/filesys,nolock,tcp,rsize=1024,wsize=1024 ip=dhcp root=/dev/nfs rootfstype=ext3 rootwait
    ------
    Linux Kernel version
    Linux beagleboard 2.6.33.3-l1 #1 PREEMPT Sat May 1 21:25:17 PDT 2010 armv7l GNU/Linux

  • George,

    Besides minor differences, I get the feeling that the state of the demos running on my board and yours is not so different. I did not report any permission denied problems for TTY because that is not SGX related. Did u try checking for permissions to /dev/ttyN ?

    Also, just to side track a bit I have tried to run the demo under X11 (only in angstrom), but not in lucid. In lucid, I only tried console based. What I did to gather error messages is to press Ctrl^C during execution or if the key inputs work, exit the program using files->exit. I never used mouse.

    As for Qt, I tried the mainline version as well as a omap3 version just like the one u mentioned. Doesn't work on my board either way, same error 0x300B. tried somethings to alter Qt powervr drivers recommended by TI. For that, I'm still waiting for further feedback from TI. Perhaps when the problem is solved, I could feedback to you in making the step-by-step document.

    Regards,

    Otsuki

  • hello,

     

    cp libsrv_um.so libEGL.so libGLESv2.so libIMGegl.so to qt-embedded/lib   but  ./hellogl_es2 -qws -display powervr
    Could not initialize EGL display - are the drivers loaded?  Segmentation fault

    i,m  Chinese,  cannot speak english  t