Unity + linux: signal safety, direct-memory zeroing, AudioOut2 pacing, renderer and SaveData fixes #156
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!156
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/156/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@StefanosCosta on GitHub · 2026-08-03 11:04 UTC · original
StefanosCosta:series/pr-rebuild→main· +1298 −114 · 26 files · 11 commits · closed without mergingSummary
Fixes deadlocks, stalls and correctness bugs found while getting FMOD-based titles to a playable
state. The two largest are in guest signal delivery and audio submission: a guest signal handler
could run while the emulator held its own locks and deadlock the process, and AudioOut2 was paced
against a modelled queue rather than the device, so the device ran dry 98% of the time.
These are platform-neutral changes in shared code, not Linux-only — Windows is affected and was not
run. See Platform impact for more details.
This PR has major fixes for Unity games.
What's included
Guest signals and condition variables
Audio
Memory
Renderer
RenderDoc
SaveData, filesystem and loader
Diagnostics
Platform impact
Testing
Built and run on Linux (Clang, Ninja). Every commit builds standalone; ctest 6/6;
-DKYTY_ENABLE_HLE_TRACE=ON builds.
Boot health as EndOfPipe Signal count over a 45 s run (1 = hung): PowerWash Simulator 3906,
Cat Quest III 4740, Subnautica 2764.
Audio verified by ear — Subnautica, PowerWash Simulator, Cult of the lamb menu and in-game, Superliminal menu. No
clicking or dropouts, and audio survives sustained in-game movement, which previously killed it
permanently. Not machine-checked: the glitch counter gave 31.9/s and 87.6/s for the same binary.
AI was used for investigation, bisection and drafting; every claim above is backed by a measurement
or by my own listening test.
The following titles were either not playable before these changes:
Subliminal did not boot to the menu as well.
Fixes have been confirmed to be universal and not game-specific, and as such were pushed for review.
Proof of Errors and Working In-Game footage can be found here:
https://drive.google.com/drive/folders/1tpYUxadOKHL7QwwBMez_lWwphPQ7adYB?usp=sharing
Note on commit
bb75992: its subject mentions implementing the address-wait pair, but that half is no longer in the branch.Upstream's
00a5dd3landed a fuller sceKernelSyncOnAddressWait/Wake (32/64-bit variants, dedicated src/kernel/syncOnAddress.cpp, its own tests), so the merge of upstream/main resolved in favour of upstream's implementation. All that remains from that commit is the AudioOut2 device-paced submission.@StefanosCosta on GitHub · 2026-08-03 11:12 UTC · original
Hey @Nmzik . Did my best to make it easy for you to cherry-pick whatever you want. Both clicking and audio cut-off issues from previous PR are fixed in this PR.
@StefanosCosta on GitHub · 2026-08-04 23:06 UTC · original
Hey @Nmzik. I realize that many of the changes in this branch are obsolete given the latest changes merged in main, and probably not welcome as a relatively large PR. It is not my intent to make things difficult or inconvenient. I separated the remaining valid commits into 6 other branches which should make it easier for you to review, and excluded the changes that are now obsolete. However, I don't want to cut you off if you already started cherry-picking any commits, so I will close this PR and open the rest of them only after receiving your OK. Thanks again for your amazing work
@Nmzik on GitHub · 2026-08-04 23:24 UTC · original
@StefanosCosta Just so you know, I’m actively reviewing your PRs - not ignoring them. However, please dont expect me to merge them immediately, as Im also working on other things.
I also dont want to merge hacks into the main codebase. If you’ve discovered an actual bug, thats fine, and I’ll credit you for finding it. However, some of the changes look more like workarounds/hacks than proper implementations that will work across all games. Thanks for understanding. Not trying to be mean
@StefanosCosta on GitHub · 2026-08-04 23:28 UTC · original
@Nmzik Of course. You're right. That's what I realized, that's why I want to change it. I'm not pushing or complaining about it. I'm mostly ashamed because I didn't actually give you something worth working with and honestly if I was in your position I would have rejected it. I just wanted to make sure I didn't interrupt you if you actually did start looking through it.
@Nmzik on GitHub · 2026-08-04 23:32 UTC · original
@StefanosCosta It’s all good - don’t close this PR, as some parts of it still need further investigation. However, if you find other unrelated bugs in the future, please submit them as separate, smaller PRs, even if each fix only helps games progress a little further. You can reference related PRs in each other so that I can understand the changes more easily.
@StefanosCosta on GitHub · 2026-08-04 23:37 UTC · original
@Nmzik Thank you. I will stick to that practice from now on
@gandalfthewhite19890404 on GitHub · 2026-08-08 06:47 UTC · original
Why not mergin this?
Or cherry pick some commits from PR - save fixes, i.e.
For what big PRs, why not separate to small - it easier for testing and merge can be completed faster
@StefanosCosta on GitHub · 2026-08-08 06:52 UTC · original
@gandalfthewhite19890404 As you can read from the previous comments some of these fixes are hacks. The file save fixes and others have already been committed in separate commits by the maintainer. I was going to split it into smaller PRs but since they already started investigating we concluded to leave this as is and make smaller PRs from now on. At least that's how I understood it
@Nmzik on GitHub · 2026-08-08 16:52 UTC · original
Persist sceSaveDataSetParam's arguments, which were discarded — saves enumerate as damagedI understand that this is a real bug. Is there any game that actually checks or relies on this behavior? I don’t know of any game that really depends on it.
@Nmzik on GitHub · 2026-08-08 16:54 UTC · original
Fix four sources of invalid draws: null-image keying in the texture cache, depth-compare state applied to a colour surface, colour-write-enable left set for depth-only passes, and a render area wider than its attachment.Which game caused this change?
@StefanosCosta on GitHub · 2026-08-08 16:59 UTC · original
Hi @Nmzik ! Both issues that you just mentioned were identified in subnautica. With main changes a couple days ago, I was able to replicate only 2 of the 4 sources of invalid draws. Both showed up I believe in both subnautica and powerwash simulator. I believe the save issue also exists both in subnautica and cat quest 3.
@Nmzik on GitHub · 2026-08-08 17:00 UTC · original
@StefanosCosta Could you please confirm whether the following games are working on Linux with the latest main branch?
@Nmzik on GitHub · 2026-08-08 17:02 UTC · original
Definitely not "cat quest 3". It does save
@StefanosCosta on GitHub · 2026-08-08 17:06 UTC · original
The issue was i believe corrupted save files, so it wouldn't boot after saving. Checking now
@Nmzik on GitHub · 2026-08-08 17:12 UTC · original
Yeap, that was the issue but it was fixed
@StefanosCosta on GitHub · 2026-08-08 17:40 UTC · original · edited 2026-08-08 17:42 UTC
Hey @Nmzik . In current main, none of the titles go in-game. Subnautica goes in menu but never goes in-game. I believe the changes in this branch solved that issue, though I don't remember which ones. The same was true for powerwash simulator, and cult_of_the_lamb (they don't reach the menu, but superliminal does). I went into my branch that this PR is from and they run fine there. Would you like me to isolate the changes that make them run?
@StefanosCosta on GitHub · 2026-08-08 18:41 UTC · original
@Nmzik Forgot to mention cat quest 3 works fine. My bad. Rest of them still have an issue though
@StefanosCosta on GitHub · 2026-08-08 18:53 UTC · original · edited 2026-08-08 19:02 UTC
@Nmzik Sorry for the constant pinging. I just checked my notes because I kept a backlog. Commits
12f71e0+1d25e35made subnautica reach in-game instead of hanging forever. After that If i remember correctly the rest of the games also reached not only the menu but also in-game. I'm starting a test branch and cherry-picking them in there to test and confirm for the other titles, but consider it true for Subnautica. Regarding the save files, subnautica also had corrupted game files, so I'm not sure if it's affected by what you mentioned previously@StefanosCosta on GitHub · 2026-08-08 19:37 UTC · original
Commits that made the games Cult of the lamb, powerwash simulator and Subnautica run and reach in-game were separated and submitted in #215.
@Nmzik on GitHub · 2026-09-07 09:05 UTC · original
Cult of the lamb, powerwash simulator and Subnautica seems to be working now on Linux Feel free to open the issue
Pull request closed