Browse Source

[audio_core] Fix audio reverb effect (#2646)

This fixes the audio reverb effect that was causing loud noise in some games and on some platforms.

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2646
Co-authored-by: MaranBr <maranbr@outlook.com>
Co-committed-by: MaranBr <maranbr@outlook.com>
pull/2624/head
MaranBr 3 months ago
committed by crueter
parent
commit
1a5b3fb239
No known key found for this signature in database GPG Key ID: 425ACD2D4830EBC6
  1. 12
      src/audio_core/renderer/behavior/info_updater.cpp
  2. 2
      src/audio_core/renderer/command/effect/reverb.cpp

12
src/audio_core/renderer/behavior/info_updater.cpp

@ -165,12 +165,6 @@ Result InfoUpdater::UpdateEffectsVersion1(EffectContext& effect_context, const b
reinterpret_cast<EffectInfoBase::OutStatusVersion1*>(output), effect_count}; reinterpret_cast<EffectInfoBase::OutStatusVersion1*>(output), effect_count};
for (u32 i = 0; i < effect_count; i++) { for (u32 i = 0; i < effect_count; i++) {
#ifdef _WIN32
// There's a bug in Windows where using this effect causes extreme noise. So let's skip it.
if (in_params[i].type == EffectInfoBase::Type::Reverb) {
continue;
}
#endif
auto effect_info{&effect_context.GetInfo(i)}; auto effect_info{&effect_context.GetInfo(i)};
if (effect_info->GetType() != in_params[i].type) { if (effect_info->GetType() != in_params[i].type) {
effect_info->ForceUnmapBuffers(pool_mapper); effect_info->ForceUnmapBuffers(pool_mapper);
@ -218,12 +212,6 @@ Result InfoUpdater::UpdateEffectsVersion2(EffectContext& effect_context, const b
reinterpret_cast<EffectInfoBase::OutStatusVersion2*>(output), effect_count}; reinterpret_cast<EffectInfoBase::OutStatusVersion2*>(output), effect_count};
for (u32 i = 0; i < effect_count; i++) { for (u32 i = 0; i < effect_count; i++) {
#ifdef _WIN32
// There's a bug in Windows where using this effect causes extreme noise. So let's skip it.
if (in_params[i].type == EffectInfoBase::Type::Reverb) {
continue;
}
#endif
auto effect_info{&effect_context.GetInfo(i)}; auto effect_info{&effect_context.GetInfo(i)};
if (effect_info->GetType() != in_params[i].type) { if (effect_info->GetType() != in_params[i].type) {
effect_info->ForceUnmapBuffers(pool_mapper); effect_info->ForceUnmapBuffers(pool_mapper);

2
src/audio_core/renderer/command/effect/reverb.cpp

@ -191,8 +191,6 @@ static void InitializeReverbEffect(const ReverbInfo::ParameterVersion2& params,
const auto center_delay_time{(5 * delay).to_uint_floor()}; const auto center_delay_time{(5 * delay).to_uint_floor()};
state.center_delay_line.Initialize(center_delay_time, 1.0f); state.center_delay_line.Initialize(center_delay_time, 1.0f);
UpdateReverbEffectParameter(params, state);
for (u32 i = 0; i < ReverbInfo::MaxDelayLines; i++) { for (u32 i = 0; i < ReverbInfo::MaxDelayLines; i++) {
std::ranges::fill(state.fdn_delay_lines[i].buffer, 0); std::ranges::fill(state.fdn_delay_lines[i].buffer, 0);
std::ranges::fill(state.decay_delay_lines[i].buffer, 0); std::ranges::fill(state.decay_delay_lines[i].buffer, 0);

Loading…
Cancel
Save