The Corsair User Forums  

Go Back   The Corsair User Forums > Corsair Product Discussion > iCUE Software

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 09-24-2018, 12:11 PM
Macca_Cool Macca_Cool is offline
Registered User
Macca_Cool's PC Specs
 
Join Date: Sep 2018
Location: Melbourne, Australia
Posts: 27
POST ID # = 974022
Macca_Cool Reputation: 13
Default [Help] Change iCUE Profile from a program

Hi there,

I'm looking to create a program to allow for game integration similar to the Far Cry 5 setup with iCUE but for other games. From what I've seen, the Far Cry setup switches iCUE between different profiles (stored in iCUE install dir) based on the game state. I would like to do the same however the iCUE SDK does not appear to support switching of iCUE profiles, and I have had no luck googling for alternative methods.

So I'm asking here, is there any method of changing iCUE's active profile to a profile stored on disk via a program (be that command line, SDK, or other).

Thanks heaps, Macca
Reply With Quote
  #2  
Old 09-24-2018, 12:16 PM
solarity solarity is offline
iCue βeta Team
solarity's PC Specs
 
Join Date: Mar 2017
Location: Rochester, NY
Posts: 710
POST ID # = 974024
solarity Reputation: 33
Default

Quote:
Originally Posted by Macca_Cool View Post
Hi there,

I'm looking to create a program to allow for game integration similar to the Far Cry 5 setup with iCUE but for other games. From what I've seen, the Far Cry setup switches iCUE between different profiles (stored in iCUE install dir) based on the game state. I would like to do the same however the iCUE SDK does not appear to support switching of iCUE profiles, and I have had no luck googling for alternative methods.

So I'm asking here, is there any method of changing iCUE's active profile to a profile stored on disk via a program (be that command line, SDK, or other).

Thanks heaps, Macca
While their is a SDK for iCUE, there is no CLI tool for iCUE. Farcry is setup a little differently as it does use the SDK to load some profiles based on events within Farcry.

However you can also set the profiles to load based on process, you just create a profile and use the setting within the profile to have it switch to that profile, when the process is active. Though there is no other way to dynamically change the profile currently.
__________________
RGB 101 Video: General overview on RGB
Zotty's Corsair Guide: RGB FAQ and Sample Diagrams


Disclaimer: I am not an employee of Corsair all my opinions are my own.
Reply With Quote
  #3  
Old 09-24-2018, 12:20 PM
Macca_Cool Macca_Cool is offline
Registered User
Macca_Cool's PC Specs
 
Join Date: Sep 2018
Location: Melbourne, Australia
Posts: 27
POST ID # = 974025
Macca_Cool Reputation: 13
Default

Alright then, thanks for the answer. Any word on if this is a planned feature or if the Far Cry workings would ever be publicised?
Reply With Quote
  #4  
Old 09-24-2018, 03:41 PM
solarity solarity is offline
iCue βeta Team
solarity's PC Specs
 
Join Date: Mar 2017
Location: Rochester, NY
Posts: 710
POST ID # = 974059
solarity Reputation: 33
Default

Quote:
Originally Posted by Macca_Cool View Post
Alright then, thanks for the answer. Any word on if this is a planned feature or if the Far Cry workings would ever be publicised?
RGB lighting is fairly new, while some other games have integration with RGB devices, I think Farcry 5 is the first time Corsair has had it work like this for the game. I am sure there will be other games, I know other companies have done this as well. This is pretty new to the industry in general and I betting extra effort has to go in from both Corsair and game developers to get this working properly. I am not a developer, though I assume there are hooks inside of the game interact with the SDK. The profiles for Farcry5 are store in the Farcry5 directory. I think in the future game developers in general will develop some type of standard to allow different devices to interact with it. There are some cool open source tools like Aurora: https://github.com/antonpup/Aurora

Though it looks like it is limited to Keyboard, Mice, mouse pad, and the headphone stand. There is no support for other devices like LNP and CoPro. I do like to tinker, though haven't tried Aurora as I do really like iCUE a lot.
__________________
RGB 101 Video: General overview on RGB
Zotty's Corsair Guide: RGB FAQ and Sample Diagrams


Disclaimer: I am not an employee of Corsair all my opinions are my own.
Reply With Quote
  #5  
Old 09-24-2018, 09:24 PM
Macca_Cool Macca_Cool is offline
Registered User
Macca_Cool's PC Specs
 
Join Date: Sep 2018
Location: Melbourne, Australia
Posts: 27
POST ID # = 974070
Macca_Cool Reputation: 13
Default

You are very much correct, it is very new and I (as a Software Developer) would really love to be able to make something similar to the Far Cry lighting. Yesterday I had only read the documentation for the SDK, but as it is still in development it is potentially not complete, so I will have a better look at it today and post any findings.

As for Project Aurora, I had already looked at its inner workings. It's limited to common peripherals across brands, as that is their main aim "unified lighting." Aurora has support for a lot of games and lighting based on game-states, exactly what Far Cry has but far more limited and all the information regarding it can be found at: https://github.com/antonpup/Aurora/t...urora/Profiles Upon inspection of these files, Aurora also lifts game support directly from another lighting project called Artemis, with Artemis' game support found: https://github.com/SpoinkyNL/Artemis.../Modules/Games

For most of these games the game-state is found by either reading values from memory (ie. Health/Mana in Terraria, boost in Rocket League) or through the use of .dll injectors or other modifications (see Witcher 3, Euro Truck Sim 2). In the case of CS:GO, Valve actually gives us direct access to relevant (and fair) data as to avoid people trying to 'hack' into the game, this is outlined here: https://developer.valvesoftware.com/...te_Integration and is what I think we'd all love to see more developers doing.

Anyway, that's for those who are interested in how Aurora and Artemis work, and how the practise will probably work in the future. I'm going to have a better poke around at the iCUE SDK and .dll packaged with Far Cry and I'll post any findings regarding loading iCUE profiles similar to Far Cry, because that's the only missing piece. Once that's possible, we can easily make awesome dynamic lighting setups!
Reply With Quote
  #6  
Old 09-24-2018, 11:11 PM
Macca_Cool Macca_Cool is offline
Registered User
Macca_Cool's PC Specs
 
Join Date: Sep 2018
Location: Melbourne, Australia
Posts: 27
POST ID # = 974076
Macca_Cool Reputation: 13
Default

So upon further inspection, the iCUE SDK documentation seems to be pretty complete. It only has functions for getting device and LED info and setting LED colours. As the Far Cry setup actually uses iCUE profiles (you can import them from the iCUE install dir) I doubt they use the iCUE SDK (or at least the public version of it).

Far Cry has a dll signed by Corsair, "CgSDK.x64_2015.dll" which has functions for setting and clearing 'states' as well as setting the current 'game'. My bet is that this dll must interact with iCUE in some way, however my knowledge of C++ is quite limited so I'm unsure of how this dll could be used. As the iCUE profiles are stored in the iCUE install, it's possible that the functionality is entirely built into iCUE and this CgSDK just tells iCUE which profile to switch too, in which case we (as not Corsair employees) probably can't tap into that functionality.

