Ancurio / mkxp

Free Software implementation of the Ruby Game Scripting System (RGSS)
GNU General Public License v2.0
515 stars 131 forks source link

MKXP build for Android #56

Closed moocow1452 closed 9 years ago

moocow1452 commented 9 years ago

More of an issue tracker than anything else. I'll see if I can get a compile going, and report back on where I can get the code running and broken, and how I can otherwise put off actually getting things done. Anyone who cares to join me, get something running, or take credit for stuff already done can do so here.

xperia64 commented 9 years ago

I tried injecting LISA into the APK, but I always get 'unable to open Data/Scripts.rvdata2'. I tried setting RTP internally and on the sdcard. Also this is a folder, not a zip file.

Ancurio commented 9 years ago

@xperia64 Sorry I haven't documented anything yet really because it's a work in progress and lots of graphical things don't work. Basically, you can only put zipped games (that is, Audio, Graphics and Data, the ini should still be outside) into the APK itself. mkxp can theoretically play unzipped games from the sdcard but the build you guys have doesn't have that enabled.

pulsejet commented 9 years ago

Sorry for such a late reply. @Ancurio, I cannot upload the apk right now (cause it's quite big and I have a costly pay-for-use net pack...) Can you just make a fresh working apk for a new blank rpgxp project with the default scripts and upload it? I tried doing this by copying the necessary rtp files, removing midi (in fact I removed all audio). Still it does not work. Can you please try it out? I have again checked whether I have done it all correct, but it does not work... Only the mirror lied works (almost perfectly). I seriously think I am missing a step...

Ancurio commented 9 years ago

@radialapps https://www.dropbox.com/s/v7cjdh91cln5m2m/mkxp-debug.apk?dl=0

I put the game and RTP files in two separate zips. Also saving won't work.

pulsejet commented 9 years ago

Ok, here is EXACTLY what happens with this new apk: 1) Initial, black screen that never vanishes. 2) However, if you touch the place where the A button should exist, it gives a beep, but still black. 3) NOW, if you press the B button, you see the menu. Black is gone! 4) Again press B, you see the map and everything is fine. Exit to title and you see the title just as you should. 5) Close and reopen the game, you have to start from step 1 again... Is it some initialize problem?

pulsejet commented 9 years ago

@Ancurio, can you also see whether it is by any chance possible to implement midi support? At least, it would be good if mkxp didn't play midi, but stop giving the sdl format not supported error. Like if the game is asking to play midi, simply ignore it. That would make life much easier!

Ancurio commented 9 years ago

@radialapps I have no idea what's going wrong, it works just fine on my Mali-400. What GPU were you testing this on again? Also you said that a previous apk worked perfectly fine, or did it never work for you?

As for midi, it's just a matter of compiling fluidsynth for android. Recent releases of fluidsynth depend on glib which is a monumental pain to build, so it would have to be an older one, and statically linked because dlopen doesn't seem to pleasant on Android (unfortunately). Or maybe one could load the .so from Java and then tell the native side to skip the dlopen? That might work too. But yeah, I agree that it shouldn't error out when encountering midi's even if it can't play them.

moocow1452 commented 9 years ago

@Ancurio, try this? Worked for me if you used the ndk-build method.

http://www.bytebucket.org/kunstmusik/fluidsynth-android

On Sat, Jan 31, 2015, 7:00 PM Jonas Kulla notifications@github.com wrote:

@radialapps https://github.com/radialapps I have no idea what's going wrong, it works just fine on my Mali-400. What GPU were you testing this on again? Also you said that a previous apk worked perfectly fine, or did it never work for you?

As for midi, it's just a matter of compiling fluidsynth for android. Recent releases of fluidsynth depend on glib with is a monumental pain to build, so it would have to be an older one, and statically linked because dlopen doesn't seem to pleasant on Android (unfortunately). Or maybe one could load the .so from Java and then tell the native side to skip the dlopen? That might work too. But yeah, I agree that it shouldn't error out when encountering midi's even if it can't play them.

— Reply to this email directly or view it on GitHub https://github.com/Ancurio/mkxp/issues/56#issuecomment-72343613.

xperia64 commented 9 years ago

Before I ported TiMidity++ to android I was using fluidsynth+SDL with glib, and it worked fine (used ndk-build). I still have the source lying around if you want to see it. And if you need an example of dlopen, check the ae-bridge component of Mupen64plus AE here https://github.com/mupen64plus-ae/mupen64plus-ae/blob/master/jni/ae-bridge/ae_exports.cpp (but I still recommend System.loadLibrary on the java side if you can use it).

