Skip to content

Add support for setting fan speed for Aquacomputer Octo#508

Merged
jonasmalacofilho merged 9 commits intoliquidctl:mainfrom
aleksamagicka:aqc-octo-write-support
Sep 23, 2022
Merged

Add support for setting fan speed for Aquacomputer Octo#508
jonasmalacofilho merged 9 commits intoliquidctl:mainfrom
aleksamagicka:aqc-octo-write-support

Conversation

@aleksamagicka
Copy link
Member

@aleksamagicka aleksamagicka commented Sep 23, 2022

Add support for setting fan speeds for the Octo fan contoller in the aquacomputer.py driver. Also, refactor generating hwmon pwmX and pwmX_enable property names to a separate method.

Related: #438


Checklist:

  • Adhere to the development process
  • Conform to the style guide
  • Verify that the changes work as expected on real hardware
  • Add automated tests cases
  • Verify that all (other) automated tests (still) pass
  • Update the README and other applicable documentation pages
  • Update the liquidctl.8 Linux/Unix/Mac OS man page
  • Update or add applicable docs/*guide.md device guides
  • Submit relevant data, scripts or dissectors to https://github.com/liquidctl/collected-device-data

New CLI flag?

  • Adjust the completion scripts in extra/completions/

New device?

  • Regenerate extra/linux/71-liquidctl.rules (instructions in the file header)
  • Add entry to the README's supported device list with applicable notes (at least en)

New driver?

  • Document the protocol in docs/developer/protocol/

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)
Copy link
Member

Choose a reason for hiding this comment

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

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)?)

Copy link
Member Author

@aleksamagicka aleksamagicka Sep 23, 2022

Choose a reason for hiding this comment

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

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).

Copy link
Member

@jonasmalacofilho jonasmalacofilho Sep 23, 2022

Choose a reason for hiding this comment

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

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

For the record, the driver responds with -ENODATA.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

@jonasmalacofilho
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants