-
Notifications
You must be signed in to change notification settings - Fork 10
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
Only one mouse axis (like horizontal) or none works. #2
Comments
Update on this. It could be, that issue with the Rival 110 (only one axis working) is related to that: Not yet an overflow, yet, data is getting already corrupted prior processing. |
Ok, the reason for the overflow was indeed caused by my device sending too much packets. I simply increased the maximum allowed packets from 8 to 16 in here and here (while for the later one, I don't know, if this is related. Anyhow, reserving more space should not be bad). Now my Steelseries Rival 600 at least is not overflowing anymore. However, the data coming from it seems to havemixed up entries in data which then ends up again in vertical movement -> scrolling. |
Good news. It looks like I found the cuplprit. It seems like the struct, which has the raw data in it from the USB device (type: signed char) , is not properly aligned.
The question now is, why this happens and especially if this is true for every single mice and for every kernel version. It could be, that this is just kernel specific (to be tested). Since I'm on bleeding edge with Arch and Manjaro (Right now 5.11.2-1), this could be totally different for other famous systems with more "stable"/"LTS" kernels like Debian. |
I tried my two mice at home:
I'm also on Arch with the 5.11.6-1 kernel. |
I added a branch for testing purposes. Can you give https://github.com/systemofapwne/mousedriver/tree/mousebug_testing_hack a try? I'm pretty confident, that your Swiftpoint Tracer now registers input and that you also should have working acceleration on both axis. However: I do not suggest to consider this to be a fix! It is a workaround of a problem which I do not fully understand yet and may or may not work on your or every other system and kernel version. Further more, acceleration is "broken" when it is too high. But that now just looks like an overflow of an uint -> int (suddenly, acceleration becomes negative with a lot of mouse movement). |
After sniffing the raw USB data sent from my mouse to the host, I see that transmitted data is simply a multi-byte value for relative X and Y movement.
However my mouse reports data like this
X and Y displacement are represented as a multi-byte number.
The fix is in principle easy. However in order to make it work for every single mouse, I question myself, how to identify if the mouse is sending multibyte relative positions or single-byte positions. I will now try to understand how the usbhid linux driver works, which is not related to usbmouse.d/leetmouse.c (it seems like, usbhid is the logical successors to the old usbmouse.c driver) |
I did try the mousebug_testing_hack branch.
|
Can you confirm, that you are on the "mousebug_testing_hack" branch and that no local changes of leetmouse.c are present (git status). And if you are, maybe try a make clean && make and a rmmod leetmouse && insmod leetmouse.ko. It looks like, that the results you have are still based on an older version. Btw: The branch testing contains my current "testing" code, which I want to push to master once I have found a solution to these bugs. If you still see no input at all from one of your mice, compile the kernel module based from the "testing" branch and observe dmesg -w. This should then spam an error + suggestion for a fix for a common type of issue I have seen, causing an EOVERFLOW. |
I confirm that I tried to use the mousebug_testing_hack branch. |
Try I will keep a cleaner look on your logfile later this day. It looks ok when quickly looking over it. |
I tried it and get the same results. |
Thank you. Can please send me the output of the following two commands (do not need to be bound by leetmouse): With Cooler Master attached I have the feeling, that the issue might be, these mice are multi-interface devices and that you might need to bind another interface of them to leetmouse. E.g.
instead of
Sidenote: The way of binding mice to leetmouse is subjet to change to ease up useability in the future (basically a udev rule). |
I did run both command and the output is in the file below. I did try to bind other interfaces. 1-2.4:1.0, 1-2.4:1.1, 1-2.4:1.2, 1-2.4:1.3. Except for the 1.0 all of them returned the following error: echo: write error: no such device. Thanks again for looking into this! |
Thank you for the feedback. Unfortunately I was unable to work on the issue the past few days due to problems with my pc: I suffered from data-corruption on my SSD. While trying to pin down my SSD issues, I was able to trigger it when the leetmouse kernel module was loaded. |
Thanks for the warning. Good luck with your issues. |
The data corruption bug now seems to be fixed (at least on two of my systems) in the master branch and the testing branch. |
I just merged my latest testing code to master. This now offers some udev magic to absolutely make sure, the right device is bound to leetmouse. Please note that the package can now be installed to your system via makepkg & pacman (see the Readme.org) You can try testing it. Keep a look at If you can not get working input with any mice, you might want to delete the udev rule for debugging (lives in /usr/lib/udev/rules.d/99-leetmouse.rules) and refresh udev I am however sure for certain, that the bug is not yet fixed. I have several mice at home for testing and my ~15 years old Logitech G5 mouse seems to use a "narrow" width (1 byte) for transmitting mouse events for X and Y while my Steelseries Rival 600 uses wide (2 byte). |
I just gave it a try.
What can I send you to help? |
Good to hear, that the new installation method of the driver works for you! But I am now very confident to know, what the root cause of the mixup of axis etc is: The driver expects the mouse to be in "Boot protocol" mode (e.g. for using your mouse in BIOS), which dictates exactly, how the data has to be sent from the device to the system. There are basically two routes I can walk
I prefere the later option. The data structure description is sent to the driver (upon request) as an USB descriptor. I already dumped the descriptor for two mice (see testing branch in the debug folder). |
I just noticed one thing, you could do @Thomot512: Can you please dump the USB descriptor (please only the RAW code) of your mice? |
Here are the USB descrioptor of both my mice: |
These dumps are gold! They heavily influenced on how I wrote the parser for the HID descriptor! Can you please give the testing branch a try again? I am especially interested in your Swiftpoint Tracer: The reported data from your mouse to the host system has a strange format, so I implemented a bit-shifting mechanism to match it's pattern (should work for every mouse reporting a "strange format"). For the swiftpoint tracer mouse, I expect the scrollwheel to be affected of this: Either it works, as espected or it completely acts irradically. |
I just tested the testing branch. |
I'm happy to see the progress :)
If you confirm, that the DPI is in fact low on that mouse when having these problems, then I have to further invest some time on it. I would then ask you to dump the raw data-stream of the mouse, when moving it. I will then prepare a modified driver for you, which can do this. |
I tried to change the Swiftpoint mouse DPI to 400, which made no difference. On the Cooler Master it did change it's speed as expected.
Edit: Until now when changing the config I reinstalled the whole driver. Is there an other method? |
using mm710 mouse, moving the mouse up, right or down doesnt move the cursor at all. only moving the mouse left causes the cursor to move up. the cursor movement going up feels ok though even though its going up not left. |
Make sure to test this with the testing branch and not with master. The master branch does not parse the report descriptor of your mouse and currently is "hard coded" for the way my main mouse outputs data to the host. Anyhow, I am working on this. It looks even my crude "report descriptor parser" is not performing well. E.g. when your mouse tags the data with a Report ID (which is the reason why @Thomot512 SwiftPoint tracer does not work), the whole thing gets more and more complicated. I am REALLY thinking about moving away from the driver base (which already works) and implement a sub-driver for the HID Core driver of linux. This was anyway planned, but looked like too much work to be done quickly. However I now have spent countless hours on parsing different mice. This gets very frustrating :D |
all working good on the testing branch with this mouse thanks, though the first time i installed the testing driver my cursor would only move up and it would do a left click whenever i moved the mouse up, but working fine on a reinstall. i also have many mice, i will perform testing on them too. gl thanks |
Good to hear. Please attach data like described in debug/Readme.org for any problematic mouse. |
i have tested on my second gaming mouse and only works in vertical movement and no buttons work. the sensitivity also didnt change on the mm710 when changing values in the config.h file. |
Thank you very much. The report descriptor looks normal. However I see, why it fails: My parser (in testing) has a bug, which I already have fixed locally (code not yet pushed). Stay tuned. Also: What mouse is that? I would like to take take its information into my /debug/devices folder. |
oh sry i forgot to name the file, should be, Trust_GXT 101 GAV |
I just have pushed the latest "testing" version with the enhanced HID Descriptor parser. This should add more compatibility to other mice. However, I have one mouse at home, which still has strange X and Y movement (too fast). This mouse also has a "Report ID" tag like the Swiftpoint Tracer of @Thomot512. Please try to test the latest version and report back. |
on the latest testing version the gxt still can only move vertically but now all the buttons work on it. mm710 still working fine |
After drawing a lot of blocks on paper with bits and bytes, I finally was able to get my problematic mouse (CSL optical mouse) working. (It really was a mess XD) @Thomot512 Can you please test the latest commits in "testing" with your swiftpoint tracer? |
I just deinstalled everything, deleted the mousedriver folder, recloned the testing branch with: |
No change here on the GXT either. |
This is very sad to hear. I need further input from your side (raw mouse packets to be precise). Can you please install the latest driver and then perform the following
Then attach the file "raw.txt" please. |
@0Dragonmoon I think I found the error for your mouse. The GXT should work now. If not, send the raw data, as asked in the previous comment. However the Swift Point Tracer might still be messed up. For that, I need the raw packts. |
just tested, the GXT works now :D |
I just tested it and it appear to be working with both my mice. Edit: I'm still unable to see any effect of pre-scale or post-scale. I tried to multiply them by 10 to see and I don't feel any difference. |
Ok, at least this is a fantastic news, that the rewritten HID descriptor parser and the usb-packet extractor seem to work now. The pre-scale and post-scale should have an influence. If not, then the mouse is either not bound to leetmouse or you might edit the wrong file (should be driver/config.h, derived from config.sample.h). However I plan to implement an easier interface via /sys/module/leetmouse for pushing the config parameters. The config.h way will become at some point deprecated. |
Disregard my previous comment @Thomot512. I found a bug in the install script. Now, your custom config should get installed. However, as stated earlier, the config.h method might get dropped in favour of the sysfs interface. But this will not happen before I have implemented a daemon and a user-space application for tweaking the acceleration parameters in an easy way. |
Indeed it seems to be working now. Thanks. |
I think, this bug has been fixed. |
I believe I am experiencing this same issue for a new mouse. Mouse: Razer Deathadder v3 (wired) - 1532:00b2 Working correctly:
Not working correctly:
Disclaimer, this is technically a fork of this project, but I am following up here due to this thread being the issue I am experiencing. I did attempt to update the BUFFER_SIZE in config.h (tried 8, 16, 32, 64) to no avail. I did follow the steps from this post to produce this raw.txt (attached). |
This is a reminder for myself
This bug can be replicated with at least the following mice:
My suspicion no 1: These mice actually consist of several USB devices and the mouse output gets mixed up?
When I bind the mouse to "leetmouse" instead of usbhid, we only do this for one (input1) of the three inputs (input0, input1, input2), since the other do not work with this modded mousedriver.
My suspicion no 2: Writing back modified mouse values do not get processed properly.
This is at least supported by the Steelseries Rival 110 behaviour, which works only with horizontal movement but not vertical (which rather then makes the mouse scroll like when scrolling with the wheel).
The text was updated successfully, but these errors were encountered: