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

Mode switching inconsistencies #374

Open
nefarius opened this issue Jul 14, 2024 · 2 comments
Open

Mode switching inconsistencies #374

nefarius opened this issue Jul 14, 2024 · 2 comments
Assignees
Labels
bug Something isn't working Core Core/Common Driver Topic
Milestone

Comments

@nefarius
Copy link
Owner

nefarius commented Jul 14, 2024

We now pull the user-specified HID mode from the configuration file, which happens at a state where the device object is already created. The HID mode device property is read by the PnP manager via filter driver when queried for HWID, which happens before the property is refreshed from the configuration file. This can lead to the XI filter being active while the driver mode is still in e.g. SYS mode, causing issues with the different HID report descriptor the filter didn't expect.

A simple workaround is to restart the device twice where the device boots with the correct property value.

For a real fix, it has to be brainstormed how to achieve; we can not delay probing for the mode in the filter PnP routines and we can not read the configuration file content before the device is operational. We could detect the mismatch of the mode from JSON and in the property and react to it somehow, but "auto-restarting" a device in a user-mode driver is tricky and not really supported officially.

@nefarius nefarius added bug Something isn't working Core Core/Common Driver Topic labels Jul 14, 2024
@nefarius nefarius added this to the Version 3 milestone Jul 14, 2024
@nefarius nefarius self-assigned this Jul 14, 2024
@nefarius
Copy link
Owner Author

First experimental trick was to issue a USB hub port cycle on mode mismatch, however it is not happy when failing powerup:

image

Might retry by setting a flag and then retrying in a timer after like a second.

nefarius added a commit that referenced this issue Jul 17, 2024
nefarius added a commit that referenced this issue Jul 17, 2024
@nefarius
Copy link
Owner Author

Experimenting with port cycle didn't yield any success sadly because the driver hosting process lacks the necessary permissions to do so. I've archived the relevant code here for future use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Core Core/Common Driver Topic
Projects
None yet
Development

No branches or pull requests

1 participant