WIP: feat(audio): the game's reverb, delay and biquad filter effects on its sub mixes #1644
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1644
Loading…
Reference in a new issue
No description provided.
Delete branch "TrashPanda/Longshot:feat/audio-effects"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: feat · Risk: medium · Tested on: not run in the game (game-free checks only, Linux) · Needs: Windows and Linux, any GPU: a listen in caves and halls
TL;DR
The game puts reverb, echo and filters on its sound in places like caves, temples and big halls, but Longshot never answered those requests, so everything sounded dry. This PR adds the game's standard reverb, its delay (echo) and its filter on the sub mixes, as the console does. A game-free test runs the effects on made-up sound and passes; nobody has listened to it in the game yet.
Breakdown
HOS_AUDIO_NO_EFFECTS=1gives the dry sound ofmainback.tests/test_audio_effects.pycompiles the real code around authored samples and passes with gcc and clang; not run in the game.Why
The game asks for reverb, delay and biquad filter effects on its sub mixes, and Longshot left those calls unanswered: rooms that should echo (Dodongo's Cavern, the Deku Tree, the Temple of Time) sounded flat. Fixes #123.
What changed
The
nn::audioeffect calls the game makes now do what they do on the console. Ported from Hookshot's 0c1a6d0a and f31d77b2 by Mooseca, with Longshot's names.host/nn_audio.c):AddReverband its setters run through the I3DL2 reverb's network with linear gains (the early mode spacing the reflections, the late mode sizing the lines);AddDelayis a delay line per channel with feedback, channel spread and a low pass;AddBiquadFilterruns the voices' filter on a mix's buffers (mix_biquad_block). They run with the reverbs and Aux effects in the order the game added them, each with a handle kind of its own.GetAudioDeviceOutputVolumeand the voice drop parameter answer floats.gpu/vk/switches.def,docs/development.md):HOS_AUDIO_NO_EFFECTSis new;HOS_AUDIO_NO_REVERBwas there and now gets its line in the docs.tests/test_audio_effects.pywithtests/audio_effects_test.c.Measurements
Verdict: not measured yet: nothing has run in the game. The audio thread's cost with the effects on is the number to take (see Must be tested).
Flags and settings
One new switch,
HOS_AUDIO_NO_EFFECTS, for comparing only;HOS_AUDIO_NO_REVERBwas already there.HOS_AUDIO_NO_EFFECTS=1: the dry sound, asmainHOS_AUDIO_NO_REVERB=1: no reverbTesting
Tested:
python -I -B tests/test_audio_effects.pypasses with gcc and clang (Linux): the reverb, delay and biquad filter on authored samples.Not tested: anything in the game; the whole of
tests/run_all.py(only the audio check was run, at the request of the person I work for).Must be tested:
HOS_AUDIO_NO_EFFECTS=1, expecting an echo with the PR and none with the switch, with no crackle, clipping or sudden loudness (by hand, or Test Farm: @Beanstalk a listen in the Deku Tree and Dodongo's Cavern).longshot_log.txtafter half an hour of play, expecting no audio warnings and no underruns thatmaindoesn't have.Risks
What could break: the sound in rooms the game adds effects to: too loud, clipped, or an echo that doesn't fit; the audio thread doing more work on a slow CPU.
Turning it off:
HOS_AUDIO_NO_EFFECTS=1(all effects) orHOS_AUDIO_NO_REVERB=1(reverb only), or revert the commits.Compatibility: Nothing changes: saves,
longshot_options.ini, the shader and pipeline caches and the vk ABI are as they were.Issues
Fixes #123
Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named). (not run: onlytests/test_audio_effects.py)third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.@Beanstalk Untested in the game so far. Please play about ten minutes inside the Deku Tree and Dodongo's Cavern on Windows and Linux, once with this PR and once with HOS_AUDIO_NO_EFFECTS=1, and report whether the rooms now echo, and any crackle, clipping, sudden loudness or audio underrun lines in longshot_log.txt.
@TrashPanda only members of
BigBeanscan start the farm.One of them can approve this request by reacting 👍 to it or to this comment.This request was for87b1335, and the PR has changed since (4774d50), so a 👍 no longer approves it. Comment@Beanstalkagain to ask for the new commit.87b133593a4774d50347View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.