MSI-mystic-light-tool icon indicating copy to clipboard operation
MSI-mystic-light-tool copied to clipboard

GetDeviceInfo dump

Open SimoDax opened this issue 7 years ago • 9 comments

Has anyone managed to get the list of devices and led areas? Can you post a screen or dump of what GetDeviceInfo returns?

SimoDax avatar Jan 04 '18 12:01 SimoDax

Have been trying this evening but whenever I call MLAPI_GetDeviceInfo() it returns the MLAPI_TIMEOUT status 😞

battlemoose avatar Jan 08 '18 15:01 battlemoose

@battlemoose what's your hardware setup?

SimoDax avatar Jan 09 '18 08:01 SimoDax

@SimoDax Using an MSI Z370 SLI PLUS LGA 1151-2 Motherboard with a DeepCool RGB cooler attached to the RGB header. Have Mystic Light 2 installed.

battlemoose avatar Jan 11 '18 01:01 battlemoose

Hm, I actually don't know why it fails, the code has no control of what happens inside the dll :( My best bet is that the library is still buggy.. Anyway you could give it a shot using ml 1 instead of 2

Update: I've tricked the library to initialize despite Mystic Light 2 saying that my platform isn't supported and GetDeviceInfo returns MLAPI_TIMEOUT here aswell. I've then tried calling GetDeviceInfo(NULL, NULL) and the result is the same. I guess it fails uncaring of the parameters you pass. I mean, if it had tried to load the info it would have dereferenced a null pointer, so I was expecting either a crash or some other error message.. certainly not a timeout. Not much I can do at this point, maybe contacting MSI could be of some help?

SimoDax avatar Jan 11 '18 11:01 SimoDax

Tried with ML1 installed and a system not supported error is returned on initialisation. Agreed that it sounds like an issue with the library and there isn't much that can be done short of contacting MSI.

battlemoose avatar Jan 21 '18 02:01 battlemoose

Hey guys, after playing around with the code, I figured out why it was timing out. You have to run the app as administrator in order for it to work and of course, you do need Mystic Light installed for it to function properly as well.

I'm new to this git thing and dunno how to do a pull request or fork or whatever. So here's a pastebin link containing the modified code. I was also able to map out some of my LEDs.

https://pastebin.com/fm0kkkqX

Also keep in mind, I'm running an MSI X399 board, so the LED integers might not apply to your device.

EDIT:

Here's a screenshot of my console window. And all my LEDs in my tower changed red after I ran it. https://jugglingcode.com/snapshot/71X3smd1524.png

Another thing I wanted to point out, I don't think LED count is set properly. I think there is an issue in MSI's library, because there are definitely not "19548964" LEDs on my motherboard.

jugglingcode avatar Jul 06 '18 21:07 jugglingcode

Thank you man! I honestly hadn't thought about administrator rights.

I tried it just now and.. yes, it gets past the initialization! Unluckily my B350 is friends with Mystic Light 1 only, so the sdk fails after that point, but I'm glad it works for people with the newer version

I'll edit the code and the readme accordingly :)

EDIT: Regarding the led count, what happens if you call GetLedInfo with an index which is not mapped to a real led zone? If it returns something different from MLAPI_OK it could be used to get the proper led count. (Theoreatically I'd expect MLAPI_DEVICE_NOT_FOUND, but given the current state of the sdk I wouldn't be surprised if the call leads straight up to a segmentation fault)

SimoDax avatar Jul 07 '18 08:07 SimoDax

I did a lot of testing, I went all the way up to 50 just to be sure, but my particular motherboard had 6 LED areas. I technically have 7 because I have that little POST code screen and a power/reset button built onto the motherboard, but it just returns "MLAPI_NOT_SUPPORTED". As for any LED that didn't exist, it just returned "DEVICE_NOT_FOUND". Granted I only did this with SetLedColor, but I imagine it'll be the same for the other methods.

jugglingcode avatar Jul 07 '18 14:07 jugglingcode

Hi @jugglingcode

Another thing I wanted to point out, I don't think LED count is set properly. I think there is an issue in MSI's library, because there are definitely not "19548964" LEDs on my motherboard.

Try to declare ledCount as array of BSTR and see if it helps

CComSafeArray<BSTR> ledCount;

You can then convert it to int:

int count = _wtoi(ledCount.GetAt(0));

intrueder avatar Aug 27 '18 11:08 intrueder