-
Notifications
You must be signed in to change notification settings - Fork 155
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
USBHID update rate is really slow #981
Comments
It is noticeable without slow footage? I do not have another controller to test but it seems smooth on my t8sg v2 with devo |
Yes very noticeable in velocidrone, you can even hear the difference. It's what lead me to investigate. |
Sharp turns in the sim sounds like D-term oscillations on a real quad and swift stick deflections are really jerky. Obviously hard to convey in a video but here it is anyway. First half is T8SG v2 (with hall gimabls) and second half is QX7. https://www.youtube.com/watch?v=oLlId8_gTKM&feature=youtu.be |
Oh I see. Can you record with slow motion the stick monitor screen and the physical stick moving together to full left and then full right? For both controllers? To calculate the lag with an objective target. I can take a look on the USBhid code |
deviation-t8sg_v2_plus-v5.0.0-32d5597.zip Can you test this one in the video? @AlessandroAU |
Sorry no video yet. Latency feels a bit better (I might just be getting used to the controller) but update rate feels the same. |
Can you test this version now: I did some checkings against a normal game controller, and the previous version was quite slow. However this one is on par with the commercial controller: If you can do the video on slow motion to confirm I will push this change to the repo. I am not sure what would be the minimum latency vs the best performance, but I do not really use my controller for games so I never noticed this issue. |
Hi there @eried, it seems you did indeed find the issue if my understanding is correct. (based on the branch you created) Assuming that the usbhid_cb return value is in microseconds, the original rate was one update per 50ms (only 20Hz). The standard minimum refresh rate for gaming has been 60Hz (~16.7ms) for a long time, but even most non-gaming input devices update at 125Hz (8ms). Gaming devices typically also feature 250Hz (4ms), 500Hz (2ms), or even 1000Hz (1ms) rates. I think targeting 125Hz (8ms) or 250Hz (4ms) updates would satisfy most if not all users, provided the transmitter hardware can handle it. Those rates seem to be similar to what most real RC protocols run at so should provide a decent experience. |
For low/full speed USB devices, this should be set to the desired update/polling interval in milliseconds. For high speed USB 2 devices, it should be set as the number of 125 microsecond frames. |
I did not get the second change but I will take a look on those files home. I have not made a PR with this because "if is not broken..." type of thought, and it might change the experience of the joystick for people that actually use the USBHID (i.e.: "it is too sensitive now!") |
Yeah, I suppose that's a valid concern. But I personally don't see why many people would complain about a move to at least the standard 125Hz. Perhaps adding rate adjustment as an option like in sbus or sumd would be feasible (though I'm not sure how to account for that in the HID endpoint). |
I guess making |
Would you mind checking this for compiler errors/warnings, and if it's all good also testing that it seems to use the correct period length on real hardware? @eried If it's not working (there's a decent chance), I'll have to look into this all properly after my radio arrives. |
Setting update rate as a protocol option seems like the obvious thing to do. I'll try to spare time to test your code changes. I created a PR to pull your changes to my development environment and also run Travis CI. |
You need to add void HID_SetInterval(u8 interval) to target.h |
okay, I fixed that up |
Nice! I have not tested it but it looks clean :D Maybe you can take a look on how to optimize how the sounds are handled. I have a solution I like on my repo (using a queue only for the "system sounds") |
Coming from an OpenTX platform I found the USBHID to be unflyable. Feels like the stick update rate is really slow. I filmed some slow-mo footage on a 100hz monitor of me spinning a stick in a circle on both a QX7 and a T8SG to illustrate the difference.
QX7:
Devo:
The text was updated successfully, but these errors were encountered: