libretro / mupen64plus-libretro-nx

Improved mupen64plus libretro core reimplementation
GNU General Public License v2.0
231 stars 115 forks source link

Weird slowdown on a single stage of Xena 64 #369

Closed i30817 closed 3 years ago

i30817 commented 3 years ago

The stage with the comic relief character of the show, 'Joxer' i think it is.

Unlike every other stage, this stage will start slow and only once or twice per battle speed up and then slow down back right away. After the stage finishes, speeds goes back to normal.

There is some kind of graphical operation is is very pathological there. I was trying it with vulkan in RA, which means the core fell back to glcore.

I force RA to start with vulkan with a bash alias and a env variable:

alias retroarch_x11="VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json /home/i3/Documents/Projects/RetroArch/retroarch_x11"

I had already experienced this before but i'm reporting it now because before i was using a portable computer from 2008. Now i'm using a portable from 2018 with 4 cpus and 8 cores.

i30817 commented 3 years ago

These are the contents of the core options found inside the dir retroarch/ configs /mupen64Plus-Next:

mupen64plus-169screensize = "960x540"
mupen64plus-43screensize = "640x480"
mupen64plus-alt-map = "False"
mupen64plus-angrylion-multithread = "all threads"
mupen64plus-angrylion-overscan = "disabled"
mupen64plus-angrylion-sync = "Low"
mupen64plus-angrylion-vioverlay = "Filtered"
mupen64plus-aspect = "4:3"
mupen64plus-astick-deadzone = "15"
mupen64plus-astick-sensitivity = "100"
mupen64plus-BackgroundMode = "OnePiece"
mupen64plus-BilinearMode = "standard"
mupen64plus-CorrectTexrectCoords = "Off"
mupen64plus-CountPerOp = "0"
mupen64plus-cpucore = "dynamic_recompiler"
mupen64plus-d-cbutton = "C3"
mupen64plus-DitheringPattern = "False"
mupen64plus-DitheringQuantization = "False"
mupen64plus-EnableCopyAuxToRDRAM = "False"
mupen64plus-EnableCopyColorToRDRAM = "Async"
mupen64plus-EnableCopyDepthToRDRAM = "Software"
mupen64plus-EnableEnhancedHighResStorage = "False"
mupen64plus-EnableEnhancedTextureStorage = "False"
mupen64plus-EnableFBEmulation = "True"
mupen64plus-EnableFragmentDepthWrite = "True"
mupen64plus-EnableHiResAltCRC = "False"
mupen64plus-EnableHWLighting = "False"
mupen64plus-EnableLegacyBlending = "False"
mupen64plus-EnableLODEmulation = "True"
mupen64plus-EnableN64DepthCompare = "False"
mupen64plus-EnableNativeResFactor = "0"
mupen64plus-EnableNativeResTexrects = "Disabled"
mupen64plus-EnableOverscan = "Enabled"
mupen64plus-EnableShadersStorage = "True"
mupen64plus-EnableTexCoordBounds = "False"
mupen64plus-EnableTextureCache = "True"
mupen64plus-ForceDisableExtraMem = "False"
mupen64plus-FrameDuping = "False"
mupen64plus-Framerate = "Original"
mupen64plus-FXAA = "0"
mupen64plus-GLideN64IniBehaviour = "late"
mupen64plus-HybridFilter = "True"
mupen64plus-IgnoreTLBExceptions = "False"
mupen64plus-l-cbutton = "C2"
mupen64plus-MaxTxCacheSize = "8000"
mupen64plus-MultiSampling = "0"
mupen64plus-OverscanBottom = "0"
mupen64plus-OverscanLeft = "0"
mupen64plus-OverscanRight = "0"
mupen64plus-OverscanTop = "0"
mupen64plus-pak1 = "memory"
mupen64plus-pak2 = "none"
mupen64plus-pak3 = "none"
mupen64plus-pak4 = "none"
mupen64plus-parallel-rdp-deinterlace-method = "Bob"
mupen64plus-parallel-rdp-dither-filter = "True"
mupen64plus-parallel-rdp-divot-filter = "True"
mupen64plus-parallel-rdp-downscaling = "disable"
mupen64plus-parallel-rdp-gamma-dither = "True"
mupen64plus-parallel-rdp-native-tex-rect = "True"
mupen64plus-parallel-rdp-native-texture-lod = "False"
mupen64plus-parallel-rdp-overscan = "0"
mupen64plus-parallel-rdp-super-sampled-read-back = "False"
mupen64plus-parallel-rdp-super-sampled-read-back-dither = "True"
mupen64plus-parallel-rdp-synchronous = "True"
mupen64plus-parallel-rdp-upscaling = "1x"
mupen64plus-parallel-rdp-vi-aa = "True"
mupen64plus-parallel-rdp-vi-bilinear = "True"
mupen64plus-r-cbutton = "C1"
mupen64plus-rdp-plugin = "gliden64"
mupen64plus-RDRAMImageDitheringMode = "False"
mupen64plus-rsp-plugin = "hle"
mupen64plus-ThreadedRenderer = "False"
mupen64plus-txCacheCompression = "True"
mupen64plus-txEnhancementMode = "None"
mupen64plus-txFilterIgnoreBG = "True"
mupen64plus-txFilterMode = "None"
mupen64plus-txHiresEnable = "False"
mupen64plus-txHiresFullAlphaChannel = "False"
mupen64plus-u-cbutton = "C4"
mupen64plus-virefresh = "Auto"
m4xw commented 3 years ago

maybe you should enable parallel rdp when using vulkan? fallback isn't really supported. you should make sure to always match your driver settings (in ra) and the core. This causes some weird perf degredation, no clue if thats relevant here tho.

i30817 commented 3 years ago

edit: tried parellel rpd now, didn't matter.

The weirdness is that i have vulkan selected on RA. The core switches by itself when loading.

If i turn off the ability to change the video driver (in settings->core) it just won't load. It doesn't say anything special in the log¹

Regardless i doubt this is that relevant to what is happening since it only happens in a single stage, which is why i thought it would be worth reporting. Maybe the fact i'm forcing the vulkan idl in the driver is causing it though, though i also kind of doubt it.

¹

[INFO] RetroArch 1.9.8 (Git 2329a36f54)
[INFO] === Build =======================================
[INFO] CPU Model Name: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
[INFO] Capabilities:  MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4 SSE4.2 AES AVX
[INFO] Built: Aug 24 2021
[INFO] Version: 1.9.8
[INFO] Git: 2329a36f54
[INFO] =================================================
[INFO] [Input]: Found input driver: "x".
[INFO] [Core]: Loading dynamic libretro core from: "/home/i3/.config/retroarch/cores/mupen64plus_next_libretro.so"
[INFO] [Overrides]: No core-specific overrides found at "/home/i3/.config/retroarch/config/Mupen64Plus-Next/Mupen64Plus-Next.cfg".
[INFO] [Overrides]: No content-dir-specific overrides found at "/home/i3/.config/retroarch/config/Mupen64Plus-Next/Xena - Warrior Princess - The Talisman of Fate (USA).cfg".
[INFO] [Overrides]: No game-specific overrides found at "/home/i3/.config/retroarch/config/Mupen64Plus-Next/Xena - Warrior Princess - The Talisman of Fate (USA).cfg".
[INFO] [Environ]: GET_CORE_OPTIONS_VERSION.
[INFO] [Environ]: RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2.
[INFO] [Environ]: SET_CONTROLLER_INFO.
[INFO] [Remaps]: Remap directory: "/home/i3/.config/retroarch/config/remaps".
[INFO] [Overrides]: Redirecting save file to "/home/i3/.config/retroarch/saves/Xena - Warrior Princess - The Talisman of Fate (USA).srm".
[INFO] [Overrides]: Redirecting save state to "/home/i3/.config/retroarch/states/Xena - Warrior Princess - The Talisman of Fate (USA).state".
[INFO] [Environ]: SYSTEM_DIRECTORY: "/home/i3/.config/retroarch/system".
[INFO] [Environ]: SYSTEM_DIRECTORY: "/home/i3/.config/retroarch/system".
[INFO] [Environ]: GET_LOG_INTERFACE.
[INFO] [Environ]: GET_PERF_INTERFACE.
[INFO] [Environ]: SET_PIXEL_FORMAT: XRGB8888.
[INFO] [Environ]: GET_RUMBLE_INTERFACE.
[INFO] [CONTENT LOAD]: Loading content file: /home/i3/Documents/Games/Nintendo - Nintendo 64/Xena - Warrior Princess - The Talisman of Fate (USA)/Xena - Warrior Princess - The Talisman of Fate (USA).n64
[INFO] Did not find a valid content patch.
[INFO] [Environ]: SET_HW_RENDER, context type: glcore.
[INFO] Requesting core OpenGL context (3.3).
[ERROR] [Environ]: SET_HW_RENDER: Dynamic verify HW context failed.
[libretro ERROR] mupen64plus: libretro frontend doesn't have OpenGL support
[ERROR] [CONTENT LOAD]: Failed to load content
[INFO] [Environ]: SET_PIXEL_FORMAT: RGB565.
[INFO] Version of libretro API: 1
[INFO] Compiled against API: 1
[INFO] [Audio]: Set audio input rate to: 48000.00 Hz.
[INFO] [Video]: Video @ fullscreen
[INFO] [Vulkan]: Vulkan dynamic library loaded.
[INFO] [Vulkan]: Found vulkan context: vk_x
[INFO] [Vulkan]: Detecting screen resolution 1920x1080.
[INFO] [X/Vulkan]: Window manager is GNOME Shell.
[INFO] [XINERAMA]: Xinerama version: 1.1.
[INFO] [XINERAMA]: Xinerama screens: 1.
[INFO] [X/Vulkan]: Using Xinerama on screen #0.
[INFO] [X/Vulkan]: X = 0, Y = 0, W = 1920, H = 1080.
[INFO] [X/Vulkan]: Using windowed fullscreen.
[INFO] [Vulkan]: Found GPU at index 0: GeForce MX150
[INFO] [Vulkan]: Using GPU index 0.
[INFO] [Vulkan]: Using fences for WSI acquire.
[INFO] [Vulkan]: Using GPU: GeForce MX150
[INFO] [Vulkan]: Queue family 0 supports 16 sub-queues.
[INFO] [Vulkan]: Using resolution 1920x1080
[INFO] [Vulkan]: Using RGB565 format.
[INFO] [Vulkan]: Loading stock shader.
[INFO] [Joypad]: Found joypad driver: "udev".
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [X11]: Suspending screensaver (X11, xdg-screensaver).
[INFO] [Video]: Found display server: x11
[INFO] [PulseAudio]: Requested 24960 bytes buffer, got 18720.
[INFO] [Display]: Found display driver: "vulkan".
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Environ]: SET_SUBSYSTEM_INFO.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [SRAM]: SRAM will not be saved.
[INFO] [Playlist]: Loading history file: [/home/i3/.config/retroarch/content_history.lpl].
[INFO] [Playlist]: Loading history file: [/home/i3/.config/retroarch/content_music_history.lpl].
[INFO] [Playlist]: Loading history file: [/home/i3/.config/retroarch/content_image_history.lpl].
[INFO] [Playlist]: Loading favorites file: [/home/i3/.config/retroarch/content_favorites.lpl].
[INFO] [PulseAudio]: Pausing.
[INFO] [X/Vulkan]: Resized fullscreen resolution to 1920x1080.
[INFO] [Vulkan]: QueuePresent failed, destroying swapchain.
[INFO] [Vulkan]: QueuePresent failed, destroying swapchain.
m4xw commented 3 years ago

Regardless i doubt this is that relevant

Seen just that before mate... it would shit itself harder than just that tho.

So need to rule out stupid stuff

i30817 commented 3 years ago

parellel rdp didn't make a difference (i got lucky and got that stage on the second battle). Restarted from the start just to check.

m4xw commented 3 years ago

Ok, can you confirm no issue with Gliden/gl to rule out mupen core shenanigans?

i30817 commented 3 years ago

Angrylion worked 'perfectly' though, so there is that if you want a clue.

m4xw commented 3 years ago

was that with parallel rsp? (its what it should fallback to if u selected hle)

i30817 commented 3 years ago

HLE yes.

m4xw commented 3 years ago

Try without synchron rdp for parallel?

i30817 commented 3 years ago

Still with HLE rsp right? And restarting with parellel and setting synchronization off in the options of that plugin?

Do i need to restart without savestates or is loading a savestate acceptable?

m4xw commented 3 years ago

hle rsp wont be active, but for testing lets just make sure you set it explicitly to parallel rsp

You need to actually close content & open content again, restart itself wont work (does for some, dunno about this one, so for testing, always close + open unless asked otherwise) Savestates are ok, use one just before the problem-level starts.

i30817 commented 3 years ago

Ok something weird happened. Now that i changed plugins and back it's actually running vulkan instead of glcore. Sigh. And it's working fine both with synchronous and off.

I dunno. Maybe it's time to close this unless you want to try to figure out why it was crashing vulkan until i apparently switched from one plugin to the other and back.

I hate when this kind of thing happens.

m4xw commented 3 years ago

I hate when this kind of thing happens.

Welcome in the club, mate.

One of those spooky things, I think it might not even be a core issue but i have like.. no starting point to look at.

If you happen to nail it down, let me know lol. Its a spooky one.

m4xw commented 3 years ago

Just for completion, re-post your core options

i30817 commented 3 years ago

Here you go

mupen64plus-169screensize = "960x540"
mupen64plus-43screensize = "640x480"
mupen64plus-alt-map = "False"
mupen64plus-angrylion-multithread = "all threads"
mupen64plus-angrylion-overscan = "disabled"
mupen64plus-angrylion-sync = "Low"
mupen64plus-angrylion-vioverlay = "Filtered"
mupen64plus-aspect = "4:3"
mupen64plus-astick-deadzone = "15"
mupen64plus-astick-sensitivity = "100"
mupen64plus-BackgroundMode = "OnePiece"
mupen64plus-BilinearMode = "standard"
mupen64plus-CorrectTexrectCoords = "Off"
mupen64plus-CountPerOp = "0"
mupen64plus-cpucore = "dynamic_recompiler"
mupen64plus-d-cbutton = "C3"
mupen64plus-DitheringPattern = "False"
mupen64plus-DitheringQuantization = "False"
mupen64plus-EnableCopyAuxToRDRAM = "False"
mupen64plus-EnableCopyColorToRDRAM = "Async"
mupen64plus-EnableCopyDepthToRDRAM = "Software"
mupen64plus-EnableEnhancedHighResStorage = "False"
mupen64plus-EnableEnhancedTextureStorage = "False"
mupen64plus-EnableFBEmulation = "True"
mupen64plus-EnableFragmentDepthWrite = "True"
mupen64plus-EnableHiResAltCRC = "False"
mupen64plus-EnableHWLighting = "False"
mupen64plus-EnableLegacyBlending = "False"
mupen64plus-EnableLODEmulation = "True"
mupen64plus-EnableN64DepthCompare = "False"
mupen64plus-EnableNativeResFactor = "0"
mupen64plus-EnableNativeResTexrects = "Disabled"
mupen64plus-EnableOverscan = "Enabled"
mupen64plus-EnableShadersStorage = "True"
mupen64plus-EnableTexCoordBounds = "False"
mupen64plus-EnableTextureCache = "True"
mupen64plus-ForceDisableExtraMem = "False"
mupen64plus-FrameDuping = "False"
mupen64plus-Framerate = "Original"
mupen64plus-FXAA = "0"
mupen64plus-GLideN64IniBehaviour = "late"
mupen64plus-HybridFilter = "True"
mupen64plus-IgnoreTLBExceptions = "False"
mupen64plus-l-cbutton = "C2"
mupen64plus-MaxTxCacheSize = "8000"
mupen64plus-MultiSampling = "0"
mupen64plus-OverscanBottom = "0"
mupen64plus-OverscanLeft = "0"
mupen64plus-OverscanRight = "0"
mupen64plus-OverscanTop = "0"
mupen64plus-pak1 = "memory"
mupen64plus-pak2 = "none"
mupen64plus-pak3 = "none"
mupen64plus-pak4 = "none"
mupen64plus-parallel-rdp-deinterlace-method = "Bob"
mupen64plus-parallel-rdp-dither-filter = "True"
mupen64plus-parallel-rdp-divot-filter = "True"
mupen64plus-parallel-rdp-downscaling = "disable"
mupen64plus-parallel-rdp-gamma-dither = "True"
mupen64plus-parallel-rdp-native-tex-rect = "True"
mupen64plus-parallel-rdp-native-texture-lod = "False"
mupen64plus-parallel-rdp-overscan = "0"
mupen64plus-parallel-rdp-super-sampled-read-back = "False"
mupen64plus-parallel-rdp-super-sampled-read-back-dither = "True"
mupen64plus-parallel-rdp-synchronous = "True"
mupen64plus-parallel-rdp-upscaling = "1x"
mupen64plus-parallel-rdp-vi-aa = "True"
mupen64plus-parallel-rdp-vi-bilinear = "True"
mupen64plus-r-cbutton = "C1"
mupen64plus-rdp-plugin = "parallel"
mupen64plus-RDRAMImageDitheringMode = "False"
mupen64plus-rsp-plugin = "hle"
mupen64plus-ThreadedRenderer = "False"
mupen64plus-txCacheCompression = "True"
mupen64plus-txEnhancementMode = "None"
mupen64plus-txFilterIgnoreBG = "True"
mupen64plus-txFilterMode = "None"
mupen64plus-txHiresEnable = "False"
mupen64plus-txHiresFullAlphaChannel = "False"
mupen64plus-u-cbutton = "C4"
mupen64plus-virefresh = "Auto"
i30817 commented 3 years ago

The only difference is

mupen64plus-rdp-plugin = "gliden64"

turned into

mupen64plus-rdp-plugin = "parallel"

m4xw commented 3 years ago

cursed

m4xw commented 3 years ago

Ah, do you have "allow cores to switch video plugin" on? (I cant remember if thats still a thing, i think we removed it in RA?) The expected behaviour on my part would be to "fail to load content" if the wrong plugin is selected. I know its not great, but you see why now, lol.

i30817 commented 3 years ago

Yes, it's on. It would not run without it with the original config.

Ok i better recheck that.

m4xw commented 3 years ago

I wonder if i maybe could just display a "please select a matching plugin" message and dont run a game..

i30817 commented 3 years ago

Yeah that was what happened. The original config (from default) was RDP GlideN64. That didn't run without 'allow core to switch video plugin', so it fell back to glcore (and had the performance issues).

Isn't it strange that parallel isn't the default? Anyway, switching to parallel allowed vulkan to start without a fallback,

m4xw commented 3 years ago

No, the core was built for gliden initially and its actually the only plugin that you cant compile without Theres also way too many users not even having a recent enough gfx card

i30817 commented 3 years ago

Maybe it's possibly to query libretro if the current driver for it is vulkan or not to chose a matching plugin in the first run?

If RA even has a easy way to check 'first run'.

m4xw commented 3 years ago

There were attempts..

i30817 commented 3 years ago

Ah, one of 'those' features.

m4xw commented 3 years ago

yea..