pulsejet commented 9 years ago

@Ancurio, GPU is a PowerVR SGX544. Now after I played TML in another player, I realized this in mkxp: 1) The first bird picture splash is not displayed but audio is played. 2) Few frames (a couple of seconds black) are skipped and then the scene starts. After this, it works perfectly. It is all black till a couple of scene changes and then everything starts magically working!

Another question, how have you handled the assets? Does mkxp keep them copied somewhere? This can help quickly change files on a rooted phone for experimentation.

pulsejet commented 9 years ago

I just realized that I seem to have caused a lot of confusion about the 'project' I mentioned earlier. What I actually meant is not compiling the binaries, but for classes.dex or are you compiling them together? What I am actually worried about is the obb support, playing many games from a single app etc. The binaries seem mostly perfect =)

I have hardly worked with android, so please don't mind if I speak something funny! =D

pulsejet commented 9 years ago

@moocow1452, your link looks promising. Hope it works out =)

pulsejet commented 9 years ago

OK, I uploaded a video of my device. Notice the fidgeting I do to get to press the A, B buttons! After the menu opens, everything is fine.

https://docs.google.com/file/d/0Bxvz3wbxE2UXN3ZiekhCdTAtbzQ/edit?usp=docslist_api

Ancurio commented 9 years ago

@moocow1452 I do not use ndk-build.

@radialapps I'm still not sure why you need an IDE project to compile a tiny bit of Java though. I execute two shell commands to compile+pack the apk and send it to the device. What else is required that the IDE gives you?

I'm really not worried about obb or "game browser" UI or other fancy things; what I'm interested in is the engine running properly without graphical corruption and decent performance.

Another question, how have you handled the assets? Does mkxp keep them copied somewhere?

The assets aren't copied anywhere, I just mount the zips inside the apk into PhysFS the same way eg. rgssad archives on the desktop would be mounted.

Actually I just downloaded fluidsynth 1.0.9 and it compiled perfectly fine for both armeabi and v7a.

pulsejet commented 9 years ago

@Ancurio, what I meant is that it will make it easier to modify the java code and suit the developer's purpose. It will also make it more streamlined and clean. Keep that aside for now, I agree that first mkxp must work perfectly :)

Fluidsynth compiled: Great news! Can you integrate it and put up a new apk?

Also, did you see the video I put up?

pulsejet commented 9 years ago

Any progress here? I really want to see this completed.

Ancurio commented 9 years ago

Sorry. Yes @radialapps I saw your video, it matches your previous description. I guess that means PowerVR is out of the picture too, unless someone can debug it and find a workaround.

Fluidsynth requires the soundfont to be available as a physical file (API limitation), so you'll have to put it on an sd card (basically anywhere except the apk). Here are the new binaries to replace the ones in lib/.

pulsejet commented 9 years ago

A simple dirty way out would be to do a couple of scene changes before the main menu...

Midi is working fine. I got knight blade running on my PowerVR, but it is extremely slow and buggy. The initial black problem if of course there, but during the game too, the screen goes on and off. The main problem comes whenever there are picture changes or animations. The game simply stops responding for a few seconds and then starts working again. Also, loading even slightly bigger maps takes one hell if a time. I am trying to find a workaround, but I don't have a PC currently so it is quite difficult.

pulsejet commented 9 years ago

I am trying to find a way to make it faster. @Ancurio, have you compiled the entire MRI? From what I understand, the main reason of several emulators' slowness is that ruby interpreters are behind it..

pulsejet commented 9 years ago

Ok, I'll make a list of something strange I am observing. The game I am testing is knight blade: 1) Initially Black (PowerVR issue) 2) In knight blade, there is an initial kinda video, so I keep pressing A for a long time till half the video gets over 3) The screen suddenly appears after a couple of scene changes. 4) After some scenes, precisely at the point when Cain overlooks the city, the screen vanishes again. 5) After some time, it reappears and works for some time. Again it disappears, reappears etc. 6) Till here, pictures and animations are TERRIBLY slow. Some pics never load at all. 7) NOW, I exit to title and again start the game. 8) When playing now, the black problem is simply gone! Also, all pictures load properly, reasonably fast though animations and map loads are still slow. Also, the screen doesn't go black at the point I mentioned above. The game simply works good!

