Jump to content

Got it running on Nexus 7


tormentor

Recommended Posts

I set it to 22 in one build and 17 in another. I also modified the manifest files to match. Of course I had the corresponding packages installed in the SDK. That's a local thing. None worked so far.

 

There is a way to use gdb for debugging. I'll try that tomorrow perhaps. Could be something useful pops out.

Link to comment

OK, I was able to open a root shell on the device using "adb." That allowed me to see the syslog, all of it, while gemrb was running. And it's very clear now what happens.

 

I/SDL (10541): SDL_Android_Init()
I/SDL (10541): SDL_Android_Init() finished!
I/GemRB (10541): [Core/]: GemRB Core Version v0.8.3-git Loading...
I/GemRB (10541): [Core/]: Initializing the Event Manager...
I/GemRB (10541): [unknown/]:
I/GemRB (10541): **cannot open**
E/GemRB (10541): [Core/ERROR]: Cache path ./Cache doesn't exist, not a folder or contains alien files!
F/libc (10541): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x2c in tid 10574 (SDLThread)

So. It's a cache path problem. The cache folder at the location I specified in the cfg was not existing, but for some reason it didn't create one either. So I created one manually. Still no dice. There are definitely no alien files in there. Where it gets the cache location "./Cache" from, I don't know. Shouldn't it just read the cfg and use the one specified there?

 

Consequently, it segfaults.

 

Rest of logfile from gemrb on Android:

 

http://pastebin.com/4k3G43Kw

 

It's quite interesting.

Link to comment

I did try that. Both the actual cache path as well as different ones including ./Cache. No dice. That does seem like a bug.

 

These path issues on android are annoying, but I'm not sure how to fix that. I'll have to look at the code. Perhaps an option to force a certain cache folder would get this resolved.

Link to comment

Are you sure you're editing the right config? This looks like and old default cache path (current is ./Cache2), since the error should print whatever was set.

 

Edit your config again and set GameType to pst. You can then break on GemRB::Interface::StupidityDetector and print GameType. A quick way to verify gemrb is using the same config.

Link to comment

I just cleaned out the app's data and cache, which removes the gemrb install directory, then reran the app to recreate said dir, and now there is only one gemrb config.

 

It seems in interface.CPP 1362 it is set to ./Cache but I might be overlooking something.

 

Also, StupidityDetector fails because the path doesn't exist, but from the code it seems as if MakeDirectories should be called to create it. In my log, that never seems to happen.

I don't have gdb working yet and I'm not even sure gdb for android lets you set breakpoints. But I'll hack interface.CPP to make it print the gametype. I'll also just try to remove some of the checks there.

Link to comment

Yeah, I did the search and just the first two show up.

 

I made StupidityDetector log the gametype and it always says "auto" despite the gemrb.cfg saying "pst", so something weird is afoot there. I checked the permissions on the config, and it's RW. Thus, either

 

a) it doesn't read the config at all

b) it reads the config and resets gametype to auto

c) I made a mistake logging the gametype.

 

I used

 

Log(MESSAGE, "StupidityDetector", "Game type is %s", GameType);

 

I think that is correct?

 

And it still looks for ./Cache. :-s

 

If I remove the gemrb.cfg, it complains and says it's creating it from the packaged one, though.

Link to comment

oh, I guess it's too early for GameType there, that's just the default. Same with the cache path, this is all supposed to be read from the config. You can change the default in the code here: gemrb/core/Interface.cpp:1362

 

my current guess would be that somehow the cfg isn't visible to the app.

Link to comment
You will need to run the following command to retrieve the config

file:

 

adb pull /sdcard/Android/data/net.sourceforge.gemrb/files/.GemRB/GemRB.cfg

 

and edit it with your preferred text editor. Pay attention to the comments in

the file, the entries you need to change are:

 

- GamePath

- CD1 to CD5 (only if not all data is found - you have a blue screen instead of terrain)

- CachePath

 

After you adjust these paths, you have to copy the file back to the correct

location on your device:

 

adb push GemRB.cfg /sdcard/Android/data/net.sourceforge.gemrb/files/.GemRB/GemRB.cfg

 

 

This is what the android/README says at the end, but I tried these commands and there is no directory .GemRB in there. Or perhaps I'd need to root my device to see hidden files, I'm not sure. It would be a decidedly bad idea to put the config in a hidden folder anyway. Since the game autocreates GemRB.cfg if it doesn't exist in the /files folder, I assume the README is simply wrong about this. There isn't really a .GemRB directory created there under installation, right?

Link to comment

No idea, my phone is much too old to be useful for testing. Judging by what you saw when you deleted the config, the path is wrong for you, yes. This $HOME like path was probably used so we find the config automatically (no /etc on android).

 

So if /sdcard/Android/data/net.sourceforge.gemrb/files/. is your game data path (GamePath), put the cfg in there, no subfolders. Details of the ordering and where all we look are in gemrb/core/InterfaceConfig.cpp:107 .

Link to comment

No, my game path is either

 

/sdcard/gemrb/bg2

 

or

 

/storage/emulated/0/Android/data/net.sourceforge.gemrb/files/bg2

 

although GemRB puts its Override, unhardcoded etc folders into

 

/storage/emulated/0/Android/data/net.sourceforge.gemrb/files

 

.

 

Anyway, when I change the default cache path in the code to /sdcard/gemrb/bg2/cache, I get progress. It seems to find that. It proceeds to starting the video driver and then it gives a lot of "invalid path" errors and claims it cannot find chitin.key.

 

So it definitely is NOT reading the config. It relies on the default paths set in the code. Very, very strange.

 

I tried putting the config into the bg2 folder, but no dice.

 

I suspect i can get it running by hacking all the default paths in the code...

 

Edit: By putting GamePath in the code as "/sdcard/gemrb/bg2/" (as well as putting CachePath as "/sdcard/gemrb/bg2/cache") the engine is now finding chitin.key, but fails to determine the game type and consequently doesn't find the matching gemrb.ini. Grr...

 

There will need to be some solution for making the engine actually read the config, this hardcoding isn't good.

 

Edit 2: Hardcoding the default gametype to "bg2" instead of "auto" makes the engine find gemrb.ini in its unhardcoded folder and complete loading resources.

 

Now it segfaults again.

 

 

I/GemRB ( 1307): [Core/]: Starting up the Sound Driver...
I/GemRB ( 1307): [OpenAL/]: Initializing OpenAL driver:
I/GemRB ( 1307): AL Version:(null)
I/GemRB ( 1307): AL Renderer:(null)
I/GemRB ( 1307): AL Vendor:(null)
F/libc ( 1307): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 1353 (SDLThread)
I/DEBUG ( 122): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 122): Build fingerprint: 'google/nakasi/grouper:5.1.1/LMY47V/1836172:user/release-keys'
I/DEBUG ( 122): Revision: '0'
I/DEBUG ( 122): ABI: 'arm'
I/DEBUG ( 122): pid: 1307, tid: 1353, name: SDLThread >>> net.sourceforge.gemrb <<<
I/DEBUG ( 122): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
I/DEBUG ( 122): r0 00000000 r1 00000000 r2 00004000 r3 5aa3fe44
I/DEBUG ( 122): r4 6a1d31cc r5 5aa5d698 r6 00000000 r7 6a7b9008
I/DEBUG ( 122): r8 00000000 r9 6a7b9010 sl 00000000 fp 6a1d4bd8
I/DEBUG ( 122): ip 4021d6e4 sp 6a1d31c8 lr 5aa3fe54 pc 5aa3fd84 cpsr 600f0010
I/DEBUG ( 122):
I/DEBUG ( 122): backtrace:
I/DEBUG ( 122): #00 pc 0002dd84 /data/app/net.sourceforge.gemrb-1/lib/arm/libopenal.so
I/DEBUG ( 122): #01 pc 0002de50 /data/app/net.sourceforge.gemrb-1/lib/arm/libopenal.so
I/DEBUG ( 122): #02 pc 000192c8 /data/app/net.sourceforge.gemrb-1/lib/arm/libopenal.so (alcOpenDevice+772)
I/DEBUG ( 122): #03 pc 00197d61 /data/app/net.sourceforge.gemrb-1/lib/arm/libmain.so (GemRB::OpenALAudioDriver::Init()+68)
I/DEBUG ( 122): #04 pc 002d4f7d /data/app/net.sourceforge.gemrb-1/lib/arm/libmain.so (GemRB::Interface::Init(GemRB::InterfaceConfig*)+10268)
I/DEBUG ( 122): #05 pc 002e5063 /data/app/net.sourceforge.gemrb-1/lib/arm/libmain.so (SDL_main+126)
I/DEBUG ( 122): #06 pc 002e520d /data/app/net.sourceforge.gemrb-1/lib/arm/libmain.so (Java_org_libsdl_app_SDLActivity_nativeInit+200)
I/DEBUG ( 122): #07 pc 000010e9 /data/dalvik-cache/arm/data@app@net.sourceforge.gemrb-1@base.apk@classes.dex
I/DEBUG ( 122):
I/DEBUG ( 122): Tombstone written to: /data/tombstones/tombstone_06

 


 

