Post new topic    
Page «  1, 2, 3, 4, 5  »
Liquid Metal King Slime
Send private message
 
 PostSun Dec 08, 2019 2:16 am
Send private message Reply with quote
Okay, as for the fails-to-resume after being backgrounded problem, I am also leaning towards this being a hardware problem with my phone.

This particular phone has trouble with audio, most of the time it doesn't work at all, and I have to hook up bluetooth headphones.

I captured the adb logcat output for a few seconds while backgrounding and then immediately returning to baconthulhu, triggering the black screen.

https://pastebin.com/raw/FPDsN6vG

As you can see, there are a ton of audio device errors in there. I think that resuming the music crashes because of the audio device problem, and so the video resume fails too.

So since this is a hardware problem, I say just forget about it. I can accept that my phone is broken.

The other bug, the one about libsdl-settings.cfg not being written and DeleteFilesOnUpgrade() not being called is still important of course
Metal King Slime
Send private message
 
 PostSun Dec 08, 2019 2:48 am
Send private message Reply with quote
I tried looking at the log and matching it up with the messages printed from inside Video.java, but I didn't really learn anything. The most that I can suggest is building some simple test game from the latest version commander-genius repo (preferable one that uses audio) and seeing whether it has the same problem or not. But that's just more work.

Would be nice to be able to catch up to the latest upstream version instead of having to cherry-pick stuff.
Liquid Metal King Slime
Send private message
 
 PostSun Dec 08, 2019 9:26 pm
Send private message Reply with quote
Aha! So I simply installed the Commander Keen port from the play store. It works fine on my good phone, but it freezes after the downloading screen on the trouble phone.

This afternoon, my 4 year old was playing with the trouble phone and somehow got the sound working (possibly by dropping it on the floor)

I quickly tested Baconthulhu, and it worked! I could background and resume with no problem. I also tried Commander Keen again, and this time it worked, also allowing backgrounding and resuming.

That settles it for that bug.

Haven't had time this weekend to look at the other one.

Did make a snowman today though, so it has been a productive day. :)
Metal King Slime
Send private message
 
 PostMon Dec 09, 2019 12:09 pm
Send private message Reply with quote
That is an intriguing method of fixing a phone/computer problem. I shall have to remember it the next time something doesn't behave!

I haven't seen snow in years (or do any work on the OHRRPGCE today), but I did plant tomatoes, so it was a good day too :)
Liquid Metal Slime
Send private message
 
 PostThu Dec 12, 2019 3:34 am
Send private message Reply with quote
I've been lurking this thread for a while. I have to say, observing this bug finding process is pretty interesting and dramatic. When James realized there might be a problem with hisphone, it was like learning a clue in a mystery of story. I was like, "Aha! Now what will happen?!"
Liquid Metal King Slime
Send private message
 
 PostSat Jan 18, 2020 8:06 pm
Send private message Reply with quote
TMC wrote:
...
A look at adb logcat shows why:
Code:
libSDL: Settings.Load(): loading settings failed, running config dialog

(I only knew to look for that after looking at Settings.java)

This causes DeleteFilesOnUpgrade() to be totally skipped because it can't check whether it needs to or not.
I see that the libsdl-settings.cfg file is actually totally missing, so it's Save() that's broken. It writes libsdl-settings.cfg to the current directory, which seems dubious to me. I expect there are some commits in upstream sdl-android to fix Save(), but that's enough for me tonight.


I was looking at this today, and I was wondering, why don't I remember anything about libsdl-settings.cfg?

We don't have that file, we have never had that file, not anywhere in the history of our apk port. it does not exist in the commandergenius tree, and it does not exist in the unpacked /sdcard/Android/data/whatever/files/ folder on the device.

This includes old apk files build long before we ever had any problems with failing to delete libsdl-DownloadFinished-0.flag

I am totally baffled. The one line of code in the commandergenius repository that references this "libsdl-settings.cfg" filename is not new, it is 10 years old. Maybe something happened more recently that changed it from being an optional file to a mandatory file?
Metal King Slime
Send private message
 
 PostSat Jan 18, 2020 10:40 pm
Send private message Reply with quote
I think you're looking in the wrong directory. And I'm pretty sure that file has always been used and required.

I just checked and see in the log:
Code:
I/SDL     (15162): libSDL: loading lib /data/data/com.hamsterrepublic.ohrrpgce.game/files/../lib/libsdl-1.2.so
...
I/SDL     (15162): libSDL: Settings.Load(): loaded settings successfully
I/SDL     (15162): libSDL: old cfg version 16, our version 16
...
I/libSDL  (15162): Changing curdir to "/storage/sdcard0/Android/data/com.hamsterrepublic.ohrrpgce.game/files"


/storage/sdcard0/Android/data/com.hamsterrepublic.ohrrpgce.game/files is where libsdl-DownloadFinished-0.flag is stored. I can't access /data/data/com.hamsterrepublic.ohrrpgce.game/files/ with adb shell, where libsdl-settings.cfg must be.
Liquid Metal King Slime
Send private message
 
 PostSat Jan 18, 2020 10:42 pm
Send private message Reply with quote
I was going to try to start working on this, when I discovered that even though distrib-nightly-android.sh works fine for both 32 bit and 64 bit builds, misc/makeapk.sh is failing on both with this sort of error:

https://pastebin.com/raw/sRMMNtTC

Most of it seems related to gif/png/jpeg support but I havent yet figured out why it is no problem fir the nightly build, but fails for makeapk.sh
Metal King Slime
Send private message
 
 PostSat Jan 18, 2020 10:49 pm
Send private message Reply with quote
I notice that the nightly-android.sh calls "./build.sh" while makeapk.sh calls "./build.sh release". However I just tried running "./build.sh release" (which I normally don't do), and it works fine for me (arm64 build). Your errors look the same as the errors you've posted previously (.c files in subdirectories aren't being compiled+linked). Could I see the full build log?
Liquid Metal King Slime
Send private message
 
 PostSat Jan 18, 2020 11:06 pm
Send private message Reply with quote
I double checked that the symlink from ~/src/ohrandroid/wandering-hamster/tmp correctly points to ~/src/ohr/wip/android/tmp so it *should* be trying to compile the same files

I gotta break this bad habit of partial build logs ;)

Here is the whole thing: http://hamsterrepublic.com/tmp/text/makeapk-2020-01-18-A.log

EDIT: oh, you know? Last time I did this I was using baconthulhu, not wandering-hamster. Maybe there is something I need to update in my wandering-hamster folder... investigating...

EDIT2: Yep! My dumb mistake! I failed to set up gamespecific.cfg or to replace Wander's copy of AndroidAppSettings.cfg to a symlink to the main copy of it. That explains why it was failing. I better fix those things for ALL these games, so I don't keep forgetting over and over ;)

EDIT3: Fixed for all game project folders. I added the following snippit to my script that verifies the symlinks
Code:

  AAS="${D}/AndroidAppSettings.cfg"
  if [ ! -L "${AAS}" ] ; then
    echo " ${AAS} exists but is not a symlink!"
    mv "${AAS}" "${AAS}.old"
    ln -s "${OHRR}/android/AndroidAppSettings.cfg" "${AAS}"
   
    GSPEC="${D}/gamespecific.cfg"
    if [ ! -f "${GSPEC}" ] ; then
      echo " ${GSPEC} does not exist yet, generating it"
      grep -e "^AppName=" "${AAS}.old" > "${GSPEC}"
      grep -e "^AppFullName=" "${AAS}.old" >> "${GSPEC}"
      grep -e "^AppDataDownloadUrl=" "${AAS}.old" >> "${GSPEC}"
      grep -e "^DeleteFilesOnUpgrade=" "${AAS}.old" >> "${GSPEC}"
      echo "# This is the user-visible version code, it is just a string" >> "${GSPEC}"
      grep -e "^AppVersionName=" "${AAS}.old" >> "${GSPEC}"
      echo "# The following is used by ohrrpgce's misc/makeapk.sh script to gengerate AppVersionCode" >> "${GSPEC}"
      grep -e "^AppVersionCode=" "${AAS}.old" | sed -e "s/AppVersionCode/BaseAppVersionCode/" >> "${GSPEC}"
      echo "# This should be zero unless you are building a single-arch patch fix" >> "${GSPEC}"
      echo "PatchVersionCode=0" >> "${GSPEC}"
      echo "# Include the generated version config" >> "${GSPEC}"
      echo ". src/versioninfo.cfg" >> "${GSPEC}"
    fi
  fi


Successfully rebuilt vocabmosaic after that.

Now that my build environment is all fixed, I am ready to... go to bed, actually ;P
Liquid Metal King Slime
Send private message
 
 PostSun Jan 19, 2020 7:53 pm
Send private message Reply with quote
So I just re-tested, and now libsdl-DownloadFinished-0.flag IS being correctly deleted on an upgrade now??

I am not sure what changed!

I was able to reproduce success twice.

Both times were on a 64 bit wandering hamster apk on an Android 8.0 phone.
Metal King Slime
Send private message
 
 PostSun Jan 19, 2020 10:51 pm
Send private message Reply with quote
Huh. I was also able to reproduce this previously so I tested again with ohrrpgce-custom.apk (32 bit), and bumping AppVersionCode worked for me too!

Code:
I/SDL     (19085): libSDL: Settings.Load(): loaded settings successfully
I/SDL     (19085): libSDL: old cfg version 20, our version 21
V/SDL     (19085): Deleting old file: /storage/sdcard0/Android/data/com.hamsterrepublic.ohrrpgce.custom/files/% exists false
V/SDL     (19085): Deleting old file: /data/data/com.hamsterrepublic.ohrrpgce.custom/files/% exists false
V/SDL     (19085): Deleting old file: /storage/sdcard0/app-data/com.hamsterrepublic.ohrrpgce.custom/% exists false
I/SDL     (19085): libSDL: old cfg version 20, our version 21 and we need to clean up config file


Usually I would want to try to figure out what was going on in order to expunge the root problem, but this Android stuff is a nightmare, so let's not.
Metal King Slime
Send private message
 
 PostMon Mar 16, 2020 1:00 am
Send private message Reply with quote
And.... we have a report that bumping AppVersionCode (for the Walthros demo) no longer works. Who knows what changed.

TMC wrote:
can reproduce that bumping AppVersionCode doesn't cause gamedata.zip to be re-extracted.

A look at adb logcat shows why:
Code:
libSDL: Settings.Load(): loading settings failed, running config dialog

(I only knew to look for that after looking at Settings.java)

This causes DeleteFilesOnUpgrade() to be totally skipped because it can't check whether it needs to or not.


I suggested the problem was in Settings.Save() not working, but that's because I was looking in the directory for libsdl-settings.cfg. I don't know whether the problem is reading or writing that file.

We could avoid this problem if we simply read all our data files directly from the .apk instead of unzipping it on first run, which is something I really want to do anyway to fix all the problems with games breaking because there's not enough storage space. (Although now that I've abandoned my old phone and discovered that on a reasonable phone the unzipping is reasonably fast instead of taking a minute, I care less).

I see an easy workaround is to call DeleteFilesOnUpgrade() if the config file can't be found. That'll delete the config settings, which doesn't matter because we disabled the config menu anyway. Hopefully after doing that once Settings.Save/Load will start working again and it won't have to delete everything again. Otherwise there will be an unpleasant load every time the game is run (and probably noone will bother to complain about it, so we'll never know)
Liquid Metal King Slime
Send private message
 
 PostMon Mar 16, 2020 1:04 am
Send private message Reply with quote
My concern is that I don't see evidence that the libsdl-settings.cfg config file ever exists, even when things are working fine, even in older apk files long before this bug appeared.

I don't think that file gets written period

(EDIT: based on what I remember from a few months ago, which can be fallable!)
Metal King Slime
Send private message
 
 PostTue Mar 17, 2020 3:32 am
Send private message Reply with quote
Did you check the private app files ("persistent storage"/getFilesDir()) directory for it, which AFAIK is unreadable unless you rooted you phone? That's not the same as the data directory where the .rpgdir is extracted to. Even when the app is installed on external storage, the files dir is apparently still on internal storage to keep it absolutely private. As I mentioned before I'm sure that the file exists, even though I can't access that directory, because I get messages in the log like "libSDL: old cfg version 20, our version 21" which prove that it was read.
Display posts from previous:
Page «  1, 2, 3, 4, 5  »