Compiling experimental-eglfs-jw

Tyler Mandry tmandry at gmail.com
Wed Aug 17 08:15:27 UTC 2011


Got it running on ES 1! All that I had left to do was change the EGL_CONTEXT_CLIENT_VERSION to 1 on qandroideglplatformcontext.cpp:66 and QtEgl.java:81. Qmlshowcase runs flawlessly.

I'll see if I can put together a clean patch so we can support both. I'm not sure when or how QtEgl.java is actually used though; is it on platforms before android-9?

On Aug 16, 2011, at 1:28 PM, Tyler Mandry wrote:

> Got it running in raster at least! See below.
> 
> On Aug 16, 2011, at 4:13 AM, Thomas Senyk wrote:
> 
>> I've added the mailing-list.
>> 
>> 
>> On Tuesday, August 16, 2011 03:54:38 AM ext Tyler Mandry wrote:
>>> On Aug 16, 2011, at 3:22 AM, Thomas Senyk wrote:
>>>> Never tried opengl es1
>>>> ... I don't see the point, as I've never seen an opengl es1 android
>>>> device. Is there one?
>>> 
>>> I'm interested because I have some es1 code that I want to use with Qt. It
>>> runs on Android already. Just have to get it to play nice with Qt. Every
>>> Android device that support GLES 2 also supports GLES 1.1 and 1.0. It's a
>>> documented guarantee.
>> 
>> A, OK! Good information :)
>> 
>>>> Besides that:
>>>>> E/libEGL  ( 4822): called unimplemented OpenGL ES API
>>>> 
>>>> sounds a lot like "There is no OpenGL ES1!"
>>> 
>>> I'll take a closer look at what's going on.
>> 
>> Would be interesting .... If it's guaranteed then I guess the reference device 
>> (nexus one) should have it ;)
>> 
>> I will probably have no time this week, but maybe I can give it a try next 
>> week. Would be interesting to see.
>> Although "legacy code" is the only good use-case for that I think.
> 
> I would disagree; a lot of people still use GLES v1 because it's "easier" and gives you something to start with. GLES v2 isn't a superset; you have to make custom shaders to do anything, even if you want to just draw lines on the screen. It gives more flexibility but at a cost.
> 
>> 
>> 
>> How does you setup look like ... You want to use QGLWidget (fullscreen), put 
>> your GL-code into paintGL() for rendering?
> 
> Something like that. The code is flexible and I can easily work it into that kind of setup.
> 
>> 
>>> 
>>>> About raster:
>>>> Good questions ... have you tried to get debugging running?
>>> 
>>> Not until now. I'm pretty certain that it's caused by this:
>>> JNI WARNING: inst fieldID 0x4218e084 not valid for class
>>> Landroid/view/Surface; The crash signal is SIGSEGV and the fault adds is
>>> 0xdeadd00d which indicates that the VM aborting is what caused the app to
>>> die.
>>> 
>>> Here's a backtrace from logcat, when using libandroid-9.so. Not very useful.
>>> I/DEBUG   (   65):          #00  pc 00046240  /system/lib/libdvm.so I/DEBUG
>>>  (   65):          #01  pc 0003760c  /system/lib/libdvm.so I/DEBUG   (  
>>> 65):          #02  pc 00038522  /system/lib/libdvm.so I/DEBUG   (   65):   
>>>      #03  pc 00038c12  /system/lib/libdvm.so I/DEBUG   (   65):         
>>> #04  pc 00033fcc  /system/lib/libandroid_runtime.so I/DEBUG   (   65):     
>>>    #05  pc 00054f50  /system/lib/libandroid_runtime.so I/DEBUG   (   65): 
>>>        #06  pc 0000057e  /system/lib/libjnigraphics.so
>>> 
>>> Interestingly, this is the same error I got when I tried loading
>>> libandroidGL-5.so and libandroid-5.so. Changing to libandroidGL-9.so fixed
>>> that problem and the program runs (without displaying anything because of
>>> GL errors.) But running with libandroid-9.so for raster pulls up this error
>>> again.
>>> 
>>> Here's a backtrace when using libandroid-5.so:
>>> I/DEBUG   (   65):          #00  pc 00046240  /system/lib/libdvm.so
>>> I/DEBUG   (   65):          #01  pc 0003760c  /system/lib/libdvm.so
>>> I/DEBUG   (   65):          #02  pc 00038522  /system/lib/libdvm.so
>>> I/DEBUG   (   65):          #03  pc 00038c12  /system/lib/libdvm.so
>>> I/DEBUG   (   65):          #04  pc 00033fcc 
>>> /system/lib/libandroid_runtime.so I/DEBUG   (   65):          #05  pc
>>> 00054f50  /system/lib/libandroid_runtime.so I/DEBUG   (   65):          #06
>>> pc 0000ba88  /data/local/qt/plugins/platforms/android/libandroid-5.so
>>> 
>>> Aha.. This looks more useful. And with gdb I got a code listing:
>>> 
>>> (gdb) list *0xba88
>>> 0xba88 is in AndroidBitmap_getInfo
>>> (../../src/native/graphics/jni/bitmap.cpp:26). 21	                         
>>> AndroidBitmapInfo* info) {
>>> 22	    if (NULL == env || NULL == jbitmap) {
>>> 23	        return ANDROID_BITMAP_RESULT_BAD_PARAMETER;
>>> 24	    }
>>> 25
>>> 26	    SkBitmap* bm = GraphicsJNI::getNativeBitmap(env, jbitmap);
>>> 27	    if (NULL == bm) {
>>> 28	        return ANDROID_BITMAP_RESULT_JNI_EXCEPTION;
>>> 29	    }
>>> 30
>>> 
>>> Hopefully that will give you more of the information you need. I could keep
>>> hacking at it but it's very late here..
>> 
>> So this is backtrace from libandroid-5.so, right?
>> If so, this is a known problem when using a <8 plugin on a >=8 device.
>> 
>> If not ... I guess this is a bug in our code :)
>> 
> 
> Yep. So nothing new here then.
> 
>> 
>> A general advice:
>> Have you made sure that all linking and including to (Qt)OpenGl was removed?
>> (best starting point: projects file remove the QT += opengl)
>> 
> 
> I had done all that on the C++ side. But I looked again and what I missed was that in QtActivity.java, line 135 was "m_surface.applicationStared( true );" where the param is "usesGL". Changing that to false allows it to run in raster mode. This really ought to be commented on or (better yet) not hardcoded.
> 
> So it's running! Raster mode is painfully slow :) Now to see if we can get OpenGL...
> 
>> 
>> Greets
>> Thomas 
>> 
>> 
>>> 
>>> Thanks,
>>> Tyler
>>> 
>>>> I'm from Germany :)
>>>> 
>>>> 
>>>> Greets
>>>> Thomas
>>>> 
>>>> On Monday, August 15, 2011 04:00:21 PM ext Tyler Mandry wrote:
>>>>> Yes, I figured this out after awhile. I ended up compiling on
>>>>> experimental, which looks like it's the same as master right now,
>>>>> unless my git-fu is lacking.
>>>>> 
>>>>> I've gotten everything compiled, but haven't gotten qmlshowcase to
>>>>> run. I'm on OS X (Lion). Here's what I've done so far:
>>>>> 
>>>>> Changed TARGET on line 61 of qmlshowcase.pro from "./bin/qmlshowcase"
>>>>> to
>>>>> just "qmlshowcase" The app was not finding the app library before I
>>>>> did
>>>>> this. Also, there seems to be a bug that is causing the build to stick
>>>>> that library in "<build-dir>/libs./bin/". It creates a new directory
>>>>> called "libs." instead of getting rid of the . or adding a slash
>>>>> before it. Removing the path from the target fixed this problem.
>>>>> 
>>>>> Added these lines to the top of startApp() in QtActivity.java:
>>>>>       getIntent().putExtra("use_local_qt_libs", "true");
>>>>>       getIntent().putExtra("load_local_libs",
>>>>> 
>>>>> "plugins/platforms/android/libandroid-9.so"); Qt Creator is failing to
>>>>> start my application (presumably with the "use_local_qt_libs" intent
>>>>> set to true) when I have the option selected to deploy local libs.
>>>>> For some reason it says it's starting the app, and nothing happens on
>>>>> the Android end. (It does push the libs to the device just fine,
>>>>> however.) So I'm manually injecting the option. Next, the app is not
>>>>> loading the Android plugin. I don't see any evidence of it trying. As
>>>>> a result I force it to load the android-9 lib. (I change it to
>>>>> libandroidGL-9.so when trying to use GL.)
>>>>> 
>>>>> So far it fails in both raster and OpenGL modes. Log snippet for
>>>>> raster:
>>>>> 
>>>>> D/Qt      ( 4768): environmentString
>>>>> "HOME=/data/data/eu.licentia.necessitas.industrius.example.qmlshowcase
>>>>> /file
>>>>> s	TMPDIR=/data/data/eu.licentia.necessitas.industrius.example.qmlshow
>>>>> case/fi
>>>>> les	CACHE_PATH=/data/data/eu.licentia.necessitas.industrius.example.q
>>>>> mlshowc ase/cache	QML_IMPORT_PATH=/data/local/qt/imports
>>>> 
>>>> QT_PLUGIN_PATH=/data/local/
>>>> 
>>>>> qt/plugins"
>>>>> ("HOME=/data/data/eu.licentia.necessitas.industrius.example.qmlshowcas
>>>>> e/fil es",
>>>>> "TMPDIR=/data/data/eu.licentia.necessitas.industrius.example.qmlshowca
>>>>> se/fi les",
>>>>> "CACHE_PATH=/data/data/eu.licentia.necessitas.industrius.example.qmlsh
>>>>> owcas e/cache", "QML_IMPORT_PATH=/data/local/qt/imports",
>>>>> "QT_PLUGIN_PATH=/data/local/qt/plugins") D/Qt      ( 4768):
>>>>> paramsString
>>>>> "QtApp	-platform	android"
>>>>> W/Qt      ( 4768): WARNING: QApplication was not created in the main()
>>>>> thread. D/Qt      ( 4768): QAndroidPlatformIntegrationPlugin::create
>>>>> "android" D/Qt      ( 4768):
>>>>> QAndroidPlatformIntegration::QAndroidPlatformIntegration():  creating
>>>>> QAndroidPlatformScreen => Using Raster (Software) for painting D/Qt   
>>>>>  ( 4768): QFbScreen::setPhysicalSize QSize(74, 124)
>>>>> D/Qt      ( 4768): QFbScreen::setGeometry QRect(0,0 480x800)
>>>>> D/Qt      ( 4768):
>>>>> QAndroidPlatformScreen::QAndroidPlatformScreen():QFbScreen() D/Qt     
>>>>> (
>>>>> 4768): setDisplayMetrics
>>>>> D/Qt      ( 4768): setDisplayMetrics done
>>>>> D/Qt      ( 4768): setDesktopSize
>>>>> D/Qt      ( 4768): setDesktopSize done
>>>>> I/Qt JAVA ( 4768): surfaceChanged: 480,762
>>>>> D/Qt      ( 4768): setDisplayMetrics
>>>>> D/Qt      ( 4768): setDisplayMetrics done
>>>>> D/Qt      ( 4768): setDesktopSize
>>>>> D/Qt      ( 4768): setDesktopSize done
>>>>> I/Qt JAVA ( 4768): surfaceChanged: 480,762
>>>>> D/Qt      ( 4768): setDisplayMetrics
>>>>> D/Qt      ( 4768): setDisplayMetrics done
>>>>> D/Qt      ( 4768): setDesktopSize
>>>>> D/Qt      ( 4768): setDesktopSize done
>>>>> I/ActivityManager(   96): Displayed
>>>>> eu.licentia.necessitas.industrius.example.qmlshowcase/eu.licentia.nece
>>>>> ssita s.industrius.QtActivity: +365ms (total +1m41s955ms)
>>>>> W/IInputConnectionWrapper( 4148): showStatusIcon on inactive
>>>>> InputConnection D/Qt      ( 4768): createPlatformWindow false
>>>>> D/Qt      ( 4768): setFullScreen false
>>>>> D/Qt      ( 4768): QFbScreen::setPhysicalSize QSize(74, 124)
>>>>> D/Qt      ( 4768): QFbScreen::setGeometry QRect(0,0 480x762)
>>>>> D/Qt      ( 4768): QFbScreen::setPhysicalSize QSize(74, 124)
>>>>> D/Qt      ( 4768): QFbScreen::setGeometry QRect(0,0 480x762)
>>>>> D/Qt      ( 4768): QFbScreen::setPhysicalSize QSize(74, 124)
>>>>> D/Qt      ( 4768): QFbScreen::setGeometry QRect(0,0 480x762)
>>>>> W/dalvikvm( 4768): JNI WARNING: inst fieldID 0x4218e084 not valid for
>>>>> class Landroid/view/Surface; I/dalvikvm( 4768): "Thread-11" prio=5
>>>>> tid=9 RUNNABLE I/dalvikvm( 4768):   | group="main" sCount=0 dsCount=0
>>>>> obj=0x40526710 self=0x300138 I/dalvikvm( 4768):   | sysTid=4777
>>>>> nice=0 sched=0/0 cgrp=default handle=2776304 I/dalvikvm( 4768):   |
>>>>> schedstat=( 1585815437 269531244 322 )
>>>>> I/dalvikvm( 4768):   at dalvik.system.NativeStart.run(Native Method)
>>>>> I/dalvikvm( 4768):
>>>>> E/dalvikvm( 4768): VM aborting
>>>>> 
>>>>> OpenGL might well be failing because I configured it with "-opengl
>>>>> es1" and not es2. From what I gather this should be possible to do,
>>>>> as far as mainstream Qt goes, but maybe the eglfs plugin doesn't
>>>>> configure it for es1 or something. Here's the log:
>>>>> 
>>>>> D/Qt      ( 4822): environmentString
>>>>> "HOME=/data/data/eu.licentia.necessitas.industrius.example.qmlshowcase
>>>>> /file
>>>>> s	TMPDIR=/data/data/eu.licentia.necessitas.industrius.example.qmlshow
>>>>> case/fi
>>>>> les	CACHE_PATH=/data/data/eu.licentia.necessitas.industrius.example.q
>>>>> mlshowc ase/cache	QML_IMPORT_PATH=/data/local/qt/imports
>>>> 
>>>> QT_PLUGIN_PATH=/data/local/
>>>> 
>>>>> qt/plugins"
>>>>> ("HOME=/data/data/eu.licentia.necessitas.industrius.example.qmlshowcas
>>>>> e/fil es",
>>>>> "TMPDIR=/data/data/eu.licentia.necessitas.industrius.example.qmlshowca
>>>>> se/fi les",
>>>>> "CACHE_PATH=/data/data/eu.licentia.necessitas.industrius.example.qmlsh
>>>>> owcas e/cache", "QML_IMPORT_PATH=/data/local/qt/imports",
>>>>> "QT_PLUGIN_PATH=/data/local/qt/plugins") D/Qt      ( 4822):
>>>>> paramsString
>>>>> "QtApp	-platform	android"
>>>>> W/Qt      ( 4822): WARNING: QApplication was not created in the main()
>>>>> thread. D/Qt      ( 4822): QAndroidPlatformIntegrationPlugin::create
>>>>> "android" D/Qt      ( 4822):
>>>>> QAndroidPlatformIntegration::QAndroidPlatformIntegration():  creating
>>>>> QAndroidEglFSScreen => Using OpenGL painting D/libEGL  ( 4822): loaded
>>>>> /system/lib/egl/libGLES_android.so
>>>>> D/libEGL  ( 4822): loaded /system/lib/egl/libEGL_adreno200.so
>>>>> I/Qt JAVA ( 4822): surfaceChanged: 480,762
>>>>> D/Qt      ( 4822): setSurface 0x2a8908 0x2a8900
>>>>> I/Qt JAVA ( 4822): surfaceChanged: 480,762
>>>>> D/Qt      ( 4822): setSurface 0x2a8908 0x2a8900
>>>>> D/libEGL  ( 4822): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
>>>>> D/libEGL  ( 4822): loaded /system/lib/egl/libGLESv2_adreno200.so
>>>>> I/ActivityManager(   96): Displayed
>>>>> eu.licentia.necessitas.industrius.example.qmlshowcase/eu.licentia.nece
>>>>> ssita s.industrius.QtActivity: +350ms W/Qt      ( 4822): Opened
>>>>> display 0x1 W/Qt      ( 4822): Initialized display 1 4
>>>>> W/Qt      ( 4822): An error in Android-EGLFS-QPA-plugin occurred in
>>>>> funtion void* q_configFromQPlatformWindowFormat(void*, const
>>>>> QPlatformWindowFormat&), when calling eglChooseConfig. eglGetError
>>>>> returned: 300c D/Qt      ( 4822): ANativeWindow_settings width  480 
>>>>> height 762  format  1 D/Qt      ( 4822):
>>>>> QAndroidEglFSScreen::createWindowSurface 0x2a8908
>>>>> W/IInputConnectionWrapper( 4148): showStatusIcon on inactive
>>>>> InputConnection E/libEGL  ( 4822): called unimplemented OpenGL ES API
>>>>> E/libEGL  ( 4822): called unimplemented OpenGL ES API
>>>>> E/libEGL  ( 4822): called unimplemented OpenGL ES API
>>>>> E/libEGL  ( 4822): called unimplemented OpenGL ES API
>>>>> E/libEGL  ( 4822): called unimplemented OpenGL ES API
>>>>> E/libEGL  ( 4822): called unimplemented OpenGL ES API
>>>>> ...and so on...
>>>>> 
>>>>> I'm running on a Nexus One with 2.3.4.
>>>>> 
>>>>> I can post some or all of this on necessitas-devel if you want. Also,
>>>>> what are your working hours GMT? I'm in the US, and I take it you
>>>>> aren't, so it would help to know.
>>>>> 
>>>>> Thanks for your help,
>>>>> Tyler
>>>>> 
>>>>> On Aug 15, 2011, at 4:39 AM, <thomas.senyk at nokia.com> wrote:
>>>>>> No! This branch is deprecated.
>>>>>> Use master!
>>>>>> 
>>>>>> There you will see that there are software and opengl plugins.
>>>>>> 
>>>>>> If you got everything build, I can help you get i running tomorrow
>>>>>> (Today I'm out-of-office)
>>>>>> 
>>>>>> 
>>>>>> Greets
>>>>>> Thomas
>>>>>> 
>>>>>> ________________________________________
>>>>>> From: ext Tyler Mandry [tmandry at gmail.com]
>>>>>> Sent: Monday, August 15, 2011 1:12 AM
>>>>>> To: Senyk Thomas (Nokia-DXM/Munich)
>>>>>> Subject: Compiling experimental-eglfs-jw
>>>>>> 
>>>>>> Hi Thomas,
>>>>>> 
>>>>>> I'm compiling your GL branch of Necessitas. I'm using the
>>>>>> "experimental-eglfs-jw" branch, is this correct?
>>>>>> 
>>>>>> Also, is GLES v1.x supported, or only 2.0?
>>>>>> 
>>>>>> When I get this compiled I should be able to get it tested on a
>>>>>> handful
>>>>>> of different devices and get back to you.
>>>>>> 
>>>>>> Thanks,
>>>>>> Tyler Mandry
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/necessitas-devel/attachments/20110817/f7ca8c86/attachment-0001.html>


More information about the Necessitas-devel mailing list