openal-soft icon indicating copy to clipboard operation
openal-soft copied to clipboard

Audio crackling when emerging from the water in Serious Sam: TFE

Open Matthaiks opened this issue 3 years ago • 2 comments

Level "Oasis"

https://user-images.githubusercontent.com/3577122/150838550-c8d359ab-c0ca-4f70-ab09-308a393269b4.mp4

It sounds fine when using Creative ALchemy.

Matthaiks avatar Jan 24 '22 18:01 Matthaiks

I checked and, in fact, it happens to me too. I have no idea if it's an OpenAL Soft or DSOAL problem.

Kappa971 avatar Jan 28 '22 12:01 Kappa971

Probably OpenAL Soft. There's a bunch of feedback loops and filters in a reverb effect, and when certain reverb parameters change, various delays and filters are adjusted which can cause a discontinuity in the sample stream, introducing a click or pop that runs through the feedback loop as a bit of static. The effect does try to account for this by fading the feedback delay taps, but it's possible it's still a bit too fast. Also, the change in filter parameters are not interpolated, so the shelving and all-pass filters can still introduce discontinuities when changed.

Other implementations of this kind of reverb that I've seen/heard seem to somehow maintain the old reverb along with the new one. Essentially the reverb for the previous parameters hangs around as the last bit of audio it's given decays (where it will presumably stop after a time when it fades out to a sufficient level), while the new reverb starts up and runs along side it. However, aside from the fact that this kind of behavior would essentially mean a single reverb effect can have multiple concurrent reverb processing loops, it's also not obvious how it would handle rapid continuous changes to reverb with long reverb decays, as there has to be a limit on the number of processing loops it can deal it.

So there's obviously something I'm missing or overlooking. It can't be as basic as just changing the delay tap positions and filter parameters in the middle of an audio stream (very noticeable discontinuities). It can't be as simplistic as running the old and new reverbs concurrently until the old one finishes decaying (potentially heavy processing load and various edge cases). But despite how much the current implementation tries to manage fading things, it still can get audible discontinuities sometimes.

kcat avatar Jan 28 '22 13:01 kcat

As an update to this, with commit ab19694f6027303ad548e15998dd6d18437fad7b, changes between reverb environments should work better.

kcat avatar Jan 22 '23 05:01 kcat