Skip to content
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

Add experimental partial support for ASUS ROG RYUJIN II 360 #653

Merged
merged 28 commits into from
Jan 11, 2024

Conversation

FlorianFreudiger
Copy link
Contributor

@FlorianFreudiger FlorianFreudiger commented Dec 24, 2023

Hello, I implemented a driver for the ASUS ROG RYUJIN II 360 liquid cooler.
While there is a screen, I only implemented control and status requests of the pump, the embedded fan and the attached fan controller.

Since I only own the 360mm variant I don't know how similar the first and third generations and the different sizes are to one another, so I was a bit confused on what I should name the driver, documentation, etc.

I also noticed that requesting device status does sometimes time out, maybe I am missing something

Fixes:
Closes:
Related:


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/

Copy link
Member

@aleksamagicka aleksamagicka left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Some comments enclosed.

I also noticed that requesting device status does sometimes time out, maybe I am missing something

Did you try without the official software running? Often the official software will meddle with or outright prevent liquidctl and others from accessing the device(s).

liquidctl/driver/asus_rog_ryujin.py Outdated Show resolved Hide resolved
docs/asus-rog-ryujin-guide.md Outdated Show resolved Hide resolved
docs/developer/protocol/asus_rog_ryujin.md Outdated Show resolved Hide resolved
liquidctl/driver/asus_rog_ryujin.py Outdated Show resolved Hide resolved
@FlorianFreudiger
Copy link
Contributor Author

Did you try without the official software running? Often the official software will meddle with or outright prevent liquidctl and others from accessing the device(s).

Interestingly, I experience the opposite, the timeouts only occur sometimes when dual-booting to a Linux system that does not have any official software installed.
When the official software is or was running on a Windows system, I didn't experience any timeout (yet).

Maybe I am missing some initialization?

@aleksamagicka
Copy link
Member

Maybe I am missing some initialization?

That's possible, I seem to recall a device that needs an init, otherwise results could be inconsistent. (Can't remember the exact name.)

Look up what the official software sends once it loads.

@FlorianFreudiger
Copy link
Contributor Author

Turns out the timeouts were caused by clear_enqueued_reports() being called after write() but before read()...
Moving clear_enqueued_reports() to before write() calls fixed this issue

@aleksamagicka
Copy link
Member

Right, should have noticed it earlier. That's also how the NZXT Kraken Z driver code does it, since those also require a command to get back status. Clearing before a read is fine if the device is sending status on its own, like Aquacomputer usually does.

@FlorianFreudiger FlorianFreudiger marked this pull request as ready for review December 27, 2023 18:20
docs/asus-rog-ryujin-guide.md Outdated Show resolved Hide resolved
tests/test_asus_rog_ryujin.py Outdated Show resolved Hide resolved
liquidctl/driver/asus_rog_ryujin.py Outdated Show resolved Hide resolved
docs/asus-rog-ryujin-guide.md Outdated Show resolved Hide resolved
@aleksamagicka
Copy link
Member

(Side note, looks like Github doesn't send an email when the PR is marked as ready for review? Would have looked earlier if it did.)

@FlorianFreudiger
Copy link
Contributor Author

(Side note, looks like Github doesn't send an email when the PR is marked as ready for review? Would have looked earlier if it did.)

No worries, apparently GitHub only sends such updates to assigned reviewers

@aleksamagicka
Copy link
Member

No worries, apparently GitHub only sends such updates to assigned reviewers

TIL. Github logic, I guess. Feel free to ping if ever needed in that case.

I think this LGTM. Are you on Linux by chance? I think I can whip up a kernel driver for this.


@jonasmalacofilho, can you please look over?

@FlorianFreudiger
Copy link
Contributor Author

Are you on Linux by chance? I think I can whip up a kernel driver for this.

I am dual-booting both Windows and Linux, I tested the driver on both systems. I can help with testing a kernel driver

@aleksamagicka
Copy link
Member

Thanks. Well, here it is, you just need to run make dev after cloning (it will generate harmless output) and it should show up in sensors (lm-sensors package, usually). Instructions for setting fan speeds are in the README.

Hopefully I got most of it right! Please report if something is off or doesn't work.

Also, quick question: how does the fan controller connect to the AIO?

@FlorianFreudiger
Copy link
Contributor Author

Thanks. Well, here it is

Well, that was quick! Will test it later today or tomorrow!

Also, quick question: how does the fan controller connect to the AIO?

The cooling block is connected to the fan controller via USB micro-B cable (plugging into the controller).
See cabling on pages 17-19 in the quick start guide.

I believe this cable also powers the pump, meaning you cannot use the cooler without the fan controller.

@FlorianFreudiger
Copy link
Contributor Author

FlorianFreudiger commented Jan 2, 2024

Apparently the Ryujin II is the only generation that uses this weird fan controller combo, both Ryujin (I) and Ryujin III don't have it included, connecting directly to the motherboard instead.


As a side note, I also found an open issue on OpenRGB for the Ryujin (I), containing some protocol data.
The headers seem to be a bit different but I think if implemented in the future it probably makes sense to keep them both in the same driver.

OpenRGB supports liquid coolers of the ASUS Ryuo family which at a quick glance seem to also have similar protocols (excerpt status function). Also concerns #560.

aleksamagicka added a commit to aleksamagicka/linux that referenced this pull request Jan 4, 2024
This driver exposes hardware sensors of the ASUS ROG RYUJIN II 360
all-in-one CPU liquid cooler, which communicates through a proprietary
USB HID protocol. Report offsets were initially discovered in [1] by
Florian Freudiger.

Available sensors are pump, internal and external
(controller) fan speed in RPM, as well as coolant temperature
and their duties in PWM.

Attaching external fans to the controller is optional and allows them
to be controlled from the device. If not connected, the fan-related
sensors will report zeroes. The controller is a separate hardware unit
that comes bundled with the AIO and connects to it to allow fan control.

The addressable LCD screen are not supported in this
driver and should be controlled through userspace tools.

[1]: liquidctl/liquidctl#653

Tested-by: Florian Freudiger <florian.freudiger@proton.me>
Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com>
aleksamagicka added a commit to aleksamagicka/linux that referenced this pull request Jan 4, 2024
This driver exposes hardware sensors of the ASUS ROG RYUJIN II 360
all-in-one CPU liquid cooler, which communicates through a proprietary
USB HID protocol. Report offsets were initially discovered in [1] by
Florian Freudiger.

Available sensors are pump, internal and external
(controller) fan speed in RPM, their duties in PWM, as well as
coolant temperature.

Attaching external fans to the controller is optional and allows them
to be controlled from the device. If not connected, the fan-related
sensors will report zeroes. The controller is a separate hardware unit
that comes bundled with the AIO and connects to it to allow fan control.

The addressable LCD screen are not supported in this
driver and should be controlled through userspace tools.

[1]: liquidctl/liquidctl#653

Tested-by: Florian Freudiger <florian.freudiger@proton.me>
Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com>
aleksamagicka added a commit to aleksamagicka/linux that referenced this pull request Jan 4, 2024
This driver exposes hardware sensors of the ASUS ROG RYUJIN II 360
all-in-one CPU liquid cooler, which communicates through a proprietary
USB HID protocol. Report offsets were initially discovered in [1] by
Florian Freudiger.

Available sensors are pump, internal and external
(controller) fan speed in RPM, their duties in PWM, as well as
coolant temperature.

Attaching external fans to the controller is optional and allows them
to be controlled from the device. If not connected, the fan-related
sensors will report zeroes. The controller is a separate hardware unit
that comes bundled with the AIO and connects to it to allow fan control.

The addressable LCD screen is not supported in this
driver and should be controlled through userspace tools.

[1]: liquidctl/liquidctl#653

Tested-by: Florian Freudiger <florian.freudiger@proton.me>
Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com>
aleksamagicka added a commit to aleksamagicka/linux that referenced this pull request Jan 4, 2024
This driver exposes hardware sensors of the ASUS ROG RYUJIN II 360
all-in-one CPU liquid cooler, which communicates through a proprietary
USB HID protocol. Report offsets were initially discovered in [1] by
Florian Freudiger.

Available sensors are pump, internal and external
(controller) fan speed in RPM, their duties in PWM, as well as
coolant temperature.

Attaching external fans to the controller is optional and allows them
to be controlled from the device. If not connected, the fan-related
sensors will report zeroes. The controller is a separate hardware unit
that comes bundled with the AIO and connects to it to allow fan control.

The addressable LCD screen is not supported in this
driver and should be controlled through userspace tools.

[1]: liquidctl/liquidctl#653

Tested-by: Florian Freudiger <florian.freudiger@proton.me>
Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com>
aleksamagicka added a commit to aleksamagicka/linux that referenced this pull request Jan 4, 2024
This driver exposes hardware sensors of the ASUS ROG RYUJIN II 360
all-in-one CPU liquid cooler, which communicates through a proprietary
USB HID protocol. Report offsets were initially discovered in [1] by
Florian Freudiger.

Available sensors are pump, internal and external
(controller) fan speed in RPM, their duties in PWM, as well as
coolant temperature.

Attaching external fans to the controller is optional and allows them
to be controlled from the device. If not connected, the fan-related
sensors will report zeroes. The controller is a separate hardware unit
that comes bundled with the AIO and connects to it to allow fan control.

The addressable LCD screen is not supported in this
driver and should be controlled through userspace tools.

[1]: liquidctl/liquidctl#653

Tested-by: Florian Freudiger <florian.freudiger@proton.me>
Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this pull request Jan 8, 2024
This driver exposes hardware sensors of the ASUS ROG RYUJIN II 360
all-in-one CPU liquid cooler, which communicates through a proprietary
USB HID protocol. Report offsets were initially discovered in [1] by
Florian Freudiger.

Available sensors are pump, internal and external
(controller) fan speed in RPM, their duties in PWM, as well as
coolant temperature.

Attaching external fans to the controller is optional and allows them
to be controlled from the device. If not connected, the fan-related
sensors will report zeroes. The controller is a separate hardware unit
that comes bundled with the AIO and connects to it to allow fan control.

The addressable LCD screen is not supported in this
driver and should be controlled through userspace tools.

[1]: liquidctl/liquidctl#653

Tested-by: Florian Freudiger <florian.freudiger@proton.me>
Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com>
Copy link
Member

@jonasmalacofilho jonasmalacofilho left a comment

Choose a reason for hiding this comment

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

The implementation looks very good to me. But I think we can improve the names and the output of the various fan channels.

I also have some nitpicks on how we should name the device and filenames, mostly related to ASUS marketing noise, but also for consistency with our other ASUS drivers.

README.md Outdated Show resolved Hide resolved
docs/README.md Outdated Show resolved Hide resolved
docs/asus-rog-ryujin-guide.md Outdated Show resolved Hide resolved
docs/asus-rog-ryujin-guide.md Outdated Show resolved Hide resolved
docs/asus-rog-ryujin-guide.md Outdated Show resolved Hide resolved
liquidctl/driver/asus_rog_ryujin.py Outdated Show resolved Hide resolved
docs/asus-rog-ryujin-guide.md Outdated Show resolved Hide resolved
tests/test_asus_rog_ryujin.py Outdated Show resolved Hide resolved
tests/test_asus_rog_ryujin.py Outdated Show resolved Hide resolved
tests/test_asus_rog_ryujin.py Outdated Show resolved Hide resolved
@FlorianFreudiger FlorianFreudiger marked this pull request as draft January 11, 2024 14:05
@jonasmalacofilho
Copy link
Member

jonasmalacofilho commented Jan 11, 2024

You can ignore the unrelated second failure on tests/test_kraken3.py::test_krakenz3_not_totally_broken (related: #661).

The first failure is due to tests/test_asus_ryujin.py::test_status needing to be updated after the driver changes.

@FlorianFreudiger FlorianFreudiger marked this pull request as ready for review January 11, 2024 15:45
liquidctl.8 Show resolved Hide resolved
@jonasmalacofilho
Copy link
Member

Merging, thanks!

@jonasmalacofilho jonasmalacofilho merged commit da82c65 into liquidctl:main Jan 11, 2024
1 of 9 checks passed
ColinIanKing pushed a commit to ColinIanKing/linux-next that referenced this pull request Feb 5, 2024
This driver exposes hardware sensors of the ASUS ROG RYUJIN II 360
all-in-one CPU liquid cooler, which communicates through a proprietary
USB HID protocol. Report offsets were initially discovered in [1] by
Florian Freudiger.

Available sensors are pump, internal and external
(controller) fan speed in RPM, their duties in PWM, as well as
coolant temperature.

Attaching external fans to the controller is optional and allows them
to be controlled from the device. If not connected, the fan-related
sensors will report zeroes. The controller is a separate hardware unit
that comes bundled with the AIO and connects to it to allow fan control.

The addressable LCD screen is not supported in this
driver and should be controlled through userspace tools.

[1]: liquidctl/liquidctl#653

Tested-by: Florian Freudiger <florian.freudiger@proton.me>
Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com>
Link: https://lore.kernel.org/r/20240108094453.22986-1-savicaleksa83@gmail.com
[groeck: Add HID dependency]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
srcres258 pushed a commit to srcres258/linux-doc that referenced this pull request Feb 9, 2024
This driver exposes hardware sensors of the ASUS ROG RYUJIN II 360
all-in-one CPU liquid cooler, which communicates through a proprietary
USB HID protocol. Report offsets were initially discovered in [1] by
Florian Freudiger.

Available sensors are pump, internal and external
(controller) fan speed in RPM, their duties in PWM, as well as
coolant temperature.

Attaching external fans to the controller is optional and allows them
to be controlled from the device. If not connected, the fan-related
sensors will report zeroes. The controller is a separate hardware unit
that comes bundled with the AIO and connects to it to allow fan control.

The addressable LCD screen is not supported in this
driver and should be controlled through userspace tools.

[1]: liquidctl/liquidctl#653

Tested-by: Florian Freudiger <florian.freudiger@proton.me>
Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com>
Link: https://lore.kernel.org/r/20240108094453.22986-1-savicaleksa83@gmail.com
[groeck: Add HID dependency]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
roxell pushed a commit to roxell/linux that referenced this pull request Feb 12, 2024
This driver exposes hardware sensors of the ASUS ROG RYUJIN II 360
all-in-one CPU liquid cooler, which communicates through a proprietary
USB HID protocol. Report offsets were initially discovered in [1] by
Florian Freudiger.

Available sensors are pump, internal and external
(controller) fan speed in RPM, their duties in PWM, as well as
coolant temperature.

Attaching external fans to the controller is optional and allows them
to be controlled from the device. If not connected, the fan-related
sensors will report zeroes. The controller is a separate hardware unit
that comes bundled with the AIO and connects to it to allow fan control.

The addressable LCD screen is not supported in this
driver and should be controlled through userspace tools.

[1]: liquidctl/liquidctl#653

Tested-by: Florian Freudiger <florian.freudiger@proton.me>
Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com>
Link: https://lore.kernel.org/r/20240108094453.22986-1-savicaleksa83@gmail.com
[groeck: Add HID dependency]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
roxell pushed a commit to roxell/linux that referenced this pull request Feb 26, 2024
This driver exposes hardware sensors of the ASUS ROG RYUJIN II 360
all-in-one CPU liquid cooler, which communicates through a proprietary
USB HID protocol. Report offsets were initially discovered in [1] by
Florian Freudiger.

Available sensors are pump, internal and external
(controller) fan speed in RPM, their duties in PWM, as well as
coolant temperature.

Attaching external fans to the controller is optional and allows them
to be controlled from the device. If not connected, the fan-related
sensors will report zeroes. The controller is a separate hardware unit
that comes bundled with the AIO and connects to it to allow fan control.

The addressable LCD screen is not supported in this
driver and should be controlled through userspace tools.

[1]: liquidctl/liquidctl#653

Tested-by: Florian Freudiger <florian.freudiger@proton.me>
Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com>
Link: https://lore.kernel.org/r/20240108094453.22986-1-savicaleksa83@gmail.com
[groeck: Add HID dependency]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
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.

None yet

3 participants