-
Notifications
You must be signed in to change notification settings - Fork 39
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
Fix some issues regarding getReport and setReport #57
Conversation
Skipping the first byte of the buffer if it matches the report_id, seems to work for the T4 touchpad but not for the U1.
Thanks a lot! Can someone with an I2C-HID precisiopn touchpad device (Basically most I2C VoodooI2CHID users) test this branch to confirm it doesn't break anything? |
Doesn't work. Asus UX310, ELAN1200. Here're some related lines from the log:
|
Thank you for testing, I am not quite sure what goes wrong in your case. My first guess would be in VoodooI2CPrecisionTouchpadHIDEventDriver::enterPrecisionTouchpadMode() as there setReport() is used. Maybe you can try to see which of the two changes i made breaks your touchpad. Perhaps the fix i proposed allows for the method suggested in the comments of the function below and use the SetValue instead of manually writing a report. It is a pitty i dont have the hardware to test it but i will try to take a better look at the code when i have some more time.
|
In Linux, my primary OS, in userspace, I can do this:
Just using the file desctiptor |
@ben9923 yes, |
@ben9923 yes, the suggested changes do work. Doesn't solve the aforementioned issue with random blackouts though, unfortunately. |
@mishurov Thanks for testing it! |
@juico Just found the time to properly review it. Good catch on the Regarding Also, any idea why it's even transferred as part of the report in the first place? I see macOS is using the Thanks again! I would be happy to merge this in soon, just making sure we don't break anything by accident. |
@ben9923 Thanks for checking it out. For the setReport i remember comparing the first byte against the supplied reportID from the options argument as this is expected to be the case. Just checking for nonzero byte would also work, perhaps that would make more sense and just return a error if the reportID in the first byte doesnt match that of the one supplied in the options argument. Some of the other differences are due to the differences in the types of buffer used but it is possible there is a cleaner solution. Not sure why it is a part of the report itself. I tried to figure that out but had some trouble finding clear documentation about it. So i ended up using the webHID interface of chrome to call setReport and checked how it looked like by logging the reports fed to setReport. That lead to the conclusion that internaly the reportID is placed a the beginning of the report itself and in the options argument. In terms of breaking stuff it seemed that by merging the master branch to my fork it broke some things for me, havent had time to check out why this is the case. Perhaps if i have some spare time in the weekend so i can figure out why it breaks. |
When i was trying to fix the Alps4TUSB from blankmac i ran into some issues with setReport and getReport.
For the setReport i looked up the linux i2c-hid code and there they skipped the first byte of the featureReport as it contains the report_id. Later in the code they add the report_id to the message again. In the voodooI2CHID it is not removed in the first place but is added again like in the linux driver. This introduces a double report_id and thus corrupts the featureReport.
For the getReport function there seems to be a issue that the last two bytes of the report are not written. Fixed by making the readbuffer two bytes bigger and writing the complete result back into the report memoryDescriptor.
These two fixes make the communication part of blankmac's code work. As his code works when using USB and not using I2C i am convinced these fixes are needed to make voodooI2CHID work better.