Closed darksylinc closed 7 months ago
Hi, double check you set useLegacyPackaging to true in your gradle config, this is required for it to pickup the hooks
Hi!
Thanks for the reply.
I just added useLegacyPackaging = true
and set minSdk = 19
just in case (given [this ominous warning](https://developer.android.com/reference/tools/gradle-api/8.3/com/android/build/api/variant/JniLibsApkPackaging#useLegacyPackagingFromBundle()) that it's forced to false if API level >= 23; though I'm using APK, not bundles); but I'm afraid the problem remains.
@darksylinc looked into this more, the arguments you pass to adrenotools_open_libvulkan are a bit off, and you aren't passing app libdir, see https://github.com/hrydgard/ppsspp/blob/768174e19ca80bccadc067bd2c7adc0d35fb4602/Common/GPU/Vulkan/VulkanLoader.cpp#L316, also the driver mustn't be on the sdcard and must be in the apps data directory.
YES!!!! YES YES YES!
THANK YOU!
I got it working!
First I had confused the /data/user/0/*
folder with the /storage/emulated/0/*
folder.
But more importantly, it is not clear at all that hookDir MUST point to whatever getApplicationInfo().nativeLibraryDir
(Java code) says.
Once I tidy up some lose ends I will submit a PR to improve documentation on all the traps I fell while implementing this.
Thank you again!
I'm playing with AdrenoTools but I can't get it to work on a Xiaomi POCO F2 Pro (Adreno 640) running stock ROM Android 12.
I know that it is supposed to work fine on my phone because PPSSPP manages to load the driver fine, reports a different driver string when using the alterante driver and even displays graphical glitches when using this other driver.
I can't figure out what kotlin settings, linker flags or whatever else I'm doing wrong compared to PPSSPP.
I prepared an extremely simple repro test here.
It's a very simple sample that uses GameActivity as backbone (perhaps that's the problem??? I'm also having the same issue using NativeActivity).
No matter what I do I get:
adrenotools_open_libvulkan
returns a valid ptr but thenvkEnumeratePhysicalDevices
returns VK_SUCCESS with numDevices = 0.The full log:
Debugging further, the first time the hook activates (when I call
vkCreateInstance
) it ends up insidehook_android_dlopen_ext
:It reaches the following:
But hookImpl is nullptr.
After that it gets called again (exact same callstack) and also ends up with hookImpl = nullptr, after that it gives up.
When this happens I noticed logcat prints:
This is a stark difference with PPSSPP which is successful and prints:
I suspect perhaps the Vulkan driver gets loaded too soon; since I AFAIK the injection must happen before loading Vulkan.
But I tried modifying
game-activity/native_app_glue/android_native_app_glue.c
(which comes with the SDK) so that the injection is the first thing I do in Thread-1:However the result is the same.
I would appreciate some guidance on what am I missing or what am I doing wrong.
Thanks!
Matias