#gemrb@irc.freenode.net logs for 20 Feb 2013 (GMT)

Archive Today Yesterday Tomorrow
GemRB homepage

[00:01:03] <psch> alright, logger is there and expectedly complains about not finding GemRB.cfg
[00:01:31] <psch> im not in Interface.cpp trying to get the proper path to the app-data directory into LoadConfig
[00:01:48] <psch> and it segvaults, presumably because im writing more letters into a char* as it is long?
[00:09:18] <-- lynxlynxlynx has left IRC (Remote host closed the connection)
[00:21:11] --> brada has joined #gemrb
[00:21:23] <brada> psch: paste your code
[00:21:33] <psch> im still fiddling with it
[00:21:45] <brada> also you probably need to do what you are doing in Interface::LoadConfig(void)
[00:21:51] <psch> yeah that's where i am
[00:21:58] <brada> ok
[00:22:00] <brada> not Interface::LoadConfig(const char* filename)
[00:22:05] <psch> yup
[00:22:09] <brada> super
[00:22:15] <psch> also, does freenode have some kind of server side lastlog?
[00:22:23] <brada> we do
[00:22:27] <psch> ah ok
[00:22:29] <brada> http://log.usecode.org/gemrblog.php
[00:22:30] <Seniorita> #gemrb logs
[00:22:32] <psch> right
[00:22:35] <psch> i remember that
[00:22:37] <psch> from the topic
[00:22:41] <brada> yes :D
[00:22:45] <psch> im not thinking quickly it seems
[00:25:23] <-- exultbot has left IRC (signing off...)
[00:26:39] --> exultbot has joined #gemrb
[00:26:39] --- Topic for #gemrb is: GemRB 0.7.2 | http://gemrb.org | Something wrong? State your exact version and CHECK THE GEMRB LOG | Be wary of your thoughts for there are Illithid present: http://log.usecode.org/gemrblog.php | import pdb; pdb.set_trace()
[00:26:39] --- Topic for #gemrb set by lynxlynxlynx!~quassel@sourcemage/warlock/lynxlynxlynx at Tue Nov 20 22:36:44 2012
[00:28:00] <psch> what i tried to do now was setting UserDir to the return value of SDL_AndroidGetExternalStoragePath
[00:28:30] <psch> the SDL doc say that the path returned from there is application specific, so im thinking it should be e.g. "/sdcard/app-data/net.sourceforge.gemrb/"
[00:28:42] <brada> maybe
[00:28:46] <brada> print it to the log
[00:28:55] <psch> yeah im building that right now
[00:28:56] <psch> the log output
[00:29:12] <psch> i dont quite see through LoadConfig(void) tbh
[00:29:25] <brada> some of our code isnt very good
[00:29:36] <brada> a lot of it is very old
[00:29:40] <psch> add to that that im hardly a c/c++ dev
[00:29:45] <brada> yup
[00:29:51] <brada> this stuff is mostly c
[00:30:06] <brada> we dont seem to use std::string much at all
[00:30:42] <psch> just for curiousity's sake: the char* s that gets declared in the beginning has a fixed size, right?
[00:30:48] <psch> or rather, char* in general do
[00:30:55] <psch> if they're initialized directly
[00:31:33] <psch> cause that would explain the segfault i got with strcpy
[00:31:46] <brada> the path buffers are fixed size yes
[00:31:48] <psch> of course that is assuming that GetExternalStoragePath is longer than "./"
[00:32:17] <brada> you have _MAX_PATH bytes to work with
[00:32:21] <brada> something like 1024
[00:32:25] <brada> so you should be fine
[00:32:38] <brada> and the string functions should prevent overwrite anyway
[00:32:40] <brada> iirc
[00:32:55] <psch> well i wasn't assigning to path or name
[00:33:05] <psch> i was assigning to *s, a little further down
[00:33:09] <psch> that might have been the problem
[00:33:44] <psch> cause i thought the remaining code path is useful and should still be exercised
[00:34:03] <psch> i think i should probably stop for today soon, cant pour another all-nighter into this hah
[00:35:35] <psch> ok, the path im getting from the sdl function is "/sdcard/app-data/net.sourceforge.gemrb/files"
[00:35:41] <psch> err, no
[00:36:04] <psch> wrong clipboard
[00:36:13] <psch> /storage/emulated/0/Android/data/net.sourceforge.gemrb/files this is the path
[00:36:40] <psch> they are functionally identical
[00:36:41] <brada> that looks ok to me
[00:36:49] <psch> the files subdir throws me off though
[00:36:56] <brada> but you shouldnt assign to a char* in this case
[00:37:06] <psch> well i tried to strcpy
[00:37:12] <psch> but that doesn't change much i guess
[00:37:16] <brada> you need to copy from the returned char buffer into the variable
[00:38:03] <brada> something like strcpy( UserDir, SDL_AndroidGetExternalStoragePath );
[00:38:24] <brada> strcpy( UserDir, SDL_AndroidGetExternalStoragePath() );
[00:38:26] <brada> rather
[00:38:52] <psch> yeah, that's pretty much what i had, except for the char* s instead of UserDir
[00:39:01] <psch> but that probably was just plain wrong
[00:39:21] <psch> because *s serves some purpose there which might not coincide exactly with what i need to do
[00:39:37] <brada> but obviously you dont really want to include SDL.h here
[00:40:05] <psch> oh
[00:40:06] <psch> i dont
[00:40:08] <psch> ok
[00:40:15] <brada> so you will need to do something like i did in VFS for the mac/ios bundle stuff
[00:40:27] <brada> but for now its ok to do SDL.h
[00:40:39] <brada> just to get it working and whatnot
[00:40:49] <psch> heh
[00:42:13] <brada> but yes passing s will not work at all
[00:42:45] <brada> UserDir is the destination buffer you want to copy into
[00:43:19] <brada> later on we append gemrb.cfg to that path so that should be all you need to do
[00:43:35] <psch> yeah, that's where i arrived
[00:44:34] <psch> i also just remember to better also log the actual path where the config is loaded from
[00:44:42] <psch> which means ill build again and have another look
[00:45:03] <brada> that should already be logged
[00:45:18] <brada> maybe it only gets looged when we pass it in on cli tho
[00:46:00] <psch> oh
[00:46:01] <psch> right
[00:46:03] <psch> it gets logged in LoadConfig(const char*)
[00:50:37] <-- Maighstir has left IRC (Quit: .)
[00:53:13] <psch> hrm
[00:53:25] <psch> the path i get from SDL_AndroidGetStoragePath doesn't exist
[00:54:08] <brada> i guess im not suprised
[00:54:35] <brada> i would say just manually create it for now
[00:54:50] <brada> then once everything is working i would be happy to implement the VFS layer for you
[00:54:50] <psch> well
[00:55:05] <psch> id have to root my device to create the path
[00:55:13] <brada> why?
[00:55:15] <psch> 'cause /storage/emulated/0 is missing
[00:55:18] <brada> its on the SD card
[00:55:36] <psch> the symlink to /sdcard is missing
[00:55:38] <brada> its probably just invisible to you
[00:56:01] <psch> i have a symlink in the dir that's called legacy
[00:56:06] <psch> which points to /mnt/shell/0
[00:56:08] <brada> http://forum.xda-developers.com/showthread.php?t=1995979
[00:56:10] <Seniorita> storage/emulated/0/ - xda-developers
[00:56:18] <psch> err, /mnt/shell/emulated/0
[00:56:27] <brada> are you on android 4?
[00:56:30] <psch> 4.2.2
[00:56:51] <brada> yeah that link should exist
[00:57:48] <psch> run-as ls doesn't show me the 0 symlink either
[00:58:17] <brada> ls-a?
[00:58:52] <psch> nope
[00:59:08] <psch> i remember having the 0 symlink in that directory with 4.2.1
[00:59:30] <psch> but it's either gone now or something in my project setup is wonky
[00:59:37] <brada> i dont have android 4 so i dont know what to say
[00:59:48] <psch> as in, i can imagine that it's not there because i dont have the permissions
[01:03:55] <brada> maybe a question for fuzzie tomorrow
[01:10:03] <psch> this is a bit weird
[01:10:12] <psch> in a terminal emulator on the device the link shows up
[01:10:20] <psch> but not over adb
[01:13:23] <psch> duh
[01:13:32] <psch> im missing android.permission.READ_EXTERNAL_STORAGE
[01:13:44] <psch> that might have something to do with this behavior
[01:14:10] <psch> ah nm
[01:14:13] <psch> im too tired
[01:14:22] <psch> of course that's implicit with WRITE_...
[01:16:05] <brada> one would think
[01:16:08] <brada> but get some rest
[01:16:15] <brada> we well pick this up on the marrow
[01:16:53] <psch> yeah, you're right
[01:17:22] <psch> ill be back in something around 15 hours or so
[01:23:20] <-- kida has left IRC (Ping timeout: 272 seconds)
[01:39:13] <-- brada has left IRC (Ping timeout: 245 seconds)
[01:57:55] --> brada has joined #gemrb
[02:35:39] <-- edheldil_ has left IRC (Ping timeout: 260 seconds)
[03:20:34] <-- brada has left IRC (Quit: brada)
[03:52:27] --> brada has joined #gemrb
[04:50:14] <-- brada has left IRC (Quit: brada)
[04:58:53] <-- Canageek has left IRC (Ping timeout: 244 seconds)
[05:09:42] --> brada has joined #gemrb
[05:59:19] <-- brada has left IRC (Quit: brada)
[07:28:50] --> edheldil_ has joined #gemrb
[07:48:47] <-- WingedHussar has left IRC (Ping timeout: 255 seconds)
[07:53:16] --> WingedHussar has joined #gemrb
[07:56:57] <-- WingedHussar has left IRC (Client Quit)
[08:02:57] <-- edheldil_ has left IRC (Ping timeout: 276 seconds)
[08:43:53] --> edheldil_ has joined #gemrb
[08:56:15] <-- edheldil_ has left IRC (Ping timeout: 276 seconds)
[09:29:19] --> lynxlynxlynx has joined #gemrb
[09:29:19] <-- lynxlynxlynx has left IRC (Changing host)
[09:29:19] --> lynxlynxlynx has joined #gemrb
[09:29:19] --- ChanServ gives channel operator status to lynxlynxlynx
[09:41:52] --> Yoshimo has joined #gemrb
[10:20:16] --> WingedHussar has joined #gemrb
[12:12:51] <-- Drakkar has left IRC (Ping timeout: 248 seconds)
[12:16:03] --> Drakkar has joined #gemrb
[12:20:57] <-- WingedHussar has left IRC (Quit: WingedHussar)
[12:21:51] --> WingedHussar has joined #gemrb
[12:49:49] --> kida has joined #gemrb
[13:01:26] <edheldil> This would be a nice texture for the demo game ;-) http://karel39.rajce.idnes.cz/20.7.2012_Kostnice_u_sv._Jakuba_v_Brne#20_KOST_3225a.jpg
[13:01:26] <Seniorita> karel39 | 20.7.2012_Kostnice u sv. Jakuba v Brně – rajce.net
[14:09:32] <-- Yoshimo has left IRC (Quit: Yoshimo)
[14:16:46] --> Canageek has joined #gemrb
[14:20:36] <-- |Cable| has left IRC (Ping timeout: 276 seconds)
[14:33:29] --> |Cable| has joined #gemrb
[15:53:36] --> brada has joined #gemrb
[16:12:35] <-- WingedHussar has left IRC (Quit: WingedHussar)
[16:15:12] <brada> fuzzie: https://github.com/bradallred/gemrb/compare/gemrb:master...master
[16:15:14] <Seniorita> Comparing gemrb:master...bradallred:master · bradallred/gemrb · GitHub
[16:27:43] <fuzzie> sorry, can't look at it now
[16:27:56] <fuzzie> will try in an hour or so
[16:33:02] <brada> thank you
[16:44:59] <-- brada has left IRC (Quit: brada)
[16:53:25] --> brada has joined #gemrb
[17:06:42] <fuzzie> maybe bit later, still on train atm..
[17:15:32] <brada> fancy train wifi
[17:24:11] <-- kida has left IRC (Ping timeout: 260 seconds)
[17:33:53] <-- brada has left IRC (Quit: brada)
[17:37:58] --> edheldil_ has joined #gemrb
[17:42:05] <-- edheldil_ has left IRC (Ping timeout: 240 seconds)
[17:46:43] <-- traveler has left IRC (Ping timeout: 245 seconds)
[17:46:44] --> traveler__ has joined #gemrb
[18:07:40] --> brada has joined #gemrb
[18:17:38] <psch> im really stuck with this file path issue
[18:17:56] <psch> i can't find anything on the internet that even mentions the possbility of /storage/emulated/0 not existing
[18:18:22] <brada> i thought you determined it does exist
[18:18:35] <psch> yes
[18:18:36] <psch> it does
[18:18:40] <psch> but not for net.sourceforge.gemrb
[18:18:56] <psch> which makes me thing the app might be misconfigure somehow
[18:19:00] <brada> do you have to grant gemrb certain permissions
[18:19:03] <psch> which is what i was searching for
[18:19:28] <psch> well, it has WRITE_EXTERNAL_STORAGE
[18:19:41] <psch> with implicit READ_EXTERNAL_STORAGE
[18:19:45] <psch> which should be enough
[18:19:56] <brada> are you sure that is implicit?
[18:20:05] <psch> yes, i looked it up on the doc site
[18:20:20] <psch> i also did include READ explicitly, and it doesn't change anything
[18:20:22] --> edheldil_ has joined #gemrb
[18:20:40] <psch> the thing is, the whole /storage/emulated/0/ symlink should exist for every app for my tablet user
[18:21:03] <psch> these users aren't equal to fileowners on the actual filesystem
[18:21:38] <psch> to me it looks like gemrb for some reason isn't being told that my tablet is multi-user enabled
[18:22:26] <brada> but isnt that sym link specifically for multi user?
[18:22:37] <psch> yes
[18:23:02] <brada> so that path is correct gemrb just for whatever reason cannot access it?
[18:23:03] <psch> the symlink points to a FUSE mounted sdcard which contains the user-specifc filesystem
[18:23:12] <psch> that's how i see it, yes
[18:23:27] <psch> the path should be there, and it is for e.g. a terminal emulator on the tablet
[18:23:36] <psch> but i cant see the 0 symlink with adb nor gemrb
[18:24:51] <-- edheldil_ has left IRC (Ping timeout: 260 seconds)
[18:25:13] <psch> http://developer.android.com/about/versions/android-4.2.html#MultipleUsers
[18:25:13] <Seniorita> Android 4.2 APIs | Android Developers
[18:25:44] <psch> so, according to the api spec it should be perfectly transparent
[18:25:50] <brada> yes
[18:25:58] <brada> but we are using c functions
[18:26:05] <brada> not java
[18:26:18] <psch> well, the activity is still started with java
[18:26:28] <psch> and the function gets the correct path
[18:26:37] <psch> but the environment the app runs in isn't set up correctly
[18:30:48] <brada> this wont help you fix it, but im curious what does getenv("EXTERNAL_STORAGE"); give you?
[18:32:58] <psch> in main() i guess?
[18:33:04] <psch> does getenv exist there?
[18:33:25] <brada> getenv is a c function
[18:34:28] <psch> yes
[18:34:46] <psch> i mean GemRB.cpp/.main()
[18:35:00] <psch> well, i put it there
[18:35:03] <brada> yeah thats fine
[18:35:07] <psch> i think im also gonna try with a hardcoded path
[18:35:11] <brada> the result should be the same regardless
[18:35:50] <brada> im just trying to figure out how to get the path we want without sdl
[18:38:41] <psch> building now
[18:38:48] <psch> with hardcoded path to the .cfg and the getenv call
[18:39:01] <psch> the hardcoded path should definitely work
[18:39:24] <brada> assuming gemrb has permission required
[18:40:04] <psch> well, they're in the manifest
[18:40:18] <psch> but maybe it can't follow the hardcoded path for some reason
[18:40:28] <psch> in any case, it's definitely not a proper solution, even if it works
[18:40:42] <psch> cause it likely breaks in a multiuser env
[18:45:34] --> edheldil_ has joined #gemrb
[18:47:28] <brada> were you able to read the file?
[18:48:28] <psch> build just finished
[18:49:00] <psch> no
[18:49:23] <psch> getenv("EXTERNAL_STORAGE"): /storage/emulated/legacy
[18:49:27] <psch> this is interesting though
[18:52:18] <psch> http://nopaste.info/17a53254b3.html here's the full log
[18:52:19] <Seniorita> Nopaste - powered by project-mindstorm IT Services
[18:52:58] <-- traveler__ has left IRC (Ping timeout: 245 seconds)
[18:53:00] <psch> the path it tries to read the config at is hardcoded and typo free
[18:53:22] <psch> trying with getenv in Interface probably wouldn't hurt, ill do that
[18:56:55] <brada> so where in FileStream::Open does it fail?
[18:58:26] <psch> im not sure how to find that out
[18:59:06] <brada> well either a debugger or using print statements like you are doing :D
[18:59:21] <brada> core/System/FileStream.cpp
[18:59:30] <psch> right
[18:59:38] <brada> and FileStream::Open too
[19:00:09] <brada> sorry i meant OpenRO
[19:01:03] <psch> uhm
[19:01:10] <brada> yeah nevermind that
[19:01:41] <brada> i see it jsut calls fopen
[19:01:53] <psch> yeah that's where my confusion comes from
[19:02:37] <brada> well just find out which test in FileStream::Open fails
[19:03:43] <brada> it might be usefull to output the failure codes
[19:06:41] <psch> as in, save the return value of file_exists and str->OpenRO respectively and print them
[19:07:36] <psch> hm, no
[19:07:40] <psch> file_exists is bool
[19:07:57] <psch> i was thinking maybe this is some c magic, where 0 is true and all that and ! coerces bool context
[19:08:45] <psch> anyway, i added two log statements after file_exists and str->OpenRO
[19:08:50] <psch> in FileStream::Open
[19:10:13] <brada> ok
[19:18:03] <psch> file_exists() fails
[19:18:07] <psch> as in, returns 0
[19:18:50] <psch> ah
[19:19:02] <psch> that's my mistake though
[19:19:17] <psch> i changed the path to use PACKAGE, but that's not the package in the java sense
[19:19:25] <brada> doh
[19:19:28] <psch> i.e. it's GemRB and not net.sourceforge.gemrb
[19:19:35] <psch> ill correct that
[19:20:15] --> traveler has joined #gemrb
[19:29:59] <traveler> i've tried to bump difficulty in iwd to 5
[19:30:12] <traveler> but it only moved toggle
[19:30:36] <brada> what is the option called?
[19:30:37] <traveler> further, that is beneath
[19:30:47] <traveler> intended place
[19:30:57] <traveler> maybe it should have some input checking?
[19:31:04] <brada> known issue with the sliders
[19:31:53] <traveler> brada: in Icewind.ini Difficulty Level=4^M
[19:32:04] <traveler> ah ok
[19:33:03] <brada> what is 4^M?
[19:33:11] <traveler> 4 is setting
[19:33:16] <traveler> ^M
[19:33:16] <brada> what is ^M
[19:33:19] <traveler> is endline dos character
[19:33:32] <traveler> this is ms/dos .ttxt after all
[19:33:48] <traveler> pretty harmless
[19:33:54] <psch> ^M is \r
[19:34:16] <psch> carriage return
[19:34:22] <psch> just as added information
[19:34:46] <psch> assuming im not mixing up \n and \r and \n is line feed
[19:34:51] <psch> if i am, it's the other way around :/
[19:35:58] <traveler> ^M is \r
[19:36:00] <brada> well difficulty level is on the whitelist
[19:36:21] <traveler> *unless i'm mistaken too ;)
[19:36:48] <brada> you are sure your ini is being read?
[19:37:25] <traveler> that's good question, one i often ponder
[19:37:39] <traveler> but it clearly moves sliders
[19:38:06] <brada> well sliders arent the best way to test that at all
[19:38:06] <traveler> but i wa snot being sarcastic, i wonder about it some time ago with bg1
[19:38:11] <brada> since they are pretty broken
[19:38:20] <traveler> because some option look like being read and some don't
[19:38:24] <brada> edit teh dale.ini directly
[19:38:39] <brada> difficulty level is one we read
[19:39:06] <traveler> well i'm pretty sure difficulty bumped too... and i changed max hp on levelup and it was definitely read
[19:40:41] <traveler> well i was always editing Icewind.ini directly
[19:40:49] <brada> psch: where are you at now? got gemrb.cfg loaded?
[19:40:51] <traveler> not sure if it works from gemrb
[19:41:08] <brada> well it does if gemrb has permissions
[19:41:12] <psch> nope, can't get the config loaded
[19:41:16] <brada> and if it is located in the correct place
[19:41:19] <brada> it is logged
[19:41:23] <brada> so check your log
[19:41:26] <psch> i tried to get CWD and PWD from getenv, but those don't exist
[19:41:31] <psch> or are empty
[19:41:48] <brada> cwd?
[19:41:53] <brada> as in current working dir
[19:41:54] <brada> ?
[19:42:02] <brada> just use getcwd
[19:42:13] <psch> oh
[19:43:00] <brada> we will probably just use the sdl provided function
[19:43:12] <brada> i looked at the code behind it and its quite extensive
[19:43:22] <brada> no need to reinvent the wheel i guess
[19:43:41] <brada> maybe well see what fuzzie says
[19:43:49] <brada> if she ever looks at that diff :D
[19:46:09] <psch> i honestly don't think know the cwd will help much
[19:46:18] <psch> it's probably somewhere where i dont have write access
[19:46:32] <psch> but well, can't know that for sure if i don't know the cwd
[19:47:05] <psch> i probably also should try on a different device with android version <4.2
[19:47:09] <psch> and see if that works
[19:47:10] <brada> getcwd() ;)
[19:47:20] <psch> yeah i put getcwd in
[19:47:28] <psch> im waiting on the build :P
[19:47:51] --> rocket_hamster has joined #gemrb
[19:48:04] <brada> like you said tho. probably not what you would ever want
[19:48:21] <brada> probably the directory containing the apk
[19:49:53] <traveler> brada: "well it does if gemrb has permissions" that's cool, here gemrb don't have that's why i didn't test but i reckon it was not always working
[20:01:03] <fuzzie> muh.
[20:02:19] <fuzzie> nowhere near home/computer.
[20:03:12] <fuzzie> have no unique knowledge of storage path issues, alas
[20:04:16] <fuzzie> would have to look at what sdl is doing.
[20:08:33] <psch> i cant get getcwd to work
[20:08:35] <psch> it segfaults
[20:09:08] <brada> sdl is interfacing with jni
[20:10:51] <brada> psch: sounds like yoru code is wrong
[20:11:02] <brada> but also probably shouldnt even bother with getcwd
[20:11:14] <psch> i agree with both of those
[20:11:32] <brada> for now we will probably just use SDL_AndroidGetExternalStoragePath
[20:13:12] --> brada_ has joined #gemrb
[20:13:13] <-- brada has left IRC (Read error: Connection reset by peer)
[20:13:13] --- brada_ is now known as brada
[20:29:03] <brada> psch: what is your problem loading the config now?
[20:30:48] <psch> im still dropping out in FileStream::Open
[20:30:52] <psch> file_exists returns false
[20:31:37] <brada> and what is the path?
[20:34:35] <psch> currently im putting the path from SDL_AndroidGetExternalStoragePath() into UserDir, after that there's the call PathJoinExt that adds "GemRB.cfg" to it
[20:35:39] <psch> so, on my android 4.2 device i end up with /storage/emulated/0/Android/data/net.sourceforge.gemrb/files/GemRB.cfg and on my android 4.0 device i get /mnt/sdcard/Android/data/net.sourceforge.gemrb/files/GemRB.cfg
[20:35:47] <brada> what about using the non emulated path
[20:35:48] <psch> on both devices the cfg is in exactly those locations
[20:35:53] <psch> i tried that, hardcoded
[20:35:58] <brada> hmmm
[20:35:59] <psch> same error
[20:36:09] <brada> what about /mnt/shell/emulated/0
[20:37:29] <psch> as in, replace the /storage on the return from SDL_AndroidGetExternalStoragePath with /mnt/shell/?
[20:37:46] <psch> im not sure how to do that - i could try hardcoding just now
[20:37:59] <brada> yes hardcode
[20:39:16] <psch> i can try that
[20:39:28] <psch> but i think i made a different mistake just a bit ago
[20:39:44] <psch> namely, i uninstalled the app, and that deleted my pst on the tablet :/
[20:39:53] <psch> copying that over again takes some time..
[20:40:12] <psch> my phone has bg2 i think, i might as well just pull that from the phone and push on the tablet
[20:40:12] <-- |Cable| has left IRC (Read error: Operation timed out)
[20:40:29] <psch> although that probably takes longer... nevermind that
[20:42:07] <-- traveler has left IRC (Ping timeout: 245 seconds)
[20:42:18] <psch> okay so i apparently deleted the pst from my desktop
[20:42:24] <psch> no choice but pulling the bg2 from my phone...
[20:44:22] <-- Canageek has left IRC (Quit: KVIrc 4.0.4 Insomnia The future is here. It's just not widely distributed yet. - William Gibson)
[20:49:34] <-- brada has left IRC (Quit: brada)
[20:55:02] --> |Cable| has joined #gemrb
[21:12:32] --> traveler has joined #gemrb
[21:16:01] --> kingron has joined #gemrb
[21:29:34] <psch> hm
[21:30:28] <psch> there's definitely something wonky here
[21:30:39] <psch> i can't even write to the external storage in java
[21:30:44] <psch> *java code
[21:31:17] <psch> unless im misreading my logs...
[21:31:21] <psch> ill double check that
[21:33:49] <psch> heh, android.util.Log has the method wtf(), which apparently is an abbreviation for "What a Terrible Failure"...
[21:40:18] <psch> yeah, scratch that, i can create a file on /storage/emulated/0/ from within the android Activity in java code
[21:40:44] <psch> but it seems access to /storage/emulated/0/ somehow vanishes when the native code takes over
[21:40:50] <psch> or something, i have no real clue
[21:53:21] --> brada has joined #gemrb
[21:55:21] <-- brada has left IRC (Client Quit)
[21:56:02] --> brada has joined #gemrb
[21:57:25] <fuzzie> psch: so you're printing the final path inside FileStream::Open()?
[21:58:32] <psch> im not printing the path there, no, im printing it from LoadConfig(void) right before the call to LoadConfig(const char*)
[21:59:07] <psch> basically, i just dublicated the log print that exists in LoadConfig(const char*)
[22:00:02] <fuzzie> that is close enough, I guess, if you're sure it's file_exists which fails
[22:00:19] <psch> i have a debug print inside the if that calls file_exists
[22:00:25] <psch> so, yeah, im pretty sure that's where it fails
[22:00:35] <fuzzie> but how do you tell that it isn't a different LoadConfig call?
[22:01:10] <fuzzie> i mean, LoadConfig(void) makes several attempts at calling LoadConfig(const char*)
[22:01:25] <psch> yes
[22:01:41] <psch> the debug print i have is before the second last
[22:02:40] <fuzzie> i just wonder how you tell which ones the file_exists check fails on :)
[22:03:05] <fuzzie> there don't seem any real opportunities for problems after PathJoinExt got called..
[22:03:17] <psch> i did exclude most of the code until PathJoinExt
[22:03:31] <psch> seeing as i even hardcoded the exact path i thought i could do that
[22:03:45] <psch> most of the code in LoadConfig(void) seems to be mangling the path
[22:03:49] <fuzzie> yep
[22:04:36] <psch> let me just put my LoadConfig(void) up on nopaste
[22:05:29] <psch> http://nopaste.info/6fc08e6b16.html
[22:05:30] <Seniorita> Nopaste - powered by project-mindstorm IT Services
[22:05:40] <psch> that's LoadConfig(void) as im running it atm
[22:06:41] <fuzzie> and I guess SYSCONFDIR isn't set?
[22:07:20] <fuzzie> (it's only set by autotools/cmake)
[22:07:43] <psch> it probably isn't, im only getting one log output from file_exists and LoadConfig(const char*)
[22:08:12] <fuzzie> hrmph
[22:08:13] <fuzzie> weird
[22:08:20] <fuzzie> i mean brada already covered everything i'd say
[22:08:34] <psch> im seriously confused
[22:08:51] <psch> especially seeing that i can write to the emulated storage path inside the java activity
[22:10:22] <fuzzie> what happens if you comment out the file_exists check?
[22:10:52] <fuzzie> google doesn't have anyone complaining that stat() is broken though
[22:11:37] <psch> id assume that ill be able to read the log message i put inside the next check, for !str->OpenRO()
[22:11:48] <psch> ill build and try
[22:11:51] <fuzzie> that would be reassuringly consistent..
[22:15:33] --> brada_ has joined #gemrb
[22:15:33] <-- brada has left IRC (Read error: Connection reset by peer)
[22:15:33] --- brada_ is now known as brada
[22:16:21] <psch> gonna take a bit, im gonna make a copy of the bg2 i have on the tablet right now
[22:16:29] <psch> as to prevent any dumb accidental deletions
[22:23:52] <brada> fuzzie: did you have a look at that diff?
[22:24:37] <-- traveler has left IRC (Ping timeout: 245 seconds)
[22:26:48] <-- kingron has left IRC (Quit: Leaving)
[22:26:59] <fuzzie> no, but I am home now!
[22:28:27] <fuzzie> you'll have to explain it though
[22:28:37] <fuzzie> CopyGemSandboxDataPath is .. what?
[22:28:49] <brada> poor name choice i guess
[22:29:14] <fuzzie> it's basically SetDefaultUserDir?
[22:29:26] <brada> i suppose
[22:29:32] <fuzzie> i mean, i just try and understand
[22:29:43] <fuzzie> the comment is a bit confusing
[22:29:44] <brada> yeah you are right that its a bad name
[22:29:49] <brada> which one?
[22:30:02] <fuzzie> the one above the function declaration :)
[22:31:17] <psch> http://nopaste.info/0c74302d70.html this is my log as im getting it now
[22:31:18] <Seniorita> Nopaste - powered by project-mindstorm IT Services
[22:31:27] <brada> logically tho (naming and comments aside) is it ok? specifically in regard to linux
[22:31:31] <psch> i don't get line 33.
[22:31:37] <psch> and 34.
[22:31:42] <psch> as in, i don't know where they come from
[22:31:49] <psch> probably from fopen()?
[22:32:19] <brada> somewhere outside your control yes
[22:32:26] <brada> and those were in your earlier logs too
[22:32:38] <psch> yeah, i likely overlooked them
[22:32:40] <brada> well the unknown one is likely something you did
[22:32:53] <brada> like an empty call to log somewhere
[22:32:57] <fuzzie> they're both rather suspiciously at I level
[22:33:15] <brada> what does that mean btw fuzzie?
[22:33:18] <fuzzie> ah they're from StupidityDetector
[22:33:20] <brada> the prefix letters
[22:33:26] <fuzzie> brada: info/verbose/debug/etc, log levels
[22:33:38] <brada> oh gottcha
[22:33:40] <fuzzie> the theory being that you can exclude all the low-level debug info
[22:33:46] <fuzzie> but the reality is that everyone developing for android sucks
[22:33:54] <fuzzie> so it is a failure :/
[22:34:27] <psch> beg your pardon?
[22:34:37] <psch> i mean, i know im not a star dev, but im trying
[22:35:07] <fuzzie> yes, i mean in a general sense
[22:35:09] <fuzzie> it's all terrible
[22:35:35] <psch> i don't follow
[22:35:42] <psch> the build is all terrible? my efforts?
[22:35:45] <brada> well the big problem is i cant seem to find documentation i need so i google it and the advice you get from android devs on google is terrible
[22:35:46] <fuzzie> and i am as much to blame as anyone else, since i'm maintainer for an android app with hundreds of thousands of installs
[22:35:46] <psch> or am i taking this wrongly
[22:35:50] <fuzzie> psch: you are taking it wrongly
[22:35:53] <fuzzie> this is not about gemrb :)
[22:36:01] <psch> alright
[22:36:13] <brada> we are grateful for your efforts i assure you
[22:36:14] <fuzzie> it's just that it's almost impossible to develop for android nicely
[22:36:23] <brada> i am anyway :D
[22:36:34] <fuzzie> the documentation is a disaster
[22:36:41] <fuzzie> and all kinds of weird stuff happens that you can't debug
[22:36:56] <fuzzie> and they don't do dev previews so they release broken stuff which everyone's stuck with forever and ever..
[22:36:57] <psch> official google docs seem ok, but the changes for different api levels seem very sparse
[22:37:07] <brada> which is why when you google it you end uup on a forum where 3 people have a diffrent way to do what is asked but none of them are very good for one reason or another
[22:37:08] <fuzzie> yes, but the official google docs don't tell you anything much really
[22:37:28] <fuzzie> you end up having to ask google engineers who tell you that, oh, that's totally broken, but it's ok, because it's fixed in google's latest internal builds
[22:37:34] --> traveler has joined #gemrb
[22:38:00] <fuzzie> so as you can tell i am a bit disillusioned :-/
[22:38:08] <fuzzie> but if I had a way to make your build better, I would ask
[22:38:32] <fuzzie> i just really have no clue
[22:38:56] <psch> i guess then i fit in pretty well
[22:38:59] <psch> i also have no clue
[22:39:02] <fuzzie> yay!
[22:39:11] <brada> probably especially bad when you want to use ndk
[22:39:20] <brada> or rather need to use it
[22:39:30] <psch> well, we can't even exclude SDL2 being broken somehow
[22:39:32] <fuzzie> well, the ndk is tricky because obviously all app processes have to be java
[22:39:35] <psch> which seems kind of likely
[22:39:42] <fuzzie> but i don't think sdl2 can really be responsible for file opening failing
[22:39:58] <psch> well either sdl2 or the transition to native code
[22:40:06] <psch> or some other native lib i guess
[22:40:08] <fuzzie> the /storage/emulated/0/Android/data/net.sourceforge.gemrb/files/GemRB.cfg does exist?
[22:40:11] <fuzzie> to ask stupid question
[22:40:23] <psch> somewhere between SDLActivity.java and GemRB.cpp the access to /storage/emulated/0/ seems to break
[22:40:26] <fuzzie> i assume it isn't case-sensitive
[22:40:26] <psch> yeah, it does
[22:40:32] <psch> it should be
[22:40:42] <psch> but the case is correct
[22:40:56] <fuzzie> well, traditionally the external storage pointed at an FAT-formatted sdcard
[22:41:16] <fuzzie> google did a lot of (broken) work on a FUSE filesystem in android 3.x to emulate that
[22:41:31] <fuzzie> but i have no clue about the new world of android 4.2, as you can tell
[22:41:38] <fuzzie> so i'm just making random thoughts
[22:42:02] <psch> right, i remember the fat stuff
[22:42:16] <psch> copying from GemRB.cfg to gemrb.cfg inside the dir does nothing
[22:42:34] <fuzzie> yes, whether case-sensitive or not it should be fine right?
[22:42:35] <psch> it shouldn't be case-sensitive then
[22:42:43] <psch> that too, the path itsself is spelled correctly
[22:42:56] <psch> i dont want to assume that it has to be lower case to be read properly
[22:42:58] <fuzzie> the sdlmain is called in a different thread of course
[22:43:14] <fuzzie> and I guess your test was from the main thread?
[22:43:19] <psch> yeah
[22:43:22] <fuzzie> but I don't think that will make a difference at all
[22:43:58] <psch> i guess i could try running through the sdl code and adding debug statements
[22:43:58] <-- brada has left IRC (Read error: Connection reset by peer)
[22:44:06] --> brada has joined #gemrb
[22:44:08] <fuzzie> it sounds like a waste of time though
[22:44:14] <fuzzie> i mean, since you could spend so much time on that
[22:44:21] <psch> i definitely could spend much time on that
[22:44:26] <psch> and i agree that it'd be wasted
[22:44:42] <psch> the path i get from SDL_AndroidGetExternalStoragePath in GemRB.cpp is the same as i get in SDLActivity.java
[22:44:54] <psch> but following the path doesn't work in GemRB.cpp anymore
[22:45:54] <fuzzie> that's weird
[22:45:57] <fuzzie> the SDL init code does nothing
[22:46:33] <psch> which bit?
[22:46:37] <psch> SDL_main.cpp?
[22:46:42] <fuzzie> SDL_Android_Init
[22:46:44] <psch> oh
[22:48:25] <brada> that is called by sdl isnt it?
[22:48:32] <psch> it inits the gl context and a bunch of other things?
[22:48:36] <fuzzie> no
[22:48:44] <brada> / Called before SDL_main() to initialize JNI bindings
[22:48:47] <fuzzie> it just sets up the thread self-destruct and fetches the jni pointers
[22:48:49] <fuzzie> i.e. nothing :)
[22:49:00] <psch> oh
[22:49:11] <psch> so the function pointers aren't getting executed in the if()
[22:49:47] <psch> well, that's how i understand your explanation
[22:49:47] <-- brada has left IRC (Read error: Connection reset by peer)
[22:49:55] <fuzzie> yeah
[22:50:04] --> brada has joined #gemrb
[22:50:15] <fuzzie> it's just fetching them for later use
[22:50:21] <psch> yeah
[22:54:54] <fuzzie> brada: i think about your patch i'd be more ocncerned about you changing the win32 behaviour
[22:55:08] <brada> yeah?
[22:55:39] <fuzzie> e.g. now you're assert()ing that argv[0] exists on win32 and it didn't before
[22:56:28] <brada> ah
[22:56:33] <fuzzie> also I guess looking at the diff, that it perhaps makes more sense to just 'return LoadConfig(argv[2]);' rather than messing around with the 'if' at all, but i guess that's totally style
[22:56:44] <brada> argv[0] doesnt exist on windows?!?
[22:56:45] <fuzzie> i have no idea about argv[0] btw, i'm just looking at the diff and wondering what could thereotically go wrong
[22:57:06] <fuzzie> since i don't know if we have anyone testing on windows nowadays
[22:57:18] <brada> well i kept what was there befor
[22:57:26] <brada> but i guess while we are rewriting it...
[22:57:27] <fuzzie> more seriously i guess this will just crash on windows
[22:57:46] <brada> crash or abort?
[22:58:09] <fuzzie> since you removed the checks for getenv() returning NULL..?
[22:58:21] <brada> ah
[22:58:31] <fuzzie> it's a bit more obscure on linux but it can happen there too ofc
[22:58:47] <fuzzie> so I would put that back
[22:58:52] <brada> sure
[23:00:19] <brada> btw i just pushed a cahnge to map the android log level to ours so maybe no we wont be so "terrible" android devs
[23:00:21] <brada> ;)
[23:00:32] <fuzzie> yes, but we've already lost
[23:00:41] <fuzzie> because you can't read the android log because it's full of crap
[23:00:44] <fuzzie> in general
[23:00:55] <brada> ah
[23:00:57] <fuzzie> usually largely from the device manufacturer :/
[23:01:21] <fuzzie> psch's log is really beautifully clean
[23:02:30] <fuzzie> brada: obviously you also change the default UserDir path to include PACKAGE in a bunch of cases now
[23:02:40] <fuzzie> but I have no opinion on that, just observing
[23:03:02] <fuzzie> it all seems fine otherwise, it all seems like the kind of thing to commit first and be complained at later anyway
[23:03:32] <brada> eyah i thought so too
[23:03:51] <fuzzie> so i spent quite some time googling for any ideas about psch's problem and I have no clue at all still, sorry
[23:03:51] <-- brada has left IRC (Read error: Connection reset by peer)
[23:03:59] <fuzzie> but i agree it is very weird
[23:04:04] --> brada has joined #gemrb
[23:04:06] <brada> im so sick of the internet here...
[23:04:16] <brada> i have been kicked off about 100 times today
[23:04:31] <fuzzie> psch: but just to reiterate, i think you have done amazingly just getting this far
[23:04:37] <brada> yes thank you
[23:04:49] <fuzzie> i'll ask some more clued-in people about it tomorrow if necessary
[23:06:06] --> brada_ has joined #gemrb
[23:06:07] <-- brada has left IRC (Read error: Connection reset by peer)
[23:06:07] <fuzzie> or it might be worth just asking in the relevant google group or on the SDL list
[23:06:07] --- brada_ is now known as brada
[23:06:32] <brada> im not sure if this is related to sdl
[23:06:46] <brada> maybe their java layer
[23:06:47] <psch> i dont feel i have enough of a graps of what's exactly going on to formulate a question to anyone not involved tbh
[23:06:49] <fuzzie> yes, but someone might have a clue anyway
[23:06:58] <fuzzie> honestly it seems more likely to be an ndk thing
[23:07:09] <fuzzie> i don't see how anything sdl2 would do would break it
[23:07:11] <psch> i did upgrade to the latest ndk release inbetween
[23:07:13] <fuzzie> unless it somehow manages to strip permissions
[23:07:44] <psch> i have tried two ndks, not sure what the previous release was
[23:08:11] <psch> oh, no, nvm that, i upgrade the sdk inbetween
[23:08:18] <psch> im using ndk r8d
[23:08:46] <psch> also thanks for thanks, ive been having fun
[23:08:53] <fuzzie> which toolchain/APP_STL settins?
[23:09:12] <psch> im linking against gnustl_static
[23:09:31] <fuzzie> and default toolchain?
[23:09:53] <fuzzie> i mean i have no clue if this is relevant i just thouht i'd better ask before i sleep
[23:09:57] <fuzzie> in case it's relevant
[23:10:10] <fuzzie> and in case brada doesn't magically solve it while i'm sleeping
[23:10:22] <brada> i wouldnt count on that
[23:10:30] <psch> the default setup from sdl2 has stlport_static
[23:10:49] <psch> i can try building with that if it could do something
[23:10:59] <fuzzie> i can't imagine why it would
[23:11:31] <psch> most of the project settings are straight from the SDL2 tar
[23:11:41] <psch> ive added a few bits from pelya i think
[23:11:42] <brada> tar?
[23:11:49] <brada> did you not use the mercurial repo?
[23:12:06] <psch> no, i didnt for sdl
[23:12:19] <psch> the release was about 2 or 3 days old when i downloaded it
[23:12:29] <psch> so probably about 10 or so days now
[23:12:54] <brada> oh probably nothing much changed for android since then
[23:13:12] <brada> some clipboard stuff
[23:13:14] <fuzzie> everything on google is really just 'check your permissions' though
[23:13:42] <brada> is this relavant: http://hg.libsdl.org/SDL/rev/97187387ad79
[23:13:44] <Seniorita> SDL: changeset 6864:97187387ad79
[23:13:49] <psch> 10 days, i got SDL-2.0.0-6862.tar.gz
[23:13:59] <fuzzie> brada: i odn't think we get anywhere near that far
[23:14:26] <brada> that is audio stuff now that i look at it
[23:15:09] <brada> well it wouldnt hurt to get newer sdl
[23:15:16] <brada> they have some really terrible commit messages
[23:16:02] <psch> ill try that tomorrow
[23:16:19] <psch> the initial intense enthusiasm has worn off a bit, as you might understand
[23:16:29] <brada> heh
[23:16:54] <psch> as i said though, im having fun
[23:16:54] <-- brada has left IRC (Read error: Connection reset by peer)
[23:17:15] <psch> been some time since i really wanted to stay up a night to try to get something to compile and work
[23:17:32] --> brada has joined #gemrb
[23:18:48] <-- traveler has left IRC (Ping timeout: 245 seconds)
[23:19:37] --> brada_ has joined #gemrb
[23:19:38] <-- brada has left IRC (Read error: Connection reset by peer)
[23:19:38] --- brada_ is now known as brada
[23:22:37] --> brada_ has joined #gemrb
[23:22:38] <-- brada has left IRC (Read error: Connection reset by peer)
[23:22:38] --- brada_ is now known as brada
[23:35:52] --> brada_ has joined #gemrb
[23:35:52] <-- brada has left IRC (Read error: Connection reset by peer)
[23:35:53] --- brada_ is now known as brada
[23:36:05] <-- lynxlynxlynx has left IRC (Read error: Connection reset by peer)
[23:41:34] --> brada_ has joined #gemrb
[23:41:34] <-- brada has left IRC (Read error: Connection reset by peer)
[23:41:35] --- brada_ is now known as brada
[23:43:30] <-- brada has left IRC (Client Quit)