Artemis-RGB / Artemis.Plugins

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

Wooting Profile Service Has Hardcoded Windows Code And Does Not Start On Linux #182

Closed ProjectSynchro closed 1 year ago

ProjectSynchro commented 1 year ago

The plugin's profile service appears to attempt to load a windows DLL when initializing, looking at the code this appears to be due to the fact that the windows DLL in question is hard-coded into the file:

https://github.com/Artemis-RGB/Artemis.Plugins/blob/0664beeb423ded5d438c3c3361a3a2428cbd8c4f/src/Devices/Artemis.Plugins.Devices.Wooting/Services/ProfileService/WootingSdk.cs#L12

This seems like a pretty innocent mistake and might be fixed by some kind of elif. I am not sure how best one would fix that. Fixing this could in theory fix macOS support as well (did I mention in theory?.. :sweat_smile: )

Additionally...

When attempting to load the analog service it fails to load the analog SDK and it appears the code for looking for that seems also broken..?

https://github.com/WootingKb/wooting-analog-wrappers/blob/2248ecba001c9484237acbf0955ab87b448b44cf/WootingAnalogSDK.NET/WootingAnalogSDK.cs#L161

The AnalogSDK wrapper appears to fuzzy search for files named wooting_analog_wrapper and the linux shared object is prefixed with 'lib'.. which to me means it will fail to find the wrapper library. I have tried renaming the library but it still appears to not be able to find it, perhaps there is something else I am missing..

Not all is sad news however, the Device Provider works as intended! :smile:

Let me know if I can debug anything, I can always investigate setting up a dotnet workflow on my machine.

ProjectSynchro commented 1 year ago

For lighting control at least, a workaround for now if you have a Wooting keyboard is to use OpenRGB.

I just posted an MR to enable support for the Two HE (ARM) as well: https://gitlab.com/CalcProgrammer1/OpenRGB/-/merge_requests/1913

diogotr7 commented 1 year ago

I'll look into this but lighting control should work with the native implementation. the profile stuff won't work, but rgb should.

ProjectSynchro commented 1 year ago

The profile service now works as of 590dddfc26bb9cc70f86f7a51318b70a7274527f! Thanks!

For the sake of documenting what's known so far:

The Analog service still cannot load the DLL required. stacktrace-analogservice.txt Additionally --runtime linux-x64 needs to be omitted when building on Linux, otherwise the 'runtimes' folder is not shipped with the build.

https://github.com/Artemis-RGB/Artemis.Plugins/pull/183 (or some similar commit) will need to be merged to fix support of the Wooting Two HE (ARM) on Linux due to an older binary being shipped there.

ProjectSynchro commented 1 year ago

Assuming feature/wooting-binary is merged and anyone in the future scratching your head as to why the analog service isn't working:

Turns out the Analog SDK requires installation in a system's LD_LIBRARY_PATH as well as an 'analog plugin' installed in /usr/local/share/WootingAnalogPlugins. For Debian derivatives, you can install the deb package from https://github.com/WootingKb/wooting-analog-sdk/releases/latest, otherwise read the following install manual section: https://github.com/WootingKb/wooting-analog-sdk/tree/develop#manual

Keeping this open until feature/wooting-binary is merged