Keep XMA decoding when its worker fails to start #4801

Open
github-bot wants to merge 1 commit from github-bot/gh-4800 into main AGit
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-12-01 09:15 UTC · original
andrewpozdnakov7-jpg:fix/xma-worker-start-fallback → main · +50 −37 · 1 files · 1 commits · draft

Main at 5fabb46 has five Clippy errors covered by #4708.

What it changes

If the XMA decoder thread fails to start, the code currently stores the caller's thread handle. Later decoder wakeups go to that thread, which has no decoder loop.

Store whether the decoder worker started. If creation fails, report the error and fill the requested voice inline when it is enabled or when its read pointer advances. The same voice-filling function serves both paths.

How it was tested

  • Windows x64 and MSVC. Injected a worker creation failure into the exact wakeup function on main and b97f584. The same three requests for voices 2, 4 and 2 resulted in no fills on main and fills for 2, 4 and 2 after the change.
  • cargo check --locked -p victory-hle --jobs 2 passed.
  • cargo xtask policy --staged passed for the one changed file.
  • The fault-injection harness mocks the decoder. Audio playback on a game setup remains unverified.

Checked for overlap

  • Searched open and closed PRs by symptom and reviewed open PRs touching audio.rs. #4082 reuses decoding scratch space and #4275 fixes packet starts and sample skips.

Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change into another commit.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-12-01 09:15 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4800) `andrewpozdnakov7-jpg:fix/xma-worker-start-fallback` → `main` · +50 −37 · 1 files · 1 commits · draft Main at `5fabb46` has five Clippy errors covered by #4708. ## What it changes If the XMA decoder thread fails to start, the code currently stores the caller's thread handle. Later decoder wakeups go to that thread, which has no decoder loop. Store whether the decoder worker started. If creation fails, report the error and fill the requested voice inline when it is enabled or when its read pointer advances. The same voice-filling function serves both paths. ## How it was tested - Windows x64 and MSVC. Injected a worker creation failure into the exact wakeup function on `main` and `b97f584`. The same three requests for voices 2, 4 and 2 resulted in no fills on `main` and fills for 2, 4 and 2 after the change. - `cargo check --locked -p victory-hle --jobs 2` passed. - `cargo xtask policy --staged` passed for the one changed file. - The fault-injection harness mocks the decoder. Audio playback on a game setup remains unverified. ## Checked for overlap - [x] Searched open and closed PRs by symptom and reviewed open PRs touching `audio.rs`. #4082 reuses decoding scratch space and #4275 fixes packet starts and sample skips. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change into another commit.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 09:16:20 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/4801/head:github-bot/gh-4800'
git switch 'github-bot/gh-4800'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4800'
git switch 'github-bot/gh-4800'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4800'
git switch 'github-bot/gh-4800'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4800'
git switch 'main'
git merge --squash 'github-bot/gh-4800'
git switch 'main'
git merge --ff-only 'github-bot/gh-4800'
git switch 'main'
git merge 'github-bot/gh-4800'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!4801
No description provided.