Skip to content

Conversation

@fentbuscoding
Copy link
Contributor

This pull request introduces several improvements to the audio backend, focusing on more accurate and higher-quality audio processing, smoother transitions, and better volume control. The main changes include enhancements to volume application and normalization, improved resampler settings for higher audio fidelity, and more user-friendly volume adjustment behavior.

Audio Processing Improvements:

  • Added fast paths for unity gain and mute in apply_volume_static, improving performance and precision when volume is unchanged or set to zero. Also, improved floating-point comparison in apply_volume to avoid infinite loops and ensure accurate volume ramping. [1] [2]
  • Enhanced normalization in normalize by introducing soft clipping for smoother distortion and better dynamic range handling, reducing harsh audio artifacts.

Audio Quality Enhancements:

  • Updated resampler settings in audio_resampler to prioritize audio quality over latency by increasing sequence length, improving overlap and seeking window, disabling quick seek, and enabling anti-aliasing filtering.

Volume Control Improvements:

  • Implemented non-linear volume scaling in audio_utils.cpp for more precise control at low volumes and faster adjustment at high volumes, resulting in a more natural user experience.

Code Quality and Consistency:

  • Refactored several methods in AudioBackend to use consistent formatting and clearer logic, and increased VOLUME_CHANGE_DURATION for smoother volume transitions. [1] [2] [3]
  • Added missing includes and improved formatting for better maintainability. [1] [2] [3]

Copilot AI and others added 5 commits September 16, 2025 22:49
… control, and improved normalization

Co-authored-by: fentbuscoding <[email protected]>
…t paths, and better float comparisons

Co-authored-by: fentbuscoding <[email protected]>
…36-abe3-da1f5299af0e

Improve audio quality with enhanced resampling, volume control, and normalization
@elad335 elad335 self-requested a review September 22, 2025 04:12
if (vol_incr >= 0)
{
for (sample_idx = 0; sample_idx < sample_cnt && crnt_vol != param.target_volume; sample_idx += param.ch_cnt)
for (sample_idx = 0; sample_idx < sample_cnt && (param.target_volume - crnt_vol) > epsilon; sample_idx += param.ch_cnt)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically because std::min and and std::max are exact, this is is not needed. But it's not a blocker.

@elad335 elad335 merged commit 6bc6904 into RPCS3:master Sep 22, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants