rpcs3 icon indicating copy to clipboard operation
rpcs3 copied to clipboard

RSX: Discrepancies between Asynchronous and Synchronous Memory Manager (#16352)

Open MarioSonic2987 opened this issue 9 months ago • 15 comments

Here's a list of games that break (graphical issues or crashes) when using Asynchronous or Synchronous Memory Manager.

Asynchronous Memory Manager

  • [ ] Little Big Planet 2 - Broken text. #16449
  • [ ] Little Big Planet 3 - Broken text. #16449
  • [ ] MotorStorm: Pacific Rift - Video playback is broken. #16617
  • [ ] Resident Evil: Operation Raccoon City - Broken image. #16680
  • [ ] Rock Band (1 & 2) - Flashing splash screens. #16845
  • [ ] Splatterhouse - Missing characters in texts. #16794
  • [ ] Split/Second - Improves lighting and some effects, but it makes the image look too blury. Enabling Allow Host GPU labels fixes it, but green/red artifacts sometimes appear. #16786

Synchronous Memory Manager

Note that Synchronous Memory Manager is the same as having the Disable Asynchronous Memory Manager setting enabled, in Debug tab.

  • [ ] Saints Row: The Third - Water shakes when you're close to it.

Logs

Saints Row: The Third

Log SRTT Sync MM Log SRTT Async MM

MarioSonic2987 avatar Mar 03 '25 14:03 MarioSonic2987

if it can help the developers for troubleshooting with ASM enabled, using the suggested wiki settings :

  • issue on MotorStorm: Pacific Rift is fixed using an SPU Decoding different than Recompiler (LLVM) (e.g. Recompiler (ASMJIT))
  • issue on Split/Second is fixed enabling Allow Host GPU Labels (Experimental)

digant73 avatar Apr 16 '25 19:04 digant73

@MarioSonic2987 add to the list also #16845

digant73 avatar Apr 19 '25 17:04 digant73

@digant73 Your build provided here (#16809) doesn't break Saints Row: The Third (water works fine) and Kingdom Hearts II Final Mix (no slowdowns when Roxas attacks).

In Split/Second, green/red artifacts no longer appear when using Allow Host GPU labels. Image

Edit; Master looks the same for some reason. GTX 1060 (576.02)

Image

MarioSonic2987 avatar Apr 21 '25 14:04 MarioSonic2987

Enabling Allow Host GPU labels fixes shaking water in Saints Row: The Third with Synchronous Memory Manager, but it breaks distant water reflections. Image

Disabling Read Color Buffers fixes it, but breaks character textures. Image Image

MarioSonic2987 avatar Apr 21 '25 15:04 MarioSonic2987

@MarioSonic2987 please add to the list also #16794

digant73 avatar Apr 24 '25 08:04 digant73

Any games here that actually crash with the setting in default state?

kd-11 avatar Apr 24 '25 09:04 kd-11

the following code replacing line 48 in MM.cpp seems to fix the reported games. There is only only condition that hit performance for Need for Speed Most Wanted (see inline comments on the code)

		// Basically an unlock op. Flush if any overlap is detected
		for (const auto& block : g_deferred_mprotect_queue)
		{
			if (block.overlaps(start, end))
			{
				if (prot == utils::protection::no)      // avoids some performance drop (about 2-3 fps) on "Need for Speed Most Wanted"
					mm_flush_mprotect_queue_internal(); // fixes "Split Second"

				utils::memory_protect(ptr, length, prot); // fixes "Motorsport Pacific Rift"
				return;
			}
		}

		// condition "g_deferred_mprotect_queue.empty() && prot == utils::protection::ro" fixes missing letters on "littlebigplanet" withou any performance drop in other games
		// condition "g_deferred_mprotect_queue.empty() && prot == utils::protection::no" fixes flashing video and red referee on intro video (not in gameplay) "Rock Band" and "MME 2k14" respectively
		//
		// NOTE: Unfortunately the condition "prot == utils::protection::no" results in destroying any benefit on performance increase in games such as "Need for Speed Most Wanted"
		//
		if (prot == utils::protection::rw || prot == utils::protection::wx || (g_deferred_mprotect_queue.empty() && (prot == utils::protection::ro || prot == utils::protection::no))) // changed code
		//if (prot == utils::protection::rw || prot == utils::protection::wx) // original code

digant73 avatar Apr 24 '25 09:04 digant73

the following code replacing line 48 in MM.cpp seems to fix the reported games. There is only only condition that hit performance for Need for Speed Most Wanted (see inline comments on the code)

		// Basically an unlock op. Flush if any overlap is detected
		for (const auto& block : g_deferred_mprotect_queue)
		{
			if (block.overlaps(start, end))
			{
				if (prot == utils::protection::no)      // avoids some performance drop (about 2-3 fps) on "Need for Speed Most Wanted"
					mm_flush_mprotect_queue_internal(); // fixes "Split Second"

				utils::memory_protect(ptr, length, prot); // fixes "Motorsport Pacific Rift"
				return;
			}
		}

		// condition "g_deferred_mprotect_queue.empty() && prot == utils::protection::ro" fixes missing letters on "littlebigplanet" withou any performance drop in other games
		// condition "g_deferred_mprotect_queue.empty() && prot == utils::protection::no" fixes flashing video and red referee on intro video (not in gameplay) "Rock Band" and "MME 2k14" respectively
		//
		// NOTE: Unfortunately the condition "prot == utils::protection::no" results in destroying any benefit on performance increase in games such as "Need for Speed Most Wanted"
		//
		if (prot == utils::protection::rw || prot == utils::protection::wx || (g_deferred_mprotect_queue.empty() && (prot == utils::protection::ro || prot == utils::protection::no))) // changed code
		//if (prot == utils::protection::rw || prot == utils::protection::wx) // original code

Yea, this isn't right, it just removes the benefit of having asynchronous MM in the first place. I'm missing something else here, but so far all the games are just random visual flicker which is bad for debugging since there are no code events I can hook into. It's much easier if a game hangs or crashes since I can pause execution and debug. I'll come around to this once I fix the active regression caused by recent changes.

kd-11 avatar Apr 24 '25 09:04 kd-11

yes of course it is not a solution. I just played with the code. Apparently the only piece of code destroying any benefit on performance provided by the async MM on "Need for Speed Most Wanted" is the check on prot == utils::protection::no

digant73 avatar Apr 24 '25 10:04 digant73

With the current code (not my changes) I also verified that Pacific Rift was the only game having no issue if using Recompiler ASMJIT or . Just in case Async MM should be managed in the same way across all SPU Decoder settings

digant73 avatar Apr 24 '25 10:04 digant73

Any games here that actually crash with the setting in default state?

I enabled the “Disable Asynchronous Memory Manager” option in the debug menu and it only fixed the missing text in the menu screens and options menus in Splatterhouse. I tested the game again, and the rendering issue is still there when in game. And I’m not sure if by enabling “Disable Asynchronous Memory Manager” causes the game to crash, as it did during the opening cutscene. But the game can be prone to crashing anyway.

https://github.com/RPCS3/rpcs3/issues/16873

https://github.com/RPCS3/rpcs3/issues/13254

Bobble80 avatar Apr 24 '25 11:04 Bobble80

Any games here that actually crash with the setting in default state?

I enabled the “Disable Asynchronous Memory Manager” option in the debug menu and it only fixed the missing text in the menu screens and options menus in Splatterhouse. I tested the game again, and the rendering issue is still there when in game. And I’m not sure if by enabling “Disable Asynchronous Memory Manager” causes the game to crash, as it did during the opening cutscene. But the game can be prone to crashing anyway.

#16873

#13254

kd-11 asked to test with Asynchronous Memory Manager enabled (responsible for the issues reported on the games listed on this bug report) just to provide logs in case you get a freeze or crash (that will help him more on the troubleshooting). So you should test disabling Disable Asynchronous Memory Manager on Debug tab

digant73 avatar Apr 24 '25 15:04 digant73

Any games here that actually crash with the setting in default state?

I enabled the “Disable Asynchronous Memory Manager” option in the debug menu and it only fixed the missing text in the menu screens and options menus in Splatterhouse. I tested the game again, and the rendering issue is still there when in game. And I’m not sure if by enabling “Disable Asynchronous Memory Manager” causes the game to crash, as it did during the opening cutscene. But the game can be prone to crashing anyway. #16873 #13254

kd-11 asked to test with Asynchronous Memory Manager enabled (responsible for the issues reported on the games listed on this bug report) just to provide logs in case you get a freeze or crash (that will help him more on the troubleshooting). So you should test disabling Disable Asynchronous Memory Manager on Debug tab

Asynchronous Memory Manager Is enabled by default right? I did go into the debug tab and enable the ‘Disable Asynchronous Memory Manager’ option and run Splatterhouse again. Then the missing text issue in the menus and settings menus was fixed. But the game crashed during the opening cutscene. The game does crash sometimes during the opening cutscene though even with the default RPCS3 settings without having ‘Disable Asynchronous Memory Manager’ setting enabled.

Do I still need to upload a log?

Bobble80 avatar Apr 24 '25 18:04 Bobble80

@Bobble80 yes thanks. Possibly for both Async MM enabled (default) and disabled (from Debug tab)

digant73 avatar Apr 24 '25 21:04 digant73

@Bobble80 yes thanks. Possibly for both Async MM enabled (default) and disabled (from Debug tab)

Ok, I’ve ran Splatterhouse again with default settings and then async mem manager disabled from the debug menu. I just ran it for the first few minutes past the opening cutscene but couldn’t get the game to crash. A lot of times it crashes during the opening cutscene and has done for months now.

The flickering graphics / rendering issue is still present though with default settings and also with AMM disabled. But I noticed that when I ran the game again after originally trying to fix the missing text in the menus by disabling AMM from the debug menu yesterday, now the missing menus text seems to be visible again on default settings. EDIT - false alarm. I ran the game again after that back to the default settings and the missing text in menus bug is back again.

Anyway, I gathered the logs, not sure if they’re any use to you. And also captured another short video clip of the flickering graphics issue.

RPCS3.log (Async Mem Manager Disabled).gz RPCS3.log (Default Settings).gz

FPS_ 30.02 _ Vulkan _ 0.0.36-17820 _ SPLATTERHOUSE [BLUS30335] 2025-04-25 00-13-54.zip

Bobble80 avatar Apr 24 '25 22:04 Bobble80

@MarioSonic2987 it seems also #16835 has to be added to the list

digant73 avatar May 16 '25 08:05 digant73

Testing needed with https://github.com/RPCS3/rpcs3/pull/17249

kd-11 avatar May 25 '25 17:05 kd-11

Testing needed with #17249

Splatterhouse still broken, both issues with the missing text in menus and flickering / rendering issues on the floor of the opening level.

Bobble80 avatar May 25 '25 23:05 Bobble80

Testing needed with #17249

Motorstorm Pacific Rift and Split/Second still broken

digant73 avatar May 26 '25 07:05 digant73

Do all these games still suffer from these issues or have some been fixed by now?

FarmerJoe7355 avatar Oct 23 '25 15:10 FarmerJoe7355

Do all these games still suffer from these issues or have some been fixed by now?

Splatterhouse is still broken. It has the flickering graphics issue still on the floor of the opening level.

https://github.com/RPCS3/rpcs3/issues/16873

And the other issue here with the text not showing up in the menu screens. Same thing happens in Alice: Madness Returns with the missing text in the menu screens too.

Bobble80 avatar Oct 23 '25 15:10 Bobble80

yes, this is for sure one hot issue still open and probably affecting more games than the ones reported

digant73 avatar Oct 23 '25 15:10 digant73