I read that both "Homefront the Revolution" and "Diablo 3" had similar RGB functionality to Far Cry. The Homefront one appears to be lighting individual keys that are relevant (see http://forum.corsair.com/v3/showthread.php?t=162886) apparently it also shows the American flag (possibly the same profile Far Cry uses for the main menu). The keys are do-able with the iCUE SDK, but I don't have access to the Homefront files, so can't check if it also has CgSDK. Diablo seems to have very limited functionality (again I don't have access to look at files though) that is do-able with the iCUE SDK, probably won't have CgSDK.

Would really love to hear any information from Corsair or anyone who knows of the functionality given by this CgSDK and how we can use iCUE to do this cool stuff. Any info, hit me up!


Last edited by Macca_Cool; 09-24-2018 at 11:15 PM. Reason: Added image that I had forgot
Reply With Quote
  #7  
Old 09-25-2018, 12:18 AM
hastegag hastegag is online now
Registered User
hastegag's PC Specs
 
Join Date: Dec 2016
Location: Northeast US
Posts: 895
POST ID # = 974080
hastegag Reputation: 20
Default

Yes heavy heavy ditto. I and others have asked for this as well in many other threads for unpteen reasons. Radio silence on dev side. My only fix is via gui and autohotkey but it really isn’t a fix and I am sure it is so easy to add on their end and I’d literally mail them a check if I had an address? Or whatever.

Respect to your function calls above and (ends == means) except in future releases that may not work the same way?
Reply With Quote
  #8  
Old 09-25-2018, 12:47 AM
Macca_Cool Macca_Cool is offline
Registered User
Macca_Cool's PC Specs
 
Join Date: Sep 2018
Location: Melbourne, Australia
Posts: 27
POST ID # = 974083
Macca_Cool Reputation: 13
Default

Yeah it really does suck that this functionality isn't public. I just found this post from the iCUE Product Manager (http://forum.corsair.com/v3/showpost...59&postcount=3) and it confirms that all Far Cry 5 does is "ping" the SDK to play the profile in the iCUE install directory. Judging by the functions for CgSDK I am sure that it is the SDK that he mentions as the SDK Effects folder has a FarCry5 directory, implying usage of CgSdkSetGame. This would also infer that the priorities.cfg found in that dir (which dictates which profile is more important) would be required per game. I would also assume that the SDK Set/Clear State functions would be used to enable each profile (probably by their name). Set Event lacks a Clear Event function, so not sure of its functionality. Same with Progress Bar, no ideas there. Anyone who knows C++ maybe have a tinker with it and try to trigger the Far Cry profiles using CgSDK. I'm going to see what I can do with my limited C++ knowledge.
Reply With Quote
  #9  
Old 09-25-2018, 02:53 AM
Macca_Cool Macca_Cool is offline
Registered User
Macca_Cool's PC Specs
 
Join Date: Sep 2018
Location: Melbourne, Australia
Posts: 27
POST ID # = 974093
Macca_Cool Reputation: 13
Default

So, I had a look at CgSDK again and I'm sure that it is how the Far Cry game integration works. Unfortunently it would appear that without the header and library files for the SDK, we have no way of using it without reverse engineering it (a massive pain and probs breaches user agreements and whatnot). So that kinda sucks. I'd love to hear from any Corsair employees working on iCUE to if releasing CgSDK to the public is planned (ETA?), would really love to see this happen. Even if there isn't proper documentation for it, I'd love to at least hear more about the SDK as it would be awesome to allow us to make full dynamic lighting setups.
Reply With Quote
  #10  
Old 09-25-2018, 09:52 AM
hastegag hastegag is online now
Registered User
hastegag's PC Specs
 
Join Date: Dec 2016
Location: Northeast US
Posts: 895
POST ID # = 974114
hastegag Reputation: 20
Default

Quote:
Originally Posted by Macca_Cool View Post
Yeah it really does suck that this functionality isn't public. I just found this post from the iCUE Product Manager (http://forum.corsair.com/v3/showpost...59&postcount=3) and it confirms that all Far Cry 5 does is "ping" the SDK to play the profile in the iCUE install directory. Judging by the functions for CgSDK I am sure that it is the SDK that he mentions as the SDK Effects folder has a FarCry5 directory, implying usage of CgSdkSetGame. This would also infer that the priorities.cfg found in that dir (which dictates which profile is more important) would be required per game. I would also assume that the SDK Set/Clear State functions would be used to enable each profile (probably by their name). Set Event lacks a Clear Event function, so not sure of its functionality. Same with Progress Bar, no ideas there. Anyone who knows C++ maybe have a tinker with it and try to trigger the Far Cry profiles using CgSDK. I'm going to see what I can do with my limited C++ knowledge.
Good thoughts. I can try sometime soon (maybe this evening) a simple DLLCall in Autohotkey or also use visual studio to include that corsair.dll in the references in an SDK project and see if there's a way to just say "using cgsdk" in the namespace declarations and then it may be as simple as running these functions to experiment like CgSdkSetGame() and see what parameters it may take by sending some in or not and jotting down what happens.

We may need to address the namespace but that might just be like CgSDK::CgSdkSetGame()
Reply With Quote
  #11  
Old 09-25-2018, 11:51 AM
DevBiker's Avatar
DevBiker DevBiker is offline
iCue βeta Team Green
DevBiker's PC Specs
 
Join Date: Feb 2017
Location: Republic of Texas
Posts: 7,256
POST ID # = 974126
DevBiker Reputation: 88
Default

I totally agree that the having the functionality CgSDK released more generally would be super-awesome.

hastegag -> what you are proposing won't work at all. These are C++ exported functions. You need to use P/Invoke to access these functions.
__________________
Please click "Edit System Specs" and fill out your system info.

This comment is provided "as-is", without warranty of any kind, express or implied, including, but not limited to, the sanity or mental fitness of the author. The author is not a Corsair employee, does not represent Corsair, and no comment should be construed as an official statement from Corsair.

Reply With Quote
  #12  
Old 09-25-2018, 12:00 PM
hastegag hastegag is online now
Registered User
hastegag's PC Specs
 
Join Date: Dec 2016
Location: Northeast US
Posts: 895
POST ID # = 974131
hastegag Reputation: 20
Default

Quote:
Originally Posted by DevBiker View Post
...hastegag -> what you are proposing won't work at all. These are C++ exported functions. You need to use P/Invoke to access these functions.
Thank you that saves headaches, thank you DevBiker!

https://msdn.microsoft.com/en-us/library/55d3thsc.aspx
and this
https://en.wikipedia.org/wiki/Platfo...vices#Pitfalls

seem to detail the basics. I'll give it a shot, why not.
Reply With Quote
  #13  
Old 09-25-2018, 11:26 PM
hastegag hastegag is online now
Registered User
hastegag's PC Specs
 
Join Date: Dec 2016
Location: Northeast US
Posts: 895
POST ID # = 974222
hastegag Reputation: 20
Default

So this gent was kind enough to detail the platform invoke process and I got his example working:

https://manski.net/2012/05/pinvoke-t...basics-part-1/

I realized after trying to open the CgSDK.x64_2015.dll the same way that it is 64 bit. I needed to run some updates to my VS install to get Csharp to compile 64 bit vs x86 and that install is taking its sweet time.

I had tried switching it over to cpp instead (as that was installed) but it wasn't translating easy. I tried a couple things but I figure converting the known good quantity in c# will be easier. Will share if i figure anything out.

Edit so no I get the same error compiling in x64. Probably because it is an un managed dll and may have different .net version? You can probably use LoadLibrary and GetProcAddress to get it done, but I had trouble with the second part of that in C++, I was able to prototype the function properly (I think) and use LoadLibrary and save the handle to the loaded dll (I assume that was a pointer to its base address once loaded) but the next parts I was lost. This all assumes a whole lot - even if it is all set up properly, calling something like CgSdkSetState("FC_AnimalAttack"); might have no effect...especially if you do not sequence it all properly like performprotocolhandshake, clearall and then setstate

Last edited by hastegag; 09-26-2018 at 12:25 AM. Reason: eh
Reply With Quote
  #14  
Old 09-26-2018, 09:10 AM
Macca_Cool Macca_Cool is offline
Registered User
Macca_Cool's PC Specs
 
Join Date: Sep 2018
Location: Melbourne, Australia
Posts: 27
POST ID # = 974277
Macca_Cool Reputation: 13
Default

I had my own look into it today after having a break from the project. Gotta say, I'm happy with my results. I was able to make the required .lib and header files required to use the CgSDK dll file by modelling them off of the publicly available iCUE SDK. Yesterday I had noticed common functions between both SDKs (see PerformProtocolHandshake, Request/ReleaseContol functions).

Using the iCUE SDK documentation and header files, I just copied them over and they're exactly the same across the two SDKs. After a whole load of C++ bs I got everything compiled and got this output:
The first set of text shows the various properties of the output struct from the Handshake function. It shows an SDK version that is just behind the current iCUE SDK (indicating that perhaps this functionality is part of it after all, but is just being blocked from the public release currently) and a "server version" which is equivalent to the current iCUE version I have installed. Below that is my experimenting with input/outputs of the SetGame and SetState functions, no luck so far.

This shows us two things: 1) The functionality given by CgSDK to Far Cry 5 is probably going to be included in a future iCUE SDK release, which is awesome, shows the radio-silence isn't in bad faith. 2) With some good guesswork and experimentation, it's totally possible for us to get this functionality beforehand and start to experiment with it. In the meantime, I'm gonna keep at it and see if I can trigger the Far Cry lighting effects via the SDK.
Reply With Quote
  #15  
