hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.03k stars 2.15k forks source link

porting to arm-linux RUN ERROR: EGL Error EGL_BAD_NATIVE_WINDOW detected #19398

Open sunqianGitHub opened 1 month ago

sunqianGitHub commented 1 month ago

Game or games this happens in

N/A

What area of the game

N/A

What happens

ERROR: EGL Error EGL_BAD_NATIVE_WINDOW detected in file /home/sunqian/ppsspp/SDL/SDLGLGraphicsContext.cpp at line 276 (0x300B) EGL ERROR: Unable to create EGL surface! EGL_Init() failed

_Parsing /proc/self/auxv to extract ELF hwcaps! VulkanMayBeAvailable: Device allowed ('SDL:Linux') Vulkan loader: Library not available: DEBUG: Vulkan is not available, not using Vulkan. Info: We compiled against SDL version 2.31.0 and we are linking against SDL version 2.31.0. :) ThreadManager::Init(compute threads: 4, all: 8) Registered VFS for prefix : /usr/local/share/ppsspp/assets Registered VFS for prefix : /home/PSP/assets Registered VFS for prefix : /home/PSP Registered VFS for prefix : /usr/local/share/ppsspp/assets Registered VFS for prefix : /usr/local/share/games/ppsspp/assets Registered VFS for prefix : /usr/share/ppsspp/assets Registered VFS for prefix : /usr/share/games/ppsspp/assets Registered VFS for prefix : assets Registered VFS for prefix : /home/root INFO: sysInfo.subsystem 6 INFO: SDL_SYSWM_WAYLAND ERROR: EGL Error EGL_BAD_NATIVE_WINDOW detected in file /home/sunqian/ppsspp/SDL/SDLGLGraphicsContext.cpp at line 276 (0x300B) EGL ERROR: Unable to create EGL surface! EGLInit() failed loading control pad mappings from gamecontrollerdb.txt: SUCCESS!

and

` 44:53:120 Core/Config.cpp:373 I[G3D]: Longest display side: 800 pixels. Choosing scale 1 44:53:121 Core/Config.cpp:1282 I[LOADER]: Loading controller config: ./config/ppsspp/PSP/SYSTEM/controls.ini 44:53:121 Core/Config.cpp:1298 I[LOADER]: Config loaded: './config/ppsspp/PSP/SYSTEM/ppsspp.ini' (3.3 ms) 44:53:121 Core/Config.cpp:1600 I[LOADER]: No recents list found. 44:53:128 Core/System.cpp:721 I[IO]: Creating './config/ppsspp/PSP' and subdirs: 44:53:128 File/FileUtil.cpp:541 D[COMMON]: CreateDir('./config/ppsspp/PSP') 44:53:128 File/FileUtil.cpp:565 W[COMMON]: CreateDir: mkdir failed on ./config/ppsspp/PSP: already exists 44:53:128 File/FileUtil.cpp:577 D[COMMON]: CreateFullPath: path exists ./config/ppsspp/PSP/Cheats 44:53:128 File/FileUtil.cpp:577 D[COMMON]: CreateFullPath: path exists ./config/ppsspp/PSP/SAVEDATA 44:53:128 File/FileUtil.cpp:577 D[COMMON]: CreateFullPath: path exists ./config/ppsspp/PSP/PPSSPP_STATE 44:53:128 File/FileUtil.cpp:577 D[COMMON]: CreateFullPath: path exists ./config/ppsspp/PSP/GAME 44:53:128 File/FileUtil.cpp:577 D[COMMON]: CreateFullPath: path exists ./config/ppsspp/PSP/SYSTEM 44:53:128 File/FileUtil.cpp:577 D[COMMON]: CreateFullPath: path exists ./config/ppsspp/PSP/TEXTURES 44:53:128 File/FileUtil.cpp:577 D[COMMON]: CreateFullPath: path exists ./config/ppsspp/PSP/PLUGINS 44:53:128 File/FileUtil.cpp:577 D[COMMON]: CreateFullPath: path exists ./config/ppsspp/PSP/SYSTEM/CACHE 44:53:130 UI/NativeApp.cpp:752 D[SYSTEM]: ScreenManager! 44:53:130 UI/NativeApp.cpp:287 N[LOADER]: Not checking for failed graphics backends in debug mode 44:53:130 Core/RetroAchievements.cpp:320 I[ACHIEVEMENTS]: RetroAchievements: Using host: http://retroachievements.org 44:53:130 Core/RetroAchievements.cpp:320 I[ACHIEVEMENTS]: RetroAchievements: Encore mode disabled 44:53:130 Core/RetroAchievements.cpp:320 I[ACHIEVEMENTS]: RetroAchievements: Unofficial disabled 44:53:185 OpenGL/GLFeatures.cpp:203 I[G3D]: GPU Vendor : Imagination Technologies ; renderer: PowerVR B-Series BXE-2-32 version str: OpenGL ES 3.2 build 23.1@6404501 ; GLSL version str: OpenGL ES GLSL ES 3.20 build 23.1@6404501 44:53:185 OpenGL/GLFeatures.cpp:315 I[G3D]: OpenGL ES 3.1 support detected!

44:53:185 OpenGL/GLFeatures.cpp:108 D[G3D]: Checking for GL driver bugs... vendor=5 model='PowerVR B-Series BXE-2-32' 44:53:185 OpenGL/GLFeatures.cpp:122 W[G3D]: GL DRIVER BUG: PVR with bad precision 44:53:186 SDL/SDLMain.cpp:159 I[AUDIO]: SDL: Trying a different audio device CRITICAL: You are using the SDL disk i/o audio driver! CRITICAL: Writing to file [sdlaudio.raw]. 44:53:212 OpenGL/GLRenderManager.cpp:62 I[G3D]: Updating inflight frames to 3 44:53:212 UI/NativeApp.cpp:803 I[SYSTEM]: NativeInitGraphics 44:53:215 UI/NativeApp.cpp:864 I[SYSTEM]: NativeInitGraphics completed 44:53:216 UI/DiscordIntegration.cpp:60 I[SYSTEM]: Discord connection initialized 44:53:216 UI/Screen.cpp:22 D[SYSTEM]: Screen Logo got FOCUS_BECAME_TOP 44:53:360 SDL/SDLGLGraphicsContext.cpp:450 I[G3D]: SDL SwapInterval: 0 44:53:444 Core/Config.cpp:1600 I[LOADER]: No recents list found. 44:53:448 Core/Config.cpp:1385 I[LOADER]: Config saved (clearFailedGPUBackends): './config/ppsspp/PSP/SYSTEM/ppsspp.ini' (3.9 ms) 44:53:450 Core/Config.cpp:1398 I[LOADER]: Controller config saved: ./config/ppsspp/PSP/SYSTEM/controls.ini 44:55:781 UI/Screen.cpp:22 D[SYSTEM]: Screen Logo got FOCUS_LOST_TOP 44:55:781 UI/Screen.cpp:22 D[SYSTEM]: Screen Main got FOCUS_BECAME_TOP `

It looks like the program is stuck. I can't see anything

my system is arm64 platform with wayland:

WESTON_DISABLE_GBM_MODIFIERS=true BACKEND=drm-backend.so WESTON_TTY=2

weston --backend=drm-backend.so --tty=2

and a weston destop:

configuration file for Weston

[core] require-input=false idle-time=0

[output] name=DPI-2 mode=800x1280@60.0 transform=rotate-90

[screen-share] command=/usr/bin/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize

i run the PPSSPPSDL on the weston destop terminal

What should happen

PPSSPPSDL's launcher

GE frame capture

No response

Platform

Linux / BSD

Mobile device model or graphics card (GPU)

Imagination Technologies PowerVR B-Series BXE-2-32

PPSSPP version affected

v1.17.1-966-g1c5512a75d

Last working version

No response

Graphics backend (3D API)

OpenGL / GLES

Checklist

anr2me commented 1 month ago

Does other vulkan apps works? like vkcube/vkcube-wayland or vulkaninfo for example.

Btw, PowerVR B-Series BXE-2-32 is the GPU, right? But what is the actual device? (as most devices that use PowerVP B-Series i can google seems to use riscv64 instead of arm, like MILK-V Jupiter or VisionFive 2 for example) Also which linux distro is being used?

sunqianGitHub commented 1 month ago

Does other vulkan apps works? like vkcube/vkcube-wayland or vulkaninfo for example.

Btw, PowerVR B-Series BXE-2-32 is the GPU, right? But what is the actual device? (as most devices that use PowerVP B-Series i can google seems to use riscv64 instead of arm, like MILK-V Jupiter or VisionFive 2 for example) Also which linux distro is being used?

PowerVR is GPU, actual device is my arm64 cotex-A55*4core develop board.

not any linux distro, just a linux build from yocto

sunqianGitHub commented 1 month ago

in file SDL/SDLGLGraphicsContext.cpp
case SDL_SYSWM_WAYLAND: g_Display = (EGLNativeDisplayType)sysInfo.info.wl.display; g_Window = (EGLNativeWindowType)sysInfo.info.wl.shell_surface; printf("INFO: SDL_SYSWM_WAYLAND g_Window %p\n", g_Window); printf("INFO: SDL_SYSWM_WAYLAND g_Display %p\n", g_Display);

INFO: SDL_SYSWM_WAYLAND g_Window (nil) INFO: SDL_SYSWM_WAYLAND g_Display 0x55b37b38c0

looks like g_Window is not valid?

anr2me commented 1 month ago

May be try changing sysInfo.info.wl.shell_surface to sysInfo.info.wl.surface ?

sunqianGitHub commented 1 month ago

May be try changing sysInfo.info.wl.shell_surface to sysInfo.info.wl.surface ?

Great minds think alike. I thought of that, too, and have tried: INFO: wl display 0x559152a8c0 INFO: wl surface 0x559165f3c0 INFO: wl shell_surface (nil) INFO: wl egl_window 0x5591631ee0 INFO: wl xdg_surface 0x5591647ce0 INFO: wl xdg_toplevel 0x5591647d40 INFO: wl xdg_popup (nil) INFO: wl xdg_positioner (nil) INFO eglGetDisplay g_eglDisplay 0x559156f7a0 use g_Display 0x559152a8c0 INFO eglInitialize SUCCESS eglCreateWindowSurface use g_eglDisplay 0x559156f7a0,g_Window 0x559165f3c0 ERROR: EGL Error EGL_BAD_ALLOC detected in file /home/sunqian/ppsspp/SDL/SDLGLGraphicsContext.cpp at line 302 (0x3003) EGL ERROR: Unable to create EGL surface! EGL_Init() failed

anr2me commented 1 month ago

May be the framebuffer/surface format not supported on your device? (like the bits per pixel for example)

sunqianGitHub commented 1 month ago

could you please help to see this changes in SDL: https://github.com/libsdl-org/SDL/commit/6a342954e8d00d461e55607a3d196e7d6f334298 https://github.com/libsdl-org/SDL/commit/6aae5b44f825ff925268281d202852718849d146

looks like the SDL/SDLGLGraphicsContext.cpp for wayland is too old

anr2me commented 1 month ago

Sorry, i'm not familiar with SDL. and wayland (or linux in general). Earlier, just found an example of case SDL_SYSWM_WAYLAND that use info.wl.surface instead of info.wl.shell_surface.