I assume that's another case of the engine not finding something, or maybe it's a real bug this time?

Link to comment

Try AudioDriver = none, there are known problems with openal on android. I still need to add the sdl_mixer2 alternative to the android build script too.

 

If you find a way to use breakpoints and singlestepping, break at the start of CFGConfig::CFGConfig and see where it goes wrong for you.

Link to comment

Well, setting AudioDriverName to "none" in the code avoids the openAL crash, and the engine then runs until it starts playing the theme (it thinks so, anyway.) I also get a gemrb.log now. Unfortunately, there is an SDL error now.

 

I/GemRB ( 3593): [Core/]: Core Initialization Complete!
I/GemRB ( 3593): [GUIScript/]: Loading Script Start.
I/GemRB ( 3593): [ResourceManager/]: Searching for 'BISLOGO'...
I/GemRB ( 3593): [ResourceManager/]: Found 'BISLOGO.mve' in 'chitin.key'.
E/GemRB ( 3593): [sDL 2 Driver/ERROR]: Unable to create texture for video playback: Texture dimensions can't be 0
E/GemRB ( 3593): [sDL 2 driver/ERROR]: Unable to lock video player: Invalid texture
E/GemRB ( 3593): [sDL 2 driver/ERROR]: Unable to lock video player: Invalid texture
E/GemRB ( 3593): [sDL 2 driver/ERROR]: Unable to lock video player: Invalid texture
E/GemRB ( 3593): [sDL 2 driver/ERROR]: Unable to lock video player: Invalid texture

 

 

There's a lot of repetitions of this, but no crash, and the engine completes loading as usual with attempting to play the theme music.

 

I'll try to disable intro movies, then. :-s

 

Edit: After disabling intro movies, from the log it seems that the game thinks it is running, but the screen stays black. This is the last I see of it:

 

I/GemRB ( 4959): [sDL 2 Driver/]: Creating display
I/GemRB ( 4959): [sDL 2 Driver/]: Creating Main Surface: w=0 h=0 fmt=SDL_PIXELFORMAT_ABGR8888

 

The w=0 h=0 might be an issue...

 

GemRB.log from current git (hacked) on Android:

 

http://pastebin.com/dc4Q8NiC

 

Logcat from root console on device:

 

http://pastebin.com/7iKCQEMJ

 

At this point I believe the game is running with graphics off, I have to kill it in order to close it.

 

Edit 2: The older Android sorces seem impossible to compile, and the newer ones compile but don't run. I have to wonder how version 0.8.0 was compiled and made to work, that person must have been a better hacker than I am :-s

 

I'm giving up for now, running gdb with android seems possible but I'm too tired. And maybe someone could fix that SDL problem and the openAL one. I'll gladly run builds for you whenever you want.

Link to comment

There isn't an SDL issue to fix (in the code i mean). the problem is the 0 dimensions as you noted. these need to be set in the configuration and IIRC they need to account for the various status bars and crap on Android or it will blow up. According to the log message the dimension parameters passed to CreateDisplay are both 0 so they weren't in the config at all.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...