Investigating the cause of a buzzing sound coming from headphones only when playing homebrew games

A game developer has shared his story of how he discovered the cause of a strange buzzing noise he encountered in his headphones only when playing
Why are my headphones buzzing whenever I run my game? | Alexandru Ene blog
https://alexene.dev/2025/12/03/Why-do-my-headphones-buzz-when-i-run-my-game.html

Alexandre Aene, an engineer at Amazon who is developing a quarter-view game inspired by games like
Ene's PC environment is 'a reasonably high-performance CPU, an RTX 3090 graphics card, 32GB of memory, and audio via a MODI 2 DAC via USB.' While not particularly high-performance, it's more than adequate for average specs. Another notable feature is that the sound only plays in quarter-view games, not in other games like Fortnite or Overwatch .
Ene initially suspected a power supply issue, thinking the power supply unit was old or had some other issues, but that didn't explain why the issue was occurring in a game that's much less demanding than something like Overwatch.
What Ene noticed was that the buzzing sound didn't occur when nothing was being rendered, which ruled out the possibility that it was caused by CPU processing.

The cause of the problem was incompatibility between the GPU and the game he made. Ene used the Rust programming language and a graphics API for Rust called '
The picking texture is what's used for picking in the game. When you click somewhere on the screen, this texture is used to identify what you clicked on. Instead of a color, each object instance writes its EntityID into the picking texture. Then, when you click the mouse, we check which ID is written to the pixel under the mouse position. At the end of the frame, we copy this picking texture from GPU memory to RAM and check it against the mouse position when a click occurs.
Ene tested disabling each process in the rendering pipeline one by one, and found that the buzzing sound disappeared completely when he disabled the picking texture transfer. Setting the transfer frequency to every 250ms almost completely eliminated the noise, but increasing the frequency increased the sound.

After discussing the issue with other graphics engineers, Ene came up with the hypothesis that the problem might be caused by the GPU being forced to perform a large amount of processing, then pausing it to wait for the texture picking to be transferred, and then restarting it at 100% capacity the next frame. This suggests that the GPU temporarily consumes a large amount of power, which could be causing problems with audio equipment connected to the same power supply. When Ene powered the audio equipment from a separate power source, the buzzing sound disappeared.
Ene implemented a change that stopped transferring the entire texture every frame and instead transferred only the necessary part under the mouse position, which completely eliminated the noise.
On the social networking site Hacker News, some users commented that 'there was a buzzing noise coming from the speakers when playing particularly demanding games, but this was fixed when I stopped powering the console from the same power source as the PC,' and 'many game developers are ignoring the problem by not setting an FPS limit or other measures.'
Related Posts:







