CPUClock

The choices window


The Choices... dialogue

The choices dialogue has a set of action buttons at the bottom of the window.

The actions available are:

Set
This will use the new settings with immediate effect, and they will be used until they are changed again or until CPUClock is quit.
Save
This will use the new settings, as in Set above, and will also save the settings to disc, so they will be used when CPUClock is run in the future.
Cancel
Close the dialogue and ignore any changes made since it was opened.

At the top of the window are three tabs, labelled Application, Module and Statistics. The first two sections control the application and module specific settings, the third tab settings apply to both the module and the front end.

The settings that can be changed are as follows.


Application tab

The application tab is shown below.

Poll idle delay/cs
CPUClock checks the current speed of the cpu periodically, and writes the value under the iconbar icon, and in to the status window if it is open. The delay between checks can be adjusted using the bump arrors at the right. The value is in centiseconds. The default delay is 100cs (1s). Long delays may miss short bursts of cpu activity, while short delays may actually load the cpu. The temperatures of the cpu and the case (if applicable) are updated at the same time.
Iconbar icon at right
When an application installs an icon on the iconbar, by default it is installed at the left end of the right hand side icons. Thus the position is variable. If you wish to keep an eye on the cpu speed, it might be useful to have the iconbar icon in a relatively constant position. If this is ticked, then the iconbar icon will be installed to the right of the normal application icons (some applications have a high priority for positioning, e.g. the task or display managers, and CPUClock does not install to the right of these). Note that CPUClock will need to be quit and restarted before the change will take place. You will be offered the option of restarting immediately, or waiting.
Iconbar icon text shows
It is now possible to choose whether to show either the continuously updated CPU clock speed or the updated CPU die temperature below the iconbar icon. The two radio buttons CPU speed and Temperature allows you to switch between the two displays. The images below show the two options. The icon image always shows a representation of the cpu speed (fast, slow, or throttled).

Open status on launch
If this is ticked, then CPUClock will open the status window whenever it is first loaded. The position at which it will be opened can be set by moving the status window to the position of your choice, then ticking the option Save position now. If choices are now saved, the current position of the status window will be saved as well. The requirement to tick this option means that the setting is not changed when choices are saved at other times, unless a new position is specifically set. Note that the status window will always be opened at the smaller size.

The CPUClock iconbar icon always gives an indication of the CPU speed and temperature. By default, it shows the CPU clock speed as it changes with cpu load. This can be changed to show the CPU temperature instead (see above). CPUClock can also give a colour coded indication of the cpu temperature status. The next section controls what form this indication takes.

Show colour-coded status
This turns the colour coding on. The colour is shown either as a background to the text under the iconbar icon or as a background to the whole icon. This is set by the two radio icons, Text background and Whole icon. A further option Show low temperature as green toggles between a green background or no background for the low temperature condition. Examples are shown below.
Appearance when Text background is set
Appearance when Whole icon is set
From the left
(1) Cpu at low temperature when Show as green is off. This is also the form of the icon at any cpu temperature when Show colour-coded status is off
(2) Cpu at low temperature and Show as green is on
(3) Cpu at temperature between upper and lower limits
(4) Cpu temperature above upper limit. (Note that the cpu speed has been reduced)


Module tab

The module settings are used to control the operation of the CPUClock module.

The upper part of the Module tab (applicable to all hardware) is shown below.

At the top is an option to set the interval between each read of the cpu temperature. The cpu temperature reading is performed by the module and is quite separate from the poll-idle setting in the GUI front end. The read interval is in units of centiseconds and values between 40 and 300 cs are allowed. The default is 75 cs.

The next section controls how auto temperature control is set up.

Enable auto temperature control
If this option is ticked then CPUClock will enable the cpu temperature regulation in the CPUClock module. The module will reduce the fast speed setting if the temperature exceeds the set maximum value. If it is unticked the module will simply read the cpu temperature (and collect the temperature statistics) but do no cpu speed reduction whatever the cpu temperature rises to.

If the auto temperature control is enabled, then the following settings will influence how the control will be actioned

Maximum temperature/°C
This value (in °C) sets the maximum cpu temperature that is allowed before the cpu speed will be reduced. The maximum working temperature for a particular cpu can be found in the reference manual for the board. However, as a rough guide, 65°C to 70°C is probably a suitable upper limit. 60° would be even safer for long term use.
Differential/°C
This value (in °C) sets the number of degrees by which the temperature must fall below the maximum setting before the cpu speed will be increased again. A setting of 3 or 4°C is usually suitable.
Use rolling average temperature
If the temperature of the cpu die is close to the maximum temperature setting, the short term fluctuations (always present) may trigger the regulation. If this is felt to be a problem, the module can be set to keep a running average of the last four temperature readings. This smooths out the temperature fluctuations to some extent, but at the same time the regulation operation will be slower. The default setting is for there not to be any averaging.

The final option involves the treatment of IRQs during the callback.

Enable IRQs during callback
The CPUClock module registers a callback function that is called periodically by the OS kernel, the time interval being e.g. 1s as set above. This function reads the current temperature of the cpu, and does the processing required to regulate the cpu speed, and hence temperature, and to store the readings as part of the statistics (see below).

The callback function is always entered with IRQs disabled. IRQs are an essential part of the operating system, and should not be disabled for long periods. There may be circumstances when leaving the IRQs disabled causes some problems. For example, on the non-ES Pandaboard, reading the cpu temperature takes a much longer time (orders of magnitude) than on other hardware. If audio is being played at the same time as CPUClock is running, a loud click occurs each time the cpu temperature is read. Streaming the audio requires IRQs to be enabled, and the clicks disappear if the IRQs are enabled within the callback function.

By default, the callback function leaves the IRQs disabled. This option allows IRQs to be enabled or left disabled

Additional settings for Raspberry Pi

The Raspberry Pi can be fitted with a cpu cooling fan, which is driven from the GPIO pins on the board. If this is fitted, then CPUClock can be set up to switch this fan on or off, depending on the cpu temperature. In this case there is a further section in the Module pane to control the fan operation. The relevant section is shown below.

Enable fan control
If this option is ticked then CPUClock will control the fan by turning it on or off as necessary. If this option is not ticked, then CPUClock will do nothing fan related. By default, without any control action, the fan will always be on.

CPUClock cannot detect whether a fan is actually fitted. Thus fan control should not be enabled if no fan is fitted. However, unless something else is connected to the GPIO pin used to control the fan, enabling fan control when no fan is fitted should do nothing, other than waste some cpu cycles.

Fan trigger temperature
The value set here determines the cpu temperature above which CPUClock will turn the fan on. This would normally be set to a value lower than that at which the clock speed would be reduced, so the fan is given the chance to moderate the cpu temperature without reducing the cpu clock speed.
Differential temperature
The value entered here determines how many degrees the cpu temperature must fall below the trigger temperature before the fan is turned off again.

Statistics tab

The statistics settings are used to control how the CPUClock module and front end deal with producing and using the temperature statistics.

The Statistics tab is shown below.

The statistics are produced in two different forms, viz. accumulated values and time stamped values.

Accumulated values
In this case the maximum and minimum temperatures of the cpu are determined over each preset period (see below). The number of occurrences of each temperature value are accumulated, allowing the overall temperature variation of the cpu to be monitored. These values are collected and stored within the module, so data is not lost if the WIMP is not always multitasking.
Time stamped values
This action is carried out by the front end. A file is continuously written by the front end in csv fornat. Each line contains the time stamp, the average, maximum, and minimum temperature vakues, and the percentage throttled. Note that there may be gaps in the output if the wimp enters a single tasking period. This file essentially contains the values shown in the status window, with the addition of the time stamp showing when each set of values were read.

The settings controlling the gathering and display of the statistics are described below.

Statistics accumulation time
This allows the setting of the time slot (in seconds) over which the cpu maximum and minimum temperatures are determined. This can be varied in the range 5 to 60 seconds. The maximum and minimum temperatures in each period will be recorded. These values will be mirrored by the values shown in the status window.

This setting does not effect the collection of raw data. The raw temperature data is collected each time the temperature is read - this time is set in the Module tab, described above.

Accumulated statistics

Enable accumulated statistics
If this option is ticked, then the module will collect the statistics for temperature variation. The GUI front end will allow the collected data to be saved to file for subsequent viewing or analysis.
Statistics file format
The three radio buttons are used to set the file format of the data file. Currently, there are three formats.
  • CSV is a simple comma separated format, which can be loaded in to various spreadsheet type applications
  • MultiPlot format allows the data to be loaded into the author's !MultiPlot application
  • ChartDraw format allows the data to be loaded into the author's !ChartDraw application

Both applications !ChartDraw and !MultiPlot can be obtained from the author's web site (see the Contact page) or via !Store or !Packman.

The final option buttons define how the data files are saved, and should require little further explanation. If Save as separate files is ticked, then each of the three sets of data are saved as separate files. If unticked, then if more than one data set is selected to be saved, the combined data is included in a single file. The other three options determine which data sets are saved. The data files are stored in the directory Stats within the application. The iconbar menu has an option to open a filer window on this directory for quick access.

The image below shows an example of a set of raw data obtained over a period of about an hour on Titanium hardware and displayed in !ChartDraw.

CPU temperatures of 48-52 occur when the cpu is essentially idling. The temperatures in the mid 50s were attained during editing and viewing of html pages. The temperatures in the low 60s occurred during the few minutes spent batch processing a couple of dozen DSLR jpeg images.

Time stamped statistics

Enable time stamped statistics
If this is ticked then a file will be continuously written, containing the time and temperature readings. The location of this file is within the Stats directory in the application. This directory can be opened using the iconbar icon menu as described here.
File format
This allows the format of the time indexed file to be set. There are three options.
  1. CSV - a standard comma separated data file
  2. Tab - the fields are separated by the Tab character
  3. Spaces - the column alignment is accomplished by padding the fields with spaces

The final option Keep previous copies sets how many copies of old statistics files are kept.

For the accumulated statistics files, existing files are renamed with an incrementing '_N' siffix each time a file is saved, up to N = value set in this option. If there is already a full set of files, the oldest is deleted before the renaming occurs.

For the time stamped statistics files, the renaming occurs when CPUClock starts up. This action can also be forced to occur at any time by means of an ADJUST (right) click on the iconbar icon with both control and shift held down. Note that the renaming and restart of the data file also occurs if time indexed collection is enabled or the format is changed in the choices window.


These pages are best viewed in a CSS compliant browser. For RISC OS, Netsurf would be the browser of choice.

Larr.gif - 145
bytes The iconbar menu   |   Index  |   The status window Rarr.gif - 141 bytes

CPUClock is © Chris Johnson, 2012
Email:chris@chris-johnson.org.uk

Document last modified on 28 January, 2021