-
Notifications
You must be signed in to change notification settings - Fork 15
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
X63 support #7
Comments
While the X3 coolers are supported by liquidctl, the protocol is not very well understood. And hwmon kernel drivers work in a significantly different manner than liquidctl. It's very likely that a lot of experimentation will be necessary, and I don't have one of these devices. But if you're willing to be the main author of the driver, I can certainly help. |
I'll see what I can do. I looked over the code in both liquidctl and the current hwmon driver... I'll try to spend some time experimenting over the next few days.
…On Mon, May 10, 2021, at 8:32 PM, Jonas Malaco wrote:
While the X3 coolers are supported by liquidctl, the protocol is not very well understood. And hwmon kernel drivers work in a significantly different manner than liquidctl.
It's very likely that a lot of experimentation will be necessary, and I don't have one of these devices. But if you're willing to be the main author of the driver, I can certainly help.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#7 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AADSRCCPBIDHKOVBSDDGERTTNCJL7ANCNFSM44TMULKQ>.
|
Well, take a look at the code in the It's completely untested, and quite ugly (the main driver structure hasn't been adjusted for the X3 models, nor for future support of the Z3 models)... but it may be close to functional. I suggest you try it in QEMU first (passing through the device), as it's not fun to crash drivers on your running kernel. Personally, I use virtme as a helper, which avoids having to build a FS image. When using virtme/QEMU it will probably be easier to build a full (but minimal) kernel. For this you can use my # clone the appropriate branch from jonasmalacofilho/linux and cd into the directory
git clone https://github.com/jonasmalacofilho/linux/ --branch w-hwmon-add-nzxt-kraken3
cd linux
# create a base kernel config with support for KVM (for QEMU/virtme)
make defconfig
virtme-configkernel --update
# enable the nzxt-kraken3 driver in the kernel config
echo CONFIG_SENSORS_NZXT_KRAKEN3=y >> .config
make olddefconfig
# build the kernel
# (adjust the -j parameter to the number of hardware threads)
make -j12
# run the kernel in QEMU with virtme
# (adjust USB hostbus and hostaddr to match your setup)
# (to exit QEMU: Ctrl-a + x)
virtme-run --kdir . --mods=auto --cpus 4 -q-usb -q-device -qusb-host,hostbus=1,hostaddr=5 -adebug --pwd |
@minego have you been able to take a look at the code in the By the way, if if seems that no response is ever processed, it may be that the check for |
I haven't had a chance yet.
…On Fri, May 14, 2021, at 9:27 AM, Jonas Malaco wrote:
@minego <https://github.com/minego> have you been able to take a look at the code in the `kraken3-basic-x3-support` <https://github.com/liquidctl/liquidtux/tree/kraken3-basic-x3-support> branch?
By the way, if if seems that no response is every processed, it may be that the check for `STATUS_REPORT_ID` needs to be removed. Taking a second look at Tom's driver for liquidctl, it's possible that report IDs/numbers are not used by this device.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#7 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AADSRCDI76MEE6KI32XUUQ3TNU6PXANCNFSM44TMULKQ>.
|
I also interesting in because this device does not support FAN control and we need to emulate somehow FAN control depends on water temp instead of CPU temp. It's why this driver very important. |
nzxt-kraken3 driver looks very simple, I can help you. |
@jonasmalacofilho not really work:
but init is fine:
liquidctl at the same time working fine. |
Ok, I can see only one and wrong raw event: |
ok, I know why... let's test it |
it's working! I will make PR.
|
@jonasmalacofilho I am interesting in upstream it. |
That's great, @stalkerg! Let me know if you need help preparing or sending the patch. |
Actually, don't we want to implement pump control on this driver before upstreaming it? The older Kraken X2 coolers had some limitations that made fan/pump control unsuitable for a hwmon driver, but I don't think this necessarily applies anymore for X3 [and later Z3] coolers. |
Yes, we can try, but we should put some time limits. I mean, upstreaming still much more important than pump control. |
Do you mean that we set a PWM x temperature control curve? If so, that's correct, but the hwmon subsystem supports that as well; the hwmon documentations refers to those as "auto points". Additionally, it's possible that the device also features a "direct" mode, The previous generation (X2) does, albeit with some caveats. |
auto points look tricky, we should create a custom attribute group... also currently we write (59+1)-20 = 40 points what unusual for hwmon because for each point we create two sysfs files. We can also use interpretation but in that case, we should decide how many points we want to see and it will be static. |
The hwmon documentation explicitly instructs avoiding custom attributes.
I don't follow.
I don't think that's necessary, as the available set of points at the protocol level is static. |
At the same time, I can't find examples with auto points and without custom attributes. (I checked probably all drivers) Also, official documentation not talking much about auto points, they provide some sysfs patterns as is. If you can find more will be interesting to looking into.
I hope too but again, usually, all other drivers have ~4-5 points maximum but now we should provide 40. |
I didn't know that. What custom attributes do you have in mind? And it might be worth discussing on the hwmon mailling list about this before working on the actual patch. |
yes, it's a good idea, probably it's possible just a lack of documentation this auto point is not so popular thing in hwmon. |
Both sensors and curves have been implemented for some time for the X63 and others. I think that this issue can be closed? |
I think so, but I would like to check "write" function. I will try to do it today. |
hmm |
Okey seems like if we have already |
okey, we have two issues:
|
Thanks, I'll look into it. For values |
thanks, yes, I understand, but PWM from userspace should be "virtual" (from my point of view). If I settle 20, I should read 20 even if the device receives 50 instead or any other valid minimum value. |
The PWM is converted from the duty which is read directly from the device, we can't lie about it. |
Do you remember an exact instance of this happening, and what were both of the values (written and read back) in question?
I agree with @aleksamagicka that the driver should present the current PWM value (as) reported by the device. And my interpretation of the hwmon sysfs ABI is that it would be wrong for userspace to expect otherwise, since hwmon drivers should match device behavior and state as closely as possible. |
I see I didn't explain this. @stalkerg is referring to the cases when you write (for example)
This happens because the devices don't offer enough precision for the percentage, and in that case mapping between 0-100 range and 0-255 range can't be completely retained. In the case of Aquacomputer devices and the aquacomputer_d5next driver, centi-percents are used, so the calculation looks like this:
|
@aleksamagicka, oh, that makes sense. Thanks for the explanation. |
Can you point this into documentation or so? I need arguments for the fan2go developer. He made the daemon and program from entirely different assumption. |
Actually, nzxt-smart2 driver does "lie" about pwm a bit: https://github.com/liquidctl/liquidtux/blob/master/nzxt-smart2.c#L490-L503 Yes, the version in the kernel tree too: https://github.com/torvalds/linux/blob/master/drivers/hwmon/nzxt-smart2.c#L484-L497 Because otherwise pwmconfig and fancontrol don't work well (see the comment). |
Lines 490 to 503 in 8524d61
Oh, I forgot about that. Thanks for reminding us. @aleksamagicka, in light of that, do you want to do the same here? Additionally, according to that comment, the issue also affects fancontrol, which is more or less the cannonical userspace for hwmon PWM control. Please disregard that statement. I can't find anything the hwmon documentation to really back that up... maybe I got that impression from watching the mailing list, or maybe I'm just plainly wrong. |
Although the comment isn't accurate... nzxt-smart2 performs rounding too, so you won't always read back exactly the same pwm value you've written. And if you changed it by just 1 or 2, you may read the same value - the difference might be lost during the conversion to percent and back. But when the userspace changes the value significantly, the driver should respond - i. e. after At least that's what was necessary to make fancontrol behave reasonably well. |
Sorry, I want to add a more general topic: I also fixed a similar bug with rounded in amdgpu for vega (they did even more - simulate PWM based on RPM and depend on firmware it show noise). Sorry, for the "offtopic" and some emotions. |
Ah, had no idea that was allowed. Thanks for the pointer in nzxt-smart2. Like you, I got the same impression of no leeway from the docs. Noted on the 0, will look into that as well. Reopening for now. |
I'd like to be able to access the liquid temperature reported by my Kraken X63, so I can see it with the sensors command and use it as an input for fancontrol.
The text was updated successfully, but these errors were encountered: