Compare commits

...

3 Commits
v0.89 ... v0.90

Author SHA1 Message Date
Serge
e58a396cbd CPU power limits for old devices 2023-06-22 15:53:35 +02:00
Serge
40ecdf0d35 Max GPU core/memory config settings 2023-06-20 16:20:14 +02:00
Serge
f31b05dcd1 Aura cleanup 2023-06-20 13:48:32 +02:00
14 changed files with 209 additions and 165 deletions

View File

@@ -427,6 +427,7 @@ public class AsusACPI
return DeviceGet(PPT_CPUB0) >= 0 && DeviceGet(PPT_GPUC0) < 0; return DeviceGet(PPT_CPUB0) >= 0 && DeviceGet(PPT_GPUC0) < 0;
} }
public void ScanRange() public void ScanRange()
{ {
int value; int value;

View File

@@ -179,13 +179,11 @@ namespace GHelper
} }
private static IEnumerable<HidDevice> GetHidDevices(int[] deviceIds, int minInput = 18, int minFeatures = 1) private static IEnumerable<HidDevice> GetHidDevices(int[] deviceIds, int minFeatures = 1)
{ {
HidDevice[] HidDeviceList = HidDevices.Enumerate(ASUS_ID, deviceIds).ToArray(); HidDevice[] HidDeviceList = HidDevices.Enumerate(ASUS_ID, deviceIds).ToArray();
foreach (HidDevice device in HidDeviceList) foreach (HidDevice device in HidDeviceList)
if (device.IsConnected if (device.IsConnected && device.Capabilities.FeatureReportByteLength >= minFeatures)
&& device.Capabilities.FeatureReportByteLength >= minFeatures
&& device.Capabilities.InputReportByteLength >= minInput)
yield return device; yield return device;
} }
@@ -235,7 +233,7 @@ namespace GHelper
{ {
Task.Run(async () => Task.Run(async () =>
{ {
var devices = GetHidDevices(deviceIds, 0); var devices = GetHidDevices(deviceIds);
foreach (HidDevice device in devices) foreach (HidDevice device in devices)
{ {
device.OpenDevice(); device.OpenDevice();
@@ -263,7 +261,7 @@ namespace GHelper
byte[] msg = { AURA_HID_ID, 0xba, 0xc5, 0xc4, (byte)brightness }; byte[] msg = { AURA_HID_ID, 0xba, 0xc5, 0xc4, (byte)brightness };
byte[] msgBackup = { INPUT_HID_ID, 0xba, 0xc5, 0xc4, (byte)brightness }; byte[] msgBackup = { INPUT_HID_ID, 0xba, 0xc5, 0xc4, (byte)brightness };
var devices = GetHidDevices(deviceIds, 0); var devices = GetHidDevices(deviceIds);
foreach (HidDevice device in devices) foreach (HidDevice device in devices)
{ {
device.OpenDevice(); device.OpenDevice();
@@ -289,7 +287,7 @@ namespace GHelper
{ {
byte[] msgBackup = { INPUT_HID_ID, 0xba, 0xc5, 0xc4, (byte)brightness }; byte[] msgBackup = { INPUT_HID_ID, 0xba, 0xc5, 0xc4, (byte)brightness };
var devicesBackup = GetHidDevices(deviceIds, 0); var devicesBackup = GetHidDevices(deviceIds);
foreach (HidDevice device in devicesBackup) foreach (HidDevice device in devicesBackup)
{ {
device.OpenDevice(); device.OpenDevice();
@@ -312,13 +310,15 @@ namespace GHelper
var devices = GetHidDevices(deviceIds); var devices = GetHidDevices(deviceIds);
//Logger.WriteLine("USB-KB = " + BitConverter.ToString(msg));
foreach (HidDevice device in devices) foreach (HidDevice device in devices)
{ {
device.OpenDevice(); device.OpenDevice();
device.WriteFeatureData(msg); if (device.ReadFeatureData(out byte[] data, AURA_HID_ID))
Logger.WriteLine("USB-KB " + device.Attributes.ProductHexId + ":" + BitConverter.ToString(msg)); {
device.WriteFeatureData(msg);
Logger.WriteLine("USB-KB " + device.Attributes.ProductHexId + ":" + BitConverter.ToString(msg));
}
device.CloseDevice(); device.CloseDevice();
} }
@@ -351,23 +351,19 @@ namespace GHelper
} }
byte[] msg = AuraMessage(Mode, Color1, Color2, _speed); byte[] msg = AuraMessage(Mode, Color1, Color2, _speed);
var devices = GetHidDevices(deviceIds); var devices = GetHidDevices(deviceIds);
if (devices.Count() == 0)
{
Logger.WriteLine("USB-KB : not found");
devices = GetHidDevices(deviceIds, 1);
}
foreach (HidDevice device in devices) foreach (HidDevice device in devices)
{ {
device.OpenDevice(); device.OpenDevice();
device.WriteFeatureData(msg); if (device.ReadFeatureData(out byte[] data, AURA_HID_ID))
device.WriteFeatureData(MESSAGE_SET); {
device.WriteFeatureData(MESSAGE_APPLY); device.WriteFeatureData(msg);
//device.WriteFeatureData(MESSAGE_SET);
device.WriteFeatureData(MESSAGE_APPLY);
Logger.WriteLine("USB-KB " + device.Capabilities.FeatureReportByteLength + "|" + device.Capabilities.InputReportByteLength + device.Description + device.DevicePath + ":" + BitConverter.ToString(msg));
}
device.CloseDevice(); device.CloseDevice();
Logger.WriteLine("USB-KB " + device.Capabilities.FeatureReportByteLength + "|" + device.Capabilities.InputReportByteLength + device.Description + device.DevicePath + ":" + BitConverter.ToString(msg));
} }
if (AppConfig.ContainsModel("TUF")) if (AppConfig.ContainsModel("TUF"))
@@ -385,7 +381,7 @@ namespace GHelper
var payload = new byte[300]; var payload = new byte[300];
Array.Copy(msg, payload, msg.Length); Array.Copy(msg, payload, msg.Length);
foreach (HidDevice device in GetHidDevices(new int[] { 0x1970 }, 0, 300)) foreach (HidDevice device in GetHidDevices(new int[] { 0x1970 }, 300))
{ {
device.OpenDevice(); device.OpenDevice();
Logger.WriteLine("XGM " + device.Attributes.ProductHexId + "|" + device.Capabilities.FeatureReportByteLength + ":" + BitConverter.ToString(msg)); Logger.WriteLine("XGM " + device.Attributes.ProductHexId + "|" + device.Capabilities.FeatureReportByteLength + ":" + BitConverter.ToString(msg));

249
app/Fans.Designer.cs generated
View File

@@ -31,14 +31,14 @@ namespace GHelper
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
ChartArea chartArea5 = new ChartArea(); ChartArea chartArea1 = new ChartArea();
Title title5 = new Title(); Title title1 = new Title();
ChartArea chartArea6 = new ChartArea(); ChartArea chartArea2 = new ChartArea();
Title title6 = new Title(); Title title2 = new Title();
ChartArea chartArea7 = new ChartArea(); ChartArea chartArea3 = new ChartArea();
Title title7 = new Title(); Title title3 = new Title();
ChartArea chartArea8 = new ChartArea(); ChartArea chartArea4 = new ChartArea();
Title title8 = new Title(); Title title4 = new Title();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Fans)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Fans));
panelFans = new Panel(); panelFans = new Panel();
labelTip = new Label(); labelTip = new Label();
@@ -61,13 +61,6 @@ namespace GHelper
comboBoost = new RComboBox(); comboBoost = new RComboBox();
panelSliders = new Panel(); panelSliders = new Panel();
panelAdvanced = new Panel(); panelAdvanced = new Panel();
panelTemperature = new Panel();
labelTemp = new Label();
labelLeftTemp = new Label();
trackTemp = new TrackBar();
panelTitleTemp = new Panel();
pictureTemp = new PictureBox();
labelTempLimit = new Label();
panelAdvancedApply = new Panel(); panelAdvancedApply = new Panel();
checkApplyUV = new RCheckBox(); checkApplyUV = new RCheckBox();
buttonApplyAdvanced = new RButton(); buttonApplyAdvanced = new RButton();
@@ -83,6 +76,13 @@ namespace GHelper
panelTitleAdvanced = new Panel(); panelTitleAdvanced = new Panel();
pictureUV = new PictureBox(); pictureUV = new PictureBox();
labelTitleUV = new Label(); labelTitleUV = new Label();
panelTemperature = new Panel();
labelTemp = new Label();
labelLeftTemp = new Label();
trackTemp = new TrackBar();
panelTitleTemp = new Panel();
pictureTemp = new PictureBox();
labelTempLimit = new Label();
panelPower = new Panel(); panelPower = new Panel();
panelApplyPower = new Panel(); panelApplyPower = new Panel();
checkApplyPower = new RCheckBox(); checkApplyPower = new RCheckBox();
@@ -141,10 +141,6 @@ namespace GHelper
panelApplyFans.SuspendLayout(); panelApplyFans.SuspendLayout();
panelSliders.SuspendLayout(); panelSliders.SuspendLayout();
panelAdvanced.SuspendLayout(); panelAdvanced.SuspendLayout();
panelTemperature.SuspendLayout();
((System.ComponentModel.ISupportInitialize)trackTemp).BeginInit();
panelTitleTemp.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureTemp).BeginInit();
panelAdvancedApply.SuspendLayout(); panelAdvancedApply.SuspendLayout();
panelUViGPU.SuspendLayout(); panelUViGPU.SuspendLayout();
((System.ComponentModel.ISupportInitialize)trackUViGPU).BeginInit(); ((System.ComponentModel.ISupportInitialize)trackUViGPU).BeginInit();
@@ -152,6 +148,10 @@ namespace GHelper
((System.ComponentModel.ISupportInitialize)trackUV).BeginInit(); ((System.ComponentModel.ISupportInitialize)trackUV).BeginInit();
panelTitleAdvanced.SuspendLayout(); panelTitleAdvanced.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureUV).BeginInit(); ((System.ComponentModel.ISupportInitialize)pictureUV).BeginInit();
panelTemperature.SuspendLayout();
((System.ComponentModel.ISupportInitialize)trackTemp).BeginInit();
panelTitleTemp.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureTemp).BeginInit();
panelPower.SuspendLayout(); panelPower.SuspendLayout();
panelApplyPower.SuspendLayout(); panelApplyPower.SuspendLayout();
panelB0.SuspendLayout(); panelB0.SuspendLayout();
@@ -234,8 +234,8 @@ namespace GHelper
// //
// chartGPU // chartGPU
// //
chartArea5.Name = "ChartArea1"; chartArea1.Name = "ChartArea1";
chartGPU.ChartAreas.Add(chartArea5); chartGPU.ChartAreas.Add(chartArea1);
chartGPU.Dock = DockStyle.Fill; chartGPU.Dock = DockStyle.Fill;
chartGPU.Location = new Point(12, 467); chartGPU.Location = new Point(12, 467);
chartGPU.Margin = new Padding(2, 10, 2, 10); chartGPU.Margin = new Padding(2, 10, 2, 10);
@@ -243,13 +243,13 @@ namespace GHelper
chartGPU.Size = new Size(782, 437); chartGPU.Size = new Size(782, 437);
chartGPU.TabIndex = 17; chartGPU.TabIndex = 17;
chartGPU.Text = "chartGPU"; chartGPU.Text = "chartGPU";
title5.Name = "Title1"; title1.Name = "Title1";
chartGPU.Titles.Add(title5); chartGPU.Titles.Add(title1);
// //
// chartCPU // chartCPU
// //
chartArea6.Name = "ChartArea1"; chartArea2.Name = "ChartArea1";
chartCPU.ChartAreas.Add(chartArea6); chartCPU.ChartAreas.Add(chartArea2);
chartCPU.Dock = DockStyle.Fill; chartCPU.Dock = DockStyle.Fill;
chartCPU.Location = new Point(12, 10); chartCPU.Location = new Point(12, 10);
chartCPU.Margin = new Padding(2, 10, 2, 10); chartCPU.Margin = new Padding(2, 10, 2, 10);
@@ -257,13 +257,13 @@ namespace GHelper
chartCPU.Size = new Size(782, 437); chartCPU.Size = new Size(782, 437);
chartCPU.TabIndex = 14; chartCPU.TabIndex = 14;
chartCPU.Text = "chartCPU"; chartCPU.Text = "chartCPU";
title6.Name = "Title1"; title2.Name = "Title1";
chartCPU.Titles.Add(title6); chartCPU.Titles.Add(title2);
// //
// chartXGM // chartXGM
// //
chartArea7.Name = "ChartAreaXGM"; chartArea3.Name = "ChartAreaXGM";
chartXGM.ChartAreas.Add(chartArea7); chartXGM.ChartAreas.Add(chartArea3);
chartXGM.Dock = DockStyle.Fill; chartXGM.Dock = DockStyle.Fill;
chartXGM.Location = new Point(12, 1381); chartXGM.Location = new Point(12, 1381);
chartXGM.Margin = new Padding(2, 10, 2, 10); chartXGM.Margin = new Padding(2, 10, 2, 10);
@@ -271,14 +271,14 @@ namespace GHelper
chartXGM.Size = new Size(782, 440); chartXGM.Size = new Size(782, 440);
chartXGM.TabIndex = 14; chartXGM.TabIndex = 14;
chartXGM.Text = "chartXGM"; chartXGM.Text = "chartXGM";
title7.Name = "Title4"; title3.Name = "Title4";
chartXGM.Titles.Add(title7); chartXGM.Titles.Add(title3);
chartXGM.Visible = false; chartXGM.Visible = false;
// //
// chartMid // chartMid
// //
chartArea8.Name = "ChartArea3"; chartArea4.Name = "ChartArea3";
chartMid.ChartAreas.Add(chartArea8); chartMid.ChartAreas.Add(chartArea4);
chartMid.Dock = DockStyle.Fill; chartMid.Dock = DockStyle.Fill;
chartMid.Location = new Point(12, 924); chartMid.Location = new Point(12, 924);
chartMid.Margin = new Padding(2, 10, 2, 10); chartMid.Margin = new Padding(2, 10, 2, 10);
@@ -286,8 +286,8 @@ namespace GHelper
chartMid.Size = new Size(782, 437); chartMid.Size = new Size(782, 437);
chartMid.TabIndex = 14; chartMid.TabIndex = 14;
chartMid.Text = "chartMid"; chartMid.Text = "chartMid";
title8.Name = "Title3"; title4.Name = "Title3";
chartMid.Titles.Add(title8); chartMid.Titles.Add(title4);
chartMid.Visible = false; chartMid.Visible = false;
// //
// panelTitleFans // panelTitleFans
@@ -494,87 +494,6 @@ namespace GHelper
panelAdvanced.TabIndex = 14; panelAdvanced.TabIndex = 14;
panelAdvanced.Visible = false; panelAdvanced.Visible = false;
// //
// panelTemperature
//
panelTemperature.AutoSize = true;
panelTemperature.AutoSizeMode = AutoSizeMode.GrowAndShrink;
panelTemperature.Controls.Add(labelTemp);
panelTemperature.Controls.Add(labelLeftTemp);
panelTemperature.Controls.Add(trackTemp);
panelTemperature.Dock = DockStyle.Top;
panelTemperature.Location = new Point(0, 66);
panelTemperature.Margin = new Padding(4);
panelTemperature.MaximumSize = new Size(0, 124);
panelTemperature.Name = "panelTemperature";
panelTemperature.Size = new Size(520, 124);
panelTemperature.TabIndex = 51;
//
// labelTemp
//
labelTemp.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelTemp.Location = new Point(347, 13);
labelTemp.Margin = new Padding(4, 0, 4, 0);
labelTemp.Name = "labelTemp";
labelTemp.Size = new Size(148, 32);
labelTemp.TabIndex = 13;
labelTemp.Text = "T";
labelTemp.TextAlign = ContentAlignment.TopRight;
//
// labelLeftTemp
//
labelLeftTemp.AutoSize = true;
labelLeftTemp.Location = new Point(10, 10);
labelLeftTemp.Margin = new Padding(4, 0, 4, 0);
labelLeftTemp.Name = "labelLeftTemp";
labelLeftTemp.Size = new Size(183, 32);
labelLeftTemp.TabIndex = 12;
labelLeftTemp.Text = "CPU Temp Limit";
//
// trackTemp
//
trackTemp.Location = new Point(6, 48);
trackTemp.Margin = new Padding(4, 2, 4, 2);
trackTemp.Maximum = 0;
trackTemp.Minimum = -40;
trackTemp.Name = "trackTemp";
trackTemp.Size = new Size(508, 90);
trackTemp.TabIndex = 11;
trackTemp.TickFrequency = 5;
trackTemp.TickStyle = TickStyle.TopLeft;
//
// panelTitleTemp
//
panelTitleTemp.Controls.Add(pictureTemp);
panelTitleTemp.Controls.Add(labelTempLimit);
panelTitleTemp.Dock = DockStyle.Top;
panelTitleTemp.Location = new Point(0, 0);
panelTitleTemp.Name = "panelTitleTemp";
panelTitleTemp.Size = new Size(520, 66);
panelTitleTemp.TabIndex = 50;
//
// pictureTemp
//
pictureTemp.BackgroundImage = Properties.Resources.icons8_temperature_48;
pictureTemp.BackgroundImageLayout = ImageLayout.Zoom;
pictureTemp.InitialImage = null;
pictureTemp.Location = new Point(10, 18);
pictureTemp.Margin = new Padding(4, 2, 4, 10);
pictureTemp.Name = "pictureTemp";
pictureTemp.Size = new Size(36, 38);
pictureTemp.TabIndex = 48;
pictureTemp.TabStop = false;
//
// labelTempLimit
//
labelTempLimit.AutoSize = true;
labelTempLimit.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelTempLimit.Location = new Point(51, 20);
labelTempLimit.Margin = new Padding(4, 0, 4, 0);
labelTempLimit.Name = "labelTempLimit";
labelTempLimit.Size = new Size(140, 32);
labelTempLimit.TabIndex = 47;
labelTempLimit.Text = "Temp Limit";
//
// panelAdvancedApply // panelAdvancedApply
// //
panelAdvancedApply.Controls.Add(checkApplyUV); panelAdvancedApply.Controls.Add(checkApplyUV);
@@ -618,11 +537,14 @@ namespace GHelper
// //
// labelRisky // labelRisky
// //
labelRisky.BackColor = Color.IndianRed;
labelRisky.Dock = DockStyle.Top; labelRisky.Dock = DockStyle.Top;
labelRisky.ForeColor = SystemColors.ControlLightLight;
labelRisky.Location = new Point(0, 504); labelRisky.Location = new Point(0, 504);
labelRisky.Margin = new Padding(0, 0, 0, 0);
labelRisky.Name = "labelRisky"; labelRisky.Name = "labelRisky";
labelRisky.Padding = new Padding(10, 10, 10, 5); labelRisky.Padding = new Padding(10, 10, 10, 5);
labelRisky.Size = new Size(520, 198); labelRisky.Size = new Size(520, 220);
labelRisky.TabIndex = 46; labelRisky.TabIndex = 46;
labelRisky.Text = resources.GetString("labelRisky.Text"); labelRisky.Text = resources.GetString("labelRisky.Text");
// //
@@ -755,6 +677,87 @@ namespace GHelper
labelTitleUV.TabIndex = 47; labelTitleUV.TabIndex = 47;
labelTitleUV.Text = "Undervolting"; labelTitleUV.Text = "Undervolting";
// //
// panelTemperature
//
panelTemperature.AutoSize = true;
panelTemperature.AutoSizeMode = AutoSizeMode.GrowAndShrink;
panelTemperature.Controls.Add(labelTemp);
panelTemperature.Controls.Add(labelLeftTemp);
panelTemperature.Controls.Add(trackTemp);
panelTemperature.Dock = DockStyle.Top;
panelTemperature.Location = new Point(0, 66);
panelTemperature.Margin = new Padding(4);
panelTemperature.MaximumSize = new Size(0, 124);
panelTemperature.Name = "panelTemperature";
panelTemperature.Size = new Size(520, 124);
panelTemperature.TabIndex = 51;
//
// labelTemp
//
labelTemp.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelTemp.Location = new Point(347, 13);
labelTemp.Margin = new Padding(4, 0, 4, 0);
labelTemp.Name = "labelTemp";
labelTemp.Size = new Size(148, 32);
labelTemp.TabIndex = 13;
labelTemp.Text = "T";
labelTemp.TextAlign = ContentAlignment.TopRight;
//
// labelLeftTemp
//
labelLeftTemp.AutoSize = true;
labelLeftTemp.Location = new Point(10, 10);
labelLeftTemp.Margin = new Padding(4, 0, 4, 0);
labelLeftTemp.Name = "labelLeftTemp";
labelLeftTemp.Size = new Size(183, 32);
labelLeftTemp.TabIndex = 12;
labelLeftTemp.Text = "CPU Temp Limit";
//
// trackTemp
//
trackTemp.Location = new Point(6, 48);
trackTemp.Margin = new Padding(4, 2, 4, 2);
trackTemp.Maximum = 0;
trackTemp.Minimum = -40;
trackTemp.Name = "trackTemp";
trackTemp.Size = new Size(508, 90);
trackTemp.TabIndex = 11;
trackTemp.TickFrequency = 5;
trackTemp.TickStyle = TickStyle.TopLeft;
//
// panelTitleTemp
//
panelTitleTemp.Controls.Add(pictureTemp);
panelTitleTemp.Controls.Add(labelTempLimit);
panelTitleTemp.Dock = DockStyle.Top;
panelTitleTemp.Location = new Point(0, 0);
panelTitleTemp.Name = "panelTitleTemp";
panelTitleTemp.Size = new Size(520, 66);
panelTitleTemp.TabIndex = 50;
//
// pictureTemp
//
pictureTemp.BackgroundImage = Properties.Resources.icons8_temperature_48;
pictureTemp.BackgroundImageLayout = ImageLayout.Zoom;
pictureTemp.InitialImage = null;
pictureTemp.Location = new Point(10, 18);
pictureTemp.Margin = new Padding(4, 2, 4, 10);
pictureTemp.Name = "pictureTemp";
pictureTemp.Size = new Size(36, 38);
pictureTemp.TabIndex = 48;
pictureTemp.TabStop = false;
//
// labelTempLimit
//
labelTempLimit.AutoSize = true;
labelTempLimit.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelTempLimit.Location = new Point(51, 20);
labelTempLimit.Margin = new Padding(4, 0, 4, 0);
labelTempLimit.Name = "labelTempLimit";
labelTempLimit.Size = new Size(140, 32);
labelTempLimit.TabIndex = 47;
labelTempLimit.Text = "Temp Limit";
//
// panelPower // panelPower
// //
panelPower.AutoSize = true; panelPower.AutoSize = true;
@@ -1393,12 +1396,6 @@ namespace GHelper
panelSliders.PerformLayout(); panelSliders.PerformLayout();
panelAdvanced.ResumeLayout(false); panelAdvanced.ResumeLayout(false);
panelAdvanced.PerformLayout(); panelAdvanced.PerformLayout();
panelTemperature.ResumeLayout(false);
panelTemperature.PerformLayout();
((System.ComponentModel.ISupportInitialize)trackTemp).EndInit();
panelTitleTemp.ResumeLayout(false);
panelTitleTemp.PerformLayout();
((System.ComponentModel.ISupportInitialize)pictureTemp).EndInit();
panelAdvancedApply.ResumeLayout(false); panelAdvancedApply.ResumeLayout(false);
panelUViGPU.ResumeLayout(false); panelUViGPU.ResumeLayout(false);
panelUViGPU.PerformLayout(); panelUViGPU.PerformLayout();
@@ -1409,6 +1406,12 @@ namespace GHelper
panelTitleAdvanced.ResumeLayout(false); panelTitleAdvanced.ResumeLayout(false);
panelTitleAdvanced.PerformLayout(); panelTitleAdvanced.PerformLayout();
((System.ComponentModel.ISupportInitialize)pictureUV).EndInit(); ((System.ComponentModel.ISupportInitialize)pictureUV).EndInit();
panelTemperature.ResumeLayout(false);
panelTemperature.PerformLayout();
((System.ComponentModel.ISupportInitialize)trackTemp).EndInit();
panelTitleTemp.ResumeLayout(false);
panelTitleTemp.PerformLayout();
((System.ComponentModel.ISupportInitialize)pictureTemp).EndInit();
panelPower.ResumeLayout(false); panelPower.ResumeLayout(false);
panelPower.PerformLayout(); panelPower.PerformLayout();
panelApplyPower.ResumeLayout(false); panelApplyPower.ResumeLayout(false);

View File

@@ -1,10 +1,7 @@
using CustomControls; using CustomControls;
using GHelper.Gpu; using GHelper.Gpu;
using Ryzen; using Ryzen;
using System;
using System.Diagnostics; using System.Diagnostics;
using System.Net.Sockets;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting; using System.Windows.Forms.DataVisualization.Charting;
namespace GHelper namespace GHelper
@@ -53,6 +50,8 @@ namespace GHelper
labelGPUBoostTitle.Text = Properties.Strings.GPUBoost; labelGPUBoostTitle.Text = Properties.Strings.GPUBoost;
labelGPUTempTitle.Text = Properties.Strings.GPUTempTarget; labelGPUTempTitle.Text = Properties.Strings.GPUTempTarget;
labelRisky.Text = Properties.Strings.UndervoltingRisky;
InitTheme(true); InitTheme(true);
MinRPM = 18; MinRPM = 18;
@@ -623,7 +622,7 @@ namespace GHelper
public void InitPower(bool changed = false) public void InitPower(bool changed = false)
{ {
bool modeA0 = Program.acpi.DeviceGet(AsusACPI.PPT_TotalA0) >= 0; bool modeA0 = Program.acpi.DeviceGet(AsusACPI.PPT_TotalA0) >= 0 || Undervolter.IsAMD();
bool modeB0 = Program.acpi.IsAllAmdPPT(); bool modeB0 = Program.acpi.IsAllAmdPPT();
bool modeC1 = Program.acpi.DeviceGet(AsusACPI.PPT_APUC1) >= 0; bool modeC1 = Program.acpi.DeviceGet(AsusACPI.PPT_APUC1) >= 0;

View File

@@ -16,7 +16,7 @@
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly> <ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyVersion>0.89</AssemblyVersion> <AssemblyVersion>0.90</AssemblyVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -11,8 +11,8 @@ namespace GHelper.Gpu;
public class NvidiaGpuControl : IGpuControl public class NvidiaGpuControl : IGpuControl
{ {
public const int MaxCoreOffset = 250; public static int MaxCoreOffset => AppConfig.Get("max_gpu_core", 250);
public const int MaxMemoryOffset = 250; public static int MaxMemoryOffset => AppConfig.Get("max_gpu_memory", 250);
public const int MinCoreOffset = -250; public const int MinCoreOffset = -250;
public const int MinMemoryOffset = -250; public const int MinMemoryOffset = -250;
@@ -79,6 +79,12 @@ public class NvidiaGpuControl : IGpuControl
core = states.Clocks[PerformanceStateId.P0_3DPerformance][0].FrequencyDeltaInkHz.DeltaValue / 1000; core = states.Clocks[PerformanceStateId.P0_3DPerformance][0].FrequencyDeltaInkHz.DeltaValue / 1000;
memory = states.Clocks[PerformanceStateId.P0_3DPerformance][1].FrequencyDeltaInkHz.DeltaValue / 1000; memory = states.Clocks[PerformanceStateId.P0_3DPerformance][1].FrequencyDeltaInkHz.DeltaValue / 1000;
Logger.WriteLine($"GET GPU CLOCKS: {core}, {memory}"); Logger.WriteLine($"GET GPU CLOCKS: {core}, {memory}");
foreach (var delta in states.Voltages[PerformanceStateId.P0_3DPerformance])
{
Logger.WriteLine("GPU VOLT:" + delta.IsEditable + " - " + delta.ValueDeltaInMicroVolt.DeltaValue);
}
return 0; return 0;
} }
@@ -117,7 +123,7 @@ public class NvidiaGpuControl : IGpuControl
return status; return status;
} }
public int SetClocks(int core, int memory) public int SetClocks(int core, int memory, int voltage = 0)
{ {
if (core < MinCoreOffset || core > MaxCoreOffset) return 0; if (core < MinCoreOffset || core > MaxCoreOffset) return 0;
@@ -127,9 +133,10 @@ public class NvidiaGpuControl : IGpuControl
var coreClock = new PerformanceStates20ClockEntryV1(PublicClockDomain.Graphics, new PerformanceStates20ParameterDelta(core * 1000)); var coreClock = new PerformanceStates20ClockEntryV1(PublicClockDomain.Graphics, new PerformanceStates20ParameterDelta(core * 1000));
var memoryClock = new PerformanceStates20ClockEntryV1(PublicClockDomain.Memory, new PerformanceStates20ParameterDelta(memory * 1000)); var memoryClock = new PerformanceStates20ClockEntryV1(PublicClockDomain.Memory, new PerformanceStates20ParameterDelta(memory * 1000));
var voltageEntry = new PerformanceStates20BaseVoltageEntryV1(PerformanceVoltageDomain.Core, new PerformanceStates20ParameterDelta(voltage));
PerformanceStates20ClockEntryV1[] clocks = { coreClock, memoryClock }; PerformanceStates20ClockEntryV1[] clocks = { coreClock, memoryClock };
PerformanceStates20BaseVoltageEntryV1[] voltages = { }; PerformanceStates20BaseVoltageEntryV1[] voltages = { };
PerformanceState20[] performanceStates = { new PerformanceState20(PerformanceStateId.P0_3DPerformance, clocks, voltages) }; PerformanceState20[] performanceStates = { new PerformanceState20(PerformanceStateId.P0_3DPerformance, clocks, voltages) };

View File

@@ -193,6 +193,10 @@ namespace GHelper
switch (action) switch (action)
{ {
case "cpu":
Startup.ReScheduleAdmin();
settingsForm.FansToggle();
break;
case "gpu": case "gpu":
Startup.ReScheduleAdmin(); Startup.ReScheduleAdmin();
settingsForm.FansToggle(1); settingsForm.FansToggle(1);

View File

@@ -160,7 +160,7 @@ namespace GHelper.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Apply. /// Looks up a localized string similar to Apply Power Limits.
/// </summary> /// </summary>
internal static string ApplyPowerLimits { internal static string ApplyPowerLimits {
get { get {
@@ -1176,6 +1176,15 @@ namespace GHelper.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Undervolting is experimental and risky feature. If applied values are too low for your hardware, it can become unstable, shut down or cause data corruption. If you want to try - start from small values first, click Apply and test what works for you..
/// </summary>
internal static string UndervoltingRisky {
get {
return ResourceManager.GetString("UndervoltingRisky", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Updates. /// Looks up a localized string similar to Updates.
/// </summary> /// </summary>

View File

@@ -403,7 +403,7 @@
<value>Overdrive</value> <value>Overdrive</value>
</data> </data>
<data name="PerformanceMode" xml:space="preserve"> <data name="PerformanceMode" xml:space="preserve">
<value>Modo de rendimiento</value> <value>Modo</value>
</data> </data>
<data name="PictureGif" xml:space="preserve"> <data name="PictureGif" xml:space="preserve">
<value>Imagen / Gif</value> <value>Imagen / Gif</value>

View File

@@ -489,6 +489,9 @@
<data name="UltimateMode" xml:space="preserve"> <data name="UltimateMode" xml:space="preserve">
<value>Ultimate</value> <value>Ultimate</value>
</data> </data>
<data name="UndervoltingRisky" xml:space="preserve">
<value>Undervolting is experimental and risky feature. If applied values are too low for your hardware, it can become unstable, shut down or cause data corruption. If you want to try - start from small values first, click Apply and test what works for you.</value>
</data>
<data name="Updates" xml:space="preserve"> <data name="Updates" xml:space="preserve">
<value>Updates</value> <value>Updates</value>
</data> </data>

View File

@@ -135,12 +135,16 @@ namespace Ryzen
public Status SendMp1(uint message, ref uint[] arguments) public Status SendMp1(uint message, ref uint[] arguments)
{ {
return SendMsg(MP1_ADDR_MSG, MP1_ADDR_RSP, MP1_ADDR_ARG, message, ref arguments); var result = SendMsg(MP1_ADDR_MSG, MP1_ADDR_RSP, MP1_ADDR_ARG, message, ref arguments);
Logger.WriteLine($"RyzenMP1:{message} {arguments[0]} {result}");
return result;
} }
public Status SendPsmu(uint message, ref uint[] arguments) public Status SendPsmu(uint message, ref uint[] arguments)
{ {
return SendMsg(PSMU_ADDR_MSG, PSMU_ADDR_RSP, PSMU_ADDR_ARG, message, ref arguments); var result = SendMsg(PSMU_ADDR_MSG, PSMU_ADDR_RSP, PSMU_ADDR_ARG, message, ref arguments);
Logger.WriteLine($"RyzenPSMU:{message} {arguments[0]} {result}");
return result;
} }

View File

@@ -126,11 +126,14 @@ namespace Ryzen
public static bool IsAMD() public static bool IsAMD()
{ {
if (CPUName.Length == 0) Init(); if (CPUName.Length == 0) Init();
return CPUName.Contains("AMD") || CPUName.Contains("Ryzen") || CPUName.Contains("Athlon") || CPUName.Contains("Radeon") || CPUName.Contains("AMD Custom APU 0405"); return CPUName.Contains("AMD") || CPUName.Contains("Ryzen") || CPUName.Contains("Athlon") || CPUName.Contains("Radeon") || CPUName.Contains("AMD Custom APU 0405");
}
public static bool IsRyzen9()
{
if (CPUName.Length == 0) Init();
return CPUName.Contains("Ryzen 9");
} }
public static void SetAddresses() public static void SetAddresses()

View File

@@ -1036,7 +1036,7 @@ namespace GHelper
labelPerf.Text = Properties.Strings.PerformanceMode + ": " + Modes.GetCurrentName() + (customFans ? "+" : "") + ((customPower > 0) ? " " + customPower + "W" : ""); labelPerf.Text = Properties.Strings.PerformanceMode + ": " + Modes.GetCurrentName() + (customFans ? "+" : "") + ((customPower > 0) ? " " + customPower + "W" : "");
} }
public void SetPower() public void SetPower(bool launchAsAdmin = false)
{ {
int limit_total = AppConfig.GetMode("limit_total"); int limit_total = AppConfig.GetMode("limit_total");
@@ -1058,6 +1058,21 @@ namespace GHelper
Program.acpi.DeviceSet(AsusACPI.PPT_TotalA0, limit_total, "PowerLimit A0"); Program.acpi.DeviceSet(AsusACPI.PPT_TotalA0, limit_total, "PowerLimit A0");
Program.acpi.DeviceSet(AsusACPI.PPT_APUA3, limit_total, "PowerLimit A3"); Program.acpi.DeviceSet(AsusACPI.PPT_APUA3, limit_total, "PowerLimit A3");
customPower = limit_total; customPower = limit_total;
} else if (Undervolter.IsAMD())
{
if (ProcessHelper.IsUserAdministrator())
{
SendCommand.set_stapm_limit((uint)limit_total * 1000);
SendCommand.set_stapm2_limit((uint)limit_total * 1000);
SendCommand.set_slow_limit((uint)limit_total * 1000);
SendCommand.set_fast_limit((uint)limit_total * 1000);
customPower = limit_total;
} else if (launchAsAdmin)
{
ProcessHelper.RunAsAdmin("cpu");
return;
}
} }
if (Program.acpi.IsAllAmdPPT()) // CPU limit all amd models if (Program.acpi.IsAllAmdPPT()) // CPU limit all amd models
@@ -1293,7 +1308,7 @@ namespace GHelper
} }
else else
{ {
if (applyPower) SetPower(); if (applyPower) SetPower(true);
SetGPUPower(); SetGPUPower();
AutoUV(); AutoUV();
} }

View File

@@ -1,5 +1,4 @@
using CustomControls; using CustomControls;
using HidSharp;
using System.Diagnostics; using System.Diagnostics;
using System.Management; using System.Management;
using System.Net; using System.Net;
@@ -90,7 +89,8 @@ namespace GHelper
{ {
model = results[0]; model = results[0];
bios = results[1]; bios = results[1];
} else }
else
{ {
model = obj["SMBIOSBIOSVersion"].ToString(); model = obj["SMBIOSBIOSVersion"].ToString();
} }
@@ -118,7 +118,7 @@ namespace GHelper
var groups = data.GetProperty("Result").GetProperty("Obj"); var groups = data.GetProperty("Result").GetProperty("Obj");
List<string> skipList = new() { "Armoury Crate & Aura Creator Installer", "MyASUS", "ASUS Smart Display Control", "Aura Wallpaper", "Virtual Pet","ROG Font V1.5" }; List<string> skipList = new() { "Armoury Crate & Aura Creator Installer", "MyASUS", "ASUS Smart Display Control", "Aura Wallpaper", "Virtual Pet", "ROG Font V1.5" };
List<DriverDownload> drivers = new(); List<DriverDownload> drivers = new();
for (int i = 0; i < groups.GetArrayLength(); i++) for (int i = 0; i < groups.GetArrayLength(); i++)