Add support for setting fan speed for Aquacomputer Octo#508
Add support for setting fan speed for Aquacomputer Octo#508jonasmalacofilho merged 9 commits intoliquidctl:mainfrom
Conversation
liquidctl/driver/aquacomputer.py
Outdated
| self._hwmon.write_int(hwmon_pwm_enable_name, 1) | ||
|
|
||
| # Some devices (Octo, Quadro and Aquaero) can not accept reports in quick succession, so slow down a bit | ||
| time.sleep(0.5) |
There was a problem hiding this comment.
Is a delay always necessary? Sleeping 500 ms would be quite noticiable: could we optimistically try without it, and only do it when necessary?
(Does it matter whether the previous write was redundant (i.e. when pwmX_enable was already set)?)
There was a problem hiding this comment.
I've set the delay to 0.2s now. I've been spamming it and it still behaved correctly, though 0.5s wasn't that noticeable, at least to me. Setting fan speed now takes about 0.3s as a whole, which feels instantaneous (it was ~0.1s previously).
There's no way to do it optimistically, it may accept setting the speed twice and fail the third time, out of the blue (without me spamming the commands, during normal testing). And we can't read the pwmX_enable value either, because that also triggers sending HID reports to the device to read the state (aside from sensor reports, the driver does not cache anything else).
There was a problem hiding this comment.
What I previously had in mind was something like:
# pseudo-code, I don't know the exact failure mode when the device isn't ready
try:
self._hwmon.write_int(hwmon_pwm_name, pwm_duty)
except OSError:
# Maybe the device couldn't handle the quick succession of reports; try one more time after a bit.
time.sleep(0.5)
self._hwmon.write_int(hwmon_pwm_name, pwm_duty)But a 0.2 s delay is already a lot better, and keeps things simpler, so I actually prefer it.
There was a problem hiding this comment.
For the record, the driver responds with -ENODATA.
Co-authored-by: Jonas Malaco <[email protected]>
|
Thanks! |
Add support for setting fan speeds for the Octo fan contoller in the
aquacomputer.pydriver. Also, refactor generating hwmonpwmXandpwmX_enableproperty names to a separate method.Related: #438
Checklist:
liquidctl.8Linux/Unix/Mac OS man pagedocs/*guide.mddevice guidesNew CLI flag?
extra/completions/New device?
extra/linux/71-liquidctl.rules(instructions in the file header)en)New driver?
docs/developer/protocol/