UniLight icon indicating copy to clipboard operation
UniLight copied to clipboard

Does not synchronize when in auto-started

Open HunterZ opened this issue 5 years ago • 10 comments

OK. I found out that you need the razer sdk.

But now a very important question for me: The synchronization takes only place in two ways for me: When starting the program or when I click on "Synchronize manually", but NOT when Unilight is in autostart.

My scenario: Razer Synapse (SDK) starts and a short time later Unilight also starts (to make sure that the necessary DLLs are actually loaded beforehand from synapse). The RGB control is now not synchronized, but when I click on "Synchronize manually" it is. Is there a workaround here, i.e. start Unilight with a parameter? The strange thing is that Unilight synchronizes when the program is started manually, but not when Unilight is in autostart. I don't want to click "synchronize manually" everytime when i boot my computer.

Originally posted by @Staubgeborener in https://github.com/HunterZ/UniLight/issues/6#issuecomment-581125532

HunterZ avatar Feb 02 '20 15:02 HunterZ

@Staubgeborener what method are you using to auto-start Unilight?

The easiest way that works is to put a shortcut to it in the Startup folder of the Start Menu.

I'm currently doing it via Task Scheduler, with a task that is set to run when I log on. This is set to run only when I am logged on, and to run as my user account. This is necessary to ensure that it has access to the system tray and to user-level RGB APIs.

HunterZ avatar Feb 02 '20 15:02 HunterZ

Different approaches:

  1. Task scheduler, same as your settings, unilight is in system tray but i have to click on "synchronize manually"
  2. Put the unilight shortcut into autostart folder but i have to click on "synchronize manually"
  3. Put a small .vbs-Script into autostart folder, whichs runs unilight but i have to click on "synchronize manually", like this one:
Set WSHShell = WScript.CreateObject("WScript.Shell")
WScript.Sleep 20000 
WSHShell.Run "F:\unilight\UniLight.exe"

All in all, i can autostart unilight, it's in system tray, but i always have to "synchronize manually". Is there a way to call the programm with a synchronize-parameter?

Staubgeborener avatar Feb 03 '20 16:02 Staubgeborener

So you're changing the Windows accent color but Unilight is not automatically updating your RGB devices to match?

And this is with version 1.5?

Is this just with Razer devices?

There currently isn't a way to force synchronization other than clicking. I believe it also tries to synchronize on start, so if that's not working either then maybe my Razer integration needs a delay somewhere..

On Mon, Feb 3, 2020 at 8:35 AM Staubgeborener [email protected] wrote:

Different approaches:

  1. Task scheduler, same as your settings, unilight is in system tray but i have to click on "synchronize manually"
  2. Put the unilight shortcut into autostart folder but i have to click on "synchronize manually"
  3. Put a small .vbs-Script into autostart folder, whichs runs unilight but i have to click on "synchronize manually", like this one:

Set WSHShell = WScript.CreateObject("WScript.Shell") WScript.Sleep 20000 WSHShell.Run "F:\unilight\UniLight.exe"

All in all, i can autostart unilight, it's in system tray, but i always have to "synchronize manually". Is there a way to call the programm with a synchronize-parameter?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/HunterZ/UniLight/issues/9?email_source=notifications&email_token=AAA2TCZ3SKJZCOYV6QSFRRLRBBBV7A5CNFSM4KO2L47KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKUQJDY#issuecomment-581502095, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2TC4I4WPVUMVK7SKVUZLRBBBV7ANCNFSM4KO2L47A .

HunterZ avatar Feb 03 '20 16:02 HunterZ

So you're changing the Windows accent color but Unilight is not automatically updating your RGB devices to match?

yes

And this is with version 1.5?

yes

Is this just with Razer devices?

only got razer to test this out

There currently isn't a way to force synchronization other than clicking. I believe it also tries to synchronize on start, so if that's not working either then maybe my Razer integration needs a delay somewhere..

Yeah, when i start the program by my own (so no autostart) its working.

Staubgeborener avatar Feb 03 '20 16:02 Staubgeborener

There's some diagnostic stuff you can check to maybe narrow down the issue:

  • hovering over UniLight's system tray icon should cause a tooltip appear with a quick status of each API
  • right-clicking UniLight's system tray icon should allow you to open a popup with slightly more detailed status information

It might be useful to compare these results when it's in a non-working state versus a working state.

On Mon, Feb 3, 2020 at 8:48 AM Staubgeborener [email protected] wrote:

So you're changing the Windows accent color but Unilight is not automatically updating your RGB devices to match?

yes

And this is with version 1.5?

yes

Is this just with Razer devices?

only got razer to test this out

There currently isn't a way to force synchronization other than clicking. I believe it also tries to synchronize on start, so if that's not working either then maybe my Razer integration needs a delay somewhere..

Yeah, when i start the program by my own (so no autostart) its working.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/HunterZ/UniLight/issues/9?email_source=notifications&email_token=AAA2TC375KCRIT74E3YGSATRBBDF3A5CNFSM4KO2L47KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKURWWY#issuecomment-581507931, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2TCZ6ZNAHNCDFS5FFEDLRBBDF3ANCNFSM4KO2L47A .

HunterZ avatar Feb 04 '20 16:02 HunterZ

Well, i already checked this. RzrChrm is always marked with a tick. Always. But however, i have to click on synchronize manually to get it working. There is none "non-working-state", the tick is always there. So~ basically, the synchronization takes only place, when i do it by my own. Kinda weird.

Staubgeborener avatar Feb 05 '20 16:02 Staubgeborener

This points to the Razer SDK - or UniLight's use of it - as the problem, as the check mark indicates that Razer reported successful application of the RGB value.

I'll leave this bug open as a reminder to take another look at the Razer SDK docs and see if maybe I need to implement a delay somewhere or something.

On Wed, Feb 5, 2020 at 8:33 AM Staubgeborener [email protected] wrote:

Well, i already checked this. RzrChrm is always marked with a tick. Always. But however, i have to click on synchronize manually to get it working. There is none "non-working-state", the tick is always there. So~ basically, the synchronization takes only place, when i do it by my own. Kinda weird.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/HunterZ/UniLight/issues/9?email_source=notifications&email_token=AAA2TCZ4LSEPODEHR6FEPQDRBLS6RA5CNFSM4KO2L47KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEK4CP7A#issuecomment-582494204, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2TC5T5OG5WVFKX24ZKPTRBLS6RANCNFSM4KO2L47A .

HunterZ avatar Feb 05 '20 18:02 HunterZ

I have some issues with the Corsair CUE DLL while trying to compile your project. I thought about calling GetAndUpdateColor(); inside Main.cpp as one of the first things, when the program starts. Perhaps in L235 - maybe you could give it a try?

Staubgeborener avatar Feb 14 '20 17:02 Staubgeborener

You can always comment out Corsair CUE support. I really need to refactor the codebase to make vendor API support more pluggable, so that you don't have to build/load the ones you don't care about.

I haven't been working on this project much because I got a bit overwhelmed while trying to implement Steelseries support. They went with a wacky JSON REST API instead of just providing a DLL like everyone else, which comes with a lot of baggage.

HunterZ avatar Feb 14 '20 18:02 HunterZ

Re-reading your original comment, I'm wondering if what's going on is that the Razer Chroma SDK lies and says everything is working fine, but it's actually got a broken back-end state because the Razer software hasn't loaded yet.

Manual synchronization does NOT re-init the DLL - it just sends another color change request to the Razer SDK.

If you auto-launch it (into the bad state) and check the details status without first doing a manual synchronization, does it show anything other than SetRZCColor() success?

If not, then I'll have to either try to find a way to detect the bad state (maybe query every possible device model to ensure that at least one is reportedly connected?), or do something silly like forcing a second initial sync following some fixed delay after the initial one.

HunterZ avatar Feb 14 '20 19:02 HunterZ