My Interpretation: I think this looks like a memory issue... maybe a PhysFS issue. Maybe running games directly without mounting could be faster. Another way would be to load the entire pics and animations into memory initially. Map loading takes time, but scrolling etc. works perfectly. Can someone try something similar on a different GPU and report back for the same game?

pulsejet commented 9 years ago

@Ancurio, does mkxp really need hardware acceleration? If not, a simple potential solution would be to force use CPU rendering and this eliminate all GPU problems.

Ancurio commented 9 years ago

mkxp has no concept of "scenes". The first thing you should do to raise performance is not use midi music, it is a huge CPU hog. Not sure what is causing the animation lags, but you should set frameSkip=false so it doesn't look like the game jumps and cuts out the parts inbetween. Load times for maps might be related to midi, on my weaker phone loading a map usually never takes more than half a second.

I am trying to find a way to make it faster. @Ancurio, have you compiled the entire MRI? From what I understand, the main reason of several emulators' slowness is that ruby interpreters are behind it..

I don't know what you mean by "compiling the entire MRI". If you mean additional modules, the no, I only use the core, but that shouldn't be relevant to performance. I don't know how emulators are related to this, usually emulators don't use Ruby.

As for the opening sequence, the intro "video" played without any lag for me, but during the bandit ambush scenes there were a few lags here and there, not sure about the cause.

I think this looks like a memory issue... maybe a PhysFS issue. Maybe running games directly without mounting could be faster.

This makes no sense.

Another way would be to load the entire pics and animations into memory initially.

That would be a lot of memory used, especially on a phone.

@Ancurio, does mkxp really need hardware acceleration? If not, a simple potential solution would be to force use CPU rendering and this eliminate all GPU problems.

How do you "force use CPU rendering" with OpenGL ES on Android? I doubt Android has a software rasterizer. Besides, you just explained how everything is running slowly for you, do you really think giving the CPU a ton more work is going to help?

Also, here are the java/android project files you asked for, with the libs and asset folder you already have you should be able to build the apk using ant: https://www.dropbox.com/s/hybh46ybeajsy9j/mkxp_java.zip?dl=0

pulsejet commented 9 years ago

Thanks for replying!

Got some good news. It seems that PhysFS cant handle files properly that are even slightly compressed. I simply repacked the apk without any compression for the apk and it works wonders. Running smoothly now, though the black screen problem persists.

The software rendering I mean is something not for better performance, but simply for running it properly without black screens. Currently, mkxp seems to be contributing to a very low amount of CPU usage, so it shouldn't be a problem. I have no idea how to implement it, but am thinking loud... Oh, and by "scenes", I meant scenes in RPGXP not mkxp.

Ancurio commented 9 years ago

Got some good news. It seems that PhysFS cant handle files properly that are even slightly compressed. I simply repacked the apk without any compression for the apk and it works wonders. Running smoothly now, though the black screen problem persists.

This has nothing to do with PhysFS. If the file accessed in the apk is zlib compressed, SDL has to go through a Java stream class to read data, whereas if the file is uncompressed (STORE), SDL can directly read from it via a Linux file descriptor. Ant automatically applies no compression to certain file endings such as zip or png so this never happened to me, sorry for not mentioning it.

pulsejet commented 9 years ago

Ok, not a problem since it got solved finally! I tried to debug mkxp with GROPG, but it seems that a debugger limitation of GROPG forces mkxp to reinitialize causing a "SDL SOUND already initialized" error. I'm gonna try it again tomorrow, but looks like it's not really helping... What I don't understand is that the screen vanishes at specific positions in the game not anywhere else and when playing the game again, it does not vanish at the same positions... What workaround did you try to get the saves to work?

moocow1452 commented 9 years ago

Sorry to interrupt, but I think Android apps can go full software accelerated or only specific parts can be sent to the GPU if compatibility is giving you issues. Maybe this is what it will take?

http://developer.android.com/guide/topics/graphics/hardware-accel.html#controlling

On Fri, Feb 13, 2015, 2:55 PM radialapps notifications@github.com wrote:

Ok, not a problem since it got solved finally! I tried to debug mkxp with GROPG, but it seems that a debugger limitation of GROPG forces mkxp to reinitialize causing a "SDL SOUND already initialized" error. I'm gonna try it again tomorrow, but looks like it's not really helping... What I don't understand is that the screen vanishes at specific positions in the game not anywhere else and when playing the game again, it does not vanish at the same positions... What workaround did you try to get the saves to work?

— Reply to this email directly or view it on GitHub https://github.com/Ancurio/mkxp/issues/56#issuecomment-74316166.

xperia64 commented 9 years ago

Thanks for the Android project. I imported it into Eclipse and built an APK just fine and played a sample game fine. Still having issues with LISA, and I'm fairly certain I packed the game properly this time, but I still get the can't load Data/Scripts.rvdata2 error message. Can this version of mkxp load rgss3a files? And does it make a difference that the game zip is ~500MB? Unlike my previous attempts that produced that message instantaneously, this time it seems to be loading something and takes some time before that error appears. Also, LISA uses ffi if that makes a difference. I'm not sure how I would add ffi to the assets. Here is the mkxp.conf included with the game: http://pastebin.com/BFQ23Y8a

pulsejet commented 9 years ago

@xperia64, this version can run games only from the assets from zips. I don't see any RTP entry in your mkxp.conf... also is your game ini correctly pointing to the scripts?

If the apk is greater than 50mB, it takes one heck of time to install and starts taking a bit more time to load. 50mB is the limit for play store, but it shouldn't make a difference for your testing. I have tried a zip game about 75mB and it works fine.

@moocow1452, I already tried turning off hardware acceleration in the manifest, but it seems to make absolutely no difference. Neither does it correct any problems now get slower. I don't think the hardware acceleration had turned off at all!

pulsejet commented 9 years ago

@Ancurio, here is my logcat as I open mkxp with black screen, press a few buttons to bring up the screen, and close mkxp:

02-14 10:13:59.757 I/BufferQueue(132): Starting org.ancurio.mkxp setDefaultBufferSize: w=1280, h=720 02-14 10:13:59.853 D/dalvikvm(14214): open_cached_dex_file : /data/app/org.ancurio.mkxp-1.apk /data/dalvik-cache/data@app @org.ancurio.mkxp-1.apk@classes.dex 02-14 10:13:59.894 W/ActivityThread(14214): Application org.ancurio.mkxp can be debugged on port 8100... 02-14 10:13:59.906 D/dalvikvm(14214): Trying to load lib /data/app-lib/org.ancurio.mkxp-1/libmkxp.so 0x414c9a58 02-14 10:13:59.922 D/dalvikvm(14214): Added shared lib /data/app-lib/org.ancurio.mkxp-1/libmkxp.so 0x414c9a58 02-14 10:13:59.978 I/BufferQueue(132): org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity setConsumerName: org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity 02-14 10:13:59.991 I/BufferQueue(132): org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity setDefaultBufferSize: w=1280, h=720 02-14 10:13:59.995 I/WindowManager(507): Gaining focus: Window{41b90d50 u0 org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity} 02-14 10:14:00.032 D/AutostartService(7289): set fg pkgname:org.ancurio.mkxp 02-14 10:14:00.072 I/BufferQueue(132): org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity connect: api=1 02-14 10:14:00.072 I/BufferQueue(132): org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity setSynchronousMode: enabled=1 02-14 10:14:00.072 I/BufferQueue(132): org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity setSynchronousMode: enabled=1 02-14 10:14:00.076 I/BufferQueue(132): org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity new GraphicBuffer needed 02-14 10:14:00.170 D/mkxp (14214): RGSS version 1 (XP) 02-14 10:14:00.188 D/mkxp (14214): ALC_SOFT_pause_device present 02-14 10:14:00.205 I/BufferQueue(132): org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity new GraphicBuffer needed 02-14 10:14:00.216 I/SurfaceTexture(132): org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity [void* android::SurfaceTexture::createImage(EGLDisplay, const android::spandroid::GraphicBuffer&)] 02-14 10:14:00.232 I/ActivityManager(507): [AppLaunch] Displayed Displayed org.ancurio.mkxp/.MKXPActivity: +664ms 02-14 10:14:00.232 D/ActivityManager(507): AP_PROF:AppLaunch_LaunchTime:org.ancurio.mkxp/.MKXPActivity:664:196637479 02-14 10:14:00.235 I/BufferQueue(132): Starting org.ancurio.mkxp disconnect: api=2 02-14 10:14:00.235 I/SurfaceTexture(132): [Starting org.ancurio.mkxp] [virtual android::status_t android::SurfaceTexture::forceAuxConversionLocked()] mCurrentTexture:0, mCurrentBuf:0x428ce5a0 02-14 10:14:00.235 I/BufferQueue(132): Starting org.ancurio.mkxp getReleasedBuffers: returning mask 0xffffffff 02-14 10:14:00.235 I/SurfaceTexture(132): Starting org.ancurio.mkxp destroying EGLImage dpy=0x1 img=0x423c3718 02-14 10:14:00.236 D/mkxp (14214): FRAG GL_LOW_FLOAT: 1 1 8 02-14 10:14:00.236 D/mkxp (14214): FRAG GL_MEDIUM_FLOAT: 14 14 10 02-14 10:14:00.236 D/mkxp (14214): FRAG GL_HIGH_FLOAT: 126 126 23 02-14 10:14:00.236 D/mkxp (14214): VERT GL_LOW_FLOAT: 1 1 8 02-14 10:14:00.236 D/mkxp (14214): VERT GL_MEDIUM_FLOAT: 14 14 10 02-14 10:14:00.236 D/mkxp (14214): VERT GL_HIGH_FLOAT: 126 126 23 02-14 10:14:00.236 D/mkxp (14214): gl.unpack_subimage false 02-14 10:14:00.236 D/mkxp (14214): gl.npot_repeat true 02-14 10:14:00.238 I/BufferQueue(132): org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity new GraphicBuffer needed 02-14 10:14:00.240 I/BufferQueue(132): Starting org.ancurio.mkxp consumerDisconnect 02-14 10:14:00.240 I/BufferQueue(132): Starting org.ancurio.mkxp ~BufferQueue 02-14 10:14:00.260 D/mkxp (14214): GL Vendor : Imagination Technologies 02-14 10:14:00.260 D/mkxp (14214): GL Renderer : PowerVR SGX 544MP 02-14 10:14:00.260 D/mkxp (14214): GL Version : OpenGL ES 2.0 build 1.9@2204701 02-14 10:14:00.260 D/mkxp (14214): GLSL Version : OpenGL ES GLSL ES 1.00 build 1.9@2204701 02-14 10:14:00.260 D/mkxp (14214): DebugLogger: no debug extensions found 02-14 10:14:00.262 I/SurfaceTexture(132): org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity [void* android::SurfaceTexture::createImage(EGLDisplay, const android::spandroid::GraphicBuffer&)] 02-14 10:14:00.313 D/mkxp (14214): GL_MAX_TEXTURE_SIZE 4096 02-14 10:14:00.443 D/mkxp (14214): Failed to load libfluidsynth.so.1. Midi playback is disabled. 02-14 10:14:01.122 D/mkxp (14214): squeeze: 1 02-14 10:14:01.124 D/mkxp (14214): squeeze: 1 02-14 10:14:01.125 D/mkxp (14214): squeeze: 1 02-14 10:14:01.127 D/mkxp (14214): squeeze: 1 02-14 10:14:03.596 D/mkxp (14214): squeeze: 1 02-14 10:14:04.780 D/mkxp (14214): squeeze: 1 02-14 10:14:04.782 D/mkxp (14214): squeeze: 1 02-14 10:14:04.784 D/mkxp (14214): squeeze: 1 02-14 10:14:04.785 D/mkxp (14214): squeeze: 1 02-14 10:14:04.786 D/mkxp (14214): squeeze: 1 02-14 10:14:04.787 D/mkxp (14214): squeeze: 1 02-14 10:14:04.792 D/mkxp (14214): squeeze: 1 02-14 10:14:04.793 D/mkxp (14214): squeeze: 1 02-14 10:14:04.796 D/mkxp (14214): squeeze: 1 02-14 10:14:04.796 D/mkxp (14214): squeeze: 1 02-14 10:14:04.800 D/mkxp (14214): squeeze: 1 02-14 10:14:04.801 D/mkxp (14214): squeeze: 1 02-14 10:14:04.807 D/mkxp (14214): squeeze: 1 02-14 10:14:04.808 D/mkxp (14214): squeeze: 1 02-14 10:14:04.809 D/mkxp (14214): squeeze: 1 02-14 10:14:04.809 D/mkxp (14214): squeeze: 1 02-14 10:14:04.811 D/mkxp (14214): squeeze: 1 02-14 10:14:04.812 D/mkxp (14214): squeeze: 1 02-14 10:14:04.813 D/mkxp (14214): squeeze: 1 02-14 10:14:04.814 D/mkxp (14214): squeeze: 1 02-14 10:14:04.815 D/mkxp (14214): squeeze: 1 02-14 10:14:04.816 D/mkxp (14214): squeeze: 1 02-14 10:14:04.817 D/mkxp (14214): squeeze: 1 02-14 10:14:04.819 D/mkxp (14214): squeeze: 1 02-14 10:14:04.820 D/mkxp (14214): squeeze: 1 02-14 10:14:04.822 D/mkxp (14214): squeeze: 1 02-14 10:14:04.823 D/mkxp (14214): squeeze: 1 02-14 10:14:04.825 D/mkxp (14214): squeeze: 1 02-14 10:14:04.826 D/mkxp (14214): squeeze: 1 02-14 10:14:04.832 D/mkxp (14214): squeeze: 1 02-14 10:14:04.833 D/mkxp (14214): squeeze: 1 02-14 10:14:04.834 D/mkxp (14214): squeeze: 1 02-14 10:14:04.835 D/mkxp (14214): squeeze: 1 02-14 10:14:04.836 D/mkxp (14214): squeeze: 1 02-14 10:14:04.836 D/mkxp (14214): squeeze: 1 02-14 10:14:04.837 D/mkxp (14214): squeeze: 1 02-14 10:14:04.838 D/mkxp (14214): squeeze: 1 02-14 10:14:04.839 D/mkxp (14214): squeeze: 1 02-14 10:14:04.840 D/mkxp (14214): squeeze: 1 02-14 10:14:04.840 D/mkxp (14214): squeeze: 1 02-14 10:14:04.841 D/mkxp (14214): squeeze: 1 02-14 10:14:04.842 D/mkxp (14214): squeeze: 1 02-14 10:14:04.843 D/mkxp (14214): squeeze: 1 02-14 10:14:04.844 D/mkxp (14214): squeeze: 1 02-14 10:14:04.845 D/mkxp (14214): squeeze: 1 02-14 10:14:04.846 D/mkxp (14214): squeeze: 1 02-14 10:14:04.853 D/mkxp (14214): squeeze: 1 02-14 10:14:04.854 D/mkxp (14214): squeeze: 1 02-14 10:14:04.855 D/mkxp (14214): squeeze: 1 02-14 10:14:04.855 D/mkxp (14214): squeeze: 1 02-14 10:14:04.856 D/mkxp (14214): squeeze: 1 02-14 10:14:04.857 D/mkxp (14214): squeeze: 1 02-14 10:14:04.857 D/mkxp (14214): squeeze: 1 02-14 10:14:04.858 D/mkxp (14214): squeeze: 1 02-14 10:14:04.859 D/mkxp (14214): squeeze: 1 02-14 10:14:04.860 D/mkxp (14214): squeeze: 1 02-14 10:14:04.861 D/mkxp (14214): squeeze: 1 02-14 10:14:04.861 D/mkxp (14214): squeeze: 1 02-14 10:14:04.862 D/mkxp (14214): squeeze: 1 02-14 10:14:04.863 D/mkxp (14214): squeeze: 1 02-14 10:14:04.863 D/mkxp (14214): squeeze: 1 02-14 10:14:04.865 D/mkxp (14214): squeeze: 1 02-14 10:14:04.866 D/mkxp (14214): squeeze: 1 02-14 10:14:04.872 D/mkxp (14214): squeeze: 1 02-14 10:14:04.873 D/mkxp (14214): squeeze: 1 02-14 10:14:04.874 D/mkxp (14214): squeeze: 1 02-14 10:14:04.875 D/mkxp (14214): squeeze: 1 02-14 10:14:04.876 D/mkxp (14214): squeeze: 1 02-14 10:14:04.877 D/mkxp (14214): squeeze: 1 02-14 10:14:04.878 D/mkxp (14214): squeeze: 1 02-14 10:14:04.879 D/mkxp (14214): squeeze: 1 02-14 10:14:04.880 D/mkxp (14214): squeeze: 1 02-14 10:14:04.881 D/mkxp (14214): squeeze: 1 02-14 10:14:04.882 D/mkxp (14214): squeeze: 1 02-14 10:14:04.885 D/mkxp (14214): squeeze: 1 02-14 10:14:04.886 D/mkxp (14214): squeeze: 1 02-14 10:14:04.886 D/mkxp (14214): squeeze: 1 02-14 10:14:04.888 D/mkxp (14214): squeeze: 1 02-14 10:14:04.888 D/mkxp (14214): squeeze: 1 02-14 10:14:04.889 D/mkxp (14214): squeeze: 1 02-14 10:14:05.081 D/mkxp (14214): squeeze: 1 02-14 10:14:05.883 D/mkxp (14214): SDL_APP_WILLENTERBACKGROUND 02-14 10:14:05.902 D/mkxp (14214): SDL_APP_DIDENTERBACKGROUND 02-14 10:14:06.182 I/WindowManager(507): Losing focus: Window{41b90d50 u0 org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity} 02-14 10:14:06.335 D/BufferQueue(132): org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity cancelBuffer: slot=2 02-14 10:14:06.338 I/BufferQueue(132): org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity disconnect: api=1 02-14 10:14:06.340 I/SurfaceTexture(132): [org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity] [virtual android::status_t android::SurfaceTexture::forceAuxConversionLocked()] mCurrentTexture:1, mCurrentBuf:0x426bf960 02-14 10:14:06.340 I/BufferQueue(132): org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity getReleasedBuffers: returning mask 0xffffffff 02-14 10:14:06.340 I/SurfaceTexture(132): org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity destroying EGLImage dpy=0x1 img=0x4267b380 02-14 10:14:06.354 I/SurfaceTexture(132): org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity destroying EGLImage dpy=0x1 img=0x426836c0 02-14 10:14:06.375 I/BufferQueue(132): org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity consumerDisconnect 02-14 10:14:06.375 I/BufferQueue(132): org.ancurio.mkxp/org.ancurio.mkxp.MKXPActivity ~BufferQueue

