Repository navigation
[BUNDLE] HLE audio and input (XMA, APU, WASAPI capture, GameInput): #194 #528 #536 #478 #197 #361 #613 - #1389
MamaLeVrai wants to merge 17 commits into
Conversation
When a frame ended a loop, decode cut it at the loop's end subframe, set the loop's skip (the subframes of the loop's first frame that lie before the loop) and then took that skip out of the frame in hand: the loop's last. So the head of the last frame was dropped instead, and the first frame played from its start, with the audio before the loop in it. The number of samples came out the same; the seam did not. The pending skip is still applied to the frame in hand, and the loop's skip is set after it, for the frame decoded next. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… forever The decoder fills an XMA voice's output ring until the write block (word 0, bits 27-31) comes round to the title's read block (word 9, bits 0-4). The write block wraps modulo the ring size (word 0, bits 22-26), and so does a read block moved on by command 18, but a read block the title set up at or past the ring's end was compared as it was: no write block ever equalled it. With a stream that loops forever the pass never ended, holding that voice's lock, so the title's next command on the voice (advance, disable) waited for good, and releasing the context arrays did too. Take the read block modulo the ring size as well, as the write side already does. A test sets up read block 6 on a ring of four with an endless loop and requires the pass to end within seconds, with blocks 0 and 1 filled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…slice UB, unbounded silence allocation, and WAV header u32 overflow
…write The write block (context word 0, bits 27-31) was used as it is for the first block of a pass, so one at or past the ring size (bits 22-26) was written past the ring's end, possibly into another APU allocation, before it wrapped with (write + 1) % size. Take it modulo the ring first, as the read block is taken, and as advance_read does.
Registration and poll threads both called deliver directly, so an initial enumeration callback and a hotplug could run at the same time; GameInput guarantees one callback at a time in order. Events now go through one queue in Hub state, with a single thread draining it; callbacks that enqueue more events join the same loop instead of nesting. Add a regression that holds a registration callback open while another thread polls and checks peak concurrency is one.
Run blocking enumeration on the caller when another delivery is active. Hold hotplug events for that registration until enumeration ends, and track inline callbacks for unregistration.
Merges Marvisak#194 Marvisak#528 Marvisak#536 Marvisak#478 Marvisak#197 Marvisak#361 Marvisak#613 onto main (ffe310e), each head unchanged, no conflicts, no changes of mine. cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features, is clean and cargo test --workspace --locked passes (350 passed, 6 ignored; main has 342 passed, 6 ignored). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Runtime boot check on real hardware with a retail dumpResult: no difference from I merged head 9b39340 onto
Warnings: 7, the same kinds and counts as on Limits. Without input, the title stays on the first-boot screens. This run does not exercise saves, the intro video, the start screen, loading or the world. It shows only that the change does not break startup or the first menus on this machine. I did not run the PR's tests. Machine: Ryzen 7 7800X3D, RTX 4070 SUPER, Windows 11 25H2, game 1.0.2.1. AI-assisted (Claude Code). |
|
Automated triage for the maintainers. Closing because this pull request re-packages other open pull requests. Each of those is reviewed on its own, so a bundle cannot be merged. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution. |
One PR in place of 7. The HLE PRs on audio and input: XMA loop and write-block handling, APU pointer validation, WASAPI capture guards,
VICTORY_KEYSon a connected pad, and the order of GameInput readings. Every head is merged unchanged ontomain(ffe310e), and the result is built and tested together.What is inside
985d8d4b033495ff067a5d85e6a7ac2760d364484b4263f5eff5767da55befeAll of them merge with no conflict and no change of mine.
Left out, and why
cargo clippy ... -D warnings(dead code,needless_option_as_deref,manual_is_multiple_of,chunks_exact_to_as_chunks, an unsafe block without a safety comment). Both show a failing CI check for these errors. They need those fixed by their authors.Verification
Windows 11, RX 6950 XT, Rust 1.98.1 (the pinned toolchain):
cargo clippy --workspace --all-targets --locked -- -D warningscargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo test --workspace --lockedmain: 342 passed, 6 ignored)The title was not run, so this says nothing about in-game effect. No game data is used or committed.
Re-verify in one go
To confirm that no component PR moved since this was built, compare each
Headabove withgh pr view <n> --repo Marvisak/VIctory --json headRefOid. If one differs, the branch needs a rebuild: merge the new head in the same order.If this lands
The component heads are in the history unchanged, so each PR's commits and authorship are kept and GitHub should mark them merged. Merging them one by one instead works too, with the exceptions noted above.
AI-assisted (Claude Code); no game data.
🤖 Generated with Claude Code