Android Bounty

Wow! Cool! 38-50fps with 100 Pandas on my Fly IQ441 (Android 4.0.4)

11thPenguin: what does your build support so far? If you’re willing to share the code, I can see if I can integrate useful bits into my own implementation.

All the 3rd party libraries I checked seem to have Android versions or can be compiled for it without too much effort.
When did mobiles get so powerful?

Anyway.
FMOD has android version: fmod.org/fmod-downloads.html
OpenAL has been compiled by some already: pielot.org/2010/12/14/openal-on-android/
Miles has Anodroid version: radgametools.com/msssdk.htm

Couldn’t find anything for ODE physics.
Bullet can be compiled: bulletphysics.org/Bullet/phpBB3/ … f=9&t=4158
PhysX 3.1 seems to support Android.

First page of libRocket GUI library shows an Android game using it. librocket.com/

If we don’t have a stripped down Panda support on Android with less features than Panda in my opinion will be a very attractive option for Android game developers.

100 pandas on Samsung galaxy s3: 40-60fps
(android 4.1.2)

For audio, we can simply implement OpenSL ES, which is supported since Android 2.3 and seems powerful enough by itself. It supports decoding audio as well, which is something that OpenAL does not do.

Many of the image loading and video decoding libraries don’t need to be ported, as we can use Android’s own decoding implementations for this. For instance, I recently finished implementing Android’s bitmap loader, which replaces the need for libpng and libjpeg.
We can also replace ffmpeg with Android’s own video decoder, OpenCV with Android’s Camera class, freetype with Android’s font loading mechanisms, etc.

Compiling the remaining libraries for Android should be relatively easy.

For anyone who wants to try it out, I’ve checked my stuff into CVS. Here’s an apk showing a JPEG-textured Panda loaded from Android’s asset storage:
rdb.name/PandaActivity-debug.apk
Requires arm architecture, Android 2.3+. Runs at around 25 FPS on my Samsung Galaxy Ace when animating, 45 when not.

Compiled using:

export NDK_ROOT=c:\cygwin\home\rdb\android-ndk-r8d
mkdir built
cp -R models built/assets
python makepanda/makepanda.py --everything --target=android --arch=arm --no-python --no-pandatool --no-sse2 --no-neon --optimize 4
# Replace -t 1 with the desired target from "android list target"
android.bat update project -t 1 -p built
(cd built && ant debug && ant installd)

No thirdparty packages needed.
(If you have an ARMv7a device, you can use --arch=armv7a for a better build. If you have an x86 emulator, use --arch=x86)

Around 40 when animating and 60 when not.

BTW, was happy to see panda’s default font and gui on my phone :slight_smile:

Is there any way to debug why none of these would run on my tablet?
NenaMark2 runs on it at 16.9fps, so I think Panda should as well.

What are the specs of your tablet? Android version, CPU type, architecture, GPU?

Android 4.0.3, the rest is a bit of a mystery. The cpu could be either Action solution 1 Ghz or Cortex A8 Allwinner A13 1 GHz, gpu ‘Integrated Graphics 400 MHz’ (could be Mali 400 MP).

There are no specs in the manual, on the producers site there are 3 models with more or less the same name.

It’s the cheapest I could get (~70$)

One downside with using OS specific libraries I can think of is having different code which needs separate maintaining. Do you think it’s worth it?

Good to hear.

In most cases, the code is simple and small enough. I think that having to maintain several separate thirdparty libraries (libjpeg, libpng, especially ffmpeg) will cost much more effort than maintaining this sliver of code I have that converts an Android Bitmap object into a Panda PNMImage, etc. If the OS provides all of these features for us, I don’t see why we wouldn’t take advantage of them.

wezu, can you give a logfile? You can retrieve the logfiles on your computer using “adb logcat”. That said, that build of mine may have debug logging disabled, but maybe there’s a useful error message in there.

Alternatively, you can use an app such as Log Collector on your device to acquire and send the log file.

I think this part of the log is about panda:

01-27 09:25:09.357 I/ActivityManager(  889): START {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.android.launcher/com.android.launcher2.Launcher} from pid 889
01-27 09:25:09.441 W/NetworkManagementSocketTagger(  889): setKernelCountSet(10022, 1) failed with errno -2
01-27 09:25:09.457 D/WindowManager(  889): getConfigDisplayHeight =480,  padding?0
01-27 09:25:09.457 I/WindowManager(  889): Set app display size: 800 x 480
01-27 09:25:09.517 V/Launcher( 1033):  onResume enter
01-27 09:25:09.529 I/dalvikvm(  889): CM_compileMethod: meth=0x41c92948 OVERRAN for buffer 0x2b869000 with 6 methods 518 bytes free
01-27 09:25:09.529 I/dalvikvm(  889): CM_purgeDone old=0x2b869000 (methods 6, size 32768, free space 518) new=0x2b831000
01-27 09:25:09.529 I/dalvikvm(  889): CM_deleteBuffer 0x2b831000 numMethods 17
01-27 09:25:09.529 I/dalvikvm-heap(  889): Dropped buffers in 276us, scanned 188us
01-27 09:25:09.553 V/Launcher( 1033): onResume exit 
01-27 09:25:09.593 D/gralloc (  793): pmem, [addr(vir/phy), size, usage, offset] = [(0x30759000 / 0x92ee000), 0x177000, 0xb00, 0x2ee000]
01-27 09:25:09.733 V/TabletStatusBar(  959): setLightsOn(true)
01-27 09:25:09.861 D/gralloc (  793): pmem, [addr(vir/phy), size, usage, offset] = [(0x305e2000 / 0x9177000), 0x177000, 0xb00, 0x177000]
01-27 09:25:09.913 W/InputMethodManagerService(  889): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@2c4c2fa8 (uid=10090 pid=1905)
01-27 09:25:09.937 D/OpenGLRenderer( 1905): Flushing caches (mode 1)
01-27 09:25:09.989 W/NetworkManagementSocketTagger(  889): setKernelCountSet(10090, 0) failed with errno -2
01-27 09:25:10.269 I/wpa_supplicant( 1121): [CTRL_IFACE]SIGNAL_POLL
01-27 09:25:13.273 I/wpa_supplicant( 1121): [CTRL_IFACE]SIGNAL_POLL
01-27 09:25:13.681 I/HK/LatinKeyboardBaseView( 1003): closing org.pocketworkstation.pckeyboard.LatinKeyboardView@2c1625b0
01-27 09:25:16.277 I/wpa_supplicant( 1121): [CTRL_IFACE]SIGNAL_POLL
01-27 09:25:19.281 I/wpa_supplicant( 1121): [CTRL_IFACE]SIGNAL_POLL
01-27 09:25:20.125 I/ActivityManager(  889): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.panda3d.sdk/org.panda3d.android.PandaActivity} from pid 1033
01-27 09:25:20.201 I/dalvikvm(  889): CM_purgeDone old=0x2b831000 (methods 13, size 32768, free space 7498) new=0x2b839000
01-27 09:25:20.201 I/dalvikvm(  889): CM_deleteBuffer 0x2b839000 numMethods 2
01-27 09:25:20.285 D/dalvikvm(  889): GC_FOR_ALLOC freed 310K, 10% free 10722K/11911K, paused 83ms
01-27 09:25:20.313 D/gralloc (  793): pmem, [addr(vir/phy), size, usage, offset] = [(0x3046b000 / 0x9000000), 0x177000, 0x933, 0x0]
01-27 09:25:20.345 D/dalvikvm( 2102): Late-enabling CheckJNI
01-27 09:25:20.345 E/dalvikvm( 2102): could not disable core file generation for pid 2102: Operation not permitted
01-27 09:25:20.349 I/ActivityManager(  889): Start proc org.panda3d.sdk for activity org.panda3d.sdk/org.panda3d.android.PandaActivity: pid=2102 uid=10085 gids={}
01-27 09:25:20.393 I/dalvikvm( 2102): Turning on JNI app bug workarounds for target SDK version 9...
01-27 09:25:20.405 D/WindowManager(  889): getConfigDisplayHeight =480,  padding?0
01-27 09:25:20.405 W/NetworkManagementSocketTagger(  889): setKernelCountSet(10085, 1) failed with errno -2
01-27 09:25:20.405 I/WindowManager(  889): Set app display size: 800 x 480
01-27 09:25:20.429 D/OpenGLRenderer( 1033): Flushing caches (mode 1)
01-27 09:25:20.441 D/gralloc (  793): pmem, [addr(vir/phy), size, usage, offset] = [(0x30759000 / 0x92ee000), 0x177000, 0xb00, 0x2ee000]
01-27 09:25:20.449 D/OpenGLRenderer( 1033): Flushing caches (mode 0)
01-27 09:25:20.545 D/dalvikvm( 2102): Trying to load lib /data/data/org.panda3d.sdk/lib/libgnustl_shared.so 0x2c1041e0
01-27 09:25:20.593 I/AVM     ( 2102): AVM Build version: 14:27:36 Aug  1 2012
01-27 09:25:20.593 I/AVM     ( 2102): Build option: [MIPS] [Android 4.0] [smc] [opt_jump] [opt_plt] [opt_floateabi] 
01-27 09:25:20.725 D/dalvikvm( 2102): Added shared lib /data/data/org.panda3d.sdk/lib/libgnustl_shared.so 0x2c1041e0
01-27 09:25:20.729 D/dalvikvm( 2102): Trying to load lib /data/data/org.panda3d.sdk/lib/libp3dtool.so 0x2c1041e0
01-27 09:25:20.729 W/dalvikvm( 2102): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/panda3d/android/PandaActivity;
01-27 09:25:20.729 W/dalvikvm( 2102): Class init failed in newInstance call (Lorg/panda3d/android/PandaActivity;)
01-27 09:25:20.729 D/AndroidRuntime( 2102): Shutting down VM
01-27 09:25:20.729 W/dalvikvm( 2102): threadid=1: thread exiting with uncaught exception (group=0x2baa41f8)
01-27 09:25:20.741 E/AndroidRuntime( 2102): FATAL EXCEPTION: main
01-27 09:25:20.741 E/AndroidRuntime( 2102): java.lang.ExceptionInInitializerError
01-27 09:25:20.741 E/AndroidRuntime( 2102): 	at java.lang.Class.newInstanceImpl(Native Method)
01-27 09:25:20.741 E/AndroidRuntime( 2102): 	at java.lang.Class.newInstance(Class.java:1319)
01-27 09:25:20.741 E/AndroidRuntime( 2102): 	at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
01-27 09:25:20.741 E/AndroidRuntime( 2102): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
01-27 09:25:20.741 E/AndroidRuntime( 2102): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
01-27 09:25:20.741 E/AndroidRuntime( 2102): 	at android.app.ActivityThread.access$600(ActivityThread.java:123)
01-27 09:25:20.741 E/AndroidRuntime( 2102): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
01-27 09:25:20.741 E/AndroidRuntime( 2102): 	at android.os.Handler.dispatchMessage(Handler.java:99)
01-27 09:25:20.741 E/AndroidRuntime( 2102): 	at android.os.Looper.loop(Looper.java:137)
01-27 09:25:20.741 E/AndroidRuntime( 2102): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
01-27 09:25:20.741 E/AndroidRuntime( 2102): 	at java.lang.reflect.Method.invokeNative(Native Method)
01-27 09:25:20.741 E/AndroidRuntime( 2102): 	at java.lang.reflect.Method.invoke(Method.java:511)
01-27 09:25:20.741 E/AndroidRuntime( 2102): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-27 09:25:20.741 E/AndroidRuntime( 2102): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-27 09:25:20.741 E/AndroidRuntime( 2102): 	at dalvik.system.NativeStart.main(Native Method)
01-27 09:25:20.741 E/AndroidRuntime( 2102): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: mips_relocate_got[1804]:   794 In 'libp3dtool.so', can't locate symbol _ZNSsC1ERKSs
01-27 09:25:20.741 E/AndroidRuntime( 2102): 	at java.lang.Runtime.loadLibrary(Runtime.java:370)
01-27 09:25:20.741 E/AndroidRuntime( 2102): 	at java.lang.System.loadLibrary(System.java:535)
01-27 09:25:20.741 E/AndroidRuntime( 2102): 	at org.panda3d.android.PandaActivity.<clinit>(PandaActivity.java:49)
01-27 09:25:20.741 E/AndroidRuntime( 2102): 	... 15 more
01-27 09:25:20.753 W/ActivityManager(  889):   Force finishing activity org.panda3d.sdk/org.panda3d.android.PandaActivity
01-27 09:25:20.865 V/TabletStatusBar(  959): setLightsOn(true)
01-27 09:25:20.881 D/gralloc (  793): pmem, [addr(vir/phy), size, usage, offset] = [(0x3090a000 / 0x949f000), 0x35000, 0x933, 0x49f000]
01-27 09:25:21.329 W/ActivityManager(  889): Activity pause timeout for ActivityRecord{2c44be38 org.panda3d.sdk/org.panda3d.android.PandaActivity}
01-27 09:25:21.349 D/WindowManager(  889): getConfigDisplayHeight =480,  padding?0
01-27 09:25:21.349 I/WindowManager(  889): Set app display size: 800 x 480
01-27 09:25:21.361 D/gralloc (  793): pmem, [addr(vir/phy), size, usage, offset] = [(0x305e2000 / 0x9177000), 0x177000, 0xb00, 0x177000]
01-27 09:25:21.361 V/Launcher( 1033):  onResume enter
01-27 09:25:21.369 V/Launcher( 1033): onResume exit 
01-27 09:25:21.489 I/dalvikvm(  889): CM_compileMethod: meth=0x41ad1d68 OVERRAN for buffer 0x2b839000 with 15 methods 65 bytes free
01-27 09:25:21.501 I/dalvikvm(  889): CM_purgeDone old=0x2b839000 (methods 15, size 32768, free space 65) new=0x2b841000
01-27 09:25:21.501 I/dalvikvm(  889): CM_deleteBuffer 0x2b841000 numMethods 53
01-27 09:25:21.501 I/dalvikvm-heap(  889): Dropped buffers in 10644us, scanned 405us
01-27 09:25:21.509 W/NetworkManagementSocketTagger(  889): setKernelCountSet(10085, 0) failed with errno -2
01-27 09:25:21.865 D/gralloc (  793): pmem, [addr(vir/phy), size, usage, offset] = [(0x3093f000 / 0x94d4000), 0x35000, 0x933, 0x4d4000]
01-27 09:25:22.285 I/wpa_supplicant( 1121): [CTRL_IFACE]SIGNAL_POLL
01-27 09:25:24.189 I/Process ( 2102): Sending signal. PID: 2102 SIG: 9
01-27 09:25:24.225 V/TabletStatusBar(  959): setLightsOn(true)
01-27 09:25:24.241 W/InputMethodManagerService(  889): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@2c21bce8
01-27 09:25:24.265 I/ActivityManager(  889): Process org.panda3d.sdk (pid 2102) has died.

But aren’t they already being maintained anyway?

@preusser: I meant having to maintain Android builds of that thirdparty package, ie, having to go through the effort of rebuilding it for four different architectures (often involving many fixes to the build system or source) every time the version changes.

Also, consider that the Panda Android build has to remain small. Right now, the apk I built is a little over 5 MB, but after adding a few thirdparty packages it’s easy to push that over the application limit.

@wezu: that looks like a mips system, instead of conventional arm. That’s just a matter of enabling a build option. I’ll include mips next time I upload a build, or perhaps I’ll make a separate build so that you can test it on mips.

Could you perhaps confirm that it is in fact a mips system, using an app like Dalvik Explorer? You should be able to find this information under “Build Details” > “CPU ABI” and also the processor stuff under “Device Details”.

It’s ‘mips’. I’m off to google what ‘mips’ is.

Build Details

Manufacturer: actions
Model: OVO Light

Brand: Tracer
Board: unknown
Device: gs701b

CPU ABI: mips

Build Fingerprint: generic/gs701b/gs701b:4.0.3/IML74K/eng.asion.20121023.173240:user/test-keys

Kernel Version: Linux version 3.0.8 (asion@Monia-Server) (gcc version 4.5.2 (GCC) ) #12 PREEMPT Tue Oct 23 17:32:06 CST 2012

