Skip to content

Fan config layout

Sparronator9999 edited this page Jan 24, 2025 · 1 revision

Table of contents

This page is still a work-in-progress.

Config file layout

<?xml version="1.0" encoding="utf-8"?>
<YAMDCC_Config xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Ver="1">
	<!-- Basic config information (laptop manufacturer + model, config author)-->
	<FanConfs>
		<FanConf>
			<!-- Fan configuration: stores information on how to apply fan profiles -->
			<FanCurveConf>
				<!-- Fan curve configuration: stores user-created fan profiles -->
			</FanCurveConf>
		</FanConf>
	</FanConfs>
	<!-- MSI-specific features (FullBlastConf, ChargeLimitConf, PerfModeConf, KeySwapConf, KeyLightConf) -->
	<RegConfs>
		<!-- Register write configuration: any number of <RegConf> elements. -->
	</RegConfs>
</FanControlConfig>

For an example of a good fan config, see any config in the Configs folder.

General information

All numeric values MUST be written in decimal format. Hex values will cause an error while loading a config.

You can use Windows' programmer calculator to convert between hex and decimal values.

Basic config information

Manufacturer

The manufacturer of the laptop the config was written for.

Model

The model of the laptop the config was written for.

Author

The author of the config file.

Fan configuration

There must be at least one FanConf present in the FanConfs array in the config file.

Name

A descriptive name of the fan to be controlled, e.g. CPU Fan for the CPU fan(s).

MinSpeed

The value that will set the target fan speed to its lowest speed (or turn it off).

MaxSpeed

The value that will set the target fan speed to its highest speed.

For MSI laptops, this is either 100 or 150.

CurveSel

The zero-indexed FanCurveConf that will be applied when the config is loaded by the service.

If this is too high/low, it will be automatically reset to 0 on the next config load by any YAMDCC application.

SpeedReadReg

The EC register from which the fan speed (as a percentage of the highest fan speed) can be read.

The value read from this register is assumed to already be a percentage, from 0 to 100 percent.

TempReadReg

The EC register from which the temperature of the component being cooled is read.

For example, assuming this FanConf is for the CPU fan, this would be the register that would read the CPU temperature.

Fan RPM configuration

This section of the FanConf is optional.

ReadReg

The EC register from which the fan RPM can be read.

The following options affect the output of this register:

Is16Bit

If set to true, the fan RPM is read as a 16-bit value (instead of the default 8-bit).

IsBigEndian

Only has an effect if RPMIs16Bit is set to true.

If this option is set to true, the RPM value read from the EC will be treated as big-endian instead of the default little-endian.

RPMMult

The value to multiply the RPM value read from the EC by. Defaults to 1.

DivideByMult

If set to true, the RPM value read from the EC will be divided by RPMMult instead of being multiplied by them (the default behaviour).

Invert

If set to true, the reciprocal of the value is taken (1 / value) and used as the fan RPM.

Fan registers

All of the following sections are required.

The UpThresholdRegs and DownThresholdRegs sections must have the same number of registers.

FanCurveRegs must have one more register than UpThresholdRegs/DownThresholdRegs.

UpThresholdRegs

An array of EC registers that the fan curve up thresholds are written to.

DownThresholdRegs

An array of EC registers that the fan curve down thresholds are written to.

NOTE:

YAMDCC is currently hardcoded to write down thresholds as an offset from up thresholds (calculated using: upThreshold - downThreshold).

This works for MSI laptops, but may not be true for other laptop brands that use similar fan curves.

FanCurveRegs

An array of EC registers that the fan curve speeds are written to.

Fan profile configuration

All fan profiles for a fan live in their respective FanCurveConfs section.

There must always be at least one FanCurveConf per fan in a config.

Name

A brief description of the fan profile, e.g. Default for your laptop's default fan profile, Performance for a more agressive fan profile, and Silent for a quieter fan profile.

Desc

A longer description of the fan profile.

This will be shown in the tooltip when mousing over the fan profile selector in the config editor.

TempThresholds

An array of temperature thresholds to be written to the fan registers (described above).

All values below must be between 0 and 255, unless otherwise described below.

All values below should start low and increase for each additional temperature threshold.

UpThreshold

The temperature up threshold to be written to the corresponding up threshold register, in degrees Celsius (°C).

This should be 0 for the first UpThreshold.

DownThreshold

The temperature down threshold to be written to the corresponding down threshold register, in degrees Celsius (°C).

This should be 0 for the first DownThreshold.

This value is converted to an offset from the up threshold before writing (see above).

FanSpeed

The fan speed to write to the corresponding fan profile register.

The value must be between MinSpeed and MaxSpeed.

Extras

The following settings are likely specific to MSI laptops.

FullBlastConf

This consists of two values:

Reg

The register that controls whether Full Blast is enabled.

Mask

The bit(s) that should get toggled on full blast toggle (should be 128 on MSI laptops).

The reason a bit mask is used instead of an absolute value is because the value initially stored in this register appears to vary between MSI laptops.

ChargeLimitConf

This controls how much the battery in a laptop will charge to when plugged in.

Reg

The register that controls the charge limit.

MinVal

The minimum/disabled charge limit value for your laptop (for MSI laptops, 128).

MaxVal

The maximum charge limit value for your laptop (for MSI laptops, 228, or 100 above MinVal).

CurVal

The value to apply to the charge limit configuration.

Must be between 0 and MaxVal - MinVal.

Should be set to the default value for your laptop before publishing your config.

PerfModeConf

This controls the performance mode of an MSI laptop (usually just modifies the fan profiles applied to a laptop).

Reg

The register to write a performance mode to.

ModeSel

The zero-indexed performance mode to apply from the list of PerfModes.

PerfModes

An array of performance modes (see below).

PerfMode

This represents a single performance mode, and contains the following:

Name

The name of the performance mode (shown in the performance mode list in the config editor).

Desc

A longer description of the performance mode (e.g. what it does).

In the config editor, this is shown in the tooltip when mousing over the performance mode list.

Value

The value to write to the EC register (set by the parent PerfModeConf) when this performance mode is selected.

FanModeConf

This is an advanced setting, and ModeSel should be left on 3 (Advanced) for MSI laptops.

This config is identical to PerfModeConf, except with a FanModes array containing FanMode elements. Otherwise, all properties (Reg, ModeSel, Name, Desc, Value) are identical.

KeySwapConf

This config setting allows for the Windows and FN keys to be swapped on laptops that support it.

KeyLightConf

This config setting allows for YAMDCC to control the keyboard backlight.

For MSI laptops, only white/single-colour keyboard backlights are supported with this setting (i.e. RGB keyboard backlights are not supported).

Reg

The register that controls the keyboard backlight.

This register will also be read for the initial keyboard backlight brightness.

Values read by the YAMDCC service outside the range specified by MinVal and MaxVal will result in an error.

MinVal

The value that turns off the keyboard backlight (or sets it to its minimum brightness).

MaxVal

The value that sets the keyboard backlight to its maximum brightness.

RegConfs

An array of EC register configs to apply to the laptop.

These may be used to enable fan control via YAMDCC (e.g. by fixing fan profiles not being applied correctly), or to provide simple setting toggles (NOTE: RegConfs are not yet exposed in the config editor).

RegConf

A single EC register config.

Contains the following settings:

Enabled

Sets which of the values to write to the EC register.

If true, writes OnVal to the EC register on config apply, otherwise OffVal is written instead.

Name

A short name for this EC register config (e.g. "YAMDCC compatibility fix").

Desc

A longer description of what this RegConf does.

Reg

The register to write either OnVal or OffVal to.

OnVal

The value to write when this RegConf is enabled.

OffVal

The value to write when this RegConf is disabled.