-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Mouse unresponsive when directly attached #4
Comments
Additional Note: |
Thanks for opening this issue, so we can pin down the cause of it. I've looked up the mouse you've mentioned and I saw one interesting thing about it (beside the looks), and it was it's pooling rate of 8KHz. This should not cause problems tho, but we'll see. I'd like you to test a couple of things, as I'm physically unable to reproduce this issue on my end without the mouse. (I'm going to assume the issue has nothing to do with the OS you're using, since my knowledge is minimal on that topic.) From my couple of tests I found that when
You don't have to do the steps below, if the issue was solved after that
|
wrote a small update here of what I'll be looking into next: #2 (comment) @74k1: There's a chance that fwiw, I'm currently on a ULX (and still have to test the rest of my mice collection 😅) and the wireless dongle also doesn't work. However, plugged in, like for you, the device works. I've got a HID descriptor dump and it doesn't look weird. High-polling shouldn't (in theory?) matter since it doesn't affect the HID descriptor dump if I'm not wrong about the spec and instead is represented by a single interval variable. Anyway, there's also the possibility that dongles (not knowing how any of HID works) require some kind of output to be sent to the device before they provide the usual inputs. |
Thanks for Your input @kitten, into this issue, and this repo as a whole, Your work is awesome! As of my experience with different mice, I've tested 6, two of which were wireless, and both of these worked out of the box with no issues. I only had problems with one mouse that was so old and "modded", that I just had the board with buttons on it. It still worked, but it required manual binding through the GUI (or by the binding script), just like my Arduino Pro Micro (which is fair). Though, through some quite synthetic tests, I've managed to achieve the same kind of symptoms, as described in the original post. What I've done was just set the value of Lines 156 to 164 in 489bf1e
The only way to get the mouse to work after that was uninstalling the LeetMouse driver, and reconnecting it.
But if the issue really is caused by the Lines 65 to 72 in 489bf1e
What we could do is simply make the r_usage a dynamic array that allocates space when the ctl of D_REPORT_COUNT is encountered. As by then we already know what size it should be. This idea might sound simple, so I'll try to play around with it, and see if it actually works, and if so I'll make a push with these changes.
|
just to leave a small note here, I admittedly now spent more time on #5 (which basically now adds no virtual input device, so it's a better replacement than what I had before) Regarding the USB HID descriptor parser though, my mouse has a bit of a weird behaviour in that (I think at least) the dongle never actually turns down its DPI (and other parameters?) in its boot mode. Something similar might be happening for @74k1's dongle. I've got this suspicion because the dongle also makes the mouse input hard to handle in the EFI boot menu (which is not a problem for the mouse in wired mode) I'll leave a data dump here for now. I haven't actually compared this to my other mice's HID descriptors just yet. I suspect that maybe this comment is relevant: Lines 109 to 111 in 489bf1e
Or potentially I really am not sure, but this might also imply that we're not getting mice out of boot mode? HID Descriptor Data
|
Yea, if the dongle works this makes sense, in terms of the Either way, raising the When it comes to the Also, the #5 looks really nice, I'll look into it a bit more, and probably dive a bit deeper into the HID descriptors, to be able to help with that. |
Hey @AndyFilter Thanks for the steps to debug my issue! (I've done / have comments on all the steps, just so it's documented on what's happening on my end) To clarify some statements:
Now to answer the Questions:
output of: sudo dmesg | grep -i "leetmouse"
|
Alright, thanks for the comprehensive response, I think the latest commit (ba430f6) with the dynamic If it does, I don't think the issue is fully solved yet, as there still might be some edge cases, where the device is being rejected at the driver level, and becomes unusable, as it doesn't get rebound to the |
Unfortunately with the latest commit, I can't rebuild my system: The last few lines of the build error being:
|
It looks like difference in the Kernel version, as I'm using 6.8, and you seem to be running on 6.6. The issue can most likely be solved by adding this header to the #include <linux/slab.h> in here: Lines 5 to 7 in ba430f6
I can't really test this solution on my end though so I'd like to know if it does work for you, and if so I'll make a commit with this change. |
Hey @AndyFilter It's very interesting now. I seem to be able to move my mouse only, horizontally.. (while directly attached.) With the dongle I can fully move it, like previously. Let me know if I can send over any details to help debug this behaviour. |
Thanks for the test. I didn't expect that result, haha. Not much is coming to my mind right now. I think I'm going to have to ask you for some debug details from the |
Can definitely do that. And it's great to hear progress being made! I'm excited 😄
|
This looks very interesting. It looks like the int r_count = max(NUM_USAGES, 1), r_max_count = r_count, r_size = 0, r_sgn = 0, len = 0; This adds a new variable Next, to use it, please change Line 75 in ba430f6
At the end of this if statement, update the r_max_count = r_count; The entire // Check if the new count is greater
if(r_max_count < r_count) {
printk("LEETMOUSE: New r_count (%i) is bigger than the old r_count (%i)\n", r_count, old_r_count);
// Try to reallocate more space if needed
// (this should happen at most once, but we can handle more just in case)
int* new_r_usage = krealloc(r_usage, r_count, GFP_KERNEL);
if(!new_r_usage) {
printk("LEETMOUSE: Failed to allocate memory for r_usage");
kfree(r_usage);
return -ENOMEM;
}
else
r_usage = new_r_usage;
// Zero only the new values of r_usage
for(n = old_r_count; n < r_count; n++){
r_usage[n] = 0;
}
r_max_count = r_count;
} I forgot that device's CLTs can be out of order, this fix should keep the maximum usage size encountered. Sorry for so much work, but I don't want to push changes that might be destructive to the main branch, and I don't know how (or even if) I can make like code change suggestions for a issue, like on a PR. After that, please share your |
Hey again I've added the patches to my fork and tested it. Additionally, when plugging in my dongle, the entire system wants to crap itself. I'll have this module disabled for now until #5 is implemented. 👍 |
@74k1: btw, if you want to test out the changes in #5, I've got a branch with all my changes which would also help us make that my Doesn't of course fix the HID parsing for your mice 😞 but it at least helps us test the alternative approach |
@74k1 Alright, thanks for trying everything I suggested. You're right maybe it's better to just wait until #5 is done, as dealing with Kernel is critical, and my changes were a bit rushed. Even if that would fix your issue, the real problem would still not be solved, as there are more issues with the current descriptor parser and other parts of the code that deal with devices. |
Regarding #3 (comment)
Thanks a lot for the device selection. 👍
I do want to apologize for the mess on comments on PRs when it's only an Issue of mine.
To sum it up:
My Mouse (WL Mouse Beast X) is unresponsive in my environment when attached directly with the USB-C Port on the Mouse itself.
When using the dongle and using the mouse wirelessly, it works as expected again.
Replugging it or changing the ports does not help either.
I do think the issue was related to a0a28b1 as this issue has only appeared since then.
Thank you both for all the troubleshooting so far tho. 👍
The text was updated successfully, but these errors were encountered: