Skip to content

[Android] custom Adreno driver support #1471

Closed
@notimp

Description

@notimp

Platform / OS / Hardware:
Android

Hardware: Ayn Odin 2, Retroid Pocket 3+, or Retroid Pocket Flip

Description of the Issue

With the OpenGL driver per pixel autosort is not an option, so this graphical issue in shenmue is always present:
https://gitlab.com/inolen/redream/-/issues/484
With the Vulkan driver selected, using the built in video drivers for all android devices named (Ayn Odin 2 Retroid Pocket 3+, or Retroid Pocket Flip), and per pixel sorting enabled (and only in that case) games launch with sever graphical render issues all around. Even the Dreamcast bios swirl is missing on the bios screen.

The issue is present in Flycast standalone, as well as the retroarch core (in both).

Its probably because of the built in drivers on those devices, so one possible way to be able to fix it would probably be to implement custom Adreno driver selection (see: https://github.com/K11MCH1/AdrenoToolsDrivers/releases) like in yuzu, although I'm not sure this would fix the issue for most people.

If you could fix the issue while somehow still using OpenGL or glcore it probably would be an easier fix for most people.

Debugging Steps Tested

  • Set render resolution to 960p
  • Set video renderer to vulkan
  • Set Accuracy to per pixel.
  • Start Shenmue 1 and watch the intro

(Depending on the video renderer selected, graphical glitches should show up very early (Vulkan) or in the intro sequence at the latest (OpenGl with per triangle or per strip selected).

Screenshots

see: https://gitlab.com/inolen/redream/-/issues/484 (its the same old issue)

Activity

flyinghead

flyinghead commented on Mar 29, 2024

@flyinghead
Owner

Vulkan drivers and/or GPU drivers are faulty on these devices and there isn't much I can do. I already experimented with the Adreno driver loader with very little success, and it's only a solution for some Adreno devices.

MastaG

MastaG commented on Mar 29, 2024

@MastaG

Just out of curiosity, I once tried the pre-built turnip drivers from the repository @notimp also mentioned (https://github.com/K11MCH1/AdrenoToolsDrivers/releases) with yuzu on my older OnePlus phone.
And surprisingly they worked much better than qualcomm's default vulkan driver.
I was actually able to play Super Mario Wonder (very nice game).
I don't know how much work it would take to implement a custom driver loader for the Android gui, but perhaps it's worth a shot.

flyinghead

flyinghead commented on Apr 7, 2024

@flyinghead
Owner

I added support for custom GPU drivers loading using libadrenotools on the dev branch.

I tested on POCO F1 (SDM845, Adreno 630) running LineageOS 11.
The Mesa Turnip driver loads and runs without issue but the performance in per-pixel is much worse than the native Qualcomm driver.
Using Qualcomm drivers was more difficult since I had to patch them to use the libadrenotools qtshim shared libs. But in the end the driver loads fine (v615.77) and performance seems to be similar to the system Qualcomm driver (v502).

image

Let me know how it works for you and which driver(s) works the best.

notimp

notimp commented on Apr 10, 2024

@notimp
Author

Loves you. :) Tested with Turnip R17 (R18 on yuzu provided much less performance), and it works wonderfully on the Ayn Odin 2 without any graphical glitches. :)

I'm not able to patch the Qualcomm drivers myself - so if you could provide a patched version of v615.77 uploaded somewhere, I'm sure many people would appreciate it. :)

Yay - I'm playing Shenmue again. :)

(For people unsure how to access the feature, you have to first switch the renderer to Vulkan in settings, then acces the settings page shown above in the screenshot, then you can upload your custom driver there.

Then as a last step dont forget to set the video renderers accuracy to per pixel.)

Thank you so much. :)

notimp

flyinghead

flyinghead commented on Apr 10, 2024

@flyinghead
Owner

This is great news and thank you for the feedback!

Here is the patched Qualcomm driver v615.77 that I was able to use on my device:
adreno615.77.qtshim.adpkg.zip
Let me know if it works for you.

notimp

notimp commented on Apr 10, 2024

@notimp
Author

Downloaded thank you. :)

Played through the first day in Shenmue in my usual "perfect day one" fashion, even got space harrier with my one music tape buy, which never happens.. ;) If anyone is interested in a save at the end of day one, that has space harrier unlocked, here.. :)

Screenshots:
https://imgur.com/a/I2m1mVJ

Savegame:
https://mirrorace.org/m/5he8s

The playthrough on R17 (using the Ayn Odin 2) went well, there was only one issue, when the old man in the park teaches you his move, and there are fog effects on screen, there Shenmue slowed down to a crawl on R17. So thank you for the driver upload. :)

Also, just if you are interested - this is a way to screen mirror the Ayn Odin 2 to any Android device (TV box f.e.) wirelessly:
https://old.reddit.com/r/OdinHandheld/comments/18m0smx/tutorial_odin_2_how_to_set_up_wireless_video/

Shenmue is perfectly playable this way (thanks to Ryus "handles like a truck" controls, which dont care so much about input latency... :) ), altough the sound lags by about 200ms with the R17 driver at least... Which is to be expected though.. :)

If you feel like you have nothing to do one day, audio runahead by x milliseconds for sound processing would be great to solve this - but dont feel compelled if you dont end up using wireless screenmirroring on your own. Its really not worth the trouble, because not many people are using it anyhow.

And thank you for the work to implement the custom GPU driver selection once more. :)

notimp

notimp commented on Apr 10, 2024

@notimp
Author

Tried the driver you uploaded (adreno615.77.qtshim.adpkg.zip) on the Ayn Odin 2 and it glitches out. (doesnt let you select vulkan, once it takes over). Tried other arduino drivers and they all still have the "heavily glitched" behavior (dreamcast swirl missing) like before. (adreno615.77.qtshim.adpkg.zip in its glitched state on the Ayn Odin 2 also has the Dreamcast swirl missing on the boot screen.)

(All tested on the Ayn Odin 2)

But the Turnip R17 driver works a treat. :)

To get flycast out of its glitched driver state (vulkan not selectable in video settings), I just had to delete flycasts savedata. Just fyi for lurkers.

I'll now advertise thet Shenmue is working on flycast on reddit a little. Let other people know. :)

notimp

notimp commented on Apr 10, 2024

@notimp
Author

Good news, on R17 on the Ayn Odin 2 with Dreamcast DSP enabled in the Audio settings, the audio video streaming delay while mirroring the video output to an android TV box is much reduced. :) Probably because the CPU needs to clock higher. And the audio sounds better. :)

flyinghead

flyinghead commented on Apr 10, 2024

@flyinghead
Owner

I just tested the Turnip R17 on my device and it performs much better than R18, pretty close to the Qualcomm driver's perf.

changed the title [-][Android] Handle Shenmues per-pixel dependency in a way where modern Android Emulation handhelds dont show graphical glitching[/-] [+][Android] custom Adreno driver support[/+] on Apr 10, 2024
notimp

notimp commented on Apr 10, 2024

@notimp
Author

I just tested the Turnip R17 on my device and it performs much better than R18, pretty close to the Qualcomm driver's perf.

Thanks for the heads up. :)

Also a few pointers on my "perfect day one save", I forgot to get three things, so get them after you load into the save:

  • Milk from the fridge in the kitchen.
  • Photo from Ine-Sans room (see: https://shenmue.neoseeker.com/wiki/Ryo_and_Family_Photo)
  • Mystery scroll in the Dojo. (So visit the dojo, learn Pit blow in the cutscene on day 2 (if you sleep after loading the save, you are at day 2 :) ), enter the Dojo again, look at the scroll at the wall on the right at the top, Ryu will comment, that he cant reach it. Then look for the stool nearby and interact with it, Ryu will then get the Mystery scroll.)

After getting those three things you should have a perfect day 2 save. :) I also made sure to hit all the cutscenes on day one, buy all the moves, get the flashlight, the key, the candles, the matches, food for the cat, all the hidden moves in the Hazuki residence (minus the cellar which you dont have access to yet) and so on and so forth.

Havent prayed at the family shrine in the Hazuki Dojo either yet (cant remember if you need to do that for a passport cutscene ;) ).

notimp

notimp commented on Apr 10, 2024

@notimp
Author

Insane luck continued. :) Also just won the stereo for Ryus room (Raffle price Nr. 1) while looking to enter the tatoo parler (opens at 3 pm). (Very, very early on in the game. :) )

I've uploaded the savegame again: https://mirrorace.org/m/3fm05

Cat is named Mimi not Chibi, because I missed the naming dialog with Megumi (noooooooo ;) ). So she named the cat herself. I fed the cat every day though. ;)

nexus382

nexus382 commented on Apr 12, 2024

@nexus382

Tested using my retroid pocket pro 4.
The last stable version or so the Vulcan drivers on my device would render an image but I constantly was getting graphical glitches in the top left corner of the screen. I am not sure what changed, but for awhile, I couldn't even get vulcan per pixel to render the image on screen, let alone play a game.... Backgrounds only would kinda load in .. it was horrid. Then something changed (on device or flycast I am not sure)... But Vulcan PP became useable .. if you could deal with some issues . It looked almost like white noise on top of the picture every couple seconds/minutes for a frame or so. So far from correct..I used this dl, adreno615.77.qtshim.adpkg.zip, and installed on device. My first go to test for this on my device to see if it even was working, was Sonic adventure 1 and Sonic's eyes. Unless you're using per pixel the white in his eyes clip. I can verify the eyes clipping and then when using Vulcan with per pixel it's gone and usually I would be getting that weird snow for a frame every couple minutes in the top left corner of my screen and I did not see that one time today. So with the good results I've gotten I am about to do your bug test method are shown above... I just figured these results should be shared in the meantime.

flyinghead

flyinghead commented on May 27, 2024

@flyinghead
Owner

now available on master as well

dantesquivel

dantesquivel commented on Dec 5, 2024

@dantesquivel

Tested using my retroid pocket pro 4. The last stable version or so the Vulcan drivers on my device would render an image but I constantly was getting graphical glitches in the top left corner of the screen. I am not sure what changed, but for awhile, I couldn't even get vulcan per pixel to render the image on screen, let alone play a game.... Backgrounds only would kinda load in .. it was horrid. Then something changed (on device or flycast I am not sure)... But Vulcan PP became useable .. if you could deal with some issues . It looked almost like white noise on top of the picture every couple seconds/minutes for a frame or so. So far from correct..I used this dl, adreno615.77.qtshim.adpkg.zip, and installed on device. My first go to test for this on my device to see if it even was working, was Sonic adventure 1 and Sonic's eyes. Unless you're using per pixel the white in his eyes clip. I can verify the eyes clipping and then when using Vulcan with per pixel it's gone and usually I would be getting that weird snow for a frame every couple minutes in the top left corner of my screen and I did not see that one time today. So with the good results I've gotten I am about to do your bug test method are shown above... I just figured these results should be shared in the meantime.

Hi there - Did you ever get this sorted? I'm trying to move to Flycast from Redream because Redream does not have rumble support. But I'm getting the exact same artifacting whenever I use per pixel on vulkan. I'm using a RP3+ and can't find any updated drivers for the Mali G52 on the RP3+.

flyinghead

flyinghead commented on Dec 5, 2024

@flyinghead
Owner

Somewhat related: #1765

dantesquivel

dantesquivel commented on Dec 5, 2024

@dantesquivel

Somewhat related: #1765

Thanks for your response. I can't seem to get any custom drivers working on my Retroid Pockt 3+ when I select a new driver zip file, like the Turnip ones, my device just defaults away from Vulkan back to OpenGL and I can't select Vulkan. In a prior thread someone said that to "fix" this they deleted the Flycast savedata, but what does that mean? the VMUs? I've tried deleting the cache or other files in the Flycast folder structure but nothing helps. I'm assuming when I upload a custom driver for Vulkan that's what should show in the driver portion of the about?

Wait, the issue is RP3+ uses Mali drivers, not Adreno... darn

flyinghead

flyinghead commented on Dec 5, 2024

@flyinghead
Owner

Yes, this only works for Adreno GPUs unfortunately.

dantesquivel

dantesquivel commented on Dec 5, 2024

@dantesquivel

Yes, this only works for Adreno GPUs unfortunately.

Darn. All I want is rumble. No shade on Flycast, it's fantastic. But Redream can run 2x Native without the visual artifacting. IT JUST DOESN'T HAVE RUMBLE. I really, really, really want to switch to Flycast but outside of this rumble feature the experience is far better on redream specifically for my device.

Thank you for being so responsive, I hope something happens in the future where I can switch to Flycast. It's a great emulator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgraphicsRendering issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

      Participants

      @MastaG@flyinghead@dantesquivel@notimp@nexus382

      Issue actions

        [Android] custom Adreno driver support · Issue #1471 · flyinghead/flycast