CorsairOfficial / cue-sdk

Corsair iCUE SDK
https://corsairofficial.github.io/cue-sdk/
215 stars 23 forks source link

iCUE 4 - Commander Pro not fully controllable #22

Closed RobertBeekman closed 3 years ago

RobertBeekman commented 3 years ago

Hello,

After updating to iCUE 4, the SDK can no longer control all LEDs. It is still reporting 6 fans with 16 LEDs each, their colors simply aren't updating though.

Here I set everything to white, but only the first 2,5 fans updated. image

intrueder commented 3 years ago

I can confirm that this behavior can be reproduced with the old version of the CUESDK (3.0.301). With the new version of the CUESDK, this problem does not appear. Please, update CUESDK to the latest version: https://github.com/CorsairOfficial/cue-sdk/releases/tag/v3.0.361

RobertBeekman commented 3 years ago

Hello, are you sure the same build was used as is available on GitHub?

I checked the Protocol Details and it contains the following, while the issue is occuring. image

RobertBeekman commented 3 years ago

Just to clarify, the original report was with 3.0.301, updating to 3.0.361 did not resolve the issue

intrueder commented 3 years ago

Hey, @SpoinkyNL Thanks for the details.

I looked at how RGB.NET is implemented, and the reason you faced the issue is that RGB.NET does not read actual LEDs from the device, but tries to guess LED identifiers: CorsairCustomRGBDevice.cs#L44 The problem with this approach is that iCUE does not guarantee the order of the LEDs (and by coincidence, the order changed in the new iCUE version), and it would be safer to get the actual list of LEDs by calling the CorsairGetLedPositionsByDeviceIndex function.

RobertBeekman commented 3 years ago

Hey @intrueder thanks for taking the extra effort of going through RGB.NET! DarthAffe will work on a fix since he best knows RGB.NET and I'll test it. I'll report back to close the issue once we've resolved this.

Thanks again 👍🏻

RobertBeekman commented 3 years ago

The proposed solution worked well, thanks :)

DarthAffe commented 3 years ago

@intrueder I'd like to ask one more question about this: While the solution seems to work fine right now, we still have a part in it where we expect a specific order to be returned by the SDK. Since it's not possible to get LED-positions by channel, we expect the LEDs of the device to be in the same order as the channels on the device, skip by an offset and assign the amount stated in the channel definition. (https://github.com/DarthAffe/RGB.NET/blob/Development/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDevice.cs#L41) Is this safe to do?

(And slightly OT: Is it intended, that the debug-devices are gone in iCUE 4? They where really handy for that kind of work, since it's quite hard to get around this just with the docs - always easier to see a real result from the SDK^^)

intrueder commented 3 years ago

Hey @DarthAffe, Sorry for the delayed response. You can rely on the order of the channels, but not the order of the LEDs in the channel. Thus, the LEDs of the second channel will always follow the LEDs of the first channel. If the order of the LEDs in the channel matters, you can order them by ledId