Skip to content
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

Not initializing Joystick subsystem causes SDL_PollEvents to block with some hardware devices connected #3208

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Labels
duplicate This issue or pull request already exists

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 2.0.9
Reported for operating system, platform: Windows 10, x86_64

Comments on the original bug report:

On 2019-03-24 02:17:52 +0000, Matheus Valadares wrote:

Created attachment 3711
Repro code, not very useful without the hardware

This is a very weird bug I found that is a bit hard to reproduce. Here are all the details I could collect:

It happens only when the joystick subsystem is disabled.

On Windows 10, with a specific USB hardware device plugged in (it's an USB microphone), every exactly 3 seconds, a call to SDL_PollEvents blocks for ~80 ms.

Initializing the joystick subsystem makes the problem go away, not initializing it causes the problem to appear. Other systems being initialized (other than the gamecontroller one which initializes joystick) does not affect anything. Unplugging the device while the program is running makes the problem go away, replugging brings it back.

The blocking code is in the function hid_enumerate (in hidapi\windows\hid.c). Most of the time is spent in SetupDiGetDeviceRegistryProperty, but some non-insignificant amount of time is spent in other functions too (SetupDiGetClassDevsA, CreateFileA and HidD_GetManufacturerString).

The 3 seconds timer seems to come from HIDAPI_UpdateDiscovery.

This is the microphone: https://smile.amazon.com/gp/product/B001R76D42

On 2019-04-05 17:23:20 +0000, Daniel Gibson wrote:

This sounds like a duplicate of # 4391
The bug has been introduced in 2.0.9, the code is fixed in hg and will be part of 2.0.10 (whenever it's released)

*** This bug has been marked as a duplicate of bug 4391 ***

@SDLBugzilla SDLBugzilla added bug duplicate This issue or pull request already exists labels Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

1 participant