Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on Keychron Q3 HE #6

Open
King-of-Infinite-Space opened this issue Dec 11, 2024 · 16 comments
Open

Crash on Keychron Q3 HE #6

King-of-Infinite-Space opened this issue Dec 11, 2024 · 16 comments
Labels
bug Something isn't working question Further information is requested

Comments

@King-of-Infinite-Space
Copy link

Hi, thanks for developing this plugin. I followed the readme to install Wooting SDK and this plugin, and flashed custom firmware on Keychron Q3 HE. When I test it on https://github.com/WootingKb/wooting-analog-midi, the program can see the keyboard as a connected device, but freezes and crashes (sometimes on start, sometimes after pressing a few keys). Is this supposed to work? Or is there another way to test midi functionality?

@Sainan
Copy link
Member

Sainan commented Dec 11, 2024

It's supposed to work, yeah. Is your Wooting Analog SDK up-to-date?

@Sainan
Copy link
Member

Sainan commented Dec 11, 2024

Also works fine on my machine.

image

@Sainan
Copy link
Member

Sainan commented Dec 11, 2024

It might help if you clone wooting-analog-midi, and run it manually:

SET NODE_OPTIONS=--openssl-legacy-provider
yarn tauri dev

If there's any error, it will show it in the console.

@Sainan Sainan added bug Something isn't working question Further information is requested labels Dec 12, 2024
@King-of-Infinite-Space
Copy link
Author

  1. Yes, I have the Wooting Analog SDK v0.8.0 using the msi installer from the latest release.

  2. This is my folder structure

    WootingAnalogPlugins
    ├── universal-analog-plugin
    │   ├── abiv0.dll
    │   └── abiv1.dll
    ├── wooting-analog-plugin
    │   └── wooting_analog_plugin.dll
    └── wooting-test-plugin
        └── wooting_analog_test_plugin.dll
    

    I also tried using only the universal-analog-plugin-with-wooting-device-support like the screenshot but same issue

  3. I ran the dev server. I only get this message when the app starts. No log when it crashes.

    Device 0 is DeviceInfo { vendor_id: 13364, product_id: 2864, manufacturer_name: "Keychron", device_name: "Keychron Q3 HE", device_id: 875825968, device_type: Keyboard }
    

@Sainan
Copy link
Member

Sainan commented Dec 15, 2024

Well, I'm also using the stock SDK v0.8.0 and otherwise your setup looks fine.

  • Maybe you need the Visual C++ redistributables if your system is fresh-ish: https://aka.ms/vs/17/release/vc_redist.x64.exe
  • Alternatively you could try grabbing a Soup build, extracting the soup.exe from the CLI folder, and running "soup.exe keyboard" in a console window. This would show if the underlying soup::AnalogueKeyboard functionality is working on your system.

@King-of-Infinite-Space
Copy link
Author

soup.exe keyboard works. Looks like it's based on HID? Maybe I can implement my own solution for MIDI.

I don't know Rust but I asked LLM to write an MVP based on wooting-analog-midi-core\src\lib.rs to print output from the SDK. I get the same crashing behavior.

     Running `target\debug\wooting-analog-demo.exe`
10:06:50 [INFO] Starting Wooting Analog SDK!
10:06:50 [INFO] Analog SDK Successfully initialised with 1 devices
Device 0: VID: 3434, PID: 0B30, Manufacturer: Keychron, Name: Keychron Q3 HE, ID: 875825968, Type: Keyboard
Press any key on the Wooting keyboard to see the analog value. Press Ctrl+C to exit.
Key ID: 30, Analog Value: 0.9447
Key ID: 30, Analog Value: 0.4043
Key ID: 30, Analog Value: 0.0000
error: process didn't exit successfully: `target\debug\wooting-analog-demo.exe` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)

@Sainan
Copy link
Member

Sainan commented Dec 15, 2024

ACCESS_VIOLATION is certainly interesting. I guess I can't exclude the possibility that there's some issue in my code that I just can't reproduce on my machine.

I've compiled a build with logging and a PDB attached, this might help narrow it down: universal-analog-plugin.zip

@King-of-Infinite-Space
Copy link
Author

Not sure if I'm doing it right - using the new dll and running my demo via the debugger in Visual Studio

screenshot

@Sainan
Copy link
Member

Sainan commented Dec 17, 2024

Well, that doesn't say much. What about the console logs?

@King-of-Infinite-Space
Copy link
Author

> $env:RUST_LOG = "debug"
> .\demo\target\debug\wooting-analog-demo.exe
09:29:34 [INFO] Starting Wooting Analog SDK!
[2024-12-17T09:29:34Z INFO  wooting_analog_sdk::sdk] No plugins found in "C:\\Program Files\\WootingAnalogPlugins"
[2024-12-17T09:29:34Z INFO  wooting_analog_sdk::sdk] Loading plugin: "C:\Program Files\WootingAnalogPlugins\universal-analog-plugin\abiv1-pluswooting.dll"
[2024-12-17T09:29:34Z WARN  wooting_analog_sdk::sdk] Unable to determine the Plugin's SemVer!
[2024-12-17T09:29:34Z WARN  wooting_analog_sdk::sdk] Failed to find constructor (_plugin_create symbol): GetProcAddress failed: 找不到指定的程序。(translation: The specified procedure could not be found.) (os error 127)
[2024-12-17T09:29:34Z INFO  wooting_analog_sdk::sdk] Didn't find _plugin_create, assuming it's a C plugin
[2024-12-17T09:29:34Z INFO  wooting_analog_sdk::cplugin] Got cplugin abi: 1
[2024-12-17T09:29:34Z INFO  wooting_analog_sdk::sdk] Loaded plugin: "Universal Analog Plugin"
[2024-12-17T09:29:34Z DEBUG wooting_analog_sdk::sdk] Loaded 1 plugins from "C:\\Program Files\\WootingAnalogPlugins\\universal-analog-plugin"
New device: Keychron Q3 HE
Discovered 1 initial devices
- Keychron Q3 HE
[2024-12-17T09:29:34Z DEBUG wooting_analog_sdk::sdk] SDKResult(Ok(1))
[2024-12-17T09:29:34Z INFO  wooting_analog_sdk::sdk] 1 plugins successfully initialised
09:29:34 [INFO] Analog SDK Successfully initialised with 1 devices
Device 0: VID: 3434, PID: 0B30, Manufacturer: Keychron, Name: Keychron Q3 HE, ID: 875825968, Type: Keyboard
Press any key on the Wooting keyboard to see the analog value. Press Ctrl+C to exit.
Key ID: 9, Analog Value: 0.0596
Key ID: 9, Analog Value: 0.2511
Key ID: 9, Analog Value: 1.0000
Key ID: 9, Analog Value: 0.9702
Key ID: 9, Analog Value: 0.1745
Key ID: 9, Analog Value: 0.0000

The program exits without error message. Sometimes it exits before SDKResult(Ok(1)).

@Sainan
Copy link
Member

Sainan commented Dec 17, 2024

Hmm, well that's not really telling me anything, damn. Are you on Windows 10 or 11?

@King-of-Infinite-Space
Copy link
Author

Win11 24H2 (26100.2605)

@Sainan
Copy link
Member

Sainan commented Dec 17, 2024

Well, I personally use Windows 10. I do have an ARM laptop with Windows 11, so I installed wooting-analog-midi, wooting-analog-sdk, & universal-analog-plugin on it, plugged in my Q3 HE, and it also worked fine there.

@King-of-Infinite-Space
Copy link
Author

Also seems to be working on my other computer running Win11 (23H2)...

@King-of-Infinite-Space
Copy link
Author

I guess I'll use the midi functionality on the other computer for now. Thanks for helping track it down.

@King-of-Infinite-Space King-of-Infinite-Space changed the title wooting-analog-midi crash on Keychron Q3 HE Crash on Keychron Q3 HE Dec 17, 2024
@Sainan
Copy link
Member

Sainan commented Dec 17, 2024

I'm unsure about the exact Windows 11 version on my laptop since it constantly updates itself. As I just booted it up again, I was greeted with the Copilot app having been added to the taskbar, but it claims to still be 23H2. So, maybe there's an issue with 24H2 but unless it gets rolled out further, I'm not sure I'll be able to repro it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants