Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programs causing static noise in speakers?

Tags:

c++

opengl

audio

Does anyone know a reason why my programs could be causing my speakers to output some soft static? The programs themselves don't have a single element that outputs sound to anything, yet when I run a few of my programs I can hear a static coming from my speakers. It even gets louder when I run certain programs. Moving the speakers around doesn't help, so it must be coming from inside the computer.

I'm not sure what other details to put down since this seems very odd. They are OpenGL programs written in C++ with MS Visual C++.

Edit: It seems to be that swapping the framebuffers inside an infinite loop is making the noise, as when I stop swapping I get silence...

like image 723
Tony R Avatar asked Mar 01 '23 20:03

Tony R


1 Answers

:)

You will be surprised to know that the speaker input is picking up static from the hard disk. When you do something memory/disk intensive (like swapping framebuffers) so that the hard disk has to rotate fast, the sound will appear.

I had the same problem some years back, I solved it too. But I am sorry that I don't remember how I did it.

Hope the diagnosis helps in remedying the problem.

UPDATE: I remembered. If you are using Windows, go to volume control and mute all the external inputs/outputs like CD input etc. Just keep the two basic ones.

like image 55
euphoria83 Avatar answered Mar 07 '23 14:03

euphoria83