Closed SoumyBhow closed 2 years ago
Hm it seems PPSSPP not longer supports opening files directly by file paths? I wonder what other methods they support for telling the location of a particular game.
I think it's due to Storage Access Framework. There's also this suggestion from the Mupen64PlusFZ for DIG about the same thing: https://digdroid.com/forums/discussion/comment/2340#Comment_2340
I'm thinking would it be possible for Pegasus to use SAF to load the metadata.txt files?
Thanks for the update. But now I'm having trouble setting this up. I tried changing {file.path} for {file.uri} in my PPSSPP metadata file but it still gives an error (unknown file type). Is there something I'm missing?
Oh, you're fast! Yes, {file.uri}
should be used on Android, which should return a valid content URI, created by the OS.
Unfortunately, the URI support in PPSSPP seems to be pretty basic at the moment: it only supports one particular file provider source (com.android.externalstorage.documents
) and only it it matches one particular format (see https://github.com/hrydgard/ppsspp/blob/ff887b0f11920f569b664415849613e09328d8d5/android/jni/AndroidContentURI.h#L10). I believe this is a limitation in PPSSPP, rather than Pegasus, but if it turns out to be a common issue with apps, I think it can be fine tuned.
You know Arc browser developer solved this problem. Now PPSSPP, mupen64, dolphin and redream working on it for Android 11 . I think Yaba sanshro will be supported soon.
I've tried PPSSPP, AetherSX2 and Mupen64PlusFZ. None of them work. Though Mupen64PlusFZ did launch a single game at first before it stopped working so I have no idea what's up with that. And AetherSX2 only boots to the BIOS. At this point I think it's best to use the regular documents provider for this...
Well I was experimenting a bit more with content URIs, but Android doesn't let me send path opening requests disguised as com.android.externalstorage.documents
(I'm running into security issues). It seems this provider is only allowed when you manually select a file in a file picker, apparently can't be automated ("Applications cannot use a documents provider directly; [...] which requires a user to actively navigate and select documents", according to the Android docs)
Why not asking Arc browser or mupen64 developer for help. I think they will help pegasus developer to solve this problem.
Ok, I think I have a working prototype now, but will take a few days to make it pretty.
Great work
Okay so I've been testing out some things and so far almost everything works after the latest update of Pegasus. Merely PPSSPP and Mupen64PlusFZ don't work yet. I've tried out Arc Browser just to compare how it works and I believe it has the proper approach. It uses a seperate app as a SAF proxy which is used to give permission to directories via the documents provider thing. In Arc, PPSSPP and Mupen64PlusFZ do work. I understand that this may ruin the user experience but I sincerely believe this is the proper method to solve this issue once and for all. The spoofing document URIs doesn't work completely. Perhaps when the user selects the metadata.txt files then the SAF explorer can be used?
I'm thinking about adding a menu option for managing accessible directories; using SAF only for the metadata wouldn't be enough, because they can refer to files in different directories that their own. And, as far as I see, I cannot ask access for multiple directories at once, it has to be selected by the Android explorer thing one by one.
A menu like that might just work. As long as Pegasus somehow has access to the same sub directories I think it should work. And I don't think the one by one thing is going to be a major issue. After all the metadata files are also selected one by one (unless I missed something lol). Still I appreciate you still looking over this issue. Many thanks!
Yep this new update fixes everything. Mupen, PPSSPP and Aethersx2 all work now. Thank you so much! Closing this issue.
@SoumyBhow , I still get this error in PPSSPP with Alpha16. Can you post your PPSSPP config? Fwiw I have mupen working. Still working on PPSSPP and redream
@SoumyBhow , I still get this error in PPSSPP with Alpha16. Can you post your PPSSPP config? Fwiw I have mupen working. Still working on PPSSPP and redream
The Alphas don't work for me either. I'm using the stable version from March 28
Hi, and thanks for reporting errors! You can help us locating the bug even more by providing detailed information in the sections below:
The issue
When launching a ROM from Pegasus to PPSSPP or Mupen64PlusFZ on Android, the emulators can't find the ROM. I'm assuming that this is due to SAF restrictions. Perhaps if Pegasus can select the metadata.txt files with the SAF file picker then this could be fixed?
System info
OnePlus 7 Pro Android 11
Pegasus version
version alpha15-85-gfff1a5b2
Pegasus log
lastrun.log