libkernel: measure clock_gettime clock id 20 on PS5 (Age of Mythology Retold, Party.prx) #15725

Open
opened 2026-11-04 09:43:21 +00:00 by XatiX · 0 comments
XatiX commented 2026-11-04 09:43:21 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by XatiX on 2026-11-04T09:43:21Z.


What is unknown

clock_gettime with clock id 20 has no documented meaning. shadPS4 defines ids 16 to 19 only (PS4 network clocks), and nothing found so far describes 20. AnyPS5 currently throws for ids 16 to 31 in clock_gettime and clock_getres, which is correct while the PS5's answer is unknown.

Who needs it

Age of Mythology Retold (PPSA18653) stops at about 50 s on this call, from Party.prx at 0x29be26. The caller handles a failure: it falls back to gettimeofday and then time(0). Returning EINVAL locally lets the game reach its first-run welcome screen, but that is a guess, so it can't go upstream (see #15656, closed for that reason).

What needs measuring

A PS5 payload that calls, on real firmware:

  • clock_gettime(20, &ts): return value, errno, and ts (also whether ts is written on failure);
  • clock_getres(20, &ts), the same;
  • ideally ids 16 to 19 and 21 to 31 too, so the whole range can be implemented or rejected from measurements.

If id 20 returns a time, also note which clock it tracks (compare a few calls against CLOCK_MONOTONIC and CLOCK_REALTIME).

Once measured, the result can be implemented as the default for that id, with the measurement cited in the debt entry in docs/dev/debt/libkernel.md.

Bring-up thread: #15328.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6200327088 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/15725). Originally posted by [XatiX](https://github.com/XatiX) on 2026-11-04T09:43:21Z. --- ## What is unknown `clock_gettime` with clock id `20` has no documented meaning. shadPS4 defines ids 16 to 19 only (PS4 network clocks), and nothing found so far describes 20. AnyPS5 currently throws for ids 16 to 31 in `clock_gettime` and `clock_getres`, which is correct while the PS5's answer is unknown. ## Who needs it Age of Mythology Retold (PPSA18653) stops at about 50 s on this call, from `Party.prx` at `0x29be26`. The caller handles a failure: it falls back to `gettimeofday` and then `time(0)`. Returning `EINVAL` locally lets the game reach its first-run welcome screen, but that is a guess, so it can't go upstream (see #15656, closed for that reason). ## What needs measuring A PS5 payload that calls, on real firmware: - `clock_gettime(20, &ts)`: return value, `errno`, and `ts` (also whether `ts` is written on failure); - `clock_getres(20, &ts)`, the same; - ideally ids 16 to 19 and 21 to 31 too, so the whole range can be implemented or rejected from measurements. If id 20 returns a time, also note which clock it tracks (compare a few calls against `CLOCK_MONOTONIC` and `CLOCK_REALTIME`). Once measured, the result can be implemented as the default for that id, with the measurement cited in the debt entry in `docs/dev/debt/libkernel.md`. Bring-up thread: #15328.
Sign in to join this conversation.
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#15725
No description provided.