Author Topic: All Testers! New JNI linkage  (Read 4928 times)

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3496
  • Developer
    • View Profile
    • PaulsCode.Com
All Testers! New JNI linkage
« on: April 06, 2013, 07:06:17 PM »
Littleguy recently finished a rather significant restructuring of the JNI linkage into the new "AE Bridge" system.  We need to have this tested on a variety of devices to make sure it didn't break anything.  The focus of tests should be on areas where the front-end and core communicate with each other (things like pause, resume, speed, frame-advance, gameshark button, cheats, etc).  If you come across any problems (likely to result in the app crashing), please post the logcat output if you are able.  If you enable crash reporting in the Advanced settings, we can sometimes get the logcat that way -- just be sure to set your PaulsCode.Com username under Contact info (also in the Advanced settings) so I can look your report up easily.

AE Bridge Test
« Last Edit: April 06, 2013, 07:07:52 PM by Paul »
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline Blizzard64

  • byte
  • *
  • Posts: 11
    • View Profile
Re: All Testers! New JNI linkage
« Reply #1 on: April 07, 2013, 03:49:26 PM »
When I activate the cheat button, the emulator crashes and restarts, so I have to disable the cheats quickly.
I will send you a crash report.

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: All Testers! New JNI linkage
« Reply #2 on: April 08, 2013, 07:42:15 AM »
Thanks.  Does this happen with every game, or just some games?  And by cheat button, do you mean the checkbox in the main menu, or the gameshark button in-game?
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Blizzard64

  • byte
  • *
  • Posts: 11
    • View Profile
Re: All Testers! New JNI linkage
« Reply #3 on: April 08, 2013, 09:08:31 AM »
It happens in every game in the checkbox from the menu. I don't know where I can find the GameShark button.
Actually it doesn't crash immediately. First it's taking some seconds to load the cheats (but they don't appear) then it throw me back to the menu (where I can select the game, go to the settings, language etc.) and then I get a message that the app has crashed. When I click on 'Force Quit', it restarts.

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: All Testers! New JNI linkage
« Reply #4 on: April 08, 2013, 09:27:04 AM »
Odd, I can't replicate the crash on my Nexus 7.  I'll keep looking into it and double check to see if the code changed somewhere.

And just to be sure, you don't have this problem with the normal Google Play version of the app, correct?
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Blizzard64

  • byte
  • *
  • Posts: 11
    • View Profile
Re: All Testers! New JNI linkage
« Reply #5 on: April 08, 2013, 10:39:25 AM »
Yes, only in the 'AE Bridge Test' version

Offline Tom.K

  • Green Team
  • long
  • *
  • Posts: 130
    • View Profile
Re: All Testers! New JNI linkage
« Reply #6 on: April 08, 2013, 02:02:37 PM »
When I activate the cheat button, the emulator crashes and restarts, so I have to disable the cheats quickly.
I will send you a crash report.
Same issue here.

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: All Testers! New JNI linkage
« Reply #7 on: April 11, 2013, 04:52:03 PM »
Sorry for the delay on this.  I just downloaded this version onto my Xperia Play and indeed I get the same crash.  I found Blizzard64's report and it's the same as mine:

Code: [Select]
0 java.lang.UnsatisfiedLinkError: getHeaderCRC
1 at paulscode.android.mupen64plusae.CoreInterfaceNative.getHeaderCRC(Native Method)
2 at paulscode.android.mupen64plusae.util.Utility.getHeaderCRC(Utility.java:284)
3 at paulscode.android.mupen64plusae.PlayMenuActivity$2.run(PlayMenuActivity.java:191)
4 at paulscode.android.mupen64plusae.util.TaskHandler$2.run(TaskHandler.java:104)

These UnsatisfiedLinkErrors are the biggest cause of crashes in Mupen (38% of all crashes right now).  I have no idea what causes them.  Any ideas Paul?  I'm going to do a fresh build of the same version you posted, see if I get a different result.
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3496
  • Developer
    • View Profile
    • PaulsCode.Com
Re: All Testers! New JNI linkage
« Reply #8 on: April 11, 2013, 04:57:46 PM »
For most of these, I haven't a clue (my guess was that the device didn't have enough memory to load the natives, but that doesn't make sense here since the library is really small).  The only one that I was able to track down was on the Kindle Fire HD.  In that case, the RSP-HLE plug-in failed to link.  I solved the problem by building the library in ARM mode instead of THUMB mode.  You might try that if you haven't already.  I'll take a closer look at this later to see if I can notice anything that stands out.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: All Testers! New JNI linkage
« Reply #9 on: April 11, 2013, 05:07:03 PM »
Good suggestions, never would have thought... I'll take a look.

Good news is that I can replicate this crash from my own debug builds -- so that rules out any release/debug/build environment differences between the two of us.  Even better is that this is the first time I've been able to replicate this bug from my own debug build.  Hopefully we can get to the bottom once and for all...
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: All Testers! New JNI linkage
« Reply #10 on: April 11, 2013, 09:12:02 PM »
Wasn't the arm/thumb build config.  Fortunately the published 2.2.0 release doesn't have the bug so a git-bisect should narrow it down quickly.
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: All Testers! New JNI linkage
« Reply #11 on: April 11, 2013, 09:45:09 PM »
Ok, this is weird.  I did a full git-bisect and I found every single revision to be good, including the revision that was originally bad.  Then I uninstalled and reinstalled and suddenly the revision is bad again.  So something important is getting lost in the reinstallation process.  But the ae-bridge libraries are definitely being installed properly, since I can still run a game even when the cheats menu causes a crash.

So back to git-bisect, this time uninstalling between each test...
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: All Testers! New JNI linkage
« Reply #12 on: April 11, 2013, 10:37:29 PM »
Ok, tracked it down.  This one at least... not sure it generalizes to the other UnsatisfiedLinkErrors.

Problem is not related to the new AE JNI bridge stuff, but was created in this commit, much earlier:
https://github.com/paulscode/mupen64plus-ae/commit/b0ddd7029fd4d0dbbb6509345e4e9d9f039a0bb9

I was thinking that all static constructors are called at app launch, but I guess it's not that simple.  Somehow the native libraries weren't staying resident (even after i started a game and returned to the menu before checking the cheats box).  Maybe something to do with dalvik getting cleared out during uninstallation or something.  Beyond my knowledge...

****

On another note, has anyone discovered any other problems with this build?  If you're not trying to use cheats, everything else should run just as before. 
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version