WIP: [connection-callback] Introduce a Report Retry timeout for hotplug events in HIDRAW #765

Closed
k1-801 wants to merge 1 commit from hotplug_timeout into connection-callback
k1-801 commented 2025-12-19 18:30:29 -06:00 (Migrated from github.com)

This fix targets the scenario when udev reported a new device, but the device is not yet ready to provide a report. This results in the independent usage entries not generating for the device and certain fields in the device not being filled.

UPD: The patch, despite potentially solving timing related issues, proved to not be enough to solve the particular problem at hand, investigation continues. Marking as draft, going to update it in the next week.

This fix targets the scenario when `udev` reported a new device, but the device is not yet ready to provide a report. This results in the independent `usage` entries not generating for the device and certain fields in the device not being filled. UPD: The patch, despite potentially solving timing related issues, proved to not be enough to solve the particular problem at hand, investigation continues. Marking as draft, going to update it in the next week.
mcuee commented 2025-12-20 03:36:25 -06:00 (Migrated from github.com)

Somehow Arch Linux build failed again, but not related to this PR.

error: target not found: libudev0

This needs to be changed to libudev0-shim.

Somehow Arch Linux build failed again, but not related to this PR. error: target not found: libudev0 This needs to be changed to libudev0-shim.
mcuee commented 2025-12-20 03:38:02 -06:00 (Migrated from github.com)

Windows cmake build failed as well, again, nothing to do with this PR.

Windows cmake build failed as well, again, nothing to do with this PR.
k1-801 commented 2025-12-21 23:15:03 -06:00 (Migrated from github.com)

Testing revealed that the issue was somehow caused by the library being loaded through dlopen and does not replicate with regular build-time linking. Function pointers retrieved through dlsym did not match and the calls failed. None of the resulting pointers were NULL.

Building the aplication with -rdynamic linker flag also fixed the issue; without this flag, dynamically loaded through dlopen hidapi cannot retrieve usages - and I don't know why. But at least I know this PR is not necessary.

Testing revealed that the issue was *somehow* caused by the library being loaded through `dlopen` and does not replicate with regular build-time linking. Function pointers retrieved through `dlsym` did not match and the calls failed. None of the resulting pointers were NULL. Building the aplication with `-rdynamic` linker flag also fixed the issue; without this flag, dynamically loaded through `dlopen` hidapi cannot retrieve usages - **and I don't know why**. But at least I know this PR is not necessary.

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libusb/hidapi!765
No description provided.