xperia64 commented 9 years ago

@radialapps that mkxp.conf was included with the game when I bought it on steam. The mkxp.conf I used is the default but has LISA.zip instead of the other zip files.

pulsejet commented 9 years ago

@xperia64, you will have to modify the mkxp.conf. Put the zip in assets and point RTP to the zip. gameFolder doesn't seem to work properly. Anyway, nothing would work AS IS from steam...

moocow1452 commented 9 years ago

Well, bad news then. According to Reddit, http://www.reddit.com/r/androiddev/comments/2vss8k/turn_off_gpu_rendering_ndk/cokoehf

We're going to have to go about this the long way around. I have made compiles before, and I can swap out my own libraries as they need be, but whatever writing we do would have to be directly supported by the OpenGL standard. Which is what we already knew, which sucks.

On Sat, Feb 14, 2015, 2:26 AM radialapps notifications@github.com wrote:

@xperia64 https://github.com/xperia64, you will have to modify the mkxp.conf. Put the zip in assets and point RTP to the zip. gameFolder doesn't seem to work properly. Anyway, nothing would work AS IS from steam...

— Reply to this email directly or view it on GitHub https://github.com/Ancurio/mkxp/issues/56#issuecomment-74365465.

moocow1452 commented 9 years ago

@radicalapps, how did you get debugging to work on your device. Custom build?

Ancurio commented 9 years ago

@moocow1452 I think you're having a tiny bit of a misconception regarding how OpenGL (ES) works. You're operating under the assumption that every Android release ships with a complete GLES software implementation, and that one can just magically "turn off hardware accell" to plug into this software rasterizer. To the best of my knowledge, such a software rasterizer does not exist on Android, and a few minutes on google also don't turn up anything related to it. So please, if you have actual documentation and sources on such a software implementation, link them, because otherwise it's pointless to further crawl down this rabbit hole.

pulsejet commented 9 years ago

That's not good.

@moocow1452, I couldn't get mkxp to debug due to a GROPG problem. I am using the same build uploaded above.

Ancurio commented 9 years ago

@radialapps Thanks, but there is nothing useful in a mkxp log. What you can try to do however is turn on OpenGL tracing/debugging; on my device there's the option Call stack on glGetError. This might potentially reveal something.

moocow1452 commented 9 years ago

@Ancurio, I know that GLES was incorporated into Android and was trying to say that the only things we can fix in MKXP for Android is our implementation and calls, which sounds about as fun as DIY dentistry. I'll ask around some more, maybe it's not as hard if we know what we are looking for.

On Sat, Feb 14, 2015, 1:09 PM Jonas Kulla notifications@github.com wrote:

@radialapps https://github.com/radialapps Thanks, but there is nothing useful in a mkxp log. What you can try to do however is turn on OpenGL tracing/debugging; on my device there's the option Call stack on glGetError. This might potentially reveal something.

— Reply to this email directly or view it on GitHub https://github.com/Ancurio/mkxp/issues/56#issuecomment-74385495.

Ancurio commented 9 years ago

@moocow1452 I still don't know what you're trying to do.

the only things we can fix in MKXP for Android is our implementation and calls

so you believe the issue lies with mkxp and not the drivers?

moocow1452 commented 9 years ago

As I understand it, we can't fix the drivers, so whether or not they are broken is irrelevant to if we want to make a working version of MKXP for those chipsets. Sorry for the misunderstanding.

On Sat, Feb 14, 2015, 2:46 PM Jonas Kulla notifications@github.com wrote:

@moocow1452 https://github.com/moocow1452 I still don't know what you're trying to do.

the only things we can fix in MKXP for Android is our implementation and calls

so you believe the issue lies with mkxp and not the drivers?

— Reply to this email directly or view it on GitHub https://github.com/Ancurio/mkxp/issues/56#issuecomment-74389177.

xperia64 commented 9 years ago

Still can't get LISA to work, "Unable to open 'Data/Scripts.rvdata2'", although it takes about 5-6 minutes for that message to appear, so it appears to be trying. This is my current mkxp.conf http://pastebin.com/CtD25aXJ and Game.ini has the following lines: Library=System\RGSS301.dll Scripts=Data\Scripts.rvdata2 Title=LISA

LISA.zip contains the folders Audio, Fonts, Graphics, mkxp, etc, and Game.rgss3a containing the Data folder. The mkxp folder contains ffi and preload.rb.

Do I have to extract Game.rss3a or something?

moocow1452 commented 9 years ago

Got it!

So I believe that starting in 4.2, you have a USB Debugging option under Monitoring named "Enabling OpenGL Traces" and you can add EGL data to your logcat. This is mine...

https://drive.google.com/file/d/0B0iHVj8OqCAmcXA3cC1ZMDdxYkU/view?usp=sharing

Important stuff begins at --------- beginning of /dev/log/main

Hopefully this is valuable.

EDIT: Enable OpenGL Traces has these options;

Ancurio commented 9 years ago

@xperia64 Oh, I think it's not working for you because you put an rgssad inside the zip. Recursive archives don't work, sorry. You can either put the unpacked contents inside the zip, or put the game folder (with ini and rgssad) on an sd card and point gameFolder at it (I think that should work too if you used one of the later builds I gave to radialapps).

pulsejet commented 9 years ago

Lots of errors in logcat after open gl call stack enabled. I will upload a more detailed log later. Enabling logcat in opengl logging gets me a huge extremely detailed log.

https://docs.google.com/file/d/0Bxvz3wbxE2UXN25nWW5yY1lUYXc/edit?usp=docslist_api

pulsejet commented 9 years ago

I tried it out on a Moto E (Adreno 305), and it wasn't much good. The map and tileset seems to work well, but the menu scenes are broken. Shows lot of gibberish. However, the black screen problem of PowerVR is absent.

pulsejet commented 9 years ago

OK EDIT: Lots of things are completely broken on Adreno. Map scrolling is not working, panorama, effects are broken. About more than three quarters of graphics are broken. Only pictures seen to work perfectly.

Just a crazy idea: render everything inside mkxp with software, create a bitmap and ask OPENGL to render only the bitmap. This is bound to work everywhere, but would require coding practically all of mkxp again.

pulsejet commented 9 years ago

Complete Verbose Log for PowerVR: https://docs.google.com/file/d/0Bxvz3wbxE2UXRUFhRVFneEp3TEE/edit?usp=docslist_api

Ancurio commented 9 years ago

@radialapps If you can, please turn off everything except "Call stack on glGetError", because otherwise the log gets flooded with 99% useless information.

pulsejet commented 9 years ago

The link I put above this one has only this option enabled. I'll put it here again for clarity: https://docs.google.com/file/d/0Bxvz3wbxE2UXN25nWW5yY1lUYXc/edit?usp=docslist_api

Ancurio commented 9 years ago

@radialapps Oh I see. Looks like there are no GL errors after all, only a cryptic IMGSRV one but I have no idea what it means. Oh well was worth a try.

pulsejet commented 9 years ago

Did you see the verbose log? There are a few libegl lines between two imgsrv errors. Can the problem have something to do with SDL?