Port Ogre to Android?

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
angin3
Gnoblar
Posts: 4
Joined: Wed Jan 26, 2011 9:30 pm
x 1

Re: Port Ogre to Android?

Post by angin3 »

Hello, can anybody say what is going on

Code: Select all

05-20 09:46:01.773: DEBUG/libEGL(570): egl.cfg not found, using default config
05-20 09:46:23.403: DEBUG/libEGL(570): loaded /system/lib/egl/libGLES_android.so
05-20 09:46:28.364: INFO/System.out(570): eglDisplay: com.google.android.gles_jni.EGLDisplayImpl@40523a08, err: 12288
05-20 09:46:50.104: INFO/System.out(570): EglInitialize returned: true
05-20 09:47:01.893: INFO/System.out(570): eglInitialize err: 12288
05-20 09:47:06.604: INFO/System.out(570): eglChooseConfig err: 12288
05-20 09:48:03.156: DEBUG/SntpClient(61): request time failed: java.net.SocketException: Address family not supported by protocol
05-20 09:48:57.673: DEBUG/AndroidRuntime(570): Shutting down VM
05-20 09:48:57.673: WARN/dalvikvm(570): threadid=1: thread exiting with uncaught exception (group=0x40015560)
05-20 09:49:00.513: ERROR/AndroidRuntime(570): FATAL EXCEPTION: main
05-20 09:49:00.513: ERROR/AndroidRuntime(570): java.lang.IllegalArgumentException
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at com.google.android.gles_jni.EGLImpl._eglCreateContext(Native Method)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at com.google.android.gles_jni.EGLImpl.eglCreateContext(EGLImpl.java:50)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at com.nvidia.devtech.NvGLESActivity.initEGL(NvGLESActivity.java:498)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at com.nvidia.devtech.NvGLES2Activity.initEGL(NvGLES2Activity.java:57)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at com.nvidia.devtech.NvGLESActivity$2.surfaceCreated(NvGLESActivity.java:320)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at android.view.SurfaceView.updateWindow(SurfaceView.java:543)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at android.view.SurfaceView.dispatchDraw(SurfaceView.java:348)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at android.view.View.draw(View.java:6883)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at android.widget.FrameLayout.draw(FrameLayout.java:357)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at android.view.View.draw(View.java:6883)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at android.widget.FrameLayout.draw(FrameLayout.java:357)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1862)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at android.view.ViewRoot.draw(ViewRoot.java:1522)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1258)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at android.os.Looper.loop(Looper.java:123)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at android.app.ActivityThread.main(ActivityThread.java:3683)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at java.lang.reflect.Method.invokeNative(Native Method)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at java.lang.reflect.Method.invoke(Method.java:507)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
05-20 09:49:00.513: ERROR/AndroidRuntime(570):     at dalvik.system.NativeStart.main(Native Method)
05-20 09:49:00.693: WARN/ActivityManager(61):   Force finishing activity org.ogre.samples/.OgreSampleBrowserActivity
I'm using sources from default trunk. After java initializeEGL i have crash...
User avatar
Thoran
Halfling
Posts: 94
Joined: Mon Dec 01, 2008 2:04 pm
Location: Germany
x 1
Contact:

Re: Port Ogre to Android?

Post by Thoran »

Don't know if it was already mentioned (don't think so), but there are CMake scripts for Android now available from Google, to ease compilation for Android using the Toolchain and CMake.
Link: http://code.google.com/p/android-cmake/

I am planning to have a look at them the upcoming weeks, but yet no experience.

Thoran
dudeabot
Gnome
Posts: 334
Joined: Thu Jun 28, 2007 2:12 pm
Location: Brazil
x 5
Contact:

Re: Port Ogre to Android?

Post by dudeabot »

it would be nice if someone set up a step by step to port ogre to android, i have failed at doing this and think it would be useful for a lot of other people as well =)
CrimsonGT
Greenskin
Posts: 120
Joined: Thu Sep 20, 2007 10:13 am

Re: Port Ogre to Android?

Post by CrimsonGT »

dudeabot wrote:it would be nice if someone set up a step by step to port ogre to android, i have failed at doing this and think it would be useful for a lot of other people as well =)
I second this. I am still working on my project for now, but it would be very nice if someone could write a tutorial or document the process required to get Ogre3D projects running on Android :)
zgpogre
Gnoblar
Posts: 2
Joined: Sun Jun 19, 2011 11:28 am

Re: Port Ogre to Android?

Post by zgpogre »

when i port Ogre 1.0.0 to Android used android-ndk-r5b + Cygwin , i got a link error like this:

(.data.rel.ro._ZTISt9basic_iosIcSt11char_traitsIcEE[typeinfo for std::basic_ios<char, std::char_traits<char> >]+0x8):undefined reference to 'typeinfo for std::ios_base'

Does anyone know about this ? how can i resolve it ?
angin3
Gnoblar
Posts: 4
Joined: Wed Jan 26, 2011 9:30 pm
x 1

Re: Port Ogre to Android?

Post by angin3 »

you should try compile with stlport and -fno-rtti
zgpogre
Gnoblar
Posts: 2
Joined: Sun Jun 19, 2011 11:28 am

Re: Port Ogre to Android?

Post by zgpogre »

angin3 wrote:you should try compile with stlport and -fno-rtti
Thank you, angin3, I just make it
angin3
Gnoblar
Posts: 4
Joined: Wed Jan 26, 2011 9:30 pm
x 1

Re: Port Ogre to Android?

Post by angin3 »

Can anybody explain me what is that .mp3 file type in .apk.

As I know we have our assets folder where we can put anything.

From the other side we have 2 option for file management.

1. From SD cart , native posix fopen etc.
2. From .apk - that file inside we can watch by linked java functions as in Nvidia Samples.

As i can see in ogre we have special method from java witch open for us .apk. Then we have handler to .mp3 file (in Native ) and we have compress/uncompress method for that.

So, .mp3 file is some kind of .zip file ? or what ? and how we can generate it ?
dudeabot
Gnome
Posts: 334
Joined: Thu Jun 28, 2007 2:12 pm
Location: Brazil
x 5
Contact:

Re: Port Ogre to Android?

Post by dudeabot »

afaik its just a .zip file, i think the reason is explained somewhere in this post..
User avatar
Thoran
Halfling
Posts: 94
Joined: Mon Dec 01, 2008 2:04 pm
Location: Germany
x 1
Contact:

Re: Port Ogre to Android?

Post by Thoran »

Thoran wrote:Don't know if it was already mentioned (don't think so), but there are CMake scripts for Android now available from Google, to ease compilation for Android using the Toolchain and CMake.
Link: http://code.google.com/p/android-cmake/

I am planning to have a look at them the upcoming weeks, but yet no experience.

Thoran
Quoting myself, I have to add that I am a bit late with my news and that SRombauts here on the forum has nice tutorials on how to get the whole stuff running ( http://www.ogre3d.org/forums/viewtopic. ... 02#p426672 ).

Thoran
pmobr
Gnoblar
Posts: 7
Joined: Mon Jan 23, 2006 2:15 pm
x 3

Re: Port Ogre to Android?

Post by pmobr »

Hi,

I made some change on my local Gamekit svn repository which permit me to run Ogre on Android using GLES (not GLES2).
Here my Gamekit post :
http://gamekit.org/forum/viewtopic.php? ... rt=50#p772
Perhaps, it can be interesting to integrate this in Official Ogre3d source...

Pmobr
haydenli
Gnoblar
Posts: 15
Joined: Thu Apr 26, 2012 4:23 am
x 3

Re: Port Ogre to Android?

Post by haydenli »

I am having some problem with the android porting. I am following http://www.ogre3d.org/tikiwiki/Ogre+And ... evelopment for the android porting, and my built ogre is based on gamekit.

I am able to change the colour of the viewport background colour, however when I am trying to add entity to the scene, the render loop is stuck. The application just quits without any "force close" message.

Code: Select all

05-21 10:15:48.818: I/ogre(12337): In RenderSystem _render() - finish _render() 
05-21 10:15:48.918: I/DEBUG(3914): debuggerd: 2012-05-21 10:15:48
05-21 10:15:48.918: I/DEBUG(3914): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-21 10:15:48.918: I/DEBUG(3914): Build fingerprint: 'hkcsl_cht/htc_ace/ace:2.3.5/GRJ90/228204.4:user/release-keys'
05-21 10:15:48.928: I/DEBUG(3914): pid: 12337, tid: 12337  >>> com.cherrypicks.ogreTemplate <<<
05-21 10:15:48.928: I/DEBUG(3914): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
05-21 10:15:48.928: I/DEBUG(3914):  r0 00000000  r1 00000001  r2 00000000  r3 00000000
05-21 10:15:48.928: I/DEBUG(3914):  r4 4641c900  r5 00000000  r6 bef86e24  r7 003b0520
05-21 10:15:48.928: I/DEBUG(3914):  r8 4641ce20  r9 00000000  10 00000001  fp 80f23f3c
05-21 10:15:48.928: I/DEBUG(3914):  ip 00000000  sp bef86d60  lr 80debfa0  pc 80dde6b0  cpsr 60000010
05-21 10:15:48.928: I/DEBUG(3914):  d0  6e65725f206d6574  d1  202d202928726564
05-21 10:15:48.928: I/DEBUG(3914):  d2  5f206873696e6966  d3  29287265646e6572
05-21 10:15:48.928: I/DEBUG(3914):  d4  0000000000000000  d5  0000000000000000
05-21 10:15:48.938: I/DEBUG(3914):  d6  47c3500000000000  d7  0000000000000000
05-21 10:15:48.938: I/DEBUG(3914):  d8  3fda82793f5413cd  d9  0000000000000000
05-21 10:15:48.938: I/DEBUG(3914):  d10 0000000000000000  d11 0000000000000000
05-21 10:15:48.938: I/DEBUG(3914):  d12 0000000000000000  d13 0000000000000000
05-21 10:15:48.938: I/DEBUG(3914):  d14 0000000000000000  d15 0000000000000000
05-21 10:15:48.938: I/DEBUG(3914):  d16 4032aaaaa0000000  d17 3fd921fb60000000
05-21 10:15:48.938: I/DEBUG(3914):  d18 3f9607e47bc22070  d19 3fd5555555555563
05-21 10:15:48.938: I/DEBUG(3914):  d20 0000000000000000  d21 3f55c2778a8be9cf
05-21 10:15:48.938: I/DEBUG(3914):  d22 3f967b6faf8d2e07  d23 3f82391ed3d83df8
05-21 10:15:48.938: I/DEBUG(3914):  d24 3f57f48a38a4a052  d25 3f6d8a8e44e27de7
05-21 10:15:48.938: I/DEBUG(3914):  d26 3f3043b3a18f8aef  d27 3f43545b10f5feaa
05-21 10:15:48.948: I/DEBUG(3914):  d28 3f12e167f9ad8af4  d29 3f1460ea3eff5d8f
05-21 10:15:48.948: I/DEBUG(3914):  d30 3efb2a7074bf7ad4  d31 0000000000000000
05-21 10:15:48.948: I/DEBUG(3914):  scr 60000013
05-21 10:15:49.008: I/DEBUG(3914):          #00  pc 005de6b0  /mnt/asec/com.cherrypicks.ogreTemplate-2/lib/libogrekit.so
05-21 10:15:49.018: I/DEBUG(3914):          #01  lr 80debfa0  /mnt/asec/com.cherrypicks.ogreTemplate-2/lib/libogrekit.so
05-21 10:15:49.018: I/DEBUG(3914): code around pc:
05-21 10:15:49.018: I/DEBUG(3914): 80dde690 e59f2010 e08f2002 ebffffbf e3a00001 
05-21 10:15:49.018: I/DEBUG(3914): 80dde6a0 e8bd8010 000ad418 000ad407 e92d4010 
05-21 10:15:49.018: I/DEBUG(3914): 80dde6b0 e5903000 e1a0e00f e593f01c e2900001 
05-21 10:15:49.018: I/DEBUG(3914): 80dde6c0 13a00001 e8bd8010 e59f3004 e79f0003 
05-21 10:15:49.018: I/DEBUG(3914): 80dde6d0 e12fff1e 00146d38 e3510000 e92d4010 
05-21 10:15:49.018: I/DEBUG(3914): code around lr:
05-21 10:15:49.018: I/DEBUG(3914): 80debf80 e1a05000 e1a0100a e1d721b8 ea000002 
05-21 10:15:49.018: I/DEBUG(3914): 80debf90 e1d721b8 e1a0100a e1a05000 ebffc9c2 
05-21 10:15:49.018: I/DEBUG(3914): 80debfa0 e3500000 0a000066 e1a00005 e1a0100a 
05-21 10:15:49.018: I/DEBUG(3914): 80debfb0 e5953000 e1d721b8 e1a0e00f e593f01c 
05-21 10:15:49.028: I/DEBUG(3914): 80debfc0 e1a0a000 e5970010 e350000b 8a000006 
05-21 10:15:49.028: I/DEBUG(3914): stack:
05-21 10:15:49.028: I/DEBUG(3914):     bef86d20  4641ce20  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d24  80dead54  /mnt/asec/com.cherrypicks.ogreTemplate-2/lib/libogrekit.so
05-21 10:15:49.028: I/DEBUG(3914):     bef86d28  00000002  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d2c  bef86e7c  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d30  00000000  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d34  00008892  /system/bin/app_process
05-21 10:15:49.028: I/DEBUG(3914):     bef86d38  00371458  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d3c  0036da28  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d40  bef86d50  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d44  4641c900  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d48  4641d620  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d4c  4641c900  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d50  4641d620  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d54  bef86e24  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d58  df002777  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d5c  e3a070ad  
05-21 10:15:49.028: I/DEBUG(3914): #00 bef86d60  4641c900  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d64  80debfa0  /mnt/asec/com.cherrypicks.ogreTemplate-2/lib/libogrekit.so
05-21 10:15:49.028: I/DEBUG(3914):     bef86d68  003b03e8  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d6c  80f8f42c  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d70  00000003  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d74  00000001  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d78  46e153c4  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d7c  bef86d88  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d80  00001288  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d84  00001990  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d88  80f0dda8  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d8c  46915720  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d90  46f15510  
05-21 10:15:49.028: I/DEBUG(3914):     bef86d94  00000000  
05-21 10:15:49.038: I/DEBUG(3914):     bef86d98  46715500  
05-21 10:15:49.038: I/DEBUG(3914):     bef86d9c  46421d80  
05-21 10:15:49.038: I/DEBUG(3914):     bef86da0  4641d620  
05-21 10:15:49.038: I/DEBUG(3914):     bef86da4  46715500  
05-21 10:15:49.328: I/BootReceiver(1387): Copying /data/tombstones/tombstone_02 to DropBox (SYSTEM_TOMBSTONE)
05-21 10:15:49.348: E/InputDispatcher(1387): channel '40999fa8 com.cherrypicks.ogreTemplate/com.cherrypicks.ogreTemplate.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x8
05-21 10:15:49.348: E/InputDispatcher(1387): channel '40999fa8 com.cherrypicks.ogreTemplate/com.cherrypicks.ogreTemplate.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
05-21 10:15:49.358: E/SensorService(1387): dropping 1 events on the floor (Broken pipe)
05-21 10:15:49.358: D/Zygote(1259): Process 12337 terminated by signal (11)
05-21 10:15:49.388: E/SensorService(1387): dropping 1 events on the floor (Broken pipe)
05-21 10:15:49.418: E/SensorService(1387): dropping 1 events on the floor (Broken pipe)
05-21 10:15:49.428: D/SensorService(1387): SensorDevice::activate--: handle = 0x0, enabled = 0x0
05-21 10:15:49.428: D/SensorGUI(1387): ~SensorChannel: mSendFd = 227, mReceiveFd = -1
05-21 10:15:49.428: D/dalvikvm(1387): GC_FOR_MALLOC freed 252K, 35% free 8901K/13511K, external 2551K/3186K, paused 83ms
05-21 10:15:49.428: I/ActivityManager(1387): Process com.cherrypicks.ogreTemplate (pid 12337) has died.
Mind asking what should I pass in for the windowHandle and contextHandle ? Will a wrong number causes such problem I am seeing?

Code: Select all

initRenderWindow(unsigned int windowHandle, unsigned int width,
	unsigned int height, unsigned int contextHandle)
Many thanks in advance!
Nebojsa
Gnoblar
Posts: 8
Joined: Tue Apr 10, 2012 10:46 am

Re: Port Ogre to Android?

Post by Nebojsa »

Hi haydenli, I am having the same issue. Were you able to solve it ?

Thanks
haydenli
Gnoblar
Posts: 15
Joined: Thu Apr 26, 2012 4:23 am
x 3

Re: Port Ogre to Android?

Post by haydenli »

Nebojsa wrote:Hi haydenli, I am having the same issue. Were you able to solve it ?

Thanks
Hi Nebojsa,

Unfortunately no, as I was assigned a more urgent project to do after hitting this error. Now getting back to this, have you tried assigning a manual vertex and pixel shader for the material? As my program is related to this.

Btw, I find there is another thread about ogre porting to android:
http://www.ogre3d.org/forums/viewtopic.php?f=21&t=70218

See if it's useful for you
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 99
Contact:

Re: Port Ogre to Android?

Post by Wolfmanfx »

Hi,
This thread is pretty outdated i removed almost everything from this port in my fork so no need for mp3 files and no need for java at all everything is native (ndk - native activity).
Nebojsa
Gnoblar
Posts: 8
Joined: Tue Apr 10, 2012 10:46 am

Re: Port Ogre to Android?

Post by Nebojsa »

Thanks guys,

I have found that thread also and after using that version of the code error was gone.

Again Thanks.
Post Reply