Old 09-26-2018, 10:07 PM
hastegag hastegag is online now
Registered User
hastegag's PC Specs
 
Join Date: Dec 2016
Location: Northeast US
Posts: 895
POST ID # = 974374
hastegag Reputation: 20
Default

You are awesome and better than I! While I have some quick questions on your implementation, I wont bother you with it.

That said, in thinking about it, I suspect the whole farcry style integration just changes lighting. I do think (or hope rather), they are aware the ability to change the actual profile in the application would be equally advantageous with all the affiliated settings (remaps, macros, dpi, audio stuff, etc).

While lighting linking like this is incredibly powerful (especially if you have mobos or other non cue rgb goods, or perhaps phillips hue lighting etc), I think it is good to fix this once and for all with the ability to choose the profile as desired outside the program, not via the gui (my noob fix http://forum.corsair.com/v3/showthread.php?t=180961).

Just a real short list of the benefits:
- link lighting with other incompatible or 3rd party hardware
- allow their own elgato devices to change profiles
- fix the issue where users with a group of profiles (cuefolder) associated with a single application get stuck on one of these profiles when application focus is lost or for any other reason. (for example, I've got modifier lighting in CUE setup to indicate certain visual reminders/mnemonics in a Photoshop group that says to me as a user, hey you are in shift profile so this does blank and then somewhere along the way it gets stuck there. I cannot be the only person that would love the application to revert to the default, even after a period of time, just so I don't have to hit a key.
- Allow Cue to offer title matching or other conditional and context sensitive profile switching that extends beyond the current functionality.
Reply With Quote
Reply

Tags
icue, profiles, programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:09 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.