You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a HID forwarding project and am asking myself what the best practice is to sync the reports sent from the device (TinyUSB) to the host, reducing the latency to a minimum.
Looking at the HID device examples, as far as I understand they simply use a timer so send a report every 10 ms (bInterval) while completely ignoring the polling mechanism of USB. If I am right, this might run out of sync with the host every once in a while because the time measurement/timing of the MCU might not fit the timing of the host polling perfectly.
My idea was to use the SOF callback as a sync source to stay in sync with the host, but it looks like it is not implemented for the HID device class as discussed in Callback for SOF #1675. I want to send the reports to the host asap after the poll request comes in. Another idea was to call tud_hid_n_ready() in the main loop which feels like a complete waste of resources.
Is there a preferred method to perfectly stay in sync with the host when running TinyUSB as an HID device? Does the time span between the poll request and sending the report to the host even matter regarding latency?
I am running an RP2040 (RPi Pico) as TinyUSB device with HID Boot Protocol (composite keyboard and mouse).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am working on a HID forwarding project and am asking myself what the best practice is to sync the reports sent from the device (TinyUSB) to the host, reducing the latency to a minimum.
Looking at the HID device examples, as far as I understand they simply use a timer so send a report every 10 ms (bInterval) while completely ignoring the polling mechanism of USB. If I am right, this might run out of sync with the host every once in a while because the time measurement/timing of the MCU might not fit the timing of the host polling perfectly.
My idea was to use the SOF callback as a sync source to stay in sync with the host, but it looks like it is not implemented for the HID device class as discussed in Callback for SOF #1675. I want to send the reports to the host asap after the poll request comes in. Another idea was to call tud_hid_n_ready() in the main loop which feels like a complete waste of resources.
Is there a preferred method to perfectly stay in sync with the host when running TinyUSB as an HID device? Does the time span between the poll request and sending the report to the host even matter regarding latency?
I am running an RP2040 (RPi Pico) as TinyUSB device with HID Boot Protocol (composite keyboard and mouse).
Beta Was this translation helpful? Give feedback.
All reactions