[PR #4054] [CLOSED] Timer touchups #3901

Closed
opened 2026-02-27 22:05:23 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/4054
Author: @StevenMiller123
Created: 2/19/2026
Status: Closed

Base: mainHead: timer-touchups


📝 Commits (10+)

📊 Changes

3 files changed (+44 additions, -135 deletions)

View changed files

📝 src/core/libraries/kernel/equeue.cpp (+28 -110)
📝 src/core/libraries/kernel/equeue.h (+5 -17)
📝 src/core/libraries/videoout/driver.cpp (+11 -8)

📄 Description

This PR fixes several inaccuracies with our event queues implementation.

  • Removed fflags incrementing
  • Removed small timer logic
  • Fixed event data for timer events
  • Fixed event duplication
  • Fixed data for VideoOut vblank events

These changes fix some random hanging and debugger crashes seen in titles abusing high-res timers.

Regarding my removal of small timer-specific logic: my hardware tests (posted at https://github.com/ps4emulation/integration_tests/pull/16) suggest that small timers are around the same accuracy as normal timers, somewhere between 10 and 20ms is as low as you can go before real hardware's timing inaccuracies become apparent. Even our timer event logic is fast enough to be more accurate than real hardware.

I'm opening this as a draft, I'd like to see some tests before this gets merged, primarily to make sure removing the special high accuracy small timer logic doesn't break titles using those.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/4054 **Author:** [@StevenMiller123](https://github.com/StevenMiller123) **Created:** 2/19/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `timer-touchups` --- ### 📝 Commits (10+) - [`9683237`](https://github.com/shadps4-emu/shadPS4/commit/968323761388e267e7a2cbee3d39ee123988d2df) Fix timer data - [`ec7528b`](https://github.com/shadps4-emu/shadPS4/commit/ec7528b7528d3037cc964e78e8852c4b3c58a89e) Fix vblank event data - [`527ab8a`](https://github.com/shadps4-emu/shadPS4/commit/527ab8aae8d2edd983d1d0633b743f663b487034) Prevent duplicate events - [`c8cb7a7`](https://github.com/shadps4-emu/shadPS4/commit/c8cb7a70ff39a807891cba91d89cd529ff5c0b6f) Remove unique small timer logic. - [`da14d33`](https://github.com/shadps4-emu/shadPS4/commit/da14d334c668156a46df937e0df76268a6abcdba) Remove assert - [`8025b28`](https://github.com/shadps4-emu/shadPS4/commit/8025b282a908dba2a96bc25e5732bf0c7fc9f7d8) Remove fflags increment - [`97e6ab5`](https://github.com/shadps4-emu/shadPS4/commit/97e6ab55ede549c790e821ffb1ca1c875905dee9) Clang - [`8ce3b03`](https://github.com/shadps4-emu/shadPS4/commit/8ce3b03dbedaa9a7eef38e148a6324fbb0f9ef2f) Remove spinlock offset - [`6aa9990`](https://github.com/shadps4-emu/shadPS4/commit/6aa9990ba11ba2ce51c8ca3f13944c4d8e1803a9) Merge branch 'shadps4-emu:main' into timer-touchups - [`cd3c846`](https://github.com/shadps4-emu/shadPS4/commit/cd3c846d63f57b39c4e7debb9099c2e954aff0fc) Update equeue.cpp ### 📊 Changes **3 files changed** (+44 additions, -135 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/kernel/equeue.cpp` (+28 -110) 📝 `src/core/libraries/kernel/equeue.h` (+5 -17) 📝 `src/core/libraries/videoout/driver.cpp` (+11 -8) </details> ### 📄 Description This PR fixes several inaccuracies with our event queues implementation. - Removed fflags incrementing - Removed small timer logic - Fixed event data for timer events - Fixed event duplication - Fixed data for VideoOut vblank events These changes fix some random hanging and debugger crashes seen in titles abusing high-res timers. Regarding my removal of small timer-specific logic: my hardware tests (posted at https://github.com/ps4emulation/integration_tests/pull/16) suggest that small timers are around the same accuracy as normal timers, somewhere between 10 and 20ms is as low as you can go before real hardware's timing inaccuracies become apparent. Even our timer event logic is fast enough to be more accurate than real hardware. I'm opening this as a draft, I'd like to see some tests before this gets merged, primarily to make sure removing the special high accuracy small timer logic doesn't break titles using those. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:05:23 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#3901
No description provided.