Rus Articles Journal

We reduce software the noise published by the computer

the Author: Maxims hatchet Field

When the speech comes about decrease in the noise level published by the iron friend, people usually begin to speak about low-reverse coolers, hard drives on the sled, water cooling systems and other things far from the world of software. But today we will talk about noise as about a problem of program character what settings and by means of what utilities can be made in Linux that the car became rather silent.

All of us know that there are exactly three main sources of the noise published by the iron friend: coolers in the case, a cooler on the video card and the hard drive which is constantly driving heads on all surface " pancakes;. Therefore, there are three possible ways of decrease in noise level: impact on the speed of rotation of coolers of the case, decline in production of a video subsystem and optimization of operation of the hard drive. Let`s begin as it is necessary, with the first.

The Case of the modern computer can contain coolers

from one to four (possibly more) coolers, all depends on the imagination and whims of its owner or on the producer. Usually only three of them are connected to the motherboard thanks to what the last has an opportunity to control the speed of their rotation. All others poklyuchayutsya directly to the power supply unit therefore always work at full speed (if, of course, have no analog regulators of rotation on the case). Respectively, it is necessary for us for receiving the silent system unit:

To relieve the case of numerous coolers. If in your sistemnik it is not established four the hard drive and two video cards, there is no sense in them just, and in the majority of standard systems there will be enough also fans on the processor and the power supply unit.

to Reduce cpu productivity that will lead to decrease in internal temperature of the case and speed of rotation of its cooling coolers (first of all the processor fan).

Manually to reduce the speed of a cooler and to risk life of the processor and other accessories of a sistemnik.

You have to be already familiar with the screw-driver therefore we will pass the first point and we will dwell upon the last two.

is traditional for management of processor frequency in OS Linux the catalogs / proc files and / were applied by sys. Having written down a certain value in one of them, it was possible to transfer cpu (processor) to the energy saving mode therefore the motherboard itself lowered quantity of turns of the fan. This approach works and now, for example:

$ cat/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

by means of this team can be learned about current state of energy saving, and by means of following - to change it:

# echo conservative>/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

of All the cpufreq catalog contains 11 files, changing contents of which, you will be able to operate processor frequency very flexibly. Their list and descriptions are provided further:

$ ls - 1/sys/devices/system/cpu/cpu0/cpufreq

affected_cpus - the list of processors which frequency will be changed

of cpuinfo_cur_freq - the current frequency of the processor in KHZ

of cpuinfo_max_freq - the greatest possible frequency of cpuinfo_min_freq

processor - minimum possible frequency of scaling_available_frequencies

processor - the list of admissible frequencies of the

processor scaling_available_governors - the list of admissible

regulators scaling_driver - the used driver of management of the frequency

of scaling_governor - the used scaling_max_freq

regulator - the maximum frequency of the processor admissible for installation by scaling_min_freq

regulator - the minimum frequency of the processor, admissible for installation by scaling_setspeed

regulator - is intended for change of frequency of the processor

there are two key moments relating to change of clock frequency of cpu in OS Linux which should be remembered once and for all:

1. Technologies of management of frequencies and energy saving improve with an exit of each new model of the processor, irrespective of its brand. Therefore almost each cpu model has own driver which needs to be loaded into memory to have an opportunity to change files of the cpufreq catalog. Here the list of the most used modules:

acpi - cpufreq - change of a condition of the processor means of ACPI (P - States Driver)

of p4 - clockmod - Pentium 4

speedstep - centrino - Pentium M

speedstep - ich - Pentium III - M, P4 - M, ICH2/ICH3/ICH4

speedstep - smi - Pentium III - M, 440 BX/ZX/MX

of powernow - k6 - AMD K6

powernow - k7 - AMD Athlon

powernow - k8 - AMD Opteron, Athlon 64, Athlon64X2, by Turion 64

cpufreq - nforce2 - change of frequency means of a chipset of nVidia nForce2 (change of FSB irrespective of PCI/AGP frequency)

In many distribution kits all these modules are built in a kernel therefore it is not necessary to select the suitable candidate manually.

2. For automatic control of the frequency of the processor regulators - program algorithms which change processor productivity depending on any conditions are used. The last kernels of Linux provide five various regulators for all occasions:

performance - the regulator used by default forces to work the processor with the maximum frequency.

of ondemand - changes the clock frequency of cpu depending on load of an operating system.

of conservative - the analog of ondemand differing in smooth change of frequency of the processor (it is actual for laptops as allows to preserve battery resources).

of powersave - always exposes the minimum frequency of the processor.

of userspace - does not do anything, allowing the user to expose frequency independently.

In some distribution kits regulators can be taken out in separate modules therefore before use they should be loaded into memory by means of team it seems:

# modprobe cpufreq_ondemand

the regulator can be activated Further by record of his name in the scaling_governor file:

# echo ondemand>/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

In our case can appear useful all four last regulators. The algorithm of ondemand will approach when only temporary reduction of noise of the fan, for example is required at night when torrents shake, and the computer stands idle. The last two algorithms will be useful to all who want constant silence. And, in case of activation of the userspace regulator, frequency should be written down independently in the scaling_setspeed file:

# echo 1000>/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed

Value should be taken from the scaling_available_frequencies file. Not to kill the keyboard, gathering long ways to the operating files after each reset, I advise to install the cpufrequtils package available in any distribution kit. Including in Debian/Ubuntu:

$ sudo apt - get install cpufrequtils

After installation start the cpufreq team - info which will output all information on current settings: driver, regulators, range of frequencies etc. For change of the regulator use the following team:

$ sudo cpufreq - set - g powersave

Frequency changes by means of a flag `-f`:

$ sudo cpufreq - set - f 1. 22 GHz

For change of the regulator installed during initialization of system enter his name in the line GOVERNOR file / etc/init. d / cpufrequtils (ondemand is by default used).

All these actions have to lead to decrease in clock frequency of the processor and reduction of the noise level published by its fan. However in certain cases it will not work, and it is necessary to use special programs for a speed control of rotation of a cooler.

One of such programs bears the name fancontrol and extends together with a lm package - sensors. To begin to use it, it is necessary to establish lm - sensors, using the manager of packages and to start the standard utility of a configuration of sensors - detect. It is possible to answer questions with pressing safely. Having come to the question Do you want to add these lines automatically? write yes, copy the names of modules given in a question and feed them to the modprobe team. In my case the team turned out such:

$ sudo modprobe i2c - nforce2 asb100 w83l785ts

to check operability of sensors, execute the sensors command. On the screen you have to see the mass of information removed from the most different sensors. Pay attention to the lines CPU Fan and CPU Temp in them the current speed of rotation of a cooler and temperature of the processor is specified. For certain the speed of a cooler will be very high (over 4000 turns), and processor temperature - very low (it is much lower than 60 degrees). All this indicates irrational use of the fan. To correct a situation, it is necessary to involve the demon of fancontrol who will regulate tension given on the fan, changing it depending on the current temperature of the processor. The demon demands settings, specific to this car, therefore before his start we will use a script of pwmconfig which will generate a working configuration.

Start pwmconfig and press a key in response to any questions. When the configuration is complete, and on the screen the line " will appear; Select fan output to configure, or other action: enter into the answer figure 1 also follow further instructions. The most important - the first question, a script will demand to choose the temperature sensor which will influence cooler speed. Personally I received five various options which are not identified in any way except the current value thanks to which it was succeeded to define the correct option. It was the second, most likely, in your case will be also. Further the script will ask to choose ranges of temperatures and speeds, answer, defoltovy values more than are reasonable.

After the end of interrogation pwmconfig will create the configuration file, and you, at last, will be able to start the demon of fancontrol:

$ sudo/etc/init. d / fancontrol start

Should noting that fancontrol will approach not all cars (generally it concerns various laptops and netbooks) therefore it is necessary to look for the special program for the device. For example, for management of coolers on the Acer Aspire One netbook the utility of acerhdf can be used (www. piie. net/? section=acerhdf). The utility for the Sony Vaio laptop is called Fan Silencer (www. taimila. com/fansilencer. php). Pogugliv, you for certain will be able to find similar utilities and for the laptop.

The

video adapter So, in the case it seems dealt with coolers, now it is necessary to make something with the fan on the video card which sometimes appears even more noisy, than all others. Actually here everything is much simpler: the good video adapter itself changes the speed of rotation of the cooler, based on indications of the temperature sensor of the video chip which heats up only during active work (that is games or use 3D - editors). Big part of time the video chip stands idle, and its cooling fan has to work at the lowered turns. If it does not occur - it is time to address special utilities.

If you have a video card from nVidia, then for management it from Linux can use the remarkable utility of nvclock (www. linuxhardware. org/nvclock). It allows not only to change working frequencies of the video chip and memory, but also to make a set of other actions, including regulation of speed of rotation of the fan.

For a start start the utility with a flag `-i` and look at a conclusion in the section - - Sensor info - - there you have to see the current temperature of a graphic kernel and speed of rotation of a cooler as a percentage. Further it is possible just to start nvclock with flags `-f` and `-F` to change cooler speed:

$ sudo nvclock - f - F 60

Value has to be ranging from 10 to 100 with a step 10. Notice that not each vidyukha will allow you to make such operation.

The hard drive

There now, it was necessary to pacify the store. By the way, modern screws almost do not rustle and to hear them even behind a low-reverse cooler quite not easy. However, if you are an owner of the system equipped with old hard drives - the constant crash has to be to you well a sign and is not less well heard. How to get rid of it?

For a start we will try to understand that there is this crash. Soaring over plates of the hard drive, heads do many movements, constantly changing the direction of the movement. At the moments of fixing of a head over a plate or changes of its movement there is a characteristic crash published by mechanics. Therefore the best way to force a disk to crack less - to make so that movements of a head were minimized. It can achieve in three ways:

To disconnect a swap that at shortage of memory the kernel did not address the hard drive, and applied other methods of its clarification. by

to Make file system less fragmented, then when reading the file the head will not rush about between paths in search of parts of the file. to Make

so that dumping dirty FS buffers occurred less often, in this case record on a disk will be carried out breakthroughs with wide intervals between record operations.

The first way is radical, but at enough random access memory is quite justified. To make a disk less noisy with its help, it is necessary just to clean the corresponding line from file / etc/fstab (the word swap the third column).

The second way includes use of the least subject to fragmentation of file systems, such as ext4, and special defragmentator which will allow to collect the pieces of files scattered on a disk in one continuous block. Do not trust those who say that in Linux file systems are not fragmented, it is simply impossible without loss of notable quantity of free space of a disk. Both ext2, and ext4, and reiserfs is subject to fragmentation, everyone, of course, in different degree and it is far not so brightly expressed as FAT, but nevertheless.

For defragmentation of any file system it is possible to use universal defragmentator, for example defrag (kolivas. org/apps/defrag) or Shake (net/shake). Let`s try to apply the second as more advanced and productive option.

We pass to an official page of the project and we download the latest version of an installer (shake - 0. 99. 1 - Linux. sh), we do it executed and we start. Most likely, some dependences so they should be established manually will not be considered. Users of Debian and Ubuntu can install the program by means of apt, the corresponding instructions are provided on stranichkenet/apt.

After the end of installation execute the following command to begin process of defragmenting of the specified catalog:

$ sudo shake - pvv/way / to / the Program Operating Time catalog

can make from 5 to 15 minutes depending on the number of files and the size of the catalog.

the Third way more preferable and is more effective than the others. The best way to make a disk silent - it is simple to deprive of it work. For this purpose it is possible to use the so-called postponed record on a disk. Any operating system (except absolutely simple) does not make record on a disk right after data recording in the file. At first information gets to the buffer in which certain time is stored, and only then registers directly in the hard drive. So it is possible to lift significantly productivity of a subsystem of input-output and to make process of record on a disk more uniform and consecutive. All this interests us so far as Linux differs in what allows to set independently an interval between dumpings of these most dirty buffers. It becomes by means of record of values in the catalog / proc/sys/vm files listed in the following table:

$ ls - 1/proc/sys/vm

laptop_mode (120) - how many seconds dolzhbut to pass between the beginning of reading any data and dumping of dirty buffers on a disk (if after data reading the disk stopped earlier all the same was untwisted why at the same time not to dump buffers?) .

of dirty_writeback_centisecs (12000) - time quantum between checks on existence of dirty buffers.

of dirty_expire_centisecs (12000) - through how many milliseconds to consider buffers rather dirty for record on a disk.

of dirty_ratio (10) - the maximum percent of memory used for storage of dirty buffers (at excess they will be dumped).

of dirty_background_ratio (1) - the minimum percent of memory used for storage of dirty buffers.

It is hard to say what values will be optimum in a concrete case. In brackets values which will allow to postpone the moment of dumping of buffers for rather long period of time are specified.

If the car exempted by you from noise does not use often the hard drive, you can adjust the energy saving mode at which the hard will be disconnected for the period of inaction. It is possible to make it by means of the famous utility of hdparm. For example, so:

$ sudo hdparm - B 1-S 12/dev/sda

Option `-B 1` includes most aggressive energy saving level. In total them 254, with 1 on 127 of which differ in the fact that lead to a winchester stop in case of need. The option `-S 12` is time after which the hard drive will stop a spindle. 255 values are provided: with 1 to 240 are just multiplied by 5 seconds, and 0 - disconnects a spindle stop.

a method, Less pernicious for the hard drive, consists in activation of the so-called Automatic Acoustic Management function thanks to which the positioner of heads will publish much less noise, at the price of insignificant reduction in the rate of positioning of heads (that, however, leads to decline of productivity of a disk on average by 10%). Function is available in the majority more - less modern hard drives and can be included by means of the same hdparm. For example:

$ sudo hdparm - M 128/dev/sda

This team activate the most silent operating mode of the winchester, value 254 is assigned to the fastest. Choosing value between these two thresholds, you will be able to pick up an optimum ratio noise/speed, but remember that the majority of hard drives really supports only two or three modes (for example, 128 - it is silent, 254 - quickly, everything that between, will or not to work at all, or to activate one of two modes).

And silence

As you could be convinced, reduce the level of the noise created by the computer programmatically not only it is possible, but also it is necessary. In most cases it will be quite enough to receive the number of decibels which is not irritating your hearing without the need for acquisition of expensive coolers and cases.