8000 Add experimental support for H110i GT by Serphentas · Pull Request #637 · liquidctl/liquidctl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add experimental support for H110i GT #637

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

Merged
merged 30 commits into from
Apr 30, 2024

Conversation

Serphentas
Copy link
Collaborator
@Serphentas Serphentas commented Nov 14, 2023

Describe what the changes are meant to address.

If the implementation is not trivial, please also include a short overview.

Fixes: n/a
Closes: n/a
Related: #142 #147


Checklist:

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 e) and git MRLV

New driver?

  • Document the protocol in docs/developer/protocol/

@Serphentas
Copy link
Collaborator Author

This is almost a 1:1 version of the original PR with simplified code in some parts.

@CRCinAU
Copy link
CRCinAU commented Nov 14, 2023

fwiw:

$ sudo python -m liquidctl status
Corsair H110i GT (experimental)
├── Liquid temperature    31.7  °C
├── Fan 1 speed            782  rpm
├── Fan 2 speed            784  rpm
└── Pump speed            2353  rpm

@Serphentas
Copy link
Collaborator Author

Per tests with @CRCinAU there is something broken in the driver when writing the fan/pump settings. The original version works fine.

@Serphentas Serphentas changed the title Add experimental support for H110i GT [DRAFT] Add experimental support for H110i GT Nov 14, 2023
@Serphentas
Copy link
Collaborator Author

Per last tests, this version now correctly changes the pump mode when using --pump-mode {quiet,extreme}.

@jonasmalacofilho jonasmalacofilho marked this pull request as draft November 19, 2023 06:01
jonasmalacofilho changed the title [DRAFT] Add experimental support for H110i GT Add experimental support for H110i GT Nov 19, 2023
@Serphentas
Copy link
Collaborator Author

Pump mode is now entirely supported with --pump-mode {quiet, extreme} but custom fan curves aren't applied properly. Will look into captures with @CRCinAU shortly.

@Serphentas
Copy link
Collaborator Author

Custom fan curves now work properly with max RPM per channel being read on demand.

@Serphentas
Copy link
Collaborator Author

@aleksamagicka Changes done per review. I see macOS tests are failing but it's not related to this PR, cannot rerun them either. Any clue ?

@aleksamagicka
Copy link
Member

I reran them and the issue persists, I'm not sure why that's happening as I've had very little contact with Mac machines generally. Perhaps Github changed something about their runners.

@Serphentas
Copy link
Collaborator Author

If you're OK with this peculiar situation, I suggest we move forward with the PR. We can ask Jonas for additional input if you prefer to be on the safe side.

@aleksamagicka
Copy link
Member

This doesn't seem to be tied to this PR specifically, I just reran it in another PR and it fails as well. Seems like libusb or something like it is missing?

@jonasmalacofilho, tagging you since you surely know more about this than me :)

@jonasmalacofilho
Copy link
Member

The problem isn't related to this PR, but rather to a change in what the macos-latest runner points to. Very basically, we're now running on the M1/ARM architecture, and Python's find_library and homebrew don't play well there.

Homebrew has a patch for its Python formulas to fix this issue, but we're using actions/setup-python to install our Python interpreters, and that provide us with stock CPython. (Possibly even x86-64 Python, according to its documentation... but that would be too weird, so I'm guessing the docs are wrong).

There doesn't seem to be an obvious way to handle this... we want to look in the Homebrew library path, but we also need to decide whether to give it priority or not, and also check that the architecture matches (at least 67E6 if that isn't the last path tried).

It's quite surprising that something like this was left for downstreams to solve. And it seems that some are resorting to shipping their own copies of the relevant dylibs...

Anyway, this is something I'll try to handle in PyUSB, so it really isn't related to liquidctl at all. In the meantime, @aleksamagicka, maybe we should pin our tests to run on Mac 12 (still Intel)? My reasoning is that outdated tests are better than no tests at all.

We could instead disable the affected test cases, but I think they are worth more than having all the others running on the new runner. The whole point of these affected tests is that they are the only ones that actually test (something) about the platform, all others are almost exclusively using mocks.

@aleksamagicka
Copy link
Member
aleksamagicka commented Apr 27, 2024

Anyway, this is something I'll try to handle in PyUSB, so it really isn't related to liquidctl at all. In the meantime, @aleksamagicka, maybe we should pin our tests to run on Mac 12 (still Intel)? My reasoning is that outdated tests are better than no tests at all.

I think we should, no reason not to let them run - and not get CI errors each time until it's resolved. (And as I understand, that's what they've been running on anyway up to now?)

@jonasmalacofilho
Copy link
Member

And they did detect a real issue as soon as they ran on the affected platform. : )

(Too bad it's something that, in hindsight, PyUSB me should have fixed a long time ago... I probably underestimated the number of Mac users running non-brew Python: if that was truly as rare as I thought, actions/setup-python would probably use brew Python too).

@aleksamagicka
Copy link
Member

And they did detect a real issue as soon as they ran on the affected platform. : )

Touché :)

Maybe, when this is fixed, we can leave macos-12 in with macos-latest (at least, until macos-12 is deprecated) and cover both.

"""
num = 1
while True:
yield (num % 31) + 1
Copy link
Member

Choose a reason for hiding this comment

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

Is this really needed for this device? In the protocol docs you said a simple counter is sufficient, and this is slightly more complex that that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

At some point, we used random sequence numbers but it didn't work right. To simplify from the original PR, I changed it to a simple sequence outside of storage. We could change it to an even simpler yield num % 31, but I'm not sure if the current implementation is really that cumbersome.

Copy link
Member

Choose a reason for hiding this comment

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

The fact that random sequence numbers didn't work well suggests that some jumps in sequence numbers aren't acceptable to the device. Thus restarting the sequence at every invocation should also sometimes cause issues, and persisting the sequence in storage may be necessary after all.

While numbers modulo 32 seem to work, why not using the simpler full byte range (i.e. modulo 256), as seen in the captures? Well, actually, the full range except 0, which doesn't appear to be used. Something like

yield (num % 255) + 1

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We could use that but it implies testing the device again. Perhaps a quicker method (that's known to work) is to use the old implementation.

Copy link
Member

Choose a reason for hiding this comment

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

Fair point. And since this appears to work, and from sanmai's comment there that in general any per-command sequence seems to work, let's just keep things as is. At least for now/until bugs are reported...

@jonasmalacofilho
Copy link
Member
jonasmalacofilho commented Apr 28, 2024

Just a few minor notes (see above).

We are good for review now, data dumps available to include in the database.

Please add the data dumps to https://github.com/liquidctl/collected-device-data.

@jonasmalacofilho
Copy link
Member

@aleksamagicka,

Maybe, when this is fixed, we can leave macos-12 in with macos-latest (at least, until macos-12 is deprecated) and cover both.

Ack. I think they might not be necessary with the fix being made (and tested) in PyUSB. But since Intel Macs are much more relevant to our project than most (because of Hackintoshes), maybe the extra CI jobs are worth it.

jonasmalacofilho added a commit that referenced this pull request Apr 30, 2024
jonasmalacofilho added a commit that referenced this pull request Apr 30, 2024
@Serphentas
Copy link
Collaborator Author

@jonasmalacofilho jonasmalacofilho merged commit 85f6a62 into liquidctl:main Apr 30, 2024
@jonasmalacofilho
Copy link
Member

Thanks!

@Serphentas Serphentas deleted the feat-h110i-gt branch April 30, 2024 19:07
@Serphentas
Copy link
Collaborator Author

Finally ! Thank you all, especially @CRCinAU for the many hours spent reversing and debugging :)

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.

4 participants
0