-
Notifications
You must be signed in to change notification settings - Fork 13
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
Need help getting it to work #3
Comments
What issue are you facing? |
So basically when I load your code into visual studio 2017 and try to compile, I get an error saying "Unable to start program '(path-to-folder)\x64\Debug\MSI-mystic-light-tool.exe'. The system can't find the file specified." I have mystic light 3 installed if that would change anything. Also in the editor, lots of things are underlined with red lines, starting with the #include "MysticLight_SDK.h" As I said, I'm not familiar with visual studio. Maybe I made a mistake trying to import the project into the ide? How was I supposed to actually get the project into visual studio? |
Theoretically you just need to clone the repo and open the .sln file in visual studio. Anyway, try doing it manually: go to files>new>project. On the left go to Visual C++>Windows desktop and create a new windows console application. Name it |
Alright, it is compiling now at least. I'm getting "Function returned status code: Request is complete." and then nothing for a bit. Then I got a Debug Assertion Failed runtime library error in atlsafe.h line 273, expression m_psa != 0. If I don't do anything in that window for a while on the console I get "Function returned status code: MLAPI_Initialize is timeout." And then press any key to continue I'm guessing that might be because I'm running ML3? |
Try running visual studio as administrator, the program will inherit admin rights. |
Admin rights did work, though the led count is 14966932 so obviously that's wrong, but that should be fine, I'm only trying to make a color cycle effect. I am actually going to try to use logitech's sdk alongside msi's to synchronize my keyboard and mouse with the motherboard. Actually, as I was typing all this. After I press enter to continue after I see my device id, I get another assertion fail at atlsafe.h at line 199 expression (((HRESULT)(hRes)) >= 0) |
That's odd, I don't know what it could be, try looking at the call stack to see what function caused that call. I wouldn't give it much weight tho, as it happens just before the program closes. As for the led count, I had begun making a user interface with Qt, and this snippet should return the proper value (j):
|
I was just typing an edit, that didn't happen again after that time so I guess that's fine. I just tried a setColor just to test if I can use it though but it didn't work. I don't really need styles, I will write the color change myself with increasing/decreasing rgb values(I've already done that for logitech's sdk so I'll just put bunch of setColors). ml.setColor(devices.GetAt(i), 0, 255, 0, 0); That was the function call I used, most likely wrong because I have 0 as the second parameter but I'm assuming it should have something else. How would I call that function to set all LED's to the same color? |
You can't do it directly, look at the reference: You need to pass both the device and the led index. which ranges from 1 to how many leds areas are in your device. So you need a loop to call the function for each index edit: |
Yeah, after looking at your sample getStyle code I think I understand how
it works. I'm gonna give it a go later and see how it goes, thank you very
much.
…On Sat, 28 Jul. 2018, 20:09 SimoDax, ***@***.***> wrote:
You can't do it directly, look at the reference:
int MLAPI_SetLedColor(BSTR type, DWORD index, DWORD R, DWORD G, DWORD B)
You need to pass both the device and the led index. which ranges from 1 to
how many leds areas are in your device. So you need a loop to call the
function for each index
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AjOdsRfRdeif4O2PUtVmXCLhgfTDfsSQks5uLDhggaJpZM4Vk5NW>
.
|
So I've been trying to play around with it for a bit, but right now if I put any code after the print device type and led count in your sample loop(whether it is in the loop after that line or out of the loop) it just doesn't execute. I even threw in some prints to see if they worked but after your device type print, nothing else happens it just says press any key to continue. I tired jugglingcode's example as well, I'm still getting the same behavior. I put another print after that print and it worked, but the mlapi function calls after that don't work, and neither do the printStatus functions. "Exception thrown at 0x00000000 in MSI-mystic-light-tool.exe: 0xC0000005: Access violation executing location 0x00000000." is what I'm getting in the debugger when I try to call setColor after getting device info stuff. |
Seems like it runs the old code instead of compiling the new one. Have you tried cleaning and rebuilding the solution?
Put your code on gist or pastebin, I can't understand what you did |
I'm uploading everything to git at https://github.com/onuralpbicer/mystic-light-sdk-test I haven't really done almost any changes to the code anyways, I just added a setColor. Just to add, when I run with ctrl+f5, it doesn't give an error it just doesn't do anything after the initialization and getDevInfo. When I run it with the windows debugger button, it breaks with an exception at the first mlapi function I try to call(i've tried different functions too) after getDevInfo. |
You forgot to initialize the aditional pointers to the mystic light functions. By default they have a NULL value, which is a C macro for 0, which is a forbidden memory address, resulting in an access violation. Add the initialization in loadLib(), my stub only used init, errorMsg and getDevInfo so you'll want to add at least |
Ohhhhh, that makes a lot of sense. I'll try that in a bit. |
Alright, when I did that looks like everything is working. Though, I was still getting an exception because of the safearrays when the program quits, and I figured out why that happened. You need to add the following code to the end of the program before you exit.
I should be able to figure out the rest of the stuff and get it working with Logitech's sdk too to get both devices synched up. Thanks a lot! |
Another little snag, everything about what you've written is working and the sdk is working properly, but my board can apparently only have 7 colors, even in sdk. So I either need to figure out a way to make it show more colors which I'd assume isn't possible, or I have to make it kind of a breathing effect when changing colors. The problem with that is, this motherboard also doesn't support setLedBright function. Do you have any idea how I could try to implement an effect like that? |
Oh, wow, even the SDK is locked. Just MSI bullshit, I'm not buying again from them. I too have only 7 colors in Mystic Light, but if I change the file that ML uses to remember the last led color it was set to I can arbitrarily choose a color, and it works perfectly. It's not that your hardware can't do it, they block it via software. I'm sorry you're in the same boat. I have no idea how to solve this. |
Hmm, if I could make it arbitrarily choose a color with 0-255 rgb values that would actually be perfect for me, since that's what I already do with my logitech sdk anyways. So do you mean that's doable or not doable? If not, I'm experimenting with breathing animations and stuff, maybe I can at least sync the color changes with the brightness going down in that setting, and then time the keyboard color change accordingly too. Edit: The breathing thing isn't working since I have no way of knowing when the led's are on and when they're off in the software, since because the function isn't supported, getBright still returns 103(which is max) even when the led's are turned off... Edit 2: I turned the project from a console application to a Win32 application, but I can't run my exe in the debug folder for some reason... |
Here's the method I use (scroll down), but it takes A LOT because you need to close mystic light and wait for it to open again, so it's not doable unless you want a static color: https://forum-en.msi.com/index.php?topic=294645.0 I guess your last resort is buying a proper rgb driver to connect the cooler lights to..
That's for creating visual interfaces with buttons etc. So it won't run unless you make an UI, which is pretty difficult and frustrating to do using Visual C++. I suggest you stay away from that :) |
I see. Ohhh really? I was researching a bit online i thought it could be used to have an app without the console. How can I do that then? |
So I just discovered something. In mystic light 2 yes I am stuck to only 7 colors, however in mystic light 3, I can choose any 0-255 r, g, b values in the software. How could I get that functionality in the sdk too? Would ml3 maybe have a new dll file? |
I honestly don't know, the sdk hasn't been update since last year. Try issuing a ticket to msi support. |
Hey, it's me again. It's been a while, and I've been corresponding with msi for a bit. Apparently, since the chip on my specific motherboard does not support more than 7 colors, so they said the functionality of setting your own colors on the mystic light software currently is there by accident and will be removed. After about 10 updates to mystic light 3 it's still there though so I don't know if they'll actually remove it. They also said they will add support to brightness changing, since they use it for the breathing animation so chip clearly does support that feature. Now since those emails, there has been a bunch of updates to mystic light, almost all of which saying "Modify LED control method". I was thinking maybe they actually have added the support, but I don't know how to check if the SDK has been updated. How do I do it? |
Sorry, but I'm missing something here: you said that with Mystic Light 3 you can set an arbitrary color, but once you apply it does it actually work on the leds? Or it just sets whichever of the 7 colors is closer? Checking the SDK is very simple, just download it and look at when the files have been created. It still says 2017-08-19 |
It does, But it's not fully accurate. A weird "effect" that msi calls
chromatic aberration happens. It basically sets the color to whatever you
want but it's a bit distorted.
Hmm, thanks. Do you have the link to download the sdk? I couldn't find
that, I just always used the files that were in your repo.
…On Sun, 23 Sep. 2018, 19:05 SimoDax, ***@***.***> wrote:
Sorry, but I'm missing something here: you said that with Mystic Light 3
you can set an arbitrary color, but once you apply it does it actually work
on the leds? Or it just sets whichever of the 7 colors is closer?
Checking the SDK is very simple, just download it and look at when the
files have been created. It still says 2017-08-19
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AjOdsVulKrCm2FPIUETu5am00YMKJlbRks5ud07KgaJpZM4Vk5NW>
.
|
The link is in the project description (https://msi.com/Landing/mystic-light-motherboard#extension), just scroll down till you see the download button. |
Hi all |
Hey, I'm a fellow computer science student, but I don't have too much experience with visual studio nor c++. I was trying to get this working on a MSI x470 Gaming Plus board but I can't seem to get it to work. Could you help if you're still around?
The text was updated successfully, but these errors were encountered: