CRITICAL - audio sample rate issue Unreal 5.4.3 - Switch build

Description:
We are encountering an intermittent but persistent audio issue on a Nintendo Switch build created with Unreal Engine 5.4.3. Occasionally, the audio playback drops in sample rate, resulting in a pitch shift and slowed/stretch playback. While the issue cannot be systematically reproduced, once it occurs, it persists until the game is either restarted or the player exits to the Nintendo Switch main menu and reopens the game. This temporary fix is the only known way to resolve the issue.


Reproduction Steps (Intermittent):

  1. Build the game using the default platform-specific settings for Nintendo Switch.
  2. Launch the game on a Nintendo Switch device.
  3. Play the game and observe audio playback. The issue occurs intermittently and inconsistently, but once it manifests, it persists until the game is restarted or reopened via the Switch main menu.

Details:

  • Audio Format: All audio files are WAV PCM 48kHz 24-bit.
  • Compression: Bink audio compression with default parameters.
  • Attempted Fixes:
    1. Clamping the resampling rate to 48kHz in platform-specific settings: No improvement.
    2. Increasing chunk size and memory allocations: No improvement.
    3. Debugging CPU performance: No issues found.
  • File Specs: Audio files are a maximum of 3 minutes in length and 70MB in size. No channel or memory limits were exceeded.
  • Temporary Fix: The only way to momentarily resolve the issue is to exit to the Nintendo Switch main menu and reopen the game, or restart the game entirely.

Observations:

  • Inconsistent Onset: The issue does not always occur and cannot be systematically reproduced. However, it happens frequently enough to disrupt gameplay.
  • Persistent Behavior: Once the issue begins during a session, it remains active until the game is restarted or reopened via the Switch main menu.
  • Similar Issue Reference: The problem resembles one reported on the forums here: Critical: Audio Sounds Choppy on Switch. However, our symptoms specifically involve sample rate and playback speed issues rather than choppiness.
  • Platform-Specific Settings: We used the default platform-specific settings for Switch, with no success in identifying a root cause through configuration changes or debugging.

Request:
We are requesting assistance to identify and resolve the root cause of this issue. Given its critical nature and the lack of a systematic workaround, we urgently need guidance on potential fixes or debugging steps to mitigate this problem.

Thank you for your support.

Good morning, @afederici !

I hope all is well.

Have you been able to resolve the issue?

I’ve checked the post you shared where another user was having a related issue, and it appears his issue creates choppy audio playback (very likely related to CPU stutters).

The issue you’ve described is indeed a bit strange. It would seem as if the sample rate may be changing halfway through a testing session. It’s a bit difficult to provide a clear solution or recommendation without profiling data, but I could provide some thoughts and potential tests that may help pinpoint and fix the issue! First, a couple questions:

1.- Are you running the game’s audio natively or using audio middleware (FMOD/Wwise/etc.)?
2.- Would you mind providing profiling data that corresponds to the issue occurring?
3.- Would you mind sharing the audio settings for your Switch exports?

Unfortunately, the Nintendo Switch’s audio playback+processing capabilities remain a bit restrictive in comparison to PC and other consoles (particularly CPU-bound operations)… As a result, you may want to restrict active voice count/max concurrent voices more aggressively than other platforms.

I’d check profiling data (session frontend in UE5, or audio middleware profilers) before and after the issue triggers in order to find potential triggers. I’d particularly hunt for active voice counts being particularly high, as a well as on-the-fly conversions / resampling of audio events during runtime (further adding to CPU costs).

Could experiment with a sample rate of 44.1kHz, and ensuring similar platform settings when creating a Switch build. Would also double check the audio asset format for the files present in the project.

Worth checking out!:

Hope this is of some use. Happy to delve deeper!

Kindly,
Eric

Hi,

Thanks for your reply.

We don’t use any middleware but we do use several dynamic pitch automations on SFX in UE5.

I was thinking the same, since this doesn’t happen on PC builds but only on switch, the hardware can’t handle multiple SFX played at the same time while changing pitch on others and the sample rate goes out.

Since we use pitch automations a lot and we cannot change this implementation, what’s the best way to solve this in your opinion? Putting a cap on the multiple voices that can be played at the same time?

Thanks

Hi, @afederici !

Glad to hear from you and hoping all is well!

Regarding next steps, I’d likely start by capping active voice counts on the Switch’s build using UE5’s concurrency settings, as well as its priority system + resolution rules. Would recommend testing with restricted voice counts (~10-20 max) and then increase a tad if the culling becomes too noticeable. We’ll want to play a careful balancing act between gaining enough performance overhead and culling the less noticeable parts of the soundscape.

For example, I’d set music and your main ambient bed(s) as high priority (will always play - as it’s very noticeable when missing and can help mask culling).

Then, establish the next tier/priority group. For example, player sounds (within these, some sounds may be high priority/noticeable), as well as any important pieces of key feedback/game interactions.

This should help reduce CPU load to allow for the additional DSP you mentioned (real time pitch modulations) to help stay within the audio’s performance budget! Would try to stay under 20 active voices while testing.

In addition, Could also consider creating an isolated test map and gradually introduce audio systems to see if the issue lies elsewhere.

One more idea that comes to mind: Would check for memory leaks / lingering components or voices not getting cleaned up or destroyed. Mostly considering as you mentioned “…but once it manifests, it persists until the game is restarted or reopened via the Switch main menu.”

This one you should be able to test on PC with audio console commands:

Basically want to make sure that voices are being destroyed / stopped when they’re supposed to. Would run the game for a while and then try these commands:

au.DumpActiveSounds 1 - get list of all sounds playing
au.Debug.AudioMemReport - generate documents detailing memory usage

Can also try during build:
au.3dVisualize.Enabled 1
au.3dVisualize.ActiveSounds 1

Hoping we can resolve the issue. Wishing you great luck!

Kindly,
Eric