# Buzzing Noise When Using SDL\_RenderPresent on Linux

**URL:** <https://discourse.libsdl.org/t/buzzing-noise-when-using-sdl-renderpresent-on-linux/51224>\
**Category:** Game Development\
**Created:** [May 16, 2024, 1:00am UTC](https://discourse.libsdl.org/t/buzzing-noise-when-using-sdl-renderpresent-on-linux/51224 "2024-05-16T01:00:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomuxs](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/t/8dc957/32.png) [@Tomuxs](https://discourse.libsdl.org/u/Tomuxs)\
**Post date:** [May 16, 2024, 1:00am UTC](https://discourse.libsdl.org/t/buzzing-noise-when-using-sdl-renderpresent-on-linux/51224/1 "2024-05-16T01:00:41Z")

</div>

I do not know if this is a bug in SDL or just my laptop playing tricks, hence I’m posting it here.

I’m using SDL 2.30.3-1 on Linux, and I’ve encountered a strange issue:

- Problem Description:

- What I’ve Tried:

- System Details:

Do you have any ideas about what might be causing this buzzing noise?

---

<div class="post-metadata">

**Author:** ![anon914446](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@anon914446](https://discourse.libsdl.org/u/anon914446)\
**Post date:** [May 16, 2024, 4:01am UTC](https://discourse.libsdl.org/t/buzzing-noise-when-using-sdl-renderpresent-on-linux/51224/2 "2024-05-16T04:01:40Z")

</div>

It would help us to see the code.  
[edit out of 2 non-helpful questions that were already answered in OP]

When you say it’s a buzzing noise:

1. Does the noise still happen on headphones or with bluetooth speakers? → (if the buzz stops then this points toward the sound card being an issue)
2. Is the noise from the speakers strong and loud (full volume) or is it a lower volume than that?

---

<div class="post-metadata">

**Author:** ![yataro](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/y/6de8d8/32.png) [@yataro](https://discourse.libsdl.org/u/yataro)\
**Post date:** [May 16, 2024, 8:21am UTC](https://discourse.libsdl.org/t/buzzing-noise-when-using-sdl-renderpresent-on-linux/51224/3 "2024-05-16T08:21:39Z")

</div>

> [@Tomuxs](#):
>
> Calling SDL\_RenderPresent causes my laptop to make a buzzing noise.

Most likely due to the use of the video card. There’s a lot of articles in web about this, you should test your laptop with some GPU testing software to confirm this.

> [@Tomuxs](#):
>
> No buzzing occurs when calling SDL\_UpdateWindowSurface.

It’s using software rendering, probably confirms the theory about the video card 😁

Like you said, you are not using audio and the problem is showing up in other SDL apps. Looks like a hardware issue for me, not critical though.

---

<div class="post-metadata">

**Author:** ![Tomuxs](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/t/8dc957/32.png) [@Tomuxs](https://discourse.libsdl.org/u/Tomuxs)\
**Post date:** [May 16, 2024, 4:01pm UTC](https://discourse.libsdl.org/t/buzzing-noise-when-using-sdl-renderpresent-on-linux/51224/4 "2024-05-16T16:01:49Z")

</div>

> [@Tomuxs](#):
>
> Non-SDL programs do NOT produce the buzzing sound.

Non-SDL programs do produce the buzzing sound, but it’s barely noticeable at 60 FPS. I tested it with an empty GLFW program using OpenGL with high framerate, and the buzzing was very obvious.

> [@anon914446](#):
>
> Does the noise still happen on headphones or with bluetooth speakers? → (if the buzz stops then this points toward the sound card being an issue)

Yes, but the buzzing is not effected. Even if I disable the audio device, the buzzing persists in the left build-in laptop speaker.

> [@anon914446](#):
>
> Is the noise from the speakers strong and loud (full volume) or is it a lower volume than that?

It is silent, and barely noticeable with the fans spinning.

> [@yataro](#):
>
> Looks like a hardware issue for me, not critical though.

It most certainly is, due to the buzzing not just appearing in SDL, and not present at all on Windows.

* * *

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![yataro](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/y/6de8d8/32.png) [@yataro](https://discourse.libsdl.org/u/yataro)\
**Post date:** [May 16, 2024, 4:17pm UTC](https://discourse.libsdl.org/t/buzzing-noise-when-using-sdl-renderpresent-on-linux/51224/5 "2024-05-16T16:17:33Z")

</div>

> [@Tomuxs](#):
>
> and not present at all on Windows.

Windows may use integrated videocard for your app, or just got a better videodriver. Good starting point for research is “coil whine” search query. I’ve found a reddit thread for your laptop (may not be the same model tho) [https://www.reddit.com/r/AMDLaptops/comments/rsnrv3/lenovo\_ideapad\_5\_pro\_14\_coil\_whineelectrical/](https://www.reddit.com/r/AMDLaptops/comments/rsnrv3/lenovo_ideapad_5_pro_14_coil_whineelectrical/)

---

<div class="post-metadata">

**Author:** ![Tomuxs](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/t/8dc957/32.png) [@Tomuxs](https://discourse.libsdl.org/u/Tomuxs)\
**Post date:** [May 16, 2024, 5:09pm UTC](https://discourse.libsdl.org/t/buzzing-noise-when-using-sdl-renderpresent-on-linux/51224/6 "2024-05-16T17:09:21Z")

</div>

My laptop does not have a dedicated graphics card. I suspect a faulty driver writing to audio memory, as suggested here: [[SOLVED] - Graphics card buzzing noise when playing games | Tom's Hardware Forum](https://forums.tomshardware.com/threads/graphics-card-buzzing-noise-when-playing-games.3382462/).

> [@yataro](#):
>
> Good starting point for research is “coil whine” search query.

I read about “coil whine” on [wikipedia](https://en.wikipedia.org/wiki/Electromagnetically_induced_acoustic_noise), and it suggests electromagnetic forces effecting other parts such as fans or speaker magnets.

If I recall correctly last time I have disassembled my laptop, those parts did not seem to be near enough APU to be effected.

* * *

Thanks for the help! I don’t see it as an issue thou, due to the buzzing being so quiet. It was noticeable because I forgot to limit the framerate of my game 😅.

I think that it’s funny that the pitch can be controlled by setting different framerates.
