Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging EA into Mainline #979

Merged
merged 40 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f0951c5
Implement CustomWpf (#154)
Valkirie Jan 12, 2024
3bec678
Restore LegionGo fan control (#159)
Valkirie Jan 13, 2024
bf664f6
Implement support for Intel Graphics Control Library (IGCL) (#158)
Valkirie Jan 13, 2024
009d555
Implement new UI classes (#153)
Valkirie Jan 13, 2024
3872ff8
Improve ADLX and IGCL (#160)
Valkirie Jan 15, 2024
0c00903
oups forgot to remove that part
Valkirie Jan 15, 2024
635f9d3
implement telemetryLock
Valkirie Jan 15, 2024
a62843a
Allow OSD customization (#161)
0SkillAllLuck Jan 15, 2024
8b2b6a7
SapientiaUsb update (#104)
MSeys Jan 15, 2024
cd532a3
Modify the CPUBoost logic to use PerfBoostMode rather than boolean (#…
Valkirie Jan 16, 2024
59edc7f
fixed issue with layoutmanager crashing when dismissing the quick set…
indiesaudi Jan 16, 2024
0a797cb
prevent crash on null AdapterRAM
Valkirie Jan 18, 2024
c0d41fc
Improve Controller UI experience (#163)
Valkirie Jan 18, 2024
86410a4
Hide Hints Stackpanel if all childrens are hidden as well
Valkirie Jan 18, 2024
5cba0f4
ControllerRefresh: move non-UI logic away from Dispatcher
Valkirie Jan 18, 2024
c944ced
cleanup
Valkirie Jan 18, 2024
8c5346c
Improve gamepad navigation
Valkirie Jan 18, 2024
b3e36f2
Change Serilog.Sinks.File MinimumLevel to Information
Valkirie Jan 19, 2024
846681f
Increase GPUManager robustness (#166)
Valkirie Jan 19, 2024
b1cdb72
Update README.md to include Droix Discord link (#168)
CasperH2O Jan 19, 2024
dc575e5
Improvement Increased gyro aiming down sites multiplier lower range. …
CasperH2O Jan 19, 2024
4dfdd20
Improve process detection, sort and add Valkirie/HandheldCompanion#94…
CasperH2O Jan 19, 2024
031bac0
Translation and localization update (#167)
CasperH2O Jan 19, 2024
680ff02
Support GPD WIN MINI (Initial) (#169)
CasperH2O Jan 24, 2024
0a0e897
allow LibreHardwareMonitor to start on HC startup (#171)
Valkirie Jan 24, 2024
35862be
Misc UI (#170)
Valkirie Jan 28, 2024
03ca0cd
Fix optional uninstall of HidHide (#172)
CasperH2O Jan 28, 2024
4fdcb6f
migrate fan control to PerformanceManager (#173)
Valkirie Jan 28, 2024
9ac87cb
GPD WIN MINI Fan Control (#174)
CasperH2O Jan 28, 2024
c420a2e
prevent crash on device cooperative level check (#176)
Valkirie Jan 28, 2024
256ab76
fix crash on HC close when an IGCL or ADLX task is running (#175)
Valkirie Jan 28, 2024
f8f8e7b
might be better to use Task.Delay on InitializeDirect3DDevice()
Valkirie Jan 28, 2024
8139afc
test fix QT locks
Valkirie Jan 29, 2024
cc3184e
Build 0.20.4.0
CasperH2O Jan 29, 2024
dc4b0b9
overlayfix
MSeys Jan 29, 2024
4234c3e
VRAMUsage is MiB not %
Valkirie Jan 30, 2024
2272189
do not try and restore default GPU frequency on AMD GPUs
Valkirie Jan 30, 2024
1bd16be
Update HidHide to 1.4.202 (#182)
Valkirie Feb 3, 2024
a1c4de0
Merge branch 'main' of https://github.com/Valkirie/HandheldCompanion-…
Valkirie Feb 3, 2024
86e1462
Merge EA into Mainline
Valkirie Feb 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions HandheldCompanion.iss
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,10 @@ end;

procedure Dependency_AddHideHide;
begin
Dependency_Add('HidHide_1.4.192_x64.exe',
Dependency_Add('HidHide_1.4.202_x64.exe',
'/quiet /norestart',
'HidHide Drivers',
'https://github.com/nefarius/HidHide/releases/download/v1.4.192.0/HidHide_1.4.192_x64.exe',
'https://github.com/nefarius/HidHide/releases/download/v1.4.202.0/HidHide_1.4.202_x64.exe',
Comment on lines +315 to +318
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version number in the HidHide dependency URL does not match the filename. Ensure consistency to avoid potential download or installation issues.

- 'https://github.com/nefarius/HidHide/releases/download/v1.4.202.0/HidHide_1.4.202_x64.exe',
+ 'https://github.com/nefarius/HidHide/releases/download/v1.4.202/HidHide_1.4.202_x64.exe',

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
Dependency_Add('HidHide_1.4.202_x64.exe',
'/quiet /norestart',
'HidHide Drivers',
'https://github.com/nefarius/HidHide/releases/download/v1.4.192.0/HidHide_1.4.192_x64.exe',
'https://github.com/nefarius/HidHide/releases/download/v1.4.202.0/HidHide_1.4.202_x64.exe',
Dependency_Add('HidHide_1.4.202_x64.exe',
'/quiet /norestart',
'HidHide Drivers',
'https://github.com/nefarius/HidHide/releases/download/v1.4.202/HidHide_1.4.202_x64.exe',

'', True, False);
end;

Expand Down Expand Up @@ -364,7 +364,7 @@ end;

#define MyAppSetupName 'Handheld Companion'
#define MyBuildId 'HandheldCompanion'
#define MyAppVersion '0.20.3.1'
#define MyAppVersion '0.20.4.0'
#define MyAppPublisher 'BenjaminLSR'
#define MyAppCopyright 'Copyright @ BenjaminLSR'
#define MyAppURL 'https://github.com/Valkirie/HandheldCompanion'
Expand Down Expand Up @@ -482,7 +482,7 @@ begin

if not(keepHidhideCheckbox.Checked) then
begin
if(ShellExec('', 'msiexec.exe', '/X{BE49B9DE-F8EB-4F54-B312-DD4B601985FC}', '', SW_SHOW, ewWaitUntilTerminated, resultCode)) then
if(ShellExec('', 'msiexec.exe', '/X{50D7EB6D-6A4A-4A38-B09C-CC28F75F082E} /L*V "C:\HidHide-Uninstall.log"', '', SW_SHOW, ewWaitUntilTerminated, resultCode)) then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The uninstall command for HidHide uses a hardcoded path which may not be valid for all installations. Consider using a dynamic approach to locate the uninstaller.

- Filename: "C:\Program Files\Nefarius Software Solutions\HidHide\x64\HidHideCLI.exe";
+ Filename: "{pf}\Nefarius Software Solutions\HidHide\x64\HidHideCLI.exe";

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
if(ShellExec('', 'msiexec.exe', '/X{50D7EB6D-6A4A-4A38-B09C-CC28F75F082E} /L*V "C:\HidHide-Uninstall.log"', '', SW_SHOW, ewWaitUntilTerminated, resultCode)) then
if(ShellExec('', 'msiexec.exe', '/X{50D7EB6D-6A4A-4A38-B09C-CC28F75F082E} /L*V "C:\HidHide-Uninstall.log"', '', SW_SHOW, ewWaitUntilTerminated, resultCode)) then

begin
log('Successfully executed Hidhide uninstaller');
if(resultCode = 0) then
Expand Down Expand Up @@ -580,4 +580,4 @@ begin
Result := True;
end;

#endif
#endif
103 changes: 103 additions & 0 deletions HandheldCompanion/ADLX/ADLXBackend.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
using System.Runtime.InteropServices;

namespace HandheldCompanion.ADLX
{
public class ADLXBackend
{
public const string ADLX_Wrapper = @"ADLX_Wrapper.dll";

[StructLayout(LayoutKind.Sequential)]
public struct AdlxTelemetryData
{
// GPU Usage
public bool gpuUsageSupported;
public double gpuUsageValue;

// GPU Core Frequency
public bool gpuClockSpeedSupported;
public double gpuClockSpeedValue;

// GPU VRAM Frequency
public bool gpuVRAMClockSpeedSupported;
public double gpuVRAMClockSpeedValue;

// GPU Core Temperature
public bool gpuTemperatureSupported;
public double gpuTemperatureValue;

// GPU Hotspot Temperature
public bool gpuHotspotTemperatureSupported;
public double gpuHotspotTemperatureValue;

// GPU Power
public bool gpuPowerSupported;
public double gpuPowerValue;

// Fan Speed
public bool gpuFanSpeedSupported;
public double gpuFanSpeedValue;

// VRAM Usage
public bool gpuVramSupported;
public double gpuVramValue;

// GPU Voltage
public bool gpuVoltageSupported;
public double gpuVoltageValue;

// GPU TBP
public bool gpuTotalBoardPowerSupported;
public double gpuTotalBoardPowerValue;
}

[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool IntializeAdlx();
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool CloseAdlx();

[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool HasRSRSupport();
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool GetRSR();
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool SetRSR(bool enable);
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern int GetRSRSharpness();
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool SetRSRSharpness(int sharpness);
Comment on lines +53 to +60
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure proper error handling for external calls to ADLX_Wrapper.dll methods to prevent application crashes or undefined behavior.


[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool GetAntiLag(int GPU);
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool SetAntiLag(int GPU, bool enable);

[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool GetBoost(int GPU);
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool SetBoost(int GPU, bool enable);
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern int GetBoostResolution(int GPU);
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool SetBoostResolution(int GPU, int minRes);

[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool GetChill(int GPU);
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool SetChill(int GPU, bool enable);
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern int GetChillMinFPS(int GPU);
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool SetChillMinFPS(int GPU, int minFPS);
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern int GetChillMaxFPS(int GPU);
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool SetChillMaxFPS(int GPU, int maxFPS);

[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool GetImageSharpening(int GPU);
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool SetImageSharpening(int GPU, bool enable);
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern int GetImageSharpeningSharpness(int GPU);
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool SetImageSharpeningSharpness(int GPU, int sharpness);

[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool HasIntegerScalingSupport(int GPU);
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool GetIntegerScaling(int GPU);
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool SetIntegerScaling(int GPU, bool enabled);

[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool HasGPUScalingSupport(int GPU);
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool GetGPUScaling(int GPU);
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool SetGPUScaling(int GPU, bool enabled);

[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool HasScalingModeSupport(int GPU);
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern int GetScalingMode(int GPU);
[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool SetScalingMode(int GPU, int mode);
Comment on lines +62 to +92
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verify the return values and error handling for all DllImport methods interacting with GPU settings to ensure robustness, especially for critical operations like SetRSR, SetAntiLag, SetBoost, SetChill, SetImageSharpening, SetIntegerScaling, SetGPUScaling, and SetScalingMode.


[DllImport(ADLX_Wrapper, CallingConvention = CallingConvention.Cdecl)] public static extern bool GetAdlxTelemetry(int GPU, ref AdlxTelemetryData adlxTelemetryData);

internal static AdlxTelemetryData GetTelemetryData()
{
AdlxTelemetryData TelemetryData = new();
bool Result = GetAdlxTelemetry(0, ref TelemetryData);
return TelemetryData;
Comment on lines +94 to +100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding error handling for the GetAdlxTelemetry method to manage cases where telemetry data cannot be retrieved successfully.

}
}
}
Binary file removed HandheldCompanion/ADLX_3DSettings.dll
Binary file not shown.
Binary file removed HandheldCompanion/ADLX_DisplaySettings.dll
Binary file not shown.
Binary file added HandheldCompanion/ADLX_Wrapper.dll
Binary file not shown.
Loading
Loading