DarthAffe / RGB.NET

The one-stop SDK for RGB-peripherals

Home Page:http://lib.arge.be

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Null Reference when initialising MSI SDK

Riccorbypro opened this issue · comments

This issue may be similar to #37. I originally encountered this when trying to sync my GPU (ROG Strix 3070) and Motherboard (MSI X570-A Pro) in Artemis, and when enabling the Mystic Light plugin it threw a Null Reference error which was in RGB.NET.

I have run the MsiSDKTest solution on my PC and got the following output:

Starting ...
Initialized! (ErrorCode: -3)
Exception:
Object reference not set to an instance of an object.

It's worth noting that Mystic Light does work in Dragon Center, and I have tried running both with Dragon Center running and closed. Additionally, I tried without LEDKeeper2 running, this is MSI's program that keeps your lighting set without Dragon Center open.

Please let me know if you need any other info from me. I will be posting and linking to this issue in Artemis's issues as well.

The SDK-docs list -3 as:

MLAPI_NO_IMPLEMENTED = -3
Description: MSI application not found or installed version not supported.

I just checked the msi page and there is a newer sdk available -> hopefully it's just the sdk not compatible with a current dragon center.
Could you try to run the test-application with the new sdk-dll? (http://download.msi.com/uti_exe/Mystic_light_SDK.zip)
It might not work at all due to changes to the api, but its worth a try. I'll look into updating the packages once we know if it works or if not what the error is.

So running the test app with the new DLL initialises successfully (I assume since that's usually what code 0 means), but it still gets that NullReferenceException afterwards when trying to get the device info (L19 in the test app).

For some reason GetDeviceInfo() is coming back as result -2 and returning ledCount as null.
image

Do you have a link to the documentation for the MSI SDK? A few minutes of googling has only managed to link me back to either reddit posts about how bad it is and a few projects here and there trying to use it, but no actual docs from MSI,

https://storage-asset.msi.com/files/pdf/Mystic_Light_Software_Development_Kit.pdf
(at the bottom of https://de.msi.com/Landing/mystic-light-rgb-gaming-pc/download)
-2 is timeout, we had this quite a lot in the past. It might help to run it as admin.

OK so running as admin with the new SDK DLLs works (albeit there's no change to RGB because I only have JRAINBOW1 and 2 plugged in, not JRGB1 which is what gets changed). Does this mean that the version of RGB.NET that Artemis uses needs to be updates, and that Artemis needs to be run as admin?

  1. Yes I'll update the SDK - Artemis will get it automatically once that's done.
  2. Most likely yes; Artemis can enforce running as admin if a specific module is loaded though (@SpoinkyNL)