DalvikVM Heap Size: 48 MiB

DalvikVM features:
  hprof-heap-dump
  hprof-heap-dump-streaming
  method-trace-profiling
  method-trace-profiling-streaming

OpenGL ES version: 2.0

Features:
  android.hardware.audio.low_latency
  android.hardware.bluetooth
  android.hardware.camera
  android.hardware.camera.autofocus
  android.hardware.camera.flash
  android.hardware.camera.front
  android.hardware.faketouch
  android.hardware.faketouch.multitouch
  android.hardware.faketouch.multitouch.distinct
  android.hardware.faketouch.multitouch.jazzhand
  android.hardware.location
  android.hardware.location.gps
  android.hardware.location.network
  android.hardware.microphone
  android.hardware.screen.landscape
  android.hardware.screen.portrait
  android.hardware.sensor.accelerometer
  android.hardware.sensor.compass
  android.hardware.touchscreen
  android.hardware.touchscreen.multitouch
  android.hardware.touchscreen.multitouch.distinct
  android.hardware.usb.host
  android.hardware.wifi
  android.hardware.wifi.direct
  android.software.sip
  android.software.sip.voip
  com.google.android.feature.GOOGLE_BUILD

Shared Java libraries:
  android.test.runner
  com.android.location.provider
  com.google.android.maps
  com.google.android.media.effects
  com.google.widevine.software.drm
  javax.obex

If the size of the app will get much bigger then a separate build for this exotic system seams a good idea.

It’s a CPU architecture, just like i386, amd64, ppc and arm. They are mostly incompatible with each other, so binaries built for one instruction set will not run on another (with the exception of i386, which is a subset of amd64). Android supports four instruction sets at the moment: arm, arm-v7a, mips, and x86, so we will be building for all four in order to support every Android device.

Oh, okay then, those are good reasons.
I guess we can update the Features page of the website when Android version is done to make it clear what the Android version uses, as well as the manual pages.

The resulting feature set will be more or less the same, so that may not be necessary. There may be some differences in the supported audio formats and video formats, but this also works in our favour - we also get support for webp and webm formats out of the box, for instance.

wezu: try this: rdb.name/PandaActivity-debug-wezu.apk