ppsspp icon indicating copy to clipboard operation
ppsspp copied to clipboard

Ppsspp on Retroarch Crash using Vulkan on Android Phone

Open yudhiyou opened this issue 2 years ago • 18 comments

Game or games this happens in

All Games

What area of the game / PPSSPP

It crash can't load any games at all on android, ios, macos.

What should happen

Can play the game.

Logs

No response

Platform

libretro / Retroarch

Mobile phone model or graphics card

Viva V9

PPSSPP version affected

74a471d

Last working version

No response

Graphics backend (3D API)

Vulkan

Checklist

  • [X] Test in the latest git build in case it's already fixed.
  • [X] Search for other reports of the same issue.
  • [ ] Try resetting settings or older versions and include if the issue is related.
  • [ ] Try without any cheats and without loading any save states.
  • [ ] Include logs or screenshots of issue.

yudhiyou avatar Aug 05 '23 23:08 yudhiyou

It seems to be related to the Vulkan video driver. Switching to the gl video driver on android and iOS resolves the issue.

trotsky40 avatar Aug 06 '23 21:08 trotsky40

It seems to be related to the Vulkan video driver. Switching to the gl video driver on android and iOS resolves the issue.

I see... How is performance compared with? Is gl better performance?

yudhiyou avatar Aug 07 '23 00:08 yudhiyou

Just tried playing using gl driver on retroarch android and yes it can be played. So it's confirmed this is vulkan driver issue.

yudhiyou avatar Aug 07 '23 23:08 yudhiyou

When did this start? can you try some older builds of the core?

hrydgard avatar Aug 08 '23 08:08 hrydgard

When did this start? can you try some older builds of the core?

Sorry... Looked like I can't try the older build because I will be always getting the latest build by updating from retroarch.

yudhiyou avatar Aug 08 '23 14:08 yudhiyou

On iOS it broke somewhere between these two commits:

https://github.com/hrydgard/ppsspp/commit/175def777495d77ac3bc0f4ac9868e43f93a1dc5 (Included in 8/2 nightly RetroArch build and vulkan works)

https://github.com/hrydgard/ppsspp/commit/74a471d7a512676c297635c7760dce1e04006021 (included in 8/3 nightly RetroArch build and vulkan crashes)

trotsky40 avatar Aug 08 '23 22:08 trotsky40

Just checked the current nightly with this commit (https://github.com/hrydgard/ppsspp/commit/bf2ec90f641b987f41d7c66c8a993f7c28e26f13) and it is working again. This can probably be closed.

trotsky40 avatar Aug 08 '23 22:08 trotsky40

Just checked the current nightly with this commit (bf2ec90) and it is working again. This can probably be closed.

No. I just updated and try playing using vulkan on my android phone it is still not working. At least now I have already moved on to gl driver because it has better performance than vulkan on my phone. Maybe someone can explain why is ppsspp gl has better performance than vulkan on android phone? Btw my android phone is vivo v9 with snapdragon 660.

yudhiyou avatar Aug 08 '23 22:08 yudhiyou

@yudhiyou that commit only affects macOS.

I'm surprised Vulkan isn't working though. Is it working in the standalone build for you?

hrydgard avatar Aug 08 '23 22:08 hrydgard

@yudhiyou that commit only affects macOS.

I'm surprised Vulkan isn't working though. Is it working in the standalone build for you?

Ok will try.

yudhiyou avatar Aug 08 '23 22:08 yudhiyou

@hrydgard just tried the latest standalone build app, it is working on vulkan. Is it different from the libretro build? Also why is using gl better performance than vulkan on my android phone?

yudhiyou avatar Aug 08 '23 23:08 yudhiyou

I think this is related to android version,3 phone i have tested which are android 9,10,11,only android 9 one crash.

lim2222 avatar Aug 09 '23 01:08 lim2222

I think this is related to android version,3 phone i have tested which are android 9,10,11,only android 9 one crash.

I see... Oh no, my phone is vivo v9 which is still android 9. :(

yudhiyou avatar Aug 09 '23 09:08 yudhiyou

Just tried again on vulkan on my android phone and it is still crash. So this issue because my phone is still android 9? Thankfully I still can play it on gl and it has great performance.

yudhiyou avatar Aug 17 '23 01:08 yudhiyou

The problem persists in Retroarch (1.15.0) on Android 12(LineageOS - GammaOS for Anbernic handheld RG405M). PPSSPP(v1.16.6-203-g1e6142d) crashes under Vulkan on emulation start.

RG405M-User avatar Oct 28 '23 06:10 RG405M-User

I have the same issue with Android 11 on a Retroid Pocket 3+. PPSSPP latest git via RetroArch crashes when the video is set to use Vulkan.

mbaran5 avatar Nov 10 '23 20:11 mbaran5

I'm having the same problems, with a Samsung Galaxy S20 FE... Right now I'm in stock Android 13.

ferrazpedro avatar Mar 19 '24 13:03 ferrazpedro

I confirm it is working using Vulkan with Adreno 512 on Android 10 with RA version 1.18.0

Log
      RetroArch  I  RetroArch 1.18.0 (Git 06fa5325f8)
                         I  === Build =======================================
                         I  Capabilities: ASIMD
                         I  [INFO] Version: 1.18.0
                         I  [INFO] Git: 06fa5325f8
                         I  [INFO] Built: Mar 26 2024
                         I  [INFO] =================================================
                         I  [Input]: Found input driver: "android".
                         I  [Core]: Loading dynamic libretro core from: "/data/user/0/com.retroarch/cores/ppsspp_libretro_android.so"
               Thread-3  W  type=1400 audit(0.0:2769): avc: granted { execute } for path="/data/data/com.retroarch/cores/ppsspp_libretro_android.so" dev="dm-2" ino=1403445 scontext=u:r:untrusted_app_27:s0:c219,c25
                            6,c512,c768 tcontext=u:object_r:app_data_file:s0:c219,c256,c512,c768 tclass=file
              RetroArch  I  [Overrides]: Redirecting save file to "/storage/emulated/0/RetroArch/saves/PPSSPP/flOw.srm".
                         I  [Overrides]: Redirecting save state to "/storage/emulated/0/RetroArch/states/PPSSPP/flOw.state".
                         I  [Environ]: GET_CORE_OPTIONS_VERSION.
                         I  [Environ]: GET_LANGUAGE: "0".
                         I  [Environ]: RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL.
                 PPSSPP  I  EARLY: ThreadManager::Init(compute threads: 8, all: 16)
              RetroArch  I  [Environ]: SET_INPUT_DESCRIPTORS:
                         I  [Environ]: GET_LOG_INTERFACE.
                         I  [IO] Missing filesystem for 'lang/.ini'
                         I  [G3D] Longest display side: -1 pixels. Choosing scale 1
                         I  [LOADER] Failed to read /controls.ini. Setting controller config to default.
                         I  [Environ]: GET_USERNAME: "".
                         I  [Environ]: SYSTEM_DIRECTORY: "/storage/emulated/0/RetroArch/system".
                         I  [Environ]: SAVE_DIRECTORY: "/storage/emulated/0/RetroArch/saves/PPSSPP".
                         I  [Content]: Content loading skipped. Implementation will load it on its own.
                         I  [Environ]: SET_PIXEL_FORMAT: XRGB8888.
                         I  [Environ]: GET_PREFERRED_HW_RENDER, video driver name: vulkan.
                         I  [Environ]: GET_PREFERRED_HW_RENDER - Context callback set to RETRO_HW_CONTEXT_VULKAN.
                         I  [Environ]: SET_HW_RENDER, context type: vulkan.
                         I  Requesting Vulkan context.
                         I  [Environ]: SET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE.
                         I  [Environ]: GET_LANGUAGE: "0".
                         I  [BOOT] PPSSPP ac5c16f
                         I  [SRAM]: Skipping SRAM load.
                         I  [Core]: Version of libretro API: 1, Compiled against API: 1
                         I  [Core]: Geometry: 480x272, Aspect: 1.765, FPS: 59.94, Sample rate: 44100.00 Hz.
                         I  [Audio]: Set audio input rate to: 44144.10 Hz.
                         I  [Video]: Set video size to: 1440x816.
                         I  [Video]: Using HW render, vulkan driver forced.
                         I  [Vulkan]: Vulkan dynamic library loaded.
               AdrenoVK  I  QUALCOMM build          : 9b15012, I23c1002cc1
                         I  Build Date              : 09/17/20
                         I  Shader Compiler Version : EV031.27.05.02
                         I  Local Branch            :
                         I  Remote Branch           : refs/tags/AU_LINUX_ANDROID_LA.UM.8.2.R1.10.00.00.556.048
                         I  Remote Branch           : NONE
                         I  Reconstruct Branch      : NOTHING
                         I  Build Config            : S L 8.0.12 AArch64
              RetroArch  I  [Vulkan]: Found vulkan context: "vk_android".
                         I  [Vulkan]: Detecting screen resolution: 0x0.
                         I  [Vulkan]: Setting swap interval: 1.
                         I  [Vulkan]: Created Android surface: 510722392128
                         I  [Vulkan]: Got HW context negotiation interface 1.
                         I  [Vulkan]: Found GPU at index 0: "Adreno (TM) 512".
                         I  [Vulkan]: Using GPU index 0.
                         I  [Vulkan]: Using semaphores for WSI acquire.
                         I  [Vulkan]: Using GPU: "Adreno (TM) 512".
                         I  [Vulkan]: Got 3 swapchain images.
                         I  [Android]: Native window size: 1080 x 2260.
                         I  [Vulkan]: Using resolution 1080x2260.
                         I  [Vulkan]: Using BGRA8888 format.
                         I  [Vulkan]: Loading stock shader.
                         I  [Joypad]: Found joypad driver: "android".
                         I  [Video]: Found display server: "android".
                         I  [OpenSL]: Requested audio latency: 128 ms.
                         I  [OpenSL]: Setting audio latency: Block size = 768, Blocks = 32, Total = 24576 ...
                         D  PlayerBase::PlayerBase()
                         D  TrackPlayerBase::TrackPlayerBase()
            libOpenSLES  I  Emulating old channel mask behavior (ignoring positional mask 0x3, using default mask 0x3 based on channel count of 2)
             AudioTrack  V  set(): streamType 3, sampleRate 48000, format 0x1, channelMask 0x3, frameCount 0, flags #104, notificationFrames -32, sessionId 209, transferType 0, uid -1, pid -1
                         V  set(): streamType 3 frameCount 0 flags 0104
                         W  set(): notificationFrames=-32 clamped to the range -1 to -8
                         I  createTrack_l(262176): AUDIO_OUTPUT_FLAG_FAST successful; frameCount 0 -> 1536
                         V  start(40): prior state:STATE_STOPPED
              RetroArch  I  [Audio]: Started synchronous audio driver.
             AudioTrack  V  processAudioBuffer(40): obtainBuffer(192) returned 1536 = 192 + 1344 err 0
                         V  processAudioBuffer(40): obtainBuffer(192) returned 1344 = 192 + 1152 err 0
                         V  processAudioBuffer(40): obtainBuffer(192) returned 1152 = 192 + 960 err 0
                         V  processAudioBuffer(40): obtainBuffer(192) returned 960 = 192 + 768 err 0
                         V  processAudioBuffer(40): obtainBuffer(192) returned 768 = 192 + 576 err 0
                         V  processAudioBuffer(40): obtainBuffer(192) returned 576 = 192 + 384 err 0
                         V  processAudioBuffer(40): obtainBuffer(192) returned 384 = 192 + 192 err 0
                         V  processAudioBuffer(40): obtainBuffer(192) returned 192 = 192 + 0 err 0
              RetroArch  I  [Display]: Found display driver: "vulkan".
             AudioTrack  V  processAudioBuffer(40): obtainBuffer(192) returned 192 = 192 + 0 err 0
                         V  processAudioBuffer(40): obtainBuffer(192) returned 192 = 192 + 0 err 0
                         V  processAudioBuffer(40): obtainBuffer(192) returned 192 = 128 + 64 err 0
                         V  processAudioBuffer(40): obtainBuffer(64) returned 64 = 64 + 0 err 0
                         V  processAudioBuffer(40): obtainBuffer(192) returned 192 = 192 + 0 err 0
                 chatty  I  uid=10219(com.retroarch) AudioTrack identical 8 lines
             AudioTrack  V  processAudioBuffer(40): obtainBuffer(192) returned 192 = 192 + 0 err 0
                         V  processAudioBuffer(40): obtainBuffer(192) returned 192 = 64 + 128 err 0
                         V  processAudioBuffer(40): obtainBuffer(128) returned 128 = 128 + 0 err 0
                         V  processAudioBuffer(40): obtainBuffer(192) returned 192 = 192 + 0 err 0
                 chatty  I  uid=10219(com.retroarch) AudioTrack identical 7 lines
             AudioTrack  V  processAudioBuffer(40): obtainBuffer(192) returned 192 = 192 + 0 err 0
              RetroArch  I  [Playlist]: Loading history file: "/storage/emulated/0/Android/data/com.retroarch/files/content_history.lpl".
                         I  [Playlist]: Loading history file: "/storage/emulated/0/Android/data/com.retroarch/files/content_music_history.lpl".
                         I  [Playlist]: Loading history file: "/storage/emulated/0/Android/data/com.retroarch/files/content_image_history.lpl".
                         I  [Playlist]: Loading favorites file: "/storage/emulated/0/Android/data/com.retroarch/files/content_favorites.lpl".
             AudioTrack  V  processAudioBuffer(40): obtainBuffer(192) returned 192 = 192 + 0 err 0
                         V  processAudioBuffer(40): obtainBuffer(192) returned 192 = 192 + 0 err 0
                         D  PlayerBase::stop() from IPlayer
             AudioTrack  V  stop(40): prior state:STATE_ACTIVE
                         D  stop(40): called with 6144 frames delivered
              RetroArch  I  [G3D] ShaderCache: Loaded 10 vertex, 9 fragment shaders and 0 geometry shaders (failed 0)
                         I  [G3D] Creating 27 pipelines from cache (1x MSAA)...
                         I  [G3D] Recreated Vulkan pipeline cache (27 pipelines, 0 failed).
                         I  [CPU] Error loading 'vfpu/vfpu_sin_lut8192.dat' (size=0, expected: 4100)
                         I  [CPU] Error loading 'vfpu/vfpu_sin_lut8192.dat' (size=0, expected: 4100)
                         I  [Android]: Native window size: 1080 x 2260.

@yudhiyou @ferrazpedro Can you provide some log maybe using pidcat with pidcat com.retroarch ? Also, please use F-Droid version as Play Store version is outdated.

Thank you.

gouchi avatar Jun 02 '24 18:06 gouchi

So, here is what I have discovered on my HPad 5. Vulkan runs graphics very smooth, and no audio stutter... HOWEVER, my screen is locked in portrait mode in the PPSSPP core and will not reorient itself based on tablet orientation. As I understand, an older version of Retroarch didn't have this problem, but I like the RetroArch Plus because it fits the 64bit tablet better than the standard for some reason. I am sure the devs can find where orientation can be fixed under the Vulkan API and have it orient based on tablet position. I don't want to set it manually because then it is a permanent oriented fix for all cores, which I don't want, plus, even though GL graphics are good, there is horrible audio stutter regardless of speed or framerate. The simplest fix would be to have the Vulkan API recognize tablet orientation. Hope this helps some.

Severem avatar Aug 02 '24 05:08 Severem

@Severem This is not the subject of this issue so please open another issue. It look likes your issue is more on RetroArch. Moreover, you should better use F-Droid version as Play Store version is outdated. Thank you.

gouchi avatar Aug 07 '24 11:08 gouchi

I tried this, and to no avail. When switched to Vulkan and attempt to go into PPSSPP, it does not follow the tablet's normal screen orientation (landscape) but attempts to load the game portrait and scrunched up, but this ONLY happens in PPSSPP, not in any other core.. so I feel it fits this issue. I have tried the F-Droid version as well as 3 others (normal RA, and RA x64) but all shows the same error on PPSSPP only. Like I said, all other cores work fine in Vulkan.

Severem avatar Aug 10 '24 03:08 Severem

Also, note. It did seem to work initially when I first started the new RA download from F-Droid... but as soon as I upgraded the PPSSPP module, it all went to hell. Another reason I believe it is in PPSSPP.

Severem avatar Aug 10 '24 03:08 Severem

@Severem Please continue your issue to this one which is more appropriate.

Also provide some information like screenshot and log if possible.

Thank you.

gouchi avatar Aug 10 '24 16:08 gouchi

I have to close this issue because it is working already now. Thank you very much.

yudhiyou avatar Aug 11 '24 23:08 yudhiyou