AZO234 / NP2kai

Neko Project II kai
http://domisan.sakura.ne.jp/article/np2kai/np2kai.html
MIT License
246 stars 61 forks source link

Games Don't Boot From External Storage on Android (Libretro/RetroArch) #106

Closed ghost closed 3 years ago

ghost commented 4 years ago

Description

This issue is a copy of this one I made on the RetroArch respository, the >libretro fork respository doesn't allow for issues to be made so I thought I make one here as well so it gets some attention and >is hopefully resolved. Neko Project II kai doesn't boot games on Android, it works fine on Switch and PC, the screen remains black after loading RAM. I included my log just in case retroarch.log

Neko Project II kai doesn't boot games from external storage on Android.

Expected behavior

PC-98 .hdi game is expected to boot and be playable on np2kai core.

PC-98 games on external storage is expected to boot and be playable on np2kai core.

Actual behavior

Screen remains black after checking for 32k of RAM instead of loading the game.

Screen remains black after 640K + 3072K appears instead of loading the game.

Steps to reproduce the bug

  1. Load Neko Project II kai core
  2. Load content from directory, in this instance it's a .hdi
  3. Wait for RAM to be checked
  4. Black screen
  1. Load Neko Project II kai core
  2. Load content from directory in external storage, in this instance it's a .hdi
  3. Wait for RAM to be checked
  4. Black screen

    Bisect Results

Not sure about previous versions but this bug has been present in the 1.8.9 stable build of RetroArch for Android.

Version/Commit

You can find this information under Information/System Information

Environment information

AZO234 commented 4 years ago
[CORE]: Using content: /storage/16A3-E8F8/Games/PC-98/Brandish 2 Renewal (FD version) [En by Gu4n v1.0].hdi.

On Android, Game Files are need to locate in '/storage/emulated/0/RetroArch' by access rights reason. Please try move files.

Edit: I added writing this caution to README.

ghost commented 4 years ago

I'll try that but I haven't had this issue regarding other cores as I can load the game files from my external storage.

AZO234 commented 4 years ago

Oh, I'm sorry my reply was too short.😥

On Android, 'Access to files on external storage is possible or impossible' depend on case. It is by Android version, Work machine, Access rights, Core using libretro file APIs or not, etc. I recommend using internal storage and inner RetroArch directory. (NP2kai core use libretro file APIs.)

I want to hear some situation.

  1. Are BIOS files located in RetroArch/system/np2kai directory?
  2. Other game work on NP2kai? It's located on inner or external storage?
  3. Other core game can be worked on external storage? (You said yes this.) Could you tell me that core?

It's a bit difficult to solve surprisingly. Best regard!

Edit: Plus one plus one.

  1. Disable cheats and rewind, is there difference working?
  2. PC-98 memory check when start is work 640K + RAM size. What is 32K?
vavelpo commented 4 years ago

I'm using RetroArch64 from the Google Play Store on Andoroid 9.

When you install an app, the system creates a directory in the microSD card dedicated to the app. The file placed in "android/data/com.retroarch.aarch64/files" in the microSD card can be read with NP2kai.

I haven't tried this one, but with the 32/64-bit integrated APK and the 32-bit only APK, the following I think it's in a place. android/data\com.retroarch/files android/data/com.retroarch.ra32\files

(This text has been machine translated.)

ghost commented 4 years ago

Are BIOS files located in RetroArch/system/np2kai directory?

Yes.

Other game work on NP2kai? It's located on inner or external storage?

Inner, games on external storage don't work.

Other core game can be worked on external storage? (You said yes this.) Could you tell me that core?

I tested mGBA, Genesis Plus GX and snes9x. Games do work from external storage from those cores.

Disable cheats and rewind, is there difference working?

When the game can boot they work.

PC-98 memory check when start is work 640K + RAM size. What is 32K?

Sorry, mistype. was supposed to write 640K + 3072K.

AZO234 commented 4 years ago

To vavelpo Thanks to your information.👍

To bugreportinganon It maybe related that NP2kai (and other PC core like) needs 'write file access rights' for FD and HD image. Consumer core may use 'read only access' for ROM.

In any case I'll check file features. Thanks.

AZO234 commented 4 years ago

I tested Brandish2(FD version) HDI file on external storage. (without English patch) I could start it. My Android is 7. (Poor develop emvironment... 😅) How are you use without patch one?

ghost commented 4 years ago

I got a black screen on Android 10 when launched the game without the english patch from external storage. I'll attach my log as well. retroarch.log

AZO234 commented 4 years ago

I could get log. retroarch.log My RA is older? But almost same...?

ghost commented 4 years ago

I'm using the latest nightly but v1.8.9 has the same issue.

AZO234 commented 4 years ago

I add log output when NP2kai fail to open file. np2kai_libretro_android(AArch64).zip

This is NP2kai only, then you need to install by selectiong 'Core' -> 'Install' from filesystem. Could you try this? and get log. If failed to opne HDI file, wrote to log.

Regard.

ghost commented 4 years ago

Here's my log, maybe this is a retroarch issue. retroarch.log

AZO234 commented 4 years ago

It seems couldn't catch. Second attempt. np2kai_libretro_android(AArch64)_2.zip

ghost commented 4 years ago

Here's my log, I really don't know what keeps not working. retroarch.log

AZO234 commented 4 years ago

Sorry to wait. This is my third. np2kai_libretro_android(AArch64)_3.zip And this is my environment retroarch.log.

Please try this.

ghost commented 4 years ago

I tried it and the amount of ram increased a lot. I really don't know why it can't load from external storage, maybe it's not meant to. retroarch.log

AZO234 commented 4 years ago

I heard a rumor that external storage write permissions. https://stackoverflow.com/questions/44455887/permission-denied-on-writing-to-external-storage-despite-permission

RA's manifest doesn't set permission setting now by some reason maybe. Look Libretro Forum.

ghost commented 4 years ago

I know something changed in android, I think 9.0, permissions for external storage is seperate from internal storage, which is why retroarch can't save on external storage, maybe I'll make an issue there and see if it will get fixed.

Well I found an issue that's already opened for it and it doesn't seem like anything has changed since 2017 sadly.

AZO234 commented 4 years ago

Yeah, this is security issue. From API 29, applications cannot access to external storage directly. To access need Context class's method.

Using newer Android is implementing ugly functions. (waste?) But attacker maybe know and use out of our knowledge. It's immeasurable fear.

I want nice Android machine and extend home dock! "That dock's storage is needed encrypt", Android saying. What is 'correct' form to everyone? Provably Android and RA developer are thinking it now.

ghost commented 3 years ago

Yeah, I think I'll close the issue because this is a retroarch problem because of changes with Android, thanks for helping and sorry for bothering you. It's a shame, Android is a great platform for emulation but google changes too many things to make it worse.

AZO234 commented 3 years ago

I thank your cooperation! And I know working on newer Android. I'll make be better to this inconvenience.