docs(libSceVideoOut): record a PS5 measurement of the vblank status third word #16584

Merged
xXPBSXx merged 2 commits from upstream-pr/16584 into main 2026-11-10 22:40:44 +00:00
xXPBSXx commented 2026-11-07 06:56:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-11-07T06:56:16Z.


What

The sceVideoOutGetVblankStatus entry says the clock of the third 64-bit word, and what it counts from, are not established. This adds what a PS5 returns in a payload process: the word advances at the rate of the same process's rdtsc (about 1.596 GHz on that console) and trails an rdtsc read just before the call by about 6 ms, less than one vblank period, consistent with the TSC at the latest vblank. It also advances in step with processTimeCounter: the word minus processTimeCounter was 0x19c1be2eaacb, 0x19c1be2eaf5c and 0x19c1be2eaece in the three calls, a spread of 1169 ticks. AnyPS5 still writes 0, so no code changes and the Closes when stays. To keep the entry under the length limit, the firmware 13.40 sentence keeps only the third word's value; the other fields' values and the "about 970 s at ~2 GHz" estimate are dropped, as the measured rate replaces that estimate.

Tested

Measured on a PS5 with firmware 11.60 (kernel_get_fw_version 0x11600005), from a homebrew payload process (ps5-payload-sdk v0.45, elfldr), on 2026-11-06 at 19:22 UTC, on a handle from sceVideoOutOpen(0xff, 0, 0, NULL) with no registered buffers and no flips. A title process may differ.

Call PS5, payload process, firmware 11.60 AnyPS5 main
sceVideoOutGetVblankStatus, three calls 200 ms apart 0 each; count 0x1, 0xd, 0x19 0
Third word 0x19c1d3c7adb2, 0x19c1e6d41970, 0x19c1f9e03c52 0
Third word, rate between calls 1.5967 GHz, 1.5956 GHz n/a
rdtsc before the call, rate over the same intervals 1.5963 GHz, 1.5963 GHz n/a
rdtsc before the call minus third word 9643387, 9568748, 9703736 ticks (6.0 ms each) n/a
Flags and phase word 0 0
Words 5 and 6 of a 56-byte buffer untouched untouched (40-byte status)

The rates are differences between consecutive calls divided by the CLOCK_MONOTONIC time between them (0.2002 s), worked out from the raw output. The status layout is the one AnyPS5 uses; there is no SDK header for it. The probe source and its raw output are in the first comment. tools/check_conventions.py --base upstream/main passes.

Overlap: the 15 open pull requests that change docs/dev/debt/libSceVideoOut.md were checked on 2026-11-07 between 06:05 UTC and 06:25 UTC against main 779572c799, which has no commit that changes this file since this change's base e88dbd3af70. #4040 already conflicts with main in that file without this change; #14212, #16463 and #12315 conflict with main only in other files. None conflicts because of this change, and the other eleven merge cleanly with and without it.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a (documentation only)
  • AI-assisted: yes

AI-assisted (Claude Code).

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5199290461 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16584). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-11-07T06:56:16Z. --- ### What The `sceVideoOutGetVblankStatus` entry says the clock of the third 64-bit word, and what it counts from, are not established. This adds what a PS5 returns in a payload process: the word advances at the rate of the same process's `rdtsc` (about 1.596 GHz on that console) and trails an `rdtsc` read just before the call by about 6 ms, less than one vblank period, consistent with the TSC at the latest vblank. It also advances in step with `processTimeCounter`: the word minus `processTimeCounter` was 0x19c1be2eaacb, 0x19c1be2eaf5c and 0x19c1be2eaece in the three calls, a spread of 1169 ticks. AnyPS5 still writes 0, so no code changes and the Closes when stays. To keep the entry under the length limit, the firmware 13.40 sentence keeps only the third word's value; the other fields' values and the "about 970 s at ~2 GHz" estimate are dropped, as the measured rate replaces that estimate. ### Tested Measured on a PS5 with firmware 11.60 (`kernel_get_fw_version` 0x11600005), from a homebrew payload process (ps5-payload-sdk v0.45, elfldr), on 2026-11-06 at 19:22 UTC, on a handle from `sceVideoOutOpen(0xff, 0, 0, NULL)` with no registered buffers and no flips. A title process may differ. | Call | PS5, payload process, firmware 11.60 | AnyPS5 `main` | |---|---|---| | `sceVideoOutGetVblankStatus`, three calls 200 ms apart | 0 each; `count` 0x1, 0xd, 0x19 | 0 | | Third word | 0x19c1d3c7adb2, 0x19c1e6d41970, 0x19c1f9e03c52 | 0 | | Third word, rate between calls | 1.5967 GHz, 1.5956 GHz | n/a | | `rdtsc` before the call, rate over the same intervals | 1.5963 GHz, 1.5963 GHz | n/a | | `rdtsc` before the call minus third word | 9643387, 9568748, 9703736 ticks (6.0 ms each) | n/a | | Flags and phase word | 0 | 0 | | Words 5 and 6 of a 56-byte buffer | untouched | untouched (40-byte status) | The rates are differences between consecutive calls divided by the `CLOCK_MONOTONIC` time between them (0.2002 s), worked out from the raw output. The status layout is the one AnyPS5 uses; there is no SDK header for it. The probe source and its raw output are in the first comment. `tools/check_conventions.py --base upstream/main` passes. Overlap: the 15 open pull requests that change `docs/dev/debt/libSceVideoOut.md` were checked on 2026-11-07 between 06:05 UTC and 06:25 UTC against `main` `779572c799`, which has no commit that changes this file since this change's base `e88dbd3af70`. #4040 already conflicts with `main` in that file without this change; #14212, #16463 and #12315 conflict with `main` only in other files. None conflicts because of this change, and the other eleven merge cleanly with and without it. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a (documentation only) <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no --> AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
gabichuuuuu commented 2026-11-10 17:48:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-10T17:48:56Z.

Review: COMMENTED


Read fbb6abfdf3 against main.

Correctness. The entry is still current on main (docs/dev/debt/libSceVideoOut.md:35) and the code is as described: Output.cpp:sceVideoOutGetVblankStatus copies cfg->vblankStatus for a PS5 handle, and VideoOutVblankStatus::reserved (SceTypes.hpp:2334) is never set, so the third word is 0. The new text keeps the "Closes when" clause, which is still right because the word is still written 0.

Non-blocking. The rewrite removes the previously recorded 13.40 values (count, processTime, processTimeCounter, flags, phase) and the "about 970 s at ~2 GHz" estimate. The PR description says this is to stay under the entry length limit, and the estimate is superseded by the 1.596 GHz rate, but the 13.40 processTime / processTimeCounter values are now only in the history. If the length warning is the only reason, keeping the two counter values and shortening the title list would lose less. The 11.60 payload-process measurement is not checkable here.

Not run here; this is from reading the code.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5846650769 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16584#pullrequestreview-5846650769). Originally posted by [gabichuuuuu](https://github.com/gabichuuuuu) on 2026-11-10T17:48:56Z. **Review:** COMMENTED --- Read `fbb6abfdf3` against `main`. **Correctness.** The entry is still current on `main` (docs/dev/debt/libSceVideoOut.md:35) and the code is as described: `Output.cpp:sceVideoOutGetVblankStatus` copies `cfg->vblankStatus` for a PS5 handle, and `VideoOutVblankStatus::reserved` (`SceTypes.hpp:2334`) is never set, so the third word is 0. The new text keeps the "Closes when" clause, which is still right because the word is still written 0. **Non-blocking.** The rewrite removes the previously recorded 13.40 values (count, `processTime`, `processTimeCounter`, flags, phase) and the "about 970 s at ~2 GHz" estimate. The PR description says this is to stay under the entry length limit, and the estimate is superseded by the 1.596 GHz rate, but the 13.40 `processTime` / `processTimeCounter` values are now only in the history. If the length warning is the only reason, keeping the two counter values and shortening the title list would lose less. The 11.60 payload-process measurement is not checkable here. Not run here; this is from reading the code. AI-assisted: yes.
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
boykopovar/AnyPS5!16584
No description provided.