hle(apu,dsp): offload Opus and DSP convolution to worker threads #511

Open
hingeowl wants to merge 1 commit from hingeowl/Darner:pr/apu-dsp-offload into Main
Contributor

What it changes

  • The problem on main: Opus decoding and DSP convolution in darner-hle (modules/apu.rs, modules/dsp.rs) execute synchronously on the title's calling thread.
  • Ported from ReTerryDavis/ReVIctory (71de60b24126155527217a0b11c0525196cd79f5, 04d9ff39c4772f8dd92b56d769bd77965a686a7d):
    • Offloads Opus decoding (apu.rs) and DSP convolution (dsp.rs) onto dedicated worker threads in darner-hle.
    • Leaves apps/darner/src/play.rs defaults untouched.

How it was tested

  • Tested revision: bf8be3f (based on main c8258f9)
  • Commands and results:
    • cargo xtask policy — pass
    • cargo clippy --workspace --all-targets --locked -- -D warnings — pass
    • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings — pass
    • cargo test -p darner-hle --locked — pass
  • Changes a default: yes (APU/DSP work runs on worker threads instead of inline).
  • A/B result: not yet benchmarked standalone in isolation; ran clean with working audio in cam-city60 and playtests (RTX 4090 + Ryzen 9 7950X3D, Series X, HW RT) as part of our integration branch.
  • Gates run on that revision: cargo xtask policy, both workspace clippy gates, cargo test -p darner-hle --locked.
  • Hardware dependence: likely general (benefits multi-core CPUs).
  • Coverage gaps: standalone A/B audio-latency / CPU benchmark not yet recorded in isolation.

Checklist

  • I ran this change in the game.
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: none found
  • Replaces or overlaps: none found
## What it changes - The problem on main: Opus decoding and DSP convolution in `darner-hle` (`modules/apu.rs`, `modules/dsp.rs`) execute synchronously on the title's calling thread. - Ported from `ReTerryDavis/ReVIctory` (`71de60b24126155527217a0b11c0525196cd79f5`, `04d9ff39c4772f8dd92b56d769bd77965a686a7d`): - Offloads Opus decoding (`apu.rs`) and DSP convolution (`dsp.rs`) onto dedicated worker threads in `darner-hle`. - Leaves `apps/darner/src/play.rs` defaults untouched. ## How it was tested - Tested revision: `bf8be3f` (based on `main` `c8258f9`) - Commands and results: - `cargo xtask policy` — pass - `cargo clippy --workspace --all-targets --locked -- -D warnings` — pass - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` — pass - `cargo test -p darner-hle --locked` — pass - Changes a default: yes (APU/DSP work runs on worker threads instead of inline). - A/B result: not yet benchmarked standalone in isolation; ran clean with working audio in `cam-city60` and playtests (RTX 4090 + Ryzen 9 7950X3D, Series X, HW RT) as part of our integration branch. - Gates run on that revision: `cargo xtask policy`, both workspace `clippy` gates, `cargo test -p darner-hle --locked`. - Hardware dependence: likely general (benefits multi-core CPUs). - Coverage gaps: standalone A/B audio-latency / CPU benchmark not yet recorded in isolation. ## Checklist - [x] I ran this change in the game. - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: none found - Replaces or overlaps: none found
Ported from ReTerryDavis/ReVIctory (71de60b24126155527217a0b11c0525196cd79f5,
04d9ff39c4772f8dd92b56d769bd77965a686a7d).

Offloads Opus decoding and DSP convolution work in darner-hle off the main
calling thread onto worker threads.

Upstream-Repository: https://github.com/ReTerryDavis/ReVIctory
Upstream-Commit: 71de60b24126155527217a0b11c0525196cd79f5 04d9ff39c4772f8dd92b56d769bd77965a686a7d
TrustNo1 changed title from [pr-performance][audio] hle(apu,dsp): offload Opus and DSP convolution to worker threads to hle(apu,dsp): offload Opus and DSP convolution to worker threads 2026-12-06 03:27:49 +00:00
Owner

Test needed — commit bf8be3fb; what to check:

  • The problem on main: Opus decoding and DSP convolution in darner-hle (modules/apu.rs, modules/dsp.rs) execute synchronously on the title's calling thread.
  • Ported from ReTerryDavis/ReVIctory (71de60b24126155527217a0b11c0525196cd79f5, 04d9ff39c4772f8dd92b56d769bd77965a686a7d):
    • Offloads Opus decoding (apu.rs) and DSP convolution (dsp.rs) onto dedicated worker threads in darner-hle.
    • Leaves apps/darner/src/play.rs defaults untouched.

Evidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture.

Reply testing to take this run; it's free again after 24 h with no results.

**Test needed** — commit `bf8be3fb`; what to check: - The problem on main: Opus decoding and DSP convolution in `darner-hle` (`modules/apu.rs`, `modules/dsp.rs`) execute synchronously on the title's calling thread. - Ported from `ReTerryDavis/ReVIctory` (`71de60b24126155527217a0b11c0525196cd79f5`, `04d9ff39c4772f8dd92b56d769bd77965a686a7d`): - Offloads Opus decoding (`apu.rs`) and DSP convolution (`dsp.rs`) onto dedicated worker threads in `darner-hle`. - Leaves `apps/darner/src/play.rs` defaults untouched. Evidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture. Reply `testing` to take this run; it's free again after 24 h with no results.
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 'pr/apu-dsp-offload:hingeowl-pr/apu-dsp-offload'
git switch 'hingeowl-pr/apu-dsp-offload'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'Main'
git merge --no-ff 'hingeowl-pr/apu-dsp-offload'
git switch 'hingeowl-pr/apu-dsp-offload'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'hingeowl-pr/apu-dsp-offload'
git switch 'hingeowl-pr/apu-dsp-offload'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'hingeowl-pr/apu-dsp-offload'
git switch 'Main'
git merge --squash 'hingeowl-pr/apu-dsp-offload'
git switch 'Main'
git merge --ff-only 'hingeowl-pr/apu-dsp-offload'
git switch 'Main'
git merge 'hingeowl-pr/apu-dsp-offload'
git push origin 'Main'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
TrustNo1/Darner!511
No description provided.