#🤖│community_dev

1 messages · Page 4 of 1

quick bough
#

Well, judging by the code that uses keyboard_handle_array, I can forsee some issues with multiple keyboards being used.

#

So, the cleanup code seems to work "fine," as in it just cleans out the slot that the keyboard was using, so it doesn't reallocate/reindex other keyboards.

#

However, when a new keyboard is inited, it looks like it takes connected_keyboards as an index

#

Although it doesn't seem like this variable is ever decremented, so... probably an array out of bounds if you disconnect an reconnect a device 10 times.

#

But it should at least mean the device ids are steady.

floral crane
#

I asssume the max is at least 255, if not way higher

quick bough
floral crane
#

hmm that might need to be increased or decremented lol

#

my keyboard disconnects constantly cause of my port

quick bough
#

Well, I think 10 is more than enough. The issue is that they don't "check which slot is free", instead they just keep incrementing until you have an array out of bounds

#

Ah wait, no, it looks like if any device is disconnected, it drops all devices.

#

So, when your disconnect callback is called, assume all device ids become invalid.

floral crane
#

ah great

#

I gotta constantly look for new device ids and link them to their serial numbers

#

hmm I can't do that though, to get sn I have to switch to that device first, it's not part of the usb meta

quick bough
#

Idk what you're doing, but it might be worthwhile to interface with the HID directly.

floral crane
#

that's basically what the rgb sdk does right

quick bough
#

Then you already have the serial number as its not abstracted away, you only have to send the reports yourself.

floral crane
#

I don't understand raw hid stuff, using the send command in rgb sdk is already more than I understand

quick bough
#

Well, there you are already sending a report yourself?

floral crane
#

yeah, that's through the rgb sdk though

quick bough
#

I forgor I have my Razer Huntsman V2 Analog connected right now instead of a Wooting® Analog Keyboard™ so I can't make a quick sample, but the HID report format is basically the same as that API call expect the first parameter goes last.

floral crane
quick bough
#

I think this is a good example

floral crane
#

well that's good, if I ever want to switch to raw hid it shouldn't be too hard

quick bough
#

but yeah I guess the GetSerial command will also work if you can't get it from the HID itself

#

I think I'm gonna plug in my Wooting again, this Razer keyboard sucks, even if it is full analog 😠

floral crane
#

I wonder what this is

quick bough
#

What are you looking at?

floral crane
#

that's the serial number buffer

#

but how does it convert to "A02B2106W031H00418"

quick bough
#

Noo you just leaked your serial number

floral crane
#

oh no not my serial number

#

someones gonna seal my keyboard

quick bough
#

It's like your keyboard's SSN smh

floral crane
#

but I gotta figure out how to convert so people can compare to Wootility and figure out what keyboard it is if they have multiple of the same keyboard for some reason

quick bough
#

I'm just looking at it now myself, and it is perplexing

floral crane
#

decipher

#
function formatSerialNumber(i) {
        const o = new SerialNumber(i)
          , {SupplierNumber: s, Year: st, WeekNumber: dt, ProductNumber: ft, RevisionNumber: mt, ProductId: xt, Stage: bt, UniquePCBDesign: Ct, MinorRevision: St, Variant: $t} = i
          , _t = st.toString().padStart(2, "0")
          , kt = s.toString().padStart(2, "0")
          , jt = dt.toString().padStart(2, "0")
          , Nt = ft.toString().padStart(2, "0")
          , Mt = xt.toString().padStart(5, "0")
          , Ht = ProductionStageToString(bt)
          , Wt = o.hasOwnProperty("Variant")
          , Gt = o.hasOwnProperty("UniquePCBDesign")
          , Vt = o.hasOwnProperty("MinorRevision")
          , zt = Gt ? `T${Ct.toString().padStart(2, "0")}` : ""
          , Jt = Vt ? `${St.toString().padStart(2, "0")}` : ""
          , Yt = Wt ? `S${$t.toString().padStart(2, "0")}` : "";
        return ["A", kt, "B", _t, jt, "W", Nt, zt, mt, Jt, Yt, Ht, Mt].join("")
    }
quick bough
#

That makes some amount of sense

floral crane
#

what's SerialNumber though

quick bough
#

Well, I found bufferToSerial, which provided me with enough info to parse out the first chunk

#

This seems to match the SN fully, but it's with a bit of guesswork, so may not be perfect

r.skip(3); // D0 DA 03
r.skip(2); // no clue
uint16_t supplier_num;
r.u16(supplier_num);
uint8_t year;
r.u8(year);
uint8_t week;
r.u8(week);
uint16_t product_number;
r.u16(product_number);
uint16_t revision_number;
r.u16(revision_number);
uint16_t product_id;
r.u16(product_id);
uint8_t production_stage;
r.u8(production_stage);
std::cout << std::format("A{:0>2}B{:0>2}{:0>2}W{:0>2}{}H{:0>5}", supplier_num, year, week, product_number, production_stage ? 0 : 1, product_id) << "\n";
#

and I assume you're looking at the preview wootility which is where UniquePCBDesign comes in for the UwUs

#

So, that will likely impact the SN in some way

floral crane
#
use wooting_rgb_sys as rgb;

// https://gist.github.com/BigBrainAFK/0ba454a1efb43f7cb6301cda8838f432
const GET_SERIAL: u8 = 3;

fn main() {
    unsafe {
        let len = u8::MAX as usize + 1;
        let mut buf = vec![0u8; len];
        let response = rgb::wooting_usb_send_feature_with_response(
            buf.as_mut_ptr(),
            len,
            GET_SERIAL,
            0,
            0,
            0,
            0,
        );

        if response == len as i32 {
            println!(
                "A{:02X}B{:02}{:02}W{:02X}{}H{:05}",
                u16::from_le_bytes(buf[5..7].try_into().unwrap()),
                buf[7],
                buf[8],
                u16::from_le_bytes(buf[9..11].try_into().unwrap()),
                if buf[15] == 1 { 0 } else { 1 },
                u16::from_le_bytes(buf[13..15].try_into().unwrap()),
            );
        } else {
            println!("Error retrieving serial number");
        }
    }
}
floral crane
#

I'm trying to determine how I should interface device selection for rules, since the data type I'm storing is HashMap<String (serial number), u8 (profile index)>

Should I keep a list of all SNs ever connected even if not connected right now so you can always make rules for disconnected devices?

#

That would allow me to pre-populate a list of devices and profile indexes automatically, but if I don't do that I would have to have an add button and a popup to select which device to add

quick bough
#

That's more of a question regarding how you should design your app, which I think you would be best qualified to answer.

floral crane
#

This is going to be hard to do without a second device to test with, but if I understand correctly I need to figure out how to reset keyboard_handle and connected_keyboards, run wooting_usb_find_keyboard, then figure out a way to access connected_keyboards, iterate over that and send the command to get each devices serial number.

#

wooting_usb_disconnect resets but I can't access the number so I'll just have to loop until it returns false

#

Oh that's unfortunate, every index 0-10 is valid and returns the first device if one isn't found Select won't fail it will just silently fallback to the first device

quick bough
#

I have 2 wooting keyboards if you need me to test anything

floral crane
strong siren
#

i have 3 boards and use them all at the same time with artemis for testing frequently

#

when that feature was first added it was buggy but it seems good now

floral crane
#

The only problem I see is that every rule updates every device, but I can add a toggle to skip devices when I update to support Wootility Beta / RGB effects whenever that becomes stable

quick bough
#

I have C++ projects with thousands of source files and we batch build them in 1/10th of that time

floral crane
#

I have release builds set to single thread compilation to reduce file size as much as possible, it could be done faster,

quick bough
#

What does multi-threading have to do with file size?

floral crane
#

but this project is the largest dependency tree out of all my projects and takes the longest, I might have to remove that if it takes much longer

#

codegen-units = 1 # Compile crates one after another so the compiler can optimize better

quick bough
#

Sounds like a weird Rust issue

#

I would die if I had to compile my projects with like 2000 source files on only one thread

#

some of these source files, no joke, take 20 seconds

#

but my i9-13900K gets the gamut done in under 1 minute

floral crane
#

Those kinds of optimizations exist with gcc too, but it doesn't really make a big difference I just enable it on all my projects cause compile time on actions doesn't matter

#

it doesn't apply to debug builds so it compiles faster on my computer

#

I could figure out how to setup caches to speed it up

quick bough
#

So, I plugged in the second wooting, seems I needed to restart the program for it to recognise it

floral crane
#

yeah it only checks on startup

#

It would take more work than it's worth to re-initialize the tray

#

it only took 2m to build on my computer

quick bough
#

That is without optimisations?

floral crane
#

without any file size optimizations

quick bough
#

Who cares about file size, CPU time is important

floral crane
#

compilation time doesn't really matter

#

30 longest to compile dependencies

quick bough
#

So, I've set up a thing to make it switch profile when GTA5.exe is focused, and it does seem to work, but when I unfocus GTA V, the second keyboard doesn't seem to have its active profile reset.

floral crane
#

The program will use the active profile at the first start (when it creates the config file) as the fallback profiles for the keyboard when no matching rule is found, I don't have a ui to edit it but it's in the config file and uses the same format as rules. you can also create a rule with wildcard in all the fields to achieve the same effect, I believe it has to be the last rule (bottom) but it might be top

quick bough
#

It looks to me like the "WootDevResetAll" command was not sent

#

I did it manually and now the keyboard is back to normal

floral crane
#

It should have sent it

quick bough
#

Well, it might be that the keyboard never gets the command to swap back the profile either

#

Idk what to say, but it's definitely a consistent issue

#

Only one of the keyboards is reset after defocusing GTA V

floral crane
#

oh hmm, what's your fallback config setting

quick bough
#

My what, where

floral crane
#

it might have populated the first time when you didn't have both plugged in and doesn't have the 2nd

#

Edit > Open Config File

quick bough
#

Ah, this one didn't get it populated.

floral crane
#

Ah yeah that's a flaw, I need to add a UI to edit the fallback and a toggle to skip devices

#

you can empty the fallback_device_indices and open the program with the profiles active that you want to be the fallback to fix that for now

quick bough
#

I have manually added the second device to the fallback_device_indecies array with a value of 0

#

now the program crashed on defocus and neither of the keyboards were reset

floral crane
#

I also just realized I forgot to update the version number on the release files lol

quick bough
#

can't reproduce it now, seems to be fine again

#

weird stuff

#

wasn't Rust supposed to not have random crashes

floral crane
#

I'm sure there was a reason, there's just no logs to find out why unless it's run from a terminal. probably forgot the comma and couldn't parse it and reset the config

quick bough
#

I know JSON isn't a very human-friendly format but I hardly pass as one anyway 😛

#

That is to say, I definitely did not mess up my commas.

#

Welp, whatever, it is working perfectly fine now

#

A weird thing is that my Wooting Two seems to be flashing at 100% brightness shortly before its profile is switched

#

but I doubt that's a you-problem

floral crane
#

I'll add that to my list of things to add with the next update when wootility updates

#

that's likely the send sleep delay, I use a higher safe value than wootility probably does, you can lower it or make it 0, I've never had an issue at 0

quick bough
#

Set it to 0, but still the same thing, just faster I guess

#

but, well, this wooting two is beaten to death anyway

#

ah wait I just realised, the second profile has a different brightness setting than the first one

#

so yeah not your issue

floral crane
#

I removed the single codegen unit optimization from the re-release, I wonder how much faster it will build

quick bough
#

weird tho how it retained the wrong brightness then

floral crane
#

brightness can be changed per-key, pey-profile, and per-device, and wootility previews it in-memory without writing it you press save. but I never write to the device in WPS

quick bough
#

yeah maybe some weirdness with that previewing

#

Seems your app somewhat-gracefully handled one of the keyboards being unplugged as well

#

Only issue is no tray update but yeah

floral crane
#

the devices will never disappear from the tray or elsewhere, I store the serial numbers in a list so you can configure unplugged devices

quick bough
#

ah, hmm

floral crane
#

clicking the button in the tray just does nothing but print a not found message in the console

quick bough
#

what are they supposed to do anyway

#

they are checked on, but I click on them and they stay on

floral crane
#

you can click the device if it's connected to select it and then the profile selection below applies to the selected device

#

hmm

quick bough
#

Some minor usability tweaks I would do is maybe sort the keyboards in descending order, since higher = newer = more likely to be what the user wants to use

#

Also maybe display the actual name of the keyboard instead of the SN

#

it's highly unlikely the user will own 2 of the same model, but more likely they will own different models

floral crane
#

yeah I want to show the model name in a shortened form and have a toggle to show the SN instead. it also doesn't pull the profile names from the other devices since wootility only added multiple devices in beta

#

I might change the tray to instead have a label showing the device and a subset of profiles under it, instead of two selections, double the list and show both sets of profiles

quick bough
#

soon I will own another wooting + a wooting UwU

#

then I will plug them all in and watch the USB ports in my mobo die a miserable death

#

that is to say, I think users using multiple keyboards in general is highly unlikely LUL

#

maybe more likely-ish with the UwU

#

if you can call that a keyboard

#

more of a macro pad, or "Osu! controller"

floral crane
#

the uwu is the only reason, even wooting didn't support it until now in wootility

quick bough
#

Although I can't help but think of Tom Scott's Emoji Keyboard

#

Imagine if he built this nowadays with the Wooting Analog SDK

#

it would be a breeze, you have the SN for reference

#

get proper reports for each key pressed

#

then just use SendInput from WinAPI, and you're on your way

floral crane
#

Looks like build time was cut in half, back down to before I switched to tauri v2 or added game scanning

quick bough
#

Now rewrite it in C++ and weep

floral crane
#

it was

#

c anyway

quick bough
floral crane
#

what's that for

quick bough
#

A big project 😛

#

What's even sadder is that this is Windows build times

#

If I could switch to Linux, it would probably only take 20 seconds

floral crane
#

10x slower on actions, it takes most of the build time to just install tauri-cli on actions

quick bough
#

Stuff compiles so incredibly fast on Linux cat_pleading

floral crane
#

linux is always the first build to finish

#

windows after, even though I build twice (portable is a debug build) and macos last

#

lots of shared libraries on linux I guess

quick bough
#

the shared libraries are such a bane to me

#

instead of relying on a dynamic linker, I basically just dynamically link myself on linux

#

because various complications

#

.<

floral crane
#

I really wish Wootility wasn't a single large minified javascript file. I see it's using a deviceId variable as the key for storing data connected to a keyboard, but what is this? I can't figure out how it's created. If I had to guess it's either the HID ID (I hope not) or an encoded form of the serial number (this seems to be the only reliably unique identifier)

quick bough
#

Let's just bribe Simon to have him hand us the Wootility source code troll240p

#

I'm actually a bit surprised the Wootility isn't open-source since it's just a "glorious" bundle of JavaScript...

#

So, severely more trivial to reverse-engineer than, say, a DLL/SO written in Rust...

floral crane
#

I give up, I found the legacy serial number code but not the device id code

quick bough
#

I don't see why device id would not be the same as the serial number

floral crane
#

I don't either, maybe it is somehow but I can't find it. mine is 241831621

quick bough
#

Ah hmm interesting

floral crane
#

it seems to be the same if I wipe the data, I'm gonna try changing ports between

#

still the same

quick bough
#

What's weird to me is that the device id is not a string, because all the code I can find relating to it calculates a string

floral crane
#

same if I restore firmware to pre-beta and open the beta wootility

#

it is a string, in json

quick bough
#

I mean, it is clearly a number?

floral crane
#

deviceId is the variable name used in the local storage, for some reason it's stored as a string but it's really a number

quick bough
#

Oh, wait

#

lmfao

#

Look at 241831621. Here, 21 is the year it was made.

#
        class Mc extends Bn {
            constructor(e, t) {
                super(e, t)
            }
            async getlayoutType(e=!1) {
                if (e || void 0 === this._layoutType) {
                    const e = await this.getDeviceConfig();
                    this._layoutType = e.getRawKeyboardLayout()
                }
                return this._layoutType
            }
            async getDeviceID() {
                if (void 0 === this.deviceID) {
                    const e = await this.getSerial();
                    this.deviceID = "" + this.keyboardType + e.ProductId + e.ProductNumber + e.RevisionNumber + e.WeekNumber + e.Year
                }
                return this.deviceID
            }
        }
#

And 16 is the week. Very similar to serial number...

floral crane
#

Ah so it is the serial

#

why did I not try to search for getDeviceId

quick bough
#

Except it also includes the "keyboard type"

#

(Whatever that means)

floral crane
#

probably full, 80, uwu etc

quick bough
#

My device id seems to be 32504413821 for a Wooting Two HE

#

I definitely recognise some parts of it from the serial

floral crane
#

WOOTING_USB_META shows the type, mine is 2

Type: 2 | 418316 | Week: 21

#

418 is at the end of my serial's 5 digit number 00418 (padded)

quick bough
#

My Wooting Two HE is definitely not a DEVICE_KEYBOARD_60

floral crane
#

Type: 2 | H: 418 | W: 31 B: XXX6 | Week: 21

quick bough
#

21 is year, not week

floral crane
#

wait yeah why is yours 3 when that's the 60HE

#

I guess 3 is all HE not just 60

quick bough
#

Well... no...

#

I think it must be something else

floral crane
#

hmm

quick bough
#

I think it might be from this:

[P.WOOTING_ONE = 0] = "WOOTING_ONE",
P[P.WOOTING_TWO = 1] = "WOOTING_TWO",
P[P.WOOTING_LEKKER = 2] = "WOOTING_LEKKER",
P[P.WOOTING_TWO_HE = 3] = "WOOTING_TWO_HE",
P[P.WOOTING_60_HE = 4] = "WOOTING_60_HE",
P[P.WOOTING_60_HE_ARM = 5] = "WOOTING_60_HE_ARM",
P[P.WOOTING_TWO_HE_ARM = 6] = "WOOTING_TWO_HE_ARM",
#

Is your keyboard a Wooting Lekker?

floral crane
#

Ah just a different incremented list I guess

#

yeah
Type: 2 | PID+PIN: 418 | REV: 3 | Week: 16 | Year: 21

quick bough
#

Then that makes sense

floral crane
#

well this is good, idk why the sn wasn't used directly though lol

quick bough
#

Not unique enough maybe

floral crane
#

I think it's less unique than before, it's missing one of the numbers from the SN

#

no nvm it's every number, just in a different order and without padding

quick bough
#

The lack of padding is what's questionable to me, because in theory there could be ambiguities due to that

#

like, as we saw, my device id is a bit longer than yours

#

but, meh, I guess it's "good enough, ship it."

floral crane
#

🤔 A02B2106W031H00418 BXX06 is not 16 for the week

quick bough
#

No, it's 6 for the week. Lack of padding, as I said.

#

This format is unfortunately unparsable due to that as well, unless you do some sort of "least vexing parse" magic.

floral crane
#

I'm just gonna write a serializer to convert

quick bough
#

You can convert serial number to a data structure and that data structure to the device id

#

but device id to a data structure cat_grimacing

floral crane
#

oh the keyboard type probably means board cause of the B after it

#

W for week H for something related to 031

quick bough
#

Huh? The thing between A and B in the SN is supplier number.

floral crane
#

but that's the keyboard_type

quick bough
#

Please don't confuse the SN for the device id

floral crane
#

oh I see

#

device id is missing the supplier number and using its own keyboard_type which happens to be the same number for me

#
#[derive(Clone, Debug)]
pub struct Device {
    model_name: String,
    supplier:   u16,
    year:       u8,
    week:       u8,
    product:    u16,
    revision:   u16,
    product_id: u16,
    production: bool,
}

#[derive(Clone, Debug, Display, Eq, Hash, PartialEq)]
pub struct DeviceID(String);

impl From<&Device> for DeviceID {
    fn from(device: &Device) -> Self {
        let keyboard_type = match device.model_name.as_str() {
            "Wooting One" => 0,
            "Wooting Two" => 1,
            "Wooting Two Lekker Edition" => 2,
            "Wooting Two HE" => 3,
            "Wooting 60HE" => 4,
            "Wooting 60HE (ARM)" => 5,
            "Wooting Two HE (ARM)" => 6,
            &_ => 7,
        };

        Self(format!(
            "{}{}{}{}{}{}",
            keyboard_type,
            device.product_id,
            device.product,
            device.revision,
            device.week,
            device.year
        ))
    }
}

#[derive(Clone, Debug, Display, Eq, Hash, PartialEq)]
pub struct DeviceSerial(String);

impl From<&Device> for DeviceSerial {
    fn from(device: &Device) -> Self {
        Self(format!(
            "A{:02X}B{:02}{:02}W{:02X}{}H{:05}",
            device.supplier,
            device.year,
            device.week,
            device.product,
            device.production as u8,
            device.product_id
        ))
    }
}
floral crane
#

So serial number doesn't use the revision number or keyboard type, and device id doesn't use the supplier number or production stage

#

🤔 which one is more unique

quick bough
#

One you make yourself 😛

#

But I'd def. prefer SN because it's parsable

#

And also something the user can easily look up themselves

floral crane
#

yeah I'm gonna use SN with FromStr to DeviceSerial, and just have a From/Into DeviceID from Device so I can access the data in Wootility, but because it lacks all information I can't directly create a Device from the serial number, I have to find it by scanning devices

quiet root
quick bough
#

If I had to guess, UwU is 7 and UwU RGB is 8 😛

floral crane
#

Is there an ETA for Wootility Beta to be stable? and do we know the exact strings and ids for the UwU?

#

The RGB SDK feature/uwu branches has the strings, but does anyone have an UwU? can you open Wootility Beta, press Ctrl + Shift + I, and go to the Application > Storage > Local Storage > file:// and tell the first number of your device id

lime charm
#

Oh hell yeah there's a .NET wrapper

#

Now I can easily play around with the keyboard as a C# developer

signal gust
#

been a few hours so i dunno but i thought i may as well

floral crane
signal gust
#

uwu

#

non rgb

#

though my id seems to be a bit longer than what you had highlighted in the image

#

14 digits if i can count correctly

#

dunno if thats something you already knew

floral crane
#

the device id length is dynamic unlike the serial number which pads leading zeros to a fixed length

signal gust
#

ah okay

lime charm
#

I really have to learn Rust one day

floral crane
#

If I had to guess your product id is longer than mine (3), and likely your week is 2 digits intead of 1

#

Rust is great 🦀

signal gust
#

rust truly is great

lime charm
#

currently learning C and ASM at uni

floral crane
#

oh no

signal gust
#

also learning C at uni and probably asm soon

#

also learning python at the same time but i already know that and the lectures are just free sleeping time

lime charm
#

Ergh I don't like Python. I never use it anyway

signal gust
#

for me python is good for scripting but i wouldnt use it for anything "big"

lime charm
#

Using it for anything big is misusing it lol

signal gust
#

not a huge fan but using it more is making me appreciate it a little more

#

it does have some nice things here n there

floral crane
#

I started with Java but really learned JS, then TS, PY, GO, and RS but not in school. I've tried C/C++ but it makes me hate programming

lime charm
#

JS/TS makes me cry

signal gust
#

i love js

#

unironically

#

liek yeah its stupid

#

but its just nice sometimes

#

though i definitely would always go to TS now

floral crane
#

I can deal with TS, but JS is just awful unless it's a small amount of code

lime charm
#

I hate that there are no object types in runtime

signal gust
#

yeah going to js feels so bad now

lime charm
#

but even ts has no types at runtime

#

no reflection

signal gust
#

i dont really find it to be an issue honestly

floral crane
#

TS is just a tool to make JS less bad

signal gust
#

to make it actually usable in big projects

#

dunno how anyone survived without it

floral crane
#

if you're able to use something like deno that runs ts why not just use something else entirely. leave js to die in the browser

signal gust
#

bun!

#

or deno yeah

#

but bun is fun

floral crane
#

yeah bun, never tried it

signal gust
#

its uh

#

its pretty nice i guess

#

rn its nothing super special (in my opinion/for what i'm doing anyway) like people are making it out to be

#

but its faster at some things and its mostly a drop in replacement for node

floral crane
#

I need to learn how to write wasm with rust for websites

lime charm
#

I want Blazor to get really good :)

floral crane
#

I never really learned C# or F#, I tried it when dotnet core came out and it's actually a usable language for more than just Windows programs. but I still don't have a reason to learn and use it over Rust, even for the windows api

strong siren
lime charm
#

I have been using C# for yeaars now but recently toned it down a bit

#

Because of Uni

signal gust
#

i think C# is pretty nice now

#

or has been for a while

floral crane
#

It's nice, certainly more enjoyable than Java

signal gust
#

i recall hearing it wasnt as nice

lime charm
#

Yeah it's fast and cross-platform now

strong siren
#

in the framework days no, not really

#

and open source!

lime charm
signal gust
#

i also feel like java isnt that bad compared to how much hate it gets but its certainly not amazing

lime charm
#

no reason to use Java when C# exists though :)

floral crane
#

Java isn't that bad but it's also only use for like Minecraft these days, so why learn it over anything else unless you need to

signal gust
#

how do i write my minecraft mods in C# 😭

#

even then just use kotlin

#

smiley face

strong siren
lime charm
#

Just uhh. Imagine it working

floral crane
#

Rust to JVM when

floral crane
#

Minecraft mods written in Rust 🤔

lime charm
#

Minecraft written in Rust!!!

signal gust
#

yes

lime charm
#

What about Zig? Bun uses that

signal gust
#

zig is apparently cool but i havent looked into it

lime charm
#

Apparently it deals with memory in a different way than Rust

#

Its biggest downside is that you cannot say you're writing Rust while using it

signal gust
#

truth

#

i think zig memory management is manual but you can choose the allocator yourself and stuff

lime charm
#

I heard it's memory safe though

signal gust
#

ye

lime charm
#

But how it achieves it without checking array bounds etc I don't know

#

C# and Java spends CPU instructions checking bounds

signal gust
#

dunno much about it i dunno either

orchid falcon
#

zig is not realy memory safe like rust
sure it has some syntax to make is safers (slices and optionals being prety much the defauld)
but it also doesent have the restrictions on memory rust has
but what is nice about zig is the no hidden controll flow
errors have to be handeld you cant ignore them

lime charm
#

but not like checked exceptions in java?

orchid falcon
#

from quickly looking what checked exceptions is its pretty much the same
https://ziglang.org/documentation/0.11.0/#catch
var value = functionThatCanError(); -> compiler error
var value = try functionThatCanError(); -> keep throwing the error
var value = functionThatCanError() catch { //deal with error };

floral crane
#

similar in rust, Result and Option types can use ? to pass to the current if its also the same Result or Option return or you can match/if check them for Ok/Err Some/None to handle the errors or let _ = to ignore the response

lime charm
quick bough
#

I guess they kinda leaked the Wooting 60HE Plus, whatever that is supposed to be >.<

#

The base PID of the Wooting 60HE Plus will be 0x1320

floral crane
#

good to know, I'll add that to the wootility aur package and wps

quick bough
#

What I don't understand is why Wooting is deciding to focus more on 60% keyboards than TKL keyboards. cat_thinking

#

Then again, I never had to manage a company that deals with physical products.

floral crane
#

I don't like anything but full keyboards but I prefer the size with a delete button and arrows. In firmware key remapping and fn layer is the main reason I use this keyboard, everything else is bonus

quick bough
#

Well, I'd also never buy a keyboard without a numpad, but it's not like we 2 people represent 100% of the market. 😄

#

Wooting's software is also quite nice. Recently I did try the Razer Huntsman V2 Analog because it is a full-analogue keyboard, but I quickly realised how much customisation that Wooting was offering I now no longer had, and the Wooting Two is quite compact in comparison, so it's overall a nicer keyboard.

floral crane
#

Wooting has the best firmware and software even if it's not open source

quick bough
#

Well, Warframe did do funny RGB effects on the Razer keyboard... but that's just a lack of support. 😄

#

It's a shame there's no universal keyboard RGB thingy

torpid fox
#

When using the analog SDK, every so often my mouse becomes unusable for a second or two, anyone have a clue as to why this happens?

#

it's quite annoying, and also happens when using software others wrote using the SDK (like the input display)

quick bough
floral crane
#

plug them into different usb controllers if you can

torpid fox
quick bough
#

Well, it's my fix 😛

#

Have you tried it, does it work?

torpid fox
#

it doesn't answer my question though

#

I haven't tried it and it doesn't answer my question

quick bough
#

I have no idea why the lag is there, no.

floral crane
#

i dont use analog, I disable it so i can use my gamepad in games

torpid fox
#

same with my mouse

quick bough
torpid fox
torpid fox
quick bough
#

It is very much related tho

floral crane
#

put then in different sides front/back of the pc or far ends of the back ports. different onboard usb controllers

torpid fox
#

(pardon my french)

quick bough
#

But yeah I understand I don't have a solution that satisfies you

torpid fox
floral crane
#

my wireless mouse has to be in the front with nothing else plugged in or it loses signag strength

torpid fox
#

I'm not using anything wireless

#

fyi

#

nope didn't help

floral crane
#

still

torpid fox
#

I tried it, didn't help

quick bough
#

I guess the USB controller might be overloaded, but I don't see why the issue would only be apparent when using the Analog SDK, then.

torpid fox
#

It definitely sounds plausible

#

I'm going to check device manager real quick to see if I actually have multiple controllers or if this is just motherboard smoke and mirrors

floral crane
#

things might be polling and recieving lots of analog data, imagine a whole keyboard of floats in milliseconds

quick bough
#

Not that I understand much about hardware, but I do think the keyboard always reports how far a key is pressed, and all the Analog SDK does is listen.

floral crane
#

idk how it works, never messed with analog sdk

quick bough
#

Your keyboard sends an update with all pressed keys and how far they are pressed when there is a change

#

It can support up to 16 keys pressed at a time in the report

#

So it would never send the full 100-something keys

#

Also it doesn't use floats, it uses a u8 with a value from 0 to 255

torpid fox
quick bough
#

There's a lot of source code to be read, if you want to look at the full framework I used for this 😄

torpid fox
quick bough
torpid fox
#

that's not what-

#

Why are you sleeping 0.1 second?

quick bough
#

When no keyboard is detected

torpid fox
#

ooh okay.

#

Is calamity-inc/Soup your life project or something

quick bough
#

haha, no, I've only been working on it for max. 2 years

#

but we need HTTP, TLS, JSON, and stuff like that for our bigger projects

#

So it's all in there

torpid fox
#

well yeah but it's also a hot mess of bloat

quick bough
#

Not really

#

Dead code elimination exists

torpid fox
#

Well yeah but if I'm going to compile this myself

quick bough
#

You can use the PHP scripts to "bootstrap" it

torpid fox
#

okay yeah no

quick bough
#

I mean you can probably build "Universal Analog Plugin" with Visual Studio, but I only used Sublime Text + Sun for it because it's simpler

torpid fox
#

Right now the choice is between reading more code than I currently have to or trusting you and I don't have any good reason to do either

quick bough
#

Would a PDB help you?

torpid fox
#

No I'm just done

quick bough
#

Alright then xD

torpid fox
#

you've been trying to shove this universal analog whatever down my throat too much so I'm just kinda done

floral crane
#

for a plugin mesnt to be used and integrated, having a different build system is an obstacle. ideally support all major systems however that may be

torpid fox
#

it's also written in a completely different language

quick bough
#

I support the only build system I consider worth using 😄

torpid fox
#

that doesn't mean we should

#

that's your choice and that doesn't impact me

quick bough
#

I mean, it's a single .cpp file, you can probably just invoke clang yourself to build it tbh

torpid fox
#

except I'm not doing it because I said I'm done with this shit

#

in the end it's not going to help anyway because I NEED to support the official SDK for my use case

#

no way around it

quick bough
#

You don't have to. I already said I know you're not satisifed with the solutions I have to offer.

#

I just personally use this plugin because a) I used the Razer analogue keyboard, and b) I don't like the lag with the official plugin.

torpid fox
quick bough
#

Sorry it came across that way

torpid fox
#

Anyway I'm here to get my question answered and not to linger on your rewrite stuff because it is simply not an option

quick bough
#

FWIW, the only lag I experienced with the Analog SDK is related to init & deinit

torpid fox
#

For me it's consistent throughout runtime

quick bough
#

I was gonna say it might be related to your specific use case, but you did say you also had it with other apps using it?

#

You were trying to write Godot bindings, right?

#

idk if you figured out why Godot GC'd your plugin yet, but the constant deinit & re-init due to that might be a cause of lag then

torpid fox
#

I fixed the GC issue

quick bough
#

Nice

torpid fox
#

or rather

#

I worked around it

#

there are now unit tests and stuff that are queued for fixing this issue

torpid fox
torpid fox
quick bough
torpid fox
#

but the constant deinit & re-init due to that might be a cause of lag then
There was no constant deinit/reinit

quick bough
torpid fox
#

I think it was this one

#

yeah

#

since you're gone for a bit I'm gonna redownload it and check whether this is the one and if the issue still happens

#

Yeah it also happens with this one

#

It very well might be some kind of bus bandwidth limit, because I have an old motherboard

#

And I’m not sure which USB ports go into what bus on my PC right now

#

Notes:

  • this does happen on init as well but that could as well be a bandwidth thing because it has to send a bunch of stuff on init anyway
  • I do have to actually connect to the application for it to start doing this
quick bough
#

nah, the init and deinit lag is "normal"

#

also did you just run the Woot-verlay-2.1.exe without checking the source or building it yourself? 😛

#

Anyway, just tested the Woot-verlay, seems to work fine on my machine, no mouse lag

torpid fox
#

I wonder if I can figure out whether this is a bandwidth limit using wireshark or something

quick bough
#

I'm like pretty sure the keyboard does always send those reports, it's just a matter of if your machine is listening or not

#

but it's also possible that my assumption about this is wrong

#

then the additional bandwidth could be an issue in processing your USB mouse

#

have you tried using the touchpad on your laptop while using the Analog SDK?

#

at least it looks a bit like a laptop idk

torpid fox
torpid fox
quick bough
#

I see

torpid fox
quick bough
#

Well, I would ask if it's only an issue with the Analog SDK but you don't trust me with my evil C++ code

#

Have you tried polling the HID reports on usage page 0xFF54 yourself?

torpid fox
#

You're not making it any better right now

quick bough
#

Maybe you could also set up a linux virtual machine, attach the Wooting keyboard to the VM so you can use the Analog SDK there, and see if it impacts your mouse

#

also, if I were to peddle malware, why would I target you specifically? If I wanted to spread malware, I'd go for a bigger audience than just a single person. I also don't know you, don't think there's anything special about you to target you specifically, but whatever.

torpid fox
#

Before doing all of this I'd like to see if I am hitting a bandwith limit because it seems the most likely given my motherboard is 10 years old

quiet root
#

would be weird given all our keyboards can only do usb1.1 speeds

#

12mbit/s

torpid fox
#

hmmmm

quiet root
#

the usb2 speeds would meed a high speed coms chip that we simply dont have. so usb fullspeed only

quick bough
#

well, my motherboard didn't like me connecting 2 wooting keyboards into the same controller

quiet root
#

thats because of usb endpoints most likely

quick bough
#

but I think that was due to the power draw of the keyboard

torpid fox
#

USB endpoints?

quiet root
#

basically usb devices the OS sees

#

our keyboard shows up as several devices

#

mainly to facilitate certain functionality like mapping mouse buttons and gamepad output

torpid fox
#

I was about to mention a controller and mouse yeah

quiet root
#

i am unsure if linux has a concept of usb endpoint limits like windows does

quick bough
#

"our keyboard" cat_thinking

#

are you support staff at wooting?

quiet root
#

no

#

developer

torpid fox
quick bough
#

Well, I don't see a tony on the "meet our team" thing

quiet root
#

all our staff is listed here

torpid fox
#

If the issue I am having is related to USB endpoints I feel like it would be happening constantly instead of specifically when the SDK is running

quiet root
#

correct

#

also it would just stop accepting new endpoint devices if that was the issue

#

but was more for sainan

#

their issue of 2 wootings is either a power limit or usb endpoints

quick bough
#

I can connect multiple wootings, it was just an issue of not on the same row

quiet root
#

depends on the mobo config. if the 2 ports share 1 controller and other ports another then it can still be endpoints

#

the endpoint limit comes from the controllers first and OS second

torpid fox
quick bough
#

Well, the issue is that the wooting itself just turned off

#

So I think it just didn't get enough power

quiet root
#

keyboard doesnt turn on if it doesnt get enumerated

quick bough
#

It turned on

#

but it turned off again very quickly

quiet root
#

hm

quick bough
#

possibly the motherboard realising that the power draw is too much and hence forcing it off

#

anyway, thing of the past

quiet root
#

could be. back to the main topic @torpid fox do you have just 1 mouse connected to the pc?

torpid fox
#

Yeah, I could connect more for testing though.

quiet root
#

id try at least

#

rule out something to start off

torpid fox
#

Or at least, one physical mouse. The keyboard obviously counts as one

quiet root
quick bough
#

I mean this thing 😄

quiet root
#

oh

#

yeah thats uh

#

"slightly" outdated

quick bough
#

I should've realised Wooting has a few more employees

torpid fox
quick bough
#

but also I have no idea what Wooting employees would be doing all day? xD

quiet root
#

most of the livestreams are from 2 of those folks

torpid fox
#

Yeah I noticed that

quick bough
#

also I just realised the z-indexing is wrong when the page first loads and only gets fixed when hovering on it

quiet root
#

ive been on like 1 and that was that but yeah we arent exactly sure how to solve it as we have a few too many people to do the same thing again

quiet root
torpid fox
# quiet root id try at least

Mouse connected. I assume you want me to try to see if the issue still happens when trying to move the new mouse I just connected?

quick bough
#

Also, may I ask what you are developing for Wooting, Tony?

torpid fox
#

Huh wait what now it isn't happening at all even with the other mouse

#

maybe I'm just getting unlucky but this seems weird

quiet root
#

no theres just something going on

torpid fox
#

Oh okay no it just happened

#

I was unlucky

quiet root
#

hm

quiet root
torpid fox
#

Happened with the first mouse I mean

quiet root
#

wait so mouse 1 does it but mouse 2 doesnt?

torpid fox
#

Not sure yet

#

I'm not sure about mouse 2 yet because it suddenly isn't 100% consistent

quick bough
quiet root
#

the what?

quick bough
#

¯_(ツ)_/¯

#

It's something I found in the Wootility Beta

torpid fox
#

God damn you windows clipboard

quick bough
#

just thought it was interesting

torpid fox
#

I tried pasting a message link and it just failed

torpid fox
quiet root
#

wait you have mouse 1 still plugged in

torpid fox
#

Should I unplug mouse 1?

#

You reckon I should plug mouse 2 in the port where mouse 1 used to be?

quiet root
#

well the same port might be good but in general switch out mouse 1 completely

torpid fox
#

oki

quiet root
#

as to eliminate mouse 1 from the test

torpid fox
#

Issue now happens immediately to mouse 2

quiet root
#

so more mice = less frequent?

torpid fox
#

...maybe I think so?

quick bough
#

or just that port not being nice to mice

torpid fox
#

That's what it seems like

torpid fox
#

hm but I plugged the mouse into a different port and it hasn't happened yet

quick bough
#

silly hardware

torpid fox
#

it's specifically on a different area on the computer though that may be a different bus

#

it's the one I plugged the keyboard into earlier

#

(issue still happened)

#

Oh nope it just happened

#

specifically when I clicked

#

Maybe my motherboard is straight up broken

#

there are several other oddities

#

if this just ends up being a motherboard problem I'm going to be slightly pissed at myself

quick bough
#

Tony, would you happen to know if the firmware always sends the analog reports on 0xFF54 or if the host specifically has to ask for it? I don't really know how HID works below the OS level unfortunately.

#

Maybe Wireshark could answer this for me

torpid fox
#

Wireshark with usbpcap seems like a good way to find that out yeah

quick bough
#

Unfortunately I haven't managed to get usbpcap working on my machine

#

Oh well

#

but assuming it's that the reports are only sent when the host registers interests in them, then it might be your motherboard being overloaded then

torpid fox
quick bough
#

Then you can see if the Wooting keyboard sends any reports when you press keys (without using the analog sdk)

#

(on usage page 0xFF54 specifically)

torpid fox
#

I'll install wireshark again and try

torpid fox
#

Gonna close the program now so I can use my computer normally

#

while installing

torpid fox
quick bough
#

Uhhh

#

Well, when you press a key, do you see a difference with and without Analog SDK?

torpid fox
#

when the SDK is running there is constant communication back and forth

quick bough
#

What's that communication say?

#

Or look like

torpid fox
#

It seems to be names of devices...?

#

As strings

quiet root
torpid fox
quiet root
#

well there will be coms when that runs as it would pull analog data from the keyboard constantly

#

unless its a test program that just inits and does nothing

quick bough
#

So is it like "the report being sent" is actually the OS constantly asking the HID if it has a report?

torpid fox
#

see if that changes anything

quick bough
#

Okay, so according to GPT, the OS does have to poll the device for it to send any reports

#

Apparently USB 3.0 did introduce some event thing tho

torpid fox
#

I stopped it from reading the buffer or doing any get_analog calls and I still seem to have the mouse issue, FYI

quick bough
#

So, wireshark no longer shows the communication you were seeing before?

torpid fox
#

I haven't checked yet

placid ledge
#

mouse issues would probably be from it searching for devices, not from reading a device that's already opened

torpid fox
#

I opened wireshark 5 seconds ago

quick bough
#

Hmmm, what's the interval on the search for new devices?

torpid fox
#

That would explain a lot...

placid ledge
#

The firmware will always attempt to send a report when the analog data changes. My understanding is that the OS will not bother polling the interface if there are no readers of the interface, so that could be why you see less communication happening when the Analog SDK isn't running

quiet root
#

was about to say doesnt the sdk just read from the device when you wanna get the buffer?

torpid fox
#

I did see communication without the SDK. it was just only when I actually touched something instead of non-stop

placid ledge
#

yeah, it won't send multiple reports with the same information

#

so if you're not pressing anything, it will only have sent a report when the last pressed key was released, then it won't send anymore until you press a key

torpid fox
#

yeah

#

as expected

#

when the SDK is running there is constant back and forth though... mainly with device names?

quick bough
#

Not that I'm the best at reading Rust, but it looks like it scans for new devices every 500ms

placid ledge
#

That could be from the device scanning as well? As usually it won't need to get the strings as it would already have got them on device connection, but the device scanning may trigger it to get the strings again

quiet root
#

unsure if it might be nice to offload device search to SDK consumers

placid ledge
#

ideally it shouldn't be polling for devices, instead using OS events to check when a device connection happens

#

offloading the search to SDK consumers just moves the problematic baton to others 😂

quick bough
#

Maybe if the device scanning was changed from every 500ms to every 5000ms?

placid ledge
#

You could increase the period, and the affect would be minimized, but at the cost of having delayed detection for devices that are connected

#

Although, you could question how important that is to have

quick bough
#

hotswapping usb devices isn't exactly a hot path

placid ledge
#

ye but it doesn't solve the issue, it just makes the issue the responsibility of the consumers. Also increasing the work required (and potentially making breaking ABI changes) for the SDK consumers

quiet root
#

i mean how easy is it to consume USB events cross os

placid ledge
#

if any significant effort was to be put in to improving this behaviour, it would be the OS events path that I would go for

#

there's no unified approach, in general would be using specific apis

quick bough
#

depends on the device. for wooting devices is it very easy to use it on linux

#

but the linux apis regarding hid are poo

#

but "hidapi" abstracts away most of this pain

torpid fox
#

I just realized that the device scanning could explain why my hiccups happened less often with more mice connected

placid ledge
#

We've experimented with using this library: https://docs.rs/rusb/latest/rusb/ (libusb wrapper) to listen for device connect/disconnect events rather than polling

torpid fox
placid ledge
#

Oh no, we're still using it. But the project is on hold and I haven't had much time to scrutinize it, but on the surface it appeared to behave pretty well. Although, I do remember it not working on all main OS' (Windows, Mac, Linux), I can't remember which ones worked/didn't work though.

torpid fox
#

If you want I can test it on all of them

placid ledge
#

Would be nice, although @remote junco may remember what the behaviour was like on each platform

quick bough
#

I don't experience any input lag by just constantly enumerating all HID devices on my machine cat_thinking

placid ledge
#

is that getAll function calling hidapi::refresh_devices?

quick bough
#

No, it's calling CM_Get_Device_Interface_ListW, HidD_GetAttributes, etc.

#

(I don't like external dependencies)

torpid fox
quick bough
#

FWIW, it's very similar to hid_enumerate from hidapi

placid ledge
#

I wouldn't be surprised if the hidapi implementation causes more overhead than is necessary

quick bough
#

I don't even see a refresh_devices in hidapi

placid ledge
#

the development of the hidapi library was basically dead for many years until libusb picked it up fairly recently

#

Oh, I'm thinking of the hidapi-rs func, I guess it doesn't map directly onto the underlying library (it's been a bit since I used hidapi straight)

#

it calls hid_enumerate underneath

quick bough
#

So, it should be doing pretty much the same thing

#

I was originally doing a different way of enumerating HID devices, but then I stole the hidapi approach because I found it more elegant 😛

placid ledge
#

I think the lag coming from enumeration is fairly set-up specific. I've never really experienced it myself, but have seen a few different people run into it

#

I suspect it would depend a lot on your system's USB controllers/chipset, could also depend on the devices you have and how quickly they turnaround from string requests

torpid fox
#

There are a lot of string requests

quick bough
#

So, might be good to just not enumerate the devices as often as every 500ms?

placid ledge
#

I don't really get why it requests so many strings when they're the same ones that the OS already got when the device connected

placid ledge
quick bough
#

It is possible that hidapi has overhead because it tries to populate all information when constructing the "hid_device" struct

#

things like product name and serial number I only lazily fetch on-demand

#

but I also don't see any input lag when spamming those requests

torpid fox
quick bough
#

I would really like to know if you experience these lag issues with my evil C++ code, because I only scan devices until I find any analogue keyboard, then I just poll it for reports until its disconnected.

#

So, in theory, if device scanning is the issue...

torpid fox
#

Fine I'll try your plugin

#

but I'll restore my setup to a usable state first

quick bough
#

damn, a single AV vendor is foiling my plans for world domination

torpid fox
#

"AIDetectMalware"?

quick bough
#

Ah yeah, Bkav Pro detects literally every single C++ thingy lol

#

It even detects our fork of Lua

#

We've been trying to get their detections sorted

#

No response from them yet tho cat_pensive

torpid fox
#

Did a small bit of research and apparently bkav pro false positives aren't uncommon

#

Okay so your plugin detects my device

#

but other than that it does not work

quick bough
#

Oh?

torpid fox
#

I'll try seeing if calling read_analog instead of read_full_buffer does anything

#

oh actually the whole godot editor doesn't respond now

#

oh it just returned

#

weird

quick bough
#

Btw., you wouldn't know if it detected your keyboard or not

#

it just provides a dummy to the SDK

#

because I'm lazy

quick bough
#

If you don't mind, here's a standalone analogue keyboard visualisation that would say if it detected your keyboard or not.

torpid fox
#

I just got this helpful error I wrote a while ago

quick bough
#

LOL

#

We love heuristics

#

Here's the same EXE but in a debug configuration; now it has only 1 detection again 🙂

torpid fox
quick bough
#

Well, neither hash has ever been seen before

#

It's just AI heuristics rolling the dice

#

😄

torpid fox
#

idk bitdefender says it's gibon

quick bough
#

I've submitted a false-positive report with bitdefender

torpid fox
#

well I am running the program

#

the visuals work

quick bough
#

Usually I don't bother, this is software we deploy to 100k+ users 😄

#

AV industry definitely not being a joke 😄

torpid fox
#

anyway

#

I'll try switching to your plugin again because I just realized I disabled it

quick bough
#

Anyway, yeah, it is weird if the program would work but not the plugin

torpid fox
#

(I swapped it out because I was planning on using stock again)

quick bough
#

It should look like this

#

And the other plugins are just stashed away here

torpid fox
#

I know

#

I know what I did and I did it intentionally

quick bough
#

Alright, cool

torpid fox
#

still works with your plugin

quick bough
#

The soup.exe is standalone and does not rely on the Wooting Analog SDK at all

#

It polls your HID devices directly

torpid fox
#

okay

#

well it works

quick bough
#

Without mouse input lag?

torpid fox
#

Haven't noticed any so far no

quick bough
#

I am going to compile this

#

If it was the device enumeration, this should lag your mouse a lot

torpid fox
#

Yep I was able to gather that idea from the code

#

given what I saw in wireshark

#

YEP

#

Mouse is literally unusable

#

can't move it at all

quick bough
#

Interesting

#

I am going to remove the polls for product name & serial number

torpid fox
#

mouse is fine

#

I think we found the culprit

quick bough
#

Cool, so what Wooting needs now is a custom fork of hidapi that doesn't poll the product name and SN of every device every 500ms haha

#

Not so useless that I reinvent every wheel after all cutegiggle

torpid fox
#

@placid ledge apologies for the ping but I think we found something here

#

Something you might want to know

quick bough
#

Unrelated but did you manage to get my plugin working or that still doesn't work with your app? cat_thinking

#

Also, the relevant code that was causing the lag:

#

A workaround might be to call hid_enumerate using only the Wooting Vendor IDs

#

because then hidapi won't try to initialise the hid_device for anything that doesn't match

torpid fox
quick bough
#

Welp, that's strange

#

Your device doesn't happen to be the Wooting UwU, does it? xD

#

That's the only one the 0.1.0 version doesn't support

torpid fox
#

Nah it's a Two HE ARM

quick bough
#

Welp, maybe if you ever publish your app, I can see if it works for me

torpid fox
#

I was thinking of doing that when my to-do list for it is done but I guess I can do it now

#

I should clean up a bit first though

quick bough
#

or maybe I should ask if it works for you with the "Woot-verlay"?

#

because that did work for me, although not brilliantly, still need to make slight improvements

torpid fox
#

Works with woot-verlay

quick bough
#

Okay, then something you do must be weird, I'd definitely love to take a look

torpid fox
quick bough
#

idk, tbh. in theory it should "just work"

torpid fox
#

yeah

torpid fox
quick bough
#

I don't write any Rust code?

torpid fox
#

thing is though, to run my project you currently have to build it yourself

#

unless I give you a build

#

in which case I might as well provide a whole godot project

quick bough
#

uhhh

#

Well, I don't have godot either lol

torpid fox
#

uhh good luck then?

quick bough
#

I shall try using the wooting-analog-wrapper cargo crate

torpid fox
#

Sure.

quick bough
#

FWIW, I have used cargo for a few rust test projects in the meanwhile

#

although all of those were dreadful

torpid fox
quick bough
#

Looks like something didn't go so well

torpid fox
#

that's a very big malloc

#

did you try to read_full_buffer with too big of a number?

torpid fox
#

I mean I don't think you're supposed to do that but it seems like that isn't the issue here

quick bough
#

That's odd, this looks like an address

#

Well, it's definitely Rust code doing this ifeelok

#

Doesn't seem like it provides a backtrace for this bogus memory allocation either

torpid fox
#

there's a command line argument you use if you want a backtrace usually

quick bough
#

I did set the RUST_BACKTRACE environment variable to "on"

torpid fox
#

oh right it was an environment variable not an argument

#

my bad

torpid fox
quick bough
#

I basically removed all the code in my DLL and it still crashed

torpid fox
#

but does it crash when it is working with the official wooting plugin

quick bough
#

Yeah, no.

#

It might just be an issue with C plugins tho

torpid fox
quick bough
#

It doesn't

balmy iron
#

How about running in a debugger, do you see where it's failing then?

quick bough
#

Will try

#

debugger doesn't seem to catch anything

balmy iron
#

Lovely

quick bough
#

nevermind attached to wrong program lol

#

Yeah, it is entirely in the Rust code here

#

I don't have a PDB for this, so I don't know what's exactly happening

torpid fox
#

If only you could build it yourself thonjico

#

(I have a pdb)

#

(you could get one too if you build it)

quick bough
#

But if I don't use get_connected_devices_info, my plugin seems to work fine with wooting-analog-wrapper. ¯_(ツ)_/¯

torpid fox
#

Except I don't use get_connected_devices_info at all

#

I did write bindings for it, it's just dead code rn

#

not being used

quick bough
#

Hmm, well, then it also works fine for me using this barebones driver for wooting-analog-wrapper

floral crane
#

I found the ETA but it's late, someone should probably change that on the website. it's a week later and stable still doesn't support the UwU

quiet root
#

didnt need xbox stuff for ages

#

someone put it into xboxdrv or smth

floral crane
#

someone should put the tkl on there before it releases so there's a chance it's in the kernel steamos uses by the time it comes out

quiet root
#

although 2he arm and uwus are missing in that

floral crane
#

backports are amazing

#

uwu can't be a gamepad can it?

quiet root
#

it can

#

it has all the features of our normal keyboards

floral crane
#

hmm 3 buttons, I guess it'll work

quiet root
#

just less keys

#

i suspect people would need to submit another patch to the kernel though so it can use the new devices

#

sad we cant list the entire vendor id

floral crane
#

pre-list the next 10 devices unnamed 🤔

#

updating the aur packages now

quick bough
#

I had to do that udev rule stuff for my Wooting Two HE

quiet root
#

the udev rules are still necessary yes but not special xbox setup anymore

strong siren
#

anyone with a uwu rgb willing to test Artemis / RGB.NET? should work as long as you have a dotnet runtime working, windows or linux is fine

quiet root
#

macos?

strong siren
#

technically no explicit reason it shouldnt work but i've never tested it

#

even less so on ARM

quiet root
#

well last i tried it crashed immediately

strong siren
#

did you test artemis or the console test app

quiet root
#

artemis

strong siren
#

test app would be a good start to see how dotnet handles dllimports on arm

quiet root
#

i have no dotnet setup on mac

strong siren
#

these are published as self contained so shouldnt need runtime installed or anything

quiet root
#

never used rgbnet directly

strong siren
#

thats just a console app that should render a rainbow moving left to right on all devices it finds

#

ive tested it pretty extensively on two he + one + 60he

quiet root
#

just dies immediately

#

assuming i need to run RGB.NET.Sandbox

strong siren
#

yes

quiet root
#

dw about the rename but macos doesnt like . in executables

strong siren
#

any diff with the x64 one?

quiet root
#

yeah that one does this

strong siren
#

that's something

#

i assume with this running as x64 you need the sdk binaries to be x64 as well? are the binaries in mac releases x64 or arm?

quiet root
#

our rgb sdk? x64

strong siren
#

gotta look into making a mac vm or something lol

quiet root
#

wait but the rgb sdk doesnt support the uwu yet

strong siren
#

theres a branch

#

i asked simon and he told me it should work fine

#

but yeah not that dll/dylib

quiet root
#

i checked the dylib is in there

#

no dice

strong siren
#

hm ok thanks for the testing

#

im not suire how much of this is mac or arm issues

quiet root
#

might be some sort of permission thing

strong siren
#

i just got a macos vm setup on my unraid box so ill try to fix things

#

the error code 0 is the most stupid part, no info whatsoever

quick bough
#

Silly question, but in this Razer press release from 2019, Wooting is mentioned as one of the brands that apparently supports Razer Chroma RGB, yet my Wooting keyboard doesn't show up in Razer Synapse/Chroma. cat_thinking

strong siren
#

if you install wootility it has an integration

#

it's pretty shitty though, use mine :)

quick bough
#

What's yours?

strong siren
#

that repo has a tray app that targets wooting keyboards specifically with razer chroma games

quick bough
#

Well, that is sorta what I am trying to achieve, yeah

strong siren
#

it is

quick bough
#

I was gonna replace the RzChromaSDK64.dll and just redirect the API calls

#

but also I was not trying to get banned from some games :^)

strong siren
#

we used to do that back in the day

#

for aurora

#

i have dlls that do this and write the colors to a pipe

#

but it's not worth using because bans and also some (most) games sigcheck the dll before loading it

quiet root
#

the solution is that USB should finally add RGB into their standard so windows and other OSs can make a standard way to interact with RGB devices

strong siren
#

LampArray is basically this as far as i understand it

quick bough
#

I will try installing the Wootility first, but your project looks good as well

strong siren
#

it's limited to 5 colors

quiet root
#

imma switch to win and then i can try artemis on uwus

strong siren
#

the razer one. your keyboard is split into 5 zones

quiet root
#

got an artemis build artifact for uwu support?

quick bough
#

Patiently waiting for my UwU to arive >.<

strong siren
quiet root
#

send dlls

quick bough
#

Woaw, hello there

strong siren
#

yeah thats the one

quiet root
#

as mentioned keep in mind 5 zones only

quick bough
#

wdym 5 zones only?

quiet root
#

its not individual keys

strong siren
#

it gets your keyboard, spits it into 5 zones horizontally, and colors each of those

quiet root
#

just 5 blobs of color basically

strong siren
quiet root
#

thats why razer chroma for third party keyboards is a joke

strong siren
#

it's equivalent to that "chromalink' window on the right

quick bough
#

?!

strong siren
#

with mine you get the rest like the keyboard on top

quick bough
#

Welp, I'm getting colour at least now!

#

Will see about the granularity

#

Yeah okay this is horrible

strong siren
#

i can probably clean up the wooting tray app and make an installer etc if you think people care about it

quiet root
#

its razers poor attempt at seeming nice and inclusive

quick bough
#

I don't think they do, I just noticed the RGB while trying the Razer Huntsman V2 Analog for a few days

#

and I decided I want it on the wooting keyboard now as well

#

I'm gonna plug it in again and compare the RGB effects cutegiggle

strong siren
#

still waiting for this smh

quiet root
#

thats only half the wait

#

after that it needs to do the OOBE setup lol

strong siren
#

ah thats great

quiet root
#

although hmm

#

10.9

#

quite old

#

might be rather quick on oobe

strong siren
#

yeah i know it was the first one i found lol

quiet root
#

prob also one of the last ones that work on non arm

#

hackintosh will have a hard time soonish when intel support drops from macos

quick bough
#

Why is it so bad with the official integration

strong siren
#

because razer

quiet root
#

also hope you have success in actually running the macos vm as some pc setups just make the vm freeze

strong siren
quick bough
#

So, how do I use your thing dio, do I have to build it myself in VS?

quiet root
#

oh yeah i stopped using artemis long long ago

strong siren
#

actually ill make a CI script for it

quick bough
#

Why did you not write this in C++ tho >.<

strong siren
#

because i hate c++

quick bough
#

why

#

Also, slight problem: The top row is entirely black.

strong siren
#

what kb?

quick bough
#

Two HE

strong siren
#

maybe i broke it lemme test

#

what game are you testing with?

quick bough
#

Warframe

#

Avalonia seems to be showing it correctly

quiet root
#

gg artemis crashes with woot plugin

strong siren
#

pog

#

does it crash with any info

quiet root
#

nope

#

just closes

strong siren
#

can you please check event viewer

quiet root
#
CoreCLR Version: 7.0.1123.42427
.NET Version: 7.0.11
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Stack:
   at WootingAnalogSDKNET.WootingAnalogSDK.initialise()
   at WootingAnalogSDKNET.WootingAnalogSDK.initialise()
   at WootingAnalogSDKNET.WootingAnalogSDK.Initialise()
   at Artemis.Plugins.Devices.Wooting.Services.AnalogService.WootingAnalogService.Activate()
   at Artemis.Plugins.Devices.Wooting.Services.ReusableService.ActivateInternal()
   at Artemis.Plugins.Devices.Wooting.Services.ReusableService.RegisterUse()
   at Artemis.Plugins.Devices.Wooting.Modules.WootingAnalogModule.Enable()
   at Artemis.Core.PluginFeature.InternalEnable()
   at Artemis.Core.Modules.Module.InternalEnable()
   at Artemis.Core.Modules.Module`1[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].InternalEnable()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()
strong siren
#

hmm analog

#

if you unplug the uwu does it still crash

quiet root
#

i didnt have it plugged in yet

#

only 2he arm plugged in

strong siren
#

i have two he (avr i think?) and 60he arm rn

#

working well

quiet root
#

i replaced the plugin again to be sure still crashing

strong siren
#

odd, do you have the analog sdk installed? maybe it crashes if not installed. i recently changed that lol

quiet root
#

yes even updated

strong siren
#

i can confirm that the analog features work in artemis with sdk version 0.7.2

quiet root
#

0.7.4 is current

#

and wootility will install that

strong siren
#

no that's not the issue, just updated

#

still good

quiet root
#

odd then

strong siren
#

yeah working fine with both kbs

quiet root
#

whny are the sdks in the zip from 07

#

did the branch exist in july?

strong siren
#

im an idiot lol, but that wont fix this analog thing

#

ill update them

quiet root
#

updated analog wrapper now it doesnt close but shows a fail

strong siren
#

analog wrapper?

quiet root
#

its in the folder

#

le content

strong siren
#

ah the binary

#

yes

#

will do as wel

quiet root
#
 ---> Artemis.Core.ArtemisPluginException: Failed to initialise WootingAnalog SDK: Failure
   at Artemis.Plugins.Devices.Wooting.Services.AnalogService.WootingAnalogService.Activate() in D:\Source\Artemis\Artemis.Plugins\src\Devices\Artemis.Plugins.Devices.Wooting\Services\AnalogService\WootingAnalogService.cs:line 80
   at Artemis.Plugins.Devices.Wooting.Services.ReusableService.ActivateInternal() in D:\Source\Artemis\Artemis.Plugins\src\Devices\Artemis.Plugins.Devices.Wooting\Services\ReusableService.cs:line 40
   at Artemis.Plugins.Devices.Wooting.Services.ReusableService.RegisterUse() in D:\Source\Artemis\Artemis.Plugins\src\Devices\Artemis.Plugins.Devices.Wooting\Services\ReusableService.cs:line 17
   at Artemis.Plugins.Devices.Wooting.Modules.WootingAnalogModule.Enable() in D:\Source\Artemis\Artemis.Plugins\src\Devices\Artemis.Plugins.Devices.Wooting\Modules\WootingAnalogModule.cs:line 24
   at Artemis.Core.PluginFeature.InternalEnable() in D:\a\Artemis\Artemis\Artemis\src\Artemis.Core\Plugins\PluginFeature.cs:line 178
   at Artemis.Core.Modules.Module.InternalEnable() in D:\a\Artemis\Artemis\Artemis\src\Artemis.Core\Plugins\Modules\Module.cs:line 317
   at Artemis.Core.Modules.Module`1.InternalEnable() in D:\a\Artemis\Artemis\Artemis\src\Artemis.Core\Plugins\Modules\Module.cs:line 85
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait(TimeSpan timeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait(TimeSpan timeout)
   at Artemis.Core.PluginFeature.SetEnabled(Boolean enable, Boolean isAutoEnable) in D:\a\Artemis\Artemis\Artemis\src\Artemis.Core\Plugins\PluginFeature.cs:line 151
   at Artemis.Core.Services.PluginManagementService.EnablePluginFeature(PluginFeature pluginFeature, Boolean saveState, Boolean isAutoEnable) in D:\a\Artemis\Artemis\Artemis\src\Artemis.Core\Services\PluginManagementService.cs:line 701
   at Artemis.Core.Services.PluginManagementService.EnablePlugin(Plugin plugin, Boolean saveState, Boolean ignorePluginLock) in D:\a\Artemis\Artemis\Artemis\src\Artemis.Core\Services\PluginManagementService.cs:line 516
   at Artemis.UI.Screens.Plugins.PluginViewModel.<UpdateEnabled>b__53_4() in D:\a\Artemis\Artemis\Artemis\src\Artemis.UI\Screens\Plugins\PluginViewModel.cs:line 162
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at Artemis.UI.Screens.Plugins.PluginViewModel.UpdateEnabled(Boolean enable) in D:\a\Artemis\Artemis\Artemis\src\Artemis.UI\Screens\Plugins\PluginViewModel.cs:line 162```
#

now i get this

strong siren
#

yeah that's prob fine

#

gimme a minute

#

or build the rgb sdk binary yourself if you have it handy

quiet root
#

i dont think i have a c build env setup on windows

strong siren
#

i only updated the windows rgb binary and the analog wrapper

quiet root
#
 ---> System.MissingMethodException: Method not found: 'Void Artemis.Core.Services.IDeviceService.AddDeviceProvider(Artemis.Core.DeviceProviders.DeviceProvider)'.
   at Artemis.Plugins.Devices.Wooting.WootingDeviceProvider.Enable()
   at Artemis.Core.PluginFeature.InternalEnable() in D:\a\Artemis\Artemis\Artemis\src\Artemis.Core\Plugins\PluginFeature.cs:line 178
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait(TimeSpan timeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait(TimeSpan timeout)
   at Artemis.Core.PluginFeature.SetEnabled(Boolean enable, Boolean isAutoEnable) in D:\a\Artemis\Artemis\Artemis\src\Artemis.Core\Plugins\PluginFeature.cs:line 151
   at Artemis.Core.Services.PluginManagementService.EnablePluginFeature(PluginFeature pluginFeature, Boolean saveState, Boolean isAutoEnable) in D:\a\Artemis\Artemis\Artemis\src\Artemis.Core\Services\PluginManagementService.cs:line 701
   at Artemis.UI.Screens.Plugins.Features.PluginFeatureViewModel.<UpdateEnabled>b__47_0() in D:\a\Artemis\Artemis\Artemis\src\Artemis.UI\Screens\Plugins\Features\PluginFeatureViewModel.cs:line 207
   at Avalonia.Threading.DispatcherOperation.InvokeCore()
--- End of stack trace from previous location ---
   at Artemis.UI.Screens.Plugins.Features.PluginFeatureViewModel.UpdateEnabled(Boolean enable) in D:\a\Artemis\Artemis\Artemis\src\Artemis.UI\Screens\Plugins\Features\PluginFeatureViewModel.cs:line 207```
#

thats the device provider

strong siren
#

bruh, yeah im working off of artemis dev and not master, 1 sec

#

sorry and thank you for the patience :p