Skip to content

Audio glitches out on audio source with a low playback sample rate in a project with LPF that has higher than 16kHz cutoff #102500

Open
@paskausks

Description

@paskausks

Tested versions

Reproducible on Windows 11 Home 23H2 and wine-9.0 (Ubuntu 9.0~repack-4build3), default prefix on Ubuntu 24.04.1 LTS. Both running via editor and Windows export.

Not reproducable on Ubuntu 24.04.1 LTS:

System information

Godot v4.3.stable - Windows 10.0.22631 - Vulkan (Forward+) - integrated Intel(R) Iris(R) Xe Graphics (Intel Corporation; 31.0.101.4032) - 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (8 Threads)

Issue description

First of all, apologies if this has already been reported, but I couldn't find anything similar, or maybe I didn't look well enough.

Also, the title is awfully specific and can probably be made into something more generic. It just represents how I first learned to reproduce it in a stable manner. Feel free to change it as you see fit.

This discovery stemmed from some players of our game experiencing audio issues manifesting as a click and then silence when music should be playing (and audio should be working in general).

One user reported that the issue is reproducable with headphones connected to their Dual Shock 4 controller. Investigating this I eventually discovered that the cause seems to be the sample rate of the Dual Shock 4 controller's audio output - 32 kHz, as reported by Windows combined with our usage of low pass filters with cutoff frequencies above 16kHz (unsurprisingly, half of 32kHz). In our case, the LPF was set to a 20kHz cut off, resulting in the audio click and then audio cutting off entirely, even for busses which didn't use the LPF, like SFX. But using different cutoff rates like 16001Hz produces different glitches.

I also managed to distill this into a MRP, so hope this helps.

For Linux (and wine), i ran it through the native dual shock controller driver, while for Windows I used DS4Windows 3.3.3.0 /w ViGEm Bus Driver 1.22.0 with the default settings.

Case 2

One of our players reports having the issue with these bluetooth headphones. The user has two audio devices both of which correspond to their headphones:

  1. Headset - Peter's Headphones Hands-Free AG Audio: "1 Channel, 16 bit, 16000 Hz (Tape Recorder Quality)"
  2. Headphones - Peter's Headphones Stereo: "2 Channel, 16 bit, 44100 Hz (CD Quality)"

If they pick the first one. Our game emits a click (its just a fast "sweep", I think) and then nothing. If they pick the second one, the audio works fine.

Case 3

Another player using Sony WH-1000XM5 headphones experienced this issue as well. The device had set itself to something called "hands-free AG audio" (pictured below, above the selected default option) which caps the playback sample rate at 16kHz. The result is the same as for the dual shock and the other case I mentioned. When they switched to the "Stereo" output, the playback rate is set at 44.1kHz and the bug doesn't occur anymore.

Image

Steps to reproduce

  1. Connect and install a Dual Shock 4 controller on Windows. This will require installation of DS4Windows. Bluetooth or USB interface doesn't matter. What (I think) matters is its operating sample rate - 32 kHz.
  2. Connect headphones or any other analog audio output to the controller's 3.5mm port. Keep it farther from your ears to preserver your hearing, just in case!
  3. Switch the operating system's default audio source to the controller's.
  4. Launch the MRP either from the editor or exported.
  5. Notice that right after launch, the audio starts to glitch.

I didn't try this out myself, but I assume that you can connect any audio interface which can be set to a sample rate under 44kHz and be able to reproduce it.

Minimal reproduction project (MRP)

dualshock-headhpones.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    For team assessment

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions