Skip to content

Commit

Permalink
Merging EA into Mainline (#979)
Browse files Browse the repository at this point in the history
* Implement CustomWpf (#154)

* Disable the RealTimeStylus for WPF Applications

* Update MainWindow.xaml.cs

* test ?

* Restore LegionGo fan control (#159)

* restore Legion Go FanControl ability (requires BIOS v29)

* Implement Sapientia function getUSBVerify()

* Implement WMI class (wip)

* implement new functions

- GetFanFullSpeedAsync
- SetFanFullSpeedAsync
- SetFanTable
- SetSmartFanMode

* implement SetCPUPowerLimit()

* Implement support for Intel Graphics Control Library (IGCL) (#158)

* Start implementing IGCL (wip)

* More work

- Implemented GPUManager
- Implemented GPU-specific classes (AMDGPU, IntelGPU)
- Implemented IGCLBackend (wip)
- SystemManager renamed to MultimediaManager
- PowerManager renamed to SystemManager

* more work on IGCL

* prevent crash on null MainThread

* prevent useless SetResolution() calls

* more work on IGCL

* add missing sharpness check

* implement ctl_device_adapter_properties_t  (wip)

* what if the issue was deviceIdx all along...

* Update IGCL_Wrapper.dll

* fix remaining implementations

* implement IntegerScalingType (Intel only)

* make sure to use defaultGPU (idx: 0)

We need to find a proper way to guess which one is used for 3D rendering I guess or linked to main screen..

* fix ctl_device_adapter_properties_t Marshalling

* implemented some form of logic to pick the first available external GPU (if any)

* improve GPUManager

- add support for Manufacturer: "Advanced Micro Devices, Inc."
- improve GPUManager and GPU Start() and Stop() logics
- prevent Task Execution within Tasks on AMDGPU

* fix a crash when UpdateTimer is null

* Implement new UI classes (#153)

* Implement new UI classes

- UISounds to manage UI sounds on interaction.
- UIGamepad to manage gamepad interactions.
- Audio files from https://kenney.nl/assets/ui-audio.
- Add support for TextBox and RepeatButton selection via gamepad.

* Update HandheldCompanion/UI/UISounds.cs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix PlayOggFile refs

* removed unused audio files

* Add UI Sounds toggle on SettingsPage (default Off)

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Improve ADLX and IGCL (#160)

* Migrate everything ADLX related to ADLX_Wrapper()

* update IGCL logic

- Implemented Terminate() and Initialize() as well as GetTelemetryData()

* debug functions on both IGCL and ADLX backends

* Update ADLX_Wrapper and fix Initialize() calls on GPU classes

* add Telemetry Timer as part of GPU class

* Implement GPU GetLoad() and GetPower()

* oups forgot to remove that part

* implement telemetryLock

* Allow OSD customization (#161)

* SapientiaUsb update (#104)

* SapientiaUsb update

* Legion Go - additional settings

* Modify the CPUBoost logic to use PerfBoostMode rather than boolean (#162)

Also improved the threading logic on powerWatchdog_Elapsed

* fixed issue with layoutmanager crashing when dismissing the quick set… (#951)

* fixed issue with layoutmanager crashing when dismissing the quick settings

* Update HandheldCompanion/Managers/LayoutManager.cs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* prevent crash on null AdapterRAM

@0SkillAllLuck, we shouldn't loop through all video controllers but instead only look for "main" one

* Improve Controller UI experience (#163)

* Update ControllerPage and IController UI logic a bit

Should simplify the virtual/physical distinction

* more work on UI

* minor tweaks

* misc text tweaks

* more work on UI

* improve wording

* Hide Hints Stackpanel if all childrens are hidden as well

* ControllerRefresh: move non-UI logic away from Dispatcher

* cleanup

* Improve gamepad navigation

When navigating, don't focus TextBox if IsReadOnly

* Change Serilog.Sinks.File MinimumLevel to Information

This should prevent AutoTDP and TDP control to flood the log.

* Increase GPUManager robustness (#166)

- GPUManager should be started before Profile and PowerProfile managers to avoid an IGCL/ADLX calls from being made before they're initialized.
- Implemented an IsInitialized check before executing any ADLX/IGCL calls.
- Implemented a try{] catch{} on GPU Execute().
- Halt Telemetry timer before closing IGCL/ADLX.

* Update README.md to include Droix Discord link (#168)

* Improvement Increased gyro aiming down sites multiplier lower range. (#165)

* Improve process detection, sort and add #947 (#164)

- Sorted Desktop list alphabetically to prevent possible duplicate entries in the future
- Added PC Manager and PowerToys' MouseWithoutBorders:

* Translation and localization update (#167)

* Improvement, translations update.

* Localization support for Device page Legion Go settings.

* Support GPD WIN MINI (Initial) (#169)

* allow LibreHardwareMonitor to start on HC startup (#171)

* Misc UI (#170)

* display "no virtual controller" error properly

* remove thread.Join() calls to avoid freezing the thread manager

* When XInput is drunk, add a delay

* safer thread manipulations

* improve threading management

* Update DynamicLightingManager.cs

* Fix optional uninstall of HidHide (#172)

* migrate fan control to PerformanceManager (#173)

* GPD WIN MINI Fan Control (#174)

* prevent crash on device cooperative level check (#176)

when device is null

* fix crash on HC close when an IGCL or ADLX task is running (#175)

* fix crash on HC close when an IGCL or ADLX task is running

* also check telemetry locks

* might be better to use Task.Delay on InitializeDirect3DDevice()

because it is called by SettingsManager

* test fix QT locks

* Build 0.20.4.0

* overlayfix

* VRAMUsage is MiB not %

* do not try and restore default GPU frequency on AMD GPUs

* Update HidHide to 1.4.202 (#182)

Fixing the rare case of soft-brick issue on uninstallation caused by a race condition

* Merge EA into Mainline

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Cedric Lewe <[email protected]>
Co-authored-by: Matthias Seys <[email protected]>
Co-authored-by: Abdullah Hamed <[email protected]>
Co-authored-by: CasperH2O <[email protected]>
Co-authored-by: CasperH2O <[email protected]>
Co-authored-by: Matthias Seys <[email protected]>
  • Loading branch information
8 people authored Feb 3, 2024
1 parent a3325e4 commit b4dee01
Show file tree
Hide file tree
Showing 119 changed files with 14,390 additions and 4,552 deletions.
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',
'', 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
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);

[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);

[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;
}
}
}
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

0 comments on commit b4dee01

Please sign in to comment.