On Dell Inspiron 7559 there is electric buzzing from beneath the keyboard that changes frequency when I touch the touchpad.

However, if the CPU is busy I hear no buzzing as the frequency gets out of my hearing range.

I was hoping to run a script to keep CPU busy enough and keep the laptop silent, something like this:

recursiveDelay(){ sleep 0.001; recursiveDelay;}

But it gradually get's the CPU percent higher and higher.

How could I keep it at a certain percent?

  • 2
    Haha, this is a horrible hack. Figure out the problem instead. Almost as bad as xkcd: Workflow. – pipe Apr 25 '16 at 10:13
  • I agree, but I can't and I can't change the hardware, so I just want to hack it. – Radivarig Apr 25 '16 at 10:19
  • 6
    Have you considered opening the machine up and checking what makes it buzz? You seem to be looking for a software solution to a mechanical problem. I'm guessing that cleaning the fan will fix this. – terdon Apr 25 '16 at 10:47
  • The fan has nothing to do with this and I cannot fix it mechanically. – Radivarig Apr 25 '16 at 13:56

What's probably happening is that the CPU goes into a more aggressive power-save mode. This causes the internal switch-mode voltage regulators to go into a pulse-skipping mode, moving the switching frequency down to the audible range. The noise comes from the inductors and capacitors, both being slightly microphonic (which also works in reverse; the emit sound)

It's a lousy design, but you're stuck with it.

The "best" way to solve it is to go into BIOS and configure your CPU for a less aggressive throttling. This would prevent all the fancy power saving modes to kick in, so you don't have to mess with these tasks.

Another way is to run a useful task, for example SETI@Home or some other thing you might want to do. I think SETI@Home can set a CPU limit percentage, but if not, you may be able to use the cpulimit linux command.

The least interesting way is to just burn up cycles with one of the stress-test utilities. techraf already suggested stress-ng, and there are a few other similar utilities.

If you can not find a utility with a fine-grained enough throttle, I whipped up this perl one-liner for you. The throttling can be tweaked. I use perl because that's what I know. Insert your favourite programming language.

perl -MTime::HiRes=sleep -e 'sleep 0.0001 while 1'

Changing the 0.0001 part will make it use more or less CPU.

  • I've read about power-saving modes and unfortunatelly my BIOS has no options for it. I have Dell Inspiron 7559. Also, I thought about the mentioned tasks as I have it running when my PC is idle, but I want it to be simple and of constant complexity. – Radivarig Apr 25 '16 at 10:36
  • @Radivarig I tried a small perl script that hopefully does what you want with enough granularity. Works fine on my machine at least. – pipe Apr 25 '16 at 10:51
  • 1
    Perfect! The perl script takes 1% of CPU and removes the buzzing completely. Thanks! – Radivarig Apr 25 '16 at 11:02

On Debian or Ubuntu install stress-ng with apt-get install stress-ng.

Then run:

stress-ng -c 1 -l 50

playing with -c (number of CPUs) and -l (percentage load) parameters.

For Fedora/RedHat/CentOS it seems you have to compile it (source repository is here) with the following procedure:

wget http://kernel.ubuntu.com/~cking/tarballs/stress-ng/stress-ng-0.05.25.tar.gz
tar zxvf stress-ng-0.05.25.tar.gz
cd stress-ng-0.05.25/
./stress-ng -c 2 -l 50
  • This keeps the CPU around given percentage based on top, but it seems it doesn't keep it busy consistently as I get a periodic on/off noise. – Radivarig Apr 25 '16 at 10:30
  • Maybe you need to run two instances in counterphase ;) – techraf Apr 25 '16 at 10:39

Not the answer you're looking for? Browse other questions tagged or ask your own question.