aarron-lee / SimpleDeckyTDP

Decky TDP plugin for alternative PC handhelds
Other
51 stars 8 forks source link

adjust debounce wait period for setting AC Power state #37

Closed Shaunathanz closed 4 months ago

Shaunathanz commented 4 months ago

I tested a few games with varying power demands and power configurations, docked and just charging.

Tested on Lenovo Legion Go using the 65W OEM charger.

The default 1000 ms wait is too small, power profiles still bounce back and forth. I had some periods where it took over 35 seconds for the AC power to kick back in.

The 60 second high ball fixes the issue for me regardless of power draw or game.

This is mainly to address the strange way the battery limit is implemented on the Lenovo Legion Go.

aarron-lee commented 4 months ago

Hrm, this will lead to a different problem where AC power profiles won't kick in until at minimum 60s after AC power is detected or disconnected.

Shaunathanz commented 4 months ago

I don't have much experience with React but maybe I could propose a configurable slider and an on/off toggle for the power profile switch delay as it could be preferable over a one-size-fits-all non-configurable delay

aarron-lee commented 4 months ago

To be honest, the debounce wasn't intended to solve the LGO problem, it was intended to handle for small amounts of jitter while AC power is being detected.

The LGO AC power problem can only be solved by Lenovo, since right now there's no way to distinguish legitimate AC power events vs the jittery events.

I could investigate making the debounce configurable, but it'd be low priority.

In the meantime though, you can run your own copy of SDTDP with a higher debounce