acphal: ProjectScarlett crashes at start-up since #527 (non-cached APU heap is 0x1800 bytes short) #556

Closed
opened 2026-11-29 23:16:33 +00:00 by NickStallman · 1 comment
NickStallman commented 2026-11-29 23:16:33 +00:00 (Migrated from github.com)
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T23:16:33Z.


ProjectScarlett crashes at start-up on main since #527. Found by bisecting 4198b48c..6bab5478 on an RTX 5090 (the good end was an integration build on 4198b48c, not plain), with the launch fix of #551 and #535's DXC helper. First bad: 051bdf79 (#527); its parent 9a266c1a is good, and so is 72e266bf (#476).

What happens

The title's own start-up code faults in a memory copy (VCRUNTIME140+0x1989, called from game_scarlett_master.exe+0x43AED60), 30 to 100 s in; exit code 5. Log of the APU calls (a local log-only patch):

ApuCreateHeap  cached=0x1c700000 non_cached=0x226e00       -> S_OK
AcpHalAllocateShapeContexts  xma=350                       -> takes 0x5780 bytes of the non-cached heap
ApuAlloc  size=0x222e00 alignment=0x800 flags=0x2          -> E_OUTOFMEMORY

0x5800 (0x5780 rounded up to the 0x800 alignment) + 0x222e00 is 0x228600, and the heap has 0x226e00: 0x1800 short. Before #527 both heaps were one region of both sizes together, so it fitted.

What I don't know

Whether the console keeps these contexts in the title's non-cached heap, and how much it really allocates for a title's size. The title works on the console with these numbers, so it has at least 0x5780 + 0x222e00 + alignment, if the contexts are there.

Measured: rounding the non-cached size up to 64 KiB (0x230000) makes the game start on plain main (f482572a); it ran until my 2-minute limit. That's a guess at the reason (64 KiB is the granule of the host memory), not a fact about the console. An alternative is to keep the contexts out of the title's heap.

@csj0oe this is your area: would you rather fix it, or shall I? I'll open a draft with the rounding and a test so that something can be run now; take it or replace it.

<!-- greyfinch-sync:brcly/TuxBox:issue:6685500789 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/556). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T23:16:33Z. --- **ProjectScarlett crashes at start-up on `main` since #527.** Found by bisecting 4198b48c..6bab5478 on an RTX 5090 (the good end was an integration build on 4198b48c, not plain), with the launch fix of #551 and #535's DXC helper. First bad: 051bdf79 (#527); its parent 9a266c1a is good, and so is 72e266bf (#476). ## What happens The title's own start-up code faults in a memory copy (`VCRUNTIME140+0x1989`, called from `game_scarlett_master.exe+0x43AED60`), 30 to 100 s in; exit code 5. Log of the APU calls (a local log-only patch): ```text ApuCreateHeap cached=0x1c700000 non_cached=0x226e00 -> S_OK AcpHalAllocateShapeContexts xma=350 -> takes 0x5780 bytes of the non-cached heap ApuAlloc size=0x222e00 alignment=0x800 flags=0x2 -> E_OUTOFMEMORY ``` 0x5800 (0x5780 rounded up to the 0x800 alignment) + 0x222e00 is 0x228600, and the heap has 0x226e00: 0x1800 short. Before #527 both heaps were one region of both sizes together, so it fitted. ## What I don't know Whether the console keeps these contexts in the title's non-cached heap, and how much it really allocates for a title's size. The title works on the console with these numbers, so it has at least 0x5780 + 0x222e00 + alignment, if the contexts are there. **Measured:** rounding the non-cached size up to 64 KiB (0x230000) makes the game start on plain `main` (f482572a); it ran until my 2-minute limit. That's a guess at the reason (64 KiB is the granule of the host memory), not a fact about the console. An alternative is to keep the contexts out of the title's heap. @csj0oe this is your area: would you rather fix it, or shall I? I'll open a draft with the rounding and a test so that something can be run now; take it or replace it.
NickStallman commented 2026-11-29 23:20:54 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T23:20:54Z.


Duplicate of #554, which I missed when I searched. The APU trace is in a comment there.

<!-- greyfinch-sync:brcly/TuxBox:comment:7264391232 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/556#issuecomment-7264391232). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T23:20:54Z. --- Duplicate of #554, which I missed when I searched. The APU trace is in a comment there.
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
brcly/TuxBox#556
No description provided.