Artemis-RGB / Artemis.Plugins

Repository containing official Artemis plugins
Other
31 stars 36 forks source link

Logitech Plugin stops working after resuming from sleep in Windows 11 #122

Open GallopingCow opened 2 years ago

GallopingCow commented 2 years ago

I haven't been able to test this on Windows 10, so I don't know whether being on 11 is relevant. When my computer goes to sleep and I wake it up later, my Logitech devices' RGBs stop responding (G910 and G900). I can go to the Plugins page and uncheck the "Plugin enabled" box, then re-check it and my peripherals light back up again immediately.

My Razer Firefly is unaffected and continues to work as expected with RGB animation layers, etc.

Apologies if I've done anything ignorant. I've only just started tinkering with Artemis after many years of using Aurora, but unfortunately I couldn't get it to work in Windows 11 the way I had on my old Windows 10 computer (same peripherals, but different computer).

hoylemd commented 2 years ago

I'm seeing a similar thing on Windows 10, sometimes after sleeping, sometimes after a cold boot. But when I bounce the Logitech Devices plugin, I get the following error

System.AggregateException: One or more errors occurred. (RGB.NET threw exception: Failed to initialize Logitech-SDK.)
 ---> Artemis.Core.ArtemisPluginException: RGB.NET threw exception: Failed to initialize Logitech-SDK.
 ---> RGB.NET.Core.RGBDeviceException: Failed to initialize Logitech-SDK.
   --- End of inner exception stack trace ---
   at Artemis.Core.Services.RgbService.AddDeviceProvider(IRGBDeviceProvider deviceProvider) in D:\a\1\s\Artemis\src\Artemis.Core\Services\RgbService.cs:line 182
   at Artemis.Plugins.Devices.Logitech.LogitechDeviceProvider.Enable() in D:\a\1\s\Artemis.Plugins\src\Devices\Artemis.Plugins.Devices.Logitech\LogitechDeviceProvider.cs:line 33
   at Artemis.Core.PluginFeature.InternalEnable() in D:\a\1\s\Artemis\src\Artemis.Core\Plugins\PluginFeature.cs:line 178
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait(TimeSpan timeout)
   at Artemis.Core.PluginFeature.SetEnabled(Boolean enable, Boolean isAutoEnable) in D:\a\1\s\Artemis\src\Artemis.Core\Plugins\PluginFeature.cs:line 151
   at Artemis.Core.Services.PluginManagementService.EnablePluginFeature(PluginFeature pluginFeature, Boolean saveState, Boolean isAutoEnable) in D:\a\1\s\Artemis\src\Artemis.Core\Services\PluginManagementService.cs:line 621
   at Artemis.Core.Services.PluginManagementService.EnablePlugin(Plugin plugin, Boolean saveState, Boolean ignorePluginLock) in D:\a\1\s\Artemis\src\Artemis.Core\Services\PluginManagementService.cs:line 444
   at Artemis.UI.Screens.Settings.Tabs.Plugins.PluginSettingsViewModel.<UpdateEnabled>b__44_3() in D:\a\1\s\Artemis\src\Artemis.UI\Screens\Settings\Tabs\Plugins\PluginSettingsViewModel.cs:line 270

Restarting artemis didn't seem to help. However, quitting and restarting Logitech G Hub did seem to fix the problem. (until it happens again.)

I have noticed a lot of problems around letting my computer sleep though, both artemis and openrgb seem to lose authority over some devices and I have to restart the applications to get control back. And to make matters worse, some artemis profile layers seem to forget their geometry, so whenever this happens I have to go and fix 5 or 6 things. It's pretty annoying, so I've just stopped putting my computer to sleep altogether.

But that's been pretty ok to be honest. It boots up only slightly slower than it wakes from sleep, and shorter uptimes mean less opportunity for memory leaks and the like to mess things up So while I do think that's a problem to be solved (bugginess after waking from sleep), 'just don't put your computer to sleep' is a viable workaround, if that's tolerable.

GallopingCow commented 2 years ago

I haven't had any problems with my surface layout, but cold booting isn't 100% for me. It's not uncommon to have to restart either G Hub or Artemis completely, and though it seems like order matters, it's not always in the same sequence. I have not yet tried disabling both applications from startup and manually starting them to see their preferred order, since I'm not frequently at this particular workstation.

RobertBeekman commented 2 years ago

Hello, thanks for the report and the info

I can implement a mechanism where the plugin reestablishes the connection with the SDK on wake. The exact timing may need some tweaking though.

I'll try to get to this soon, currently working on a huge update but maybe I can find some time to squeeze this in

copystring commented 4 months ago

Hello @RobertBeekman do you have to take a look at this? The problem also applies to other plugins like iCUE, OpenRGB, etc. I did try to get around this with scripts which restart Artemis after standby, but it